/** * [WHO]: Provides createTeamUtterance(), buildLeaderPlan(), parseTeamMentions(), runLeaderOrchestration() * [FROM]: Depends on ./team-types, ./team-presets, ./team-runtime * [TO]: Consumed by index.ts for structured speaker-stream rendering and leader-led team orchestration * [HERE]: extensions/builtin/team/team-orchestrator.ts - leader planning, mention parsing, and handoff execution */ import type { Model } from "@catui/ai/types"; import type { TeamRuntime, TeamRuntimeEvent } from "./team-runtime.js"; import type { Handoff, LeaderPlan, PersistedTeammate, TeamMention, TeamSpeakerRole, TeamUtterance } from "./team-types.js"; export interface TeamStreamEmitter { emitUtterance(utterance: TeamUtterance, options?: { streamKey?: string; replace?: boolean; }): void; } export interface LeaderOrchestrationOptions extends TeamStreamEmitter { taskDescription: string; baseCwd: string; model?: Model; onRuntimeEvent?: (event: TeamRuntimeEvent) => void; completeSimple?: (systemPrompt: string, userMessage: string) => Promise; } export interface LeaderOrchestrationResult { plan: LeaderPlan; handoffs: Handoff[]; } export declare function createTeamUtterance(input: { speakerId: string; speakerLabel: string; role: TeamSpeakerRole; text: string; kind: TeamUtterance["kind"]; mentions?: TeamMention[]; timestamp?: number; }): TeamUtterance; export declare function formatUtteranceForContext(utterance: TeamUtterance): string; export declare function parseTeamMentions(text: string, teammates: PersistedTeammate[]): TeamMention[]; export declare function buildLeaderPlan(userGoal: string, teammates: PersistedTeammate[], completeSimple?: (systemPrompt: string, userMessage: string) => Promise): Promise; export declare function runLeaderOrchestration(runtime: TeamRuntime, options: LeaderOrchestrationOptions): Promise;