import type { ContentBlock, PendingQuestionRef, ToolCallProjection, TurnProjection } from "../../schemas/projection"; import type { TurnState } from "./state"; export declare function upsertToolCall(state: TurnState, toolCallId: string, toolName: string, displayName: string, args: string): void; export declare function applyToolResult(state: TurnState, toolCallId: string, result: unknown, status: ToolCallProjection["status"], durationMs: number | null, ranInParallel: boolean | null, sourceLoop: { loop_name: string; description: string; } | null, startedAt?: string | null): void; export declare function appendToolResultDelta(state: TurnState, toolCallId: string, delta: string, reset?: boolean): void; export declare function appendTextBlock(state: TurnState, blockType: ContentBlock["type"], content: unknown): void; export declare function appendToolCallArguments(state: TurnState, toolCallId: string, delta: string): void; export declare function buildSystemNotificationTurn(sequence: number, turnId: string, loopId: string, notificationType: string, status: string, title: string, detail: string | null, metadata: Record): TurnProjection; export declare function buildSystemNotificationBlock(notificationType: string, status: string, title: string, detail: string | null, metadata: Record): ContentBlock; export declare function buildMarkerTurn(sequence: number, turnId: string, loopId: string, blockType: ContentBlock["type"], content: unknown): TurnProjection; export declare function buildCompactionTurn(sequence: number, compactionId: string, loopId: string, status: TurnProjection["status"], data: Record): TurnProjection; export interface ChildPauseInfo { parentLoopName: string; parentToolCallId: string; childLoopName: string; childToolCallId: string; description: string; } export declare function setToolCallStatus(turn: TurnState | TurnProjection | null | undefined, toolCallId: string, status: ToolCallProjection["status"], result: unknown, pendingQuestionRef: PendingQuestionRef | null): void; export declare function applyAskUserPauseToTurn(turn: TurnState | TurnProjection | null | undefined, pauseToolData: Record, toolCallId: string, childLoopName: string, description: string, displayNameResolver: (name: string) => string): void; export declare function applyChildPauseToParent(parentTurn: TurnState | TurnProjection | null | undefined, parentToolCallId: string, childLoopName: string, childToolCallId: string, description: string, displayNameResolver: (name: string) => string): void; export declare function sourceLoopFor(loopId: string, loopDescriptions: Map): { loop_name: string; description: string; } | null; /** 本轮交付给用户的成果:工作区里的文件,或可以打开的网址。 */ export interface FinalArtifact { kind: "file" | "link"; /** file 是文件路径(相对工作目录或容器内绝对路径);link 是 http/https 网址。 */ target: string; label: string; } /** * Shared by the streaming and history channels — both must decide "is this * follow-up showable" identically. Returns null when there is nothing to show. */ export declare function normalizePostChatFollowup(data: Record, assistantEntryId: string): { assistant_entry_id: string; recaption: string; suggestions: string[]; final_artifacts: FinalArtifact[]; feedback_eligible: boolean; feedback_scope: "latest_result"; } | null; export declare function normalizeChildPause(pausePayload: Record): { pauseToolData: Record; childLoopName: string; childToolCallId: string; description: string; };