/** * Teammate spawn engine — the core bridge between CC agent-teams semantics * and Codex CLI's task-oriented process model. * * CC teammates are long-lived tmux processes that poll inboxes. * Codex agents are task-oriented: they run `codex exec` and exit. * * We bridge this gap by: * 1. Enriching prompts with full team/task/inbox context (via prompt-builder) * 2. Using `codex exec resume ` for teammate continuity * 3. Injecting shared-worktree awareness so agents don't halt on concurrent changes * * Each spawn creates a CodexProcessRunner, registers it in TaskStore, wires * exit callbacks for state transitions, and stores conversationId for future * resume. */ import type { AgentRole } from '../types.js'; import type { SpawnResult } from './types.js'; /** * Spawn a Codex CLI process as a teammate. * * Flow: * 1. Validate name constraints * 2. Build TeammateMember, add to team config * 3. Ensure inbox * 4. Build enriched prompt (team context, tasks, inbox, user prompt) * 5. Optionally apply template/overlay * 6. Create task in TaskStore (process tracking) * 7. Build `codex exec` args * 8. Spawn via CodexProcessRunner * 9. Store PID, taskId in member config * 10. Wire onExit for conversationId extraction + state transitions * 11. Return SpawnResult */ export declare function spawnTeammate(teamName: string, name: string, prompt: string, options?: { role?: AgentRole; specialization?: string; model?: string; contextFiles?: Array<{ path: string; description?: string; start_line?: number; end_line?: number; }>; commonContext?: string; }): Promise; /** * Resume an inactive teammate with new context. * * If the teammate has a stored conversationId, uses `codex exec resume`. * Otherwise, spawns a fresh process with accumulated inbox + task context. */ export declare function resumeTeammate(teamName: string, name: string, newContext?: string): Promise; /** * Force-kill a teammate's Codex process. * * Sends SIGTERM, waits briefly, then SIGKILL if needed. * Updates the member config to mark as inactive. */ export declare function forceKillTeammate(teamName: string, name: string): Promise; /** * Introspect a teammate's status via TaskStore + JSONL analytics. * * Returns a rich status object with: * - Process state (running/completed/failed) * - Output tail (last N lines from ring buffer) * - Inbox status (unread count) * - Analytics from JSONL output (commands, file changes, errors) */ export declare function checkTeammate(teamName: string, name: string): Promise<{ name: string; agentId: string; agentType: string; isActive: boolean; taskId?: string; processState?: string; pid?: number; outputTail: string[]; unreadCount: number; analytics: { commands: number; fileChanges: number; errors: number; events: number; }; conversationId?: string; }>; //# sourceMappingURL=spawner.d.ts.map