import { type TurnContextRef } from '../agent/source-context/types.js'; import type { Config } from '../config/schema.js'; import { type TaskResultInput } from './result-reader/result-reader.js'; interface ConversationExcerpt { entryId: string; start: number; length: number; contentHash: string; } interface TaskHandoffContent { version: 1; inputId?: string; originalRequest?: string; conversationExcerpts?: ConversationExcerpt[]; interpretation: string; baseline: { contractVersion: number; assignmentEpoch: number; instructionSequence: number; }; sources: Array<{ kind: string; sourceId: string; version: string; title: string; text: string; truncated: boolean; representation?: 'text' | 'metadata' | 'directory'; purpose: string; contentHash: string; }>; requestedSources?: TurnContextRef[]; attachments: unknown[]; completeness: { originalInput: 'captured' | 'unavailable'; omitted: string[]; unresolvedReferences: string[]; }; } export type TaskHandoff = TaskHandoffContent & ({ kind?: 'conversation'; conversationId: string; transcriptId: string; } | { kind: 'workspace_files'; conversationId?: never; transcriptId?: never; }); export type WorkspaceFileInput = { id: string; title: string; version: string; }; export declare function captureWorkspaceFileHandoff(taskId: string, prompt: string, files: readonly WorkspaceFileInput[]): void; /** Normalize model-facing references without fetching any source on the submission path. */ export declare function parseTaskHandoffReferences(raw: unknown): TurnContextRef[] | null; /** Pin a result reference using only delivery metadata, before any file or body read. */ export declare function pinTaskHandoffReference(conversationId: string, ref: TurnContextRef): TurnContextRef; /** Pin an exact, visible passage without copying the rest of its message into the Task. */ export declare function parseTaskConversationExcerpts(conversationId: string | undefined, raw: unknown, config?: Config): ConversationExcerpt[] | null; export declare function readTaskConversationExcerpts(handoff: TaskHandoff, config?: Config): ({ entryId: string; role: "user" | "assistant"; text: string; unavailable?: undefined; } | { entryId: string; unavailable: boolean; role?: undefined; text?: undefined; })[]; /** Called inside task.create's transaction; no discovery, parsing or remote IO. */ export declare function captureTaskHandoff(taskId: string, conversationId: string, interpretation: string, references?: TurnContextRef[]): void; export declare function getTaskHandoff(taskId: string): TaskHandoff | undefined; export declare function assertTaskHandoffAccess(handoff: TaskHandoff): void; /** Replace the unresolved model-selected inputs of an unstarted allocation. */ export declare function replaceUnresolvedTaskHandoffReferences(taskId: string, references: TurnContextRef[]): void; /** Selected result pointers delegate only the pinned source, never the owner's result directory. */ export declare function readTaskHandoffSource(taskId: string, sourceIndex: number, input: TaskResultInput, config?: Config): Promise>; /** Resolve the main Agent's selected history pointers only after the foreground commit. */ export declare function resolveTaskHandoffReferences(taskId: string, config?: Config): Promise; /** Copy only the selected pinned input into this executor's workspace, without granting access to the owner's root. */ export declare function materializeTaskHandoffFile(taskId: string, sourceIndex: number, workspace: string, config: Config): Promise<{ materialized: boolean; sourceId: string; version: string; readOnlyPath: string; executionInputRoot: string; sha256: string; bytes: number; scope: string; }>; export declare function assertTaskHandoffExecutorAccess(taskId: string, agentId: string): void; export {};