import type { SessionEntry } from "@earendil-works/pi-coding-agent"; import { type FabricCompactionBudget } from "../compaction/hook.js"; import type { AgentForkSeed, AgentSessionSeed, AgentToolResultMessage, HandoffCompactionRequest } from "./types.js"; import { type ThinkingTransferInput } from "./thinking-transfer.js"; interface HandoffSessionSource { getBranch(): SessionEntry[]; getEntry(id: string): SessionEntry | undefined; getLeafId(): string | null; getSessionFile(): string | undefined; getSessionId(): string; } interface CurrentModel { provider: string; id: string; } export declare const checkedHandoffCompaction: (value: unknown) => HandoffCompactionRequest | undefined; export declare const snapshotHandoffSession: (source: HandoffSessionSource, currentModel: CurrentModel | undefined, outerToolResult: AgentToolResultMessage, outerToolCallId: string) => AgentSessionSeed; /** * Options shared by the seed writers. `workerRole` is set only for a pi-durable * child: the same write that creates the file then puts the worker-role entry * first (the tree root) and hangs the seed's former root under it. Every other * byte matches the output without the option; plain `pi` and other runners * never pass it. */ export interface SessionSeedWriteOptions { workerRole?: boolean; } export declare const writeHandoffSession: (seed: AgentSessionSeed, cwd: string, directory: string, transfer?: ThinkingTransferInput, compaction?: HandoffCompactionRequest, compactionBudget?: FabricCompactionBudget, options?: SessionSeedWriteOptions) => string; /** * Materialize a non-blocking fork (agents.run/spawn seed: "branch"). The seed * already ends at the caller's last completed turn, so no tool call is left * dangling; the worker then sends the task as the next user turn. */ export declare const writeForkSession: (seed: AgentForkSeed, cwd: string, directory: string, transfer?: ThinkingTransferInput, options?: SessionSeedWriteOptions) => string; export {}; //# sourceMappingURL=handoff.d.ts.map