/** * [WHO]: Provides TeamRuntime helper functions for prompts, harness turns, live events, tools, labels, roles, and path guards * [FROM]: Depends on core tools/sub-agent events, team-harness, team-psyche, team-mailbox, team-types * [TO]: Consumed by team-runtime.ts to keep TeamRuntime focused on lifecycle, persistence, and send queues * [HERE]: extensions/builtin/team/team-runtime-helpers.ts - stateless runtime support boundary */ import type { SubAgentEvent } from "../../../core/sub-agent/index.js"; import { type Tool } from "../../../core/tools/index.js"; import type { MailboxMessage } from "./team-mailbox.js"; import type { AgentLiveView, PersistedTeammate, TeamTask, TeammateIdentity, TeammateMode, TeammateRole } from "./team-types.js"; import type { RuntimeTeammate } from "./team-runtime.js"; export declare function ensureLiveView(view: AgentLiveView | undefined, identity: TeammateIdentity): AgentLiveView; export declare function getDefaultModeForRole(role: TeammateRole): TeammateMode; export declare function buildTeammatePrompt(input: { state: PersistedTeammate; teammates: PersistedTeammate[]; tasks: TeamTask[]; mailboxMessages: MailboxMessage[]; }): string; export declare function prepareHarnessTurn(input: { teammate: RuntimeTeammate; taskDescription: string; soulManager: unknown; }): Promise<{ psychePrompt: string; harnessInstructions: string; contextFiles: string[]; } | undefined>; export declare function applyLiveEvent(teammate: RuntimeTeammate, event: SubAgentEvent): void; export declare function selectToolsForMode(input: { mode: TeammateMode; cwd: string; getAllTeammates: () => PersistedTeammate[]; isPathAllowed: (teammateId: string, absolutePath: string) => boolean; }): Tool[]; export declare function createWritePathGuard(input: { cwd: string; getAllTeammates: () => PersistedTeammate[]; isPathAllowed: (teammateId: string, absolutePath: string) => boolean; }): (absolutePath: string) => void; export declare function normalizePath(path: string): string; export declare function isWithinPath(target: string, root: string): boolean; export declare function summarizeTask(value: string): string; export declare function singleLine(value: string): string; export declare function tailText(value: string, maxLength: number): string; export declare function labelFromIndex(index: number): string; export declare function indexFromLabel(label: string): number; export declare function isBuilderRole(role: TeammateRole): boolean;