refactor: wire role agent plan into runtime
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user