import { type Goal, type GoalModeState, type GoalRuntimeEvent, type GoalTokenUsage } from "./state"; export interface GoalRuntimeHost { getState(): GoalModeState | undefined; setState(state: GoalModeState | undefined): void; getCurrentUsage(): GoalTokenUsage; emit(event: GoalRuntimeEvent): void | Promise; persist(mode: "goal" | "goal_paused" | "none", state?: GoalModeState): void; sendHiddenMessage(message: { customType: string; content: string; deliverAs?: "steer" | "followUp" | "nextTurn"; }): Promise; now?(): number; } export interface GoalTurnSnapshot { turnId: string; baselineUsage: GoalTokenUsage; activeGoalId?: string; } export interface GoalWallClockSnapshot { lastAccountedAt: number; activeGoalId?: string; } export interface GoalRuntimeSnapshot { turnSnapshot?: GoalTurnSnapshot; wallClock: GoalWallClockSnapshot; } export type GoalPromptKind = "active" | "continuation"; export declare function escapeXmlText(input: string): string; export declare function renderTrustedObjective(objective: string): string; export declare function validateGoalObjective(objective: string, op: "create" | "replace"): string; export declare function goalTokenDelta(current: GoalTokenUsage, baseline: GoalTokenUsage): number; export declare function renderGoalPrompt(kind: GoalPromptKind, goal: Goal): string; export declare class GoalRuntime { #private; constructor(host: GoalRuntimeHost); get snapshot(): GoalRuntimeSnapshot; shouldTrackTurnBaseline(): boolean; onTurnStart(turnId: string, baselineUsage: GoalTokenUsage): void; onToolCompleted(toolName: string): Promise; onGoalToolCompleted(): Promise; onAgentEnd(options?: { turnCompleted?: boolean; currentUsage?: GoalTokenUsage; }): Promise; onTaskAborted(_options?: { reason?: "interrupted" | "internal"; }): Promise; onThreadResumed(): Promise; flushUsage(currentUsage?: GoalTokenUsage): Promise; createGoal(input: { objective: string; provenance?: Goal["provenance"]; }): Promise; replaceGoal(input: { objective: string; }): Promise; resumeGoal(): Promise; pauseGoal(): Promise; dropGoal(): Promise; completeGoalFromTool(): Promise; buildActivePrompt(): string | undefined; buildContinuationPrompt(): string | undefined; }