refactor: decompose runtime coordination and runner internals (PR6)

This commit is contained in:
ejclaw
2026-04-10 22:48:49 +09:00
parent e5bd721ac4
commit 497e6dec74
23 changed files with 1987 additions and 1804 deletions

View File

@@ -1,23 +1,4 @@
export interface RoomRoleContext {
serviceId: string;
role: 'owner' | 'reviewer';
ownerServiceId: string;
reviewerServiceId: string;
failoverOwner: boolean;
}
export function prependRoomRoleHeader(
prompt: string,
roomRoleContext?: RoomRoleContext,
): string {
if (!roomRoleContext) {
return prompt;
}
const header =
`[ROOM_ROLE self=${roomRoleContext.serviceId} role=${roomRoleContext.role} ` +
`owner=${roomRoleContext.ownerServiceId} reviewer=${roomRoleContext.reviewerServiceId} ` +
`failover=${roomRoleContext.failoverOwner ? 1 : 0}]`;
return `${header}\n\n${prompt}`;
}
export {
prependRoomRoleHeader,
type RoomRoleContext,
} from 'ejclaw-runners-shared';