import type { AgentMessage, ToolDefinition } from '../../../core/core-types.js';
import type { ExtensionSessionView } from '../../extensions/types.js';
export interface TaskSidechainArtifact {
    sessionId: string;
    sessionFile: string;
    parentSessionFile: string;
}
/** Create the sidechain transcript artifact for a subagent under the parent session. */
export declare function createTaskSidechainArtifact(session: ExtensionSessionView, agentName: string, agentId?: string): TaskSidechainArtifact | undefined;
/** Resolve (and create) the markdown output file path for a registered task. */
export declare function createTaskOutputFile(session: ExtensionSessionView, agentId: string): string;
export interface TaskSidechainWriterOptions extends TaskSidechainArtifact {
    cwd: string;
    systemPrompt: string;
    tools: readonly ToolDefinition[];
    append?: boolean;
}
export declare class TaskSidechainWriter {
    private readonly options;
    private leafId;
    private turnIndex;
    private turnStartedAt;
    private readonly usedIds;
    /** Open or resume the sidechain JSONL file for a subagent run. */
    constructor(options: TaskSidechainWriterOptions);
    /** Persist a turn-start boundary entry. */
    writeTurnStart(): void;
    /** Persist a finalized agent message. */
    writeMessage(message: AgentMessage): void;
    /** Persist a tool execution end record (result + isError). */
    writeToolExecutionEnd(input: {
        toolCallId: string;
        toolName: string;
        result: unknown;
        isError: boolean;
    }): void;
    /** Persist a turn-end boundary entry with the wall-clock duration. */
    writeTurnEnd(): void;
    /** Allocate a new entry id chained to the current leaf and stamp a timestamp. */
    private nextBase;
    /** Append an entry to the JSONL file. */
    private append;
    /** Re-link the leaf id and turn index from an existing transcript when resuming. */
    private restoreLeafFromExistingFile;
}
/** Read prior agent messages from a sidechain transcript for resume runs. */
export declare function readTaskSidechainMessages(sessionFile: string): AgentMessage[];
//# sourceMappingURL=sidechain.d.ts.map