refactor: wire role agent plan into runtime

This commit is contained in:
Eyejoker
2026-03-31 09:35:19 +09:00
parent a39dad4c8c
commit 7f8a361f24
5 changed files with 135 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
import type { AgentType } from './types.js';
import type { AgentType, PairedRoomRole } from './types.js';
export interface RoleAgentPlan {
ownerAgentType: AgentType;
@@ -39,3 +39,17 @@ export function resolveRoleAgentPlan(
arbiterAgentType: args.configuredArbiter ?? null,
};
}
export function resolveAgentTypeForRole(
plan: RoleAgentPlan,
role: PairedRoomRole,
): AgentType {
switch (role) {
case 'reviewer':
return plan.reviewerAgentType ?? plan.ownerAgentType;
case 'arbiter':
return plan.arbiterAgentType ?? plan.ownerAgentType;
default:
return plan.ownerAgentType;
}
}