import type { SessionManager } from "@earendil-works/pi-coding-agent"; import { type JsonValue, type TimelineEvent, type TimelinePartial } from "../protocol/v2/index.js"; export type ToolCallDetails = Readonly<{ tool: string; args: JsonValue; }>; type ToolContext = Readonly<{ groupId: string; correlation: T; }>; export type ToolAssociation = ToolContext & ToolCallDetails; type SessionEntry = ReturnType[number]; export declare function jsonValue(value: unknown): JsonValue; /** 按 branch 顺序关联,不能让后续同名 ID 的调用改写先前结果的参数。 */ export declare function recoverToolCalls(branch: readonly SessionEntry[]): Map; export declare function toolTimelineEvent(base: Pick, groupId: string, message: { toolCallId?: string; toolName?: string; args?: unknown; content?: unknown; isError?: boolean; errorMessage?: string; }, call?: ToolCallDetails): TimelineEvent; export declare function toolPartial(toolCallId: string, association: ToolAssociation, scope: { sessionId: string; historyGeneration: string; }, result?: unknown): TimelinePartial | null; export declare class ToolLifecycleTracker { private readonly associations; clear(): void; get(toolCallId: string): ToolAssociation | undefined; complete(toolCallId: string): void; indexAssistantContent(content: unknown, context: ToolContext): void; start(toolCallId: string, toolName: string, args: unknown, fallback?: ToolContext): ToolAssociation | null; } export {};