import { type BudgetApprovalRequest, type JsonValue, type LaunchSnapshot, type RunRecord, type WorkflowBudgetUsage } from "./types.js"; import type { OwnershipRecord } from "./agent-execution.js"; export interface EffectiveSystemPrompt { sessionId: string; attempt: number; turn: number; sha256: string; prompt: string; } export type PersistedRun = RunRecord; export interface RunSummaryAgent { id: string; name: string; label?: string; state: string; role?: string; attempts: number; } export interface RunSummaryArtifacts { runDirectory: string; statePath: string; journalPath: string; snapshotPath: string; workflowPath: string; resultPath: string; summaryPath: string; } export interface RunSummary { schemaVersion: 1; runId: string; sessionId: string; workflowName: string; state: RunRecord["state"]; createdAt: string; updatedAt: string; terminalAt?: string; usage: WorkflowBudgetUsage; agents: readonly RunSummaryAgent[]; error?: RunRecord["error"]; failedAt?: string; replayablePaths: readonly string[]; incompletePaths: readonly string[]; artifacts: RunSummaryArtifacts; } export interface CompletedOperation { path: string; value: JsonValue; } export interface AwaitingCheckpoint { path: string; name: string; prompt: string; context: JsonValue; } export type PendingWorkflowDecision = BudgetApprovalRequest; export type PersistedOwnershipNode = OwnershipRecord; export type Journal = { completed: Record; awaiting?: Record; decisions?: Record; }; export declare function positiveInteger(value: unknown): value is number; export declare function decodePersistedRun(value: unknown, allowLegacyAgentSessions?: boolean): PersistedRun | undefined; export declare function isPersistedRun(value: unknown): value is PersistedRun; export declare function decodeLaunchSnapshot(value: unknown): LaunchSnapshot | undefined; export declare function decodeSessionOwner(value: unknown): SessionOwner | undefined; export declare function decodeOwnershipRecords(value: unknown): OwnershipRecord[] | undefined; export declare function decodeWorktreeReferences(value: unknown): WorktreeReference[] | undefined; export declare function decodeBorrowedWorktreeBindings(value: unknown): BorrowedWorktreeBinding[] | undefined; export declare function decodeJournal(value: unknown): Journal | undefined; export declare function decodeBooleanCheckpointResult(value: unknown): boolean | undefined; export declare function decodeSummaryProjection(value: unknown): Partial | undefined; export declare function decodeSystemPromptArtifact(value: unknown): { version: number; format?: unknown; storage?: unknown; entries?: EffectiveSystemPrompt[]; } | undefined; export interface WorktreeReference { owner: string; path: string; branch: string; cwd: string; base: string; } export interface BorrowedWorktreeBinding { name: string; sourceRunId: string; owner: string; } export type SessionOwner = { pid: number; token: string; startedAt: number; };