refactor: add role agent plan ssot

This commit is contained in:
Eyejoker
2026-03-31 09:28:10 +09:00
parent dd28ac6223
commit a39dad4c8c
2 changed files with 104 additions and 0 deletions

41
src/role-agent-plan.ts Normal file
View 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,
};
}