refactor: add role agent plan ssot
This commit is contained in:
41
src/role-agent-plan.ts
Normal file
41
src/role-agent-plan.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { AgentType } from './types.js';
|
||||
|
||||
export interface RoleAgentPlan {
|
||||
ownerAgentType: AgentType;
|
||||
reviewerAgentType: AgentType | null;
|
||||
arbiterAgentType: AgentType | null;
|
||||
}
|
||||
|
||||
export interface ResolveRoleAgentPlanArgs {
|
||||
paired: boolean;
|
||||
groupAgentType?: AgentType;
|
||||
configuredReviewer: AgentType;
|
||||
configuredArbiter?: AgentType | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Preserve current runtime agent-resolution behavior in one pure helper.
|
||||
* This intentionally mirrors today's paired inference and does not read room mode yet.
|
||||
*/
|
||||
export function resolveRoleAgentPlan(
|
||||
args: ResolveRoleAgentPlanArgs,
|
||||
): RoleAgentPlan {
|
||||
const ownerAgentType: AgentType = args.groupAgentType || 'claude-code';
|
||||
|
||||
if (!args.paired) {
|
||||
return {
|
||||
ownerAgentType,
|
||||
reviewerAgentType: null,
|
||||
arbiterAgentType: null,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
ownerAgentType,
|
||||
reviewerAgentType:
|
||||
args.configuredReviewer !== ownerAgentType
|
||||
? args.configuredReviewer
|
||||
: ownerAgentType,
|
||||
arbiterAgentType: args.configuredArbiter ?? null,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user