export declare const AMBIENT_WORK_RECORD_SCHEMA = "osc.ambient-work-record.v1"; type AmbientWorkState = 'created' | 'ready' | 'waiting_on_human' | 'running' | 'completed' | 'failed' | 'blocked'; interface AmbientArtifactLink { role: string; path: string; schema?: string; } interface AmbientRuntimeReceipt { adapterId: string; spawned: boolean; status: string; failure: { code?: string | null; }; marker: { state: string; }; tokenUsage?: { totalTokens?: number; } | null; evidencePaths: Array<{ role: string; path: string; schema?: string; }>; } /** sha256 over a canonical JSON encoding; shared by postflight and transcript-extraction records. */ export declare function ambientDigest(value: unknown): string; /** Token usage breakdown shared by transcript parsers; nulls mean "the runtime does not report this split". */ export interface AmbientUsage { input_tokens: number | null; output_tokens: number | null; cache_creation_input_tokens: number | null; cache_read_input_tokens: number | null; total_tokens?: number | null; } /** Observed facts a transcript parser extracts; mirrors the osc.ambient-work-record.v1 observed block. */ export interface AmbientObserved { assistant_turns: number; user_events: number; started_at: string | null; ended_at: string | null; usage: AmbientUsage; tool_calls: Record; files_touched: string[]; final_message_digest: string | null; final_message_claim_words: string[]; notes: string[]; } /** * Build an osc.ambient-work-record.v1 record from facts a transcript parser observed, * with source "transcript-extraction". This is the shared shape for `osc capture` * parsers so each runtime normalizer stays a thin mapper, not a record fork. */ export declare function buildTranscriptWorkRecord(input: { runId: string; adapter: string; command: string; intent: unknown; observed: AmbientObserved; createdAt?: string; }): Record; export declare function writeAmbientWorkRecord({ repoRoot, runId, state, artifacts, receipt, }: { repoRoot: string; runId: string; state: AmbientWorkState; artifacts: AmbientArtifactLink[]; receipt: AmbientRuntimeReceipt; }): { path: string; record: { schema: string; runId: string; createdAt: string; source: string; intentDigest: string; command: {}; state: AmbientWorkState; runtime: { adapter: string; spawned: boolean; status: string; failureCode: string | null | undefined; markerState: string; tokenTotal: number | null; }; artifacts: { role: string; path: string; schema: string | null; }[]; evidencePaths: { role: string; path: string; schema: string | null; }[]; boundary: { extracted_after_runtime: boolean; not_worker_authored: boolean; not_approval: boolean; not_correctness_certification: boolean; no_runtime_spawning: boolean; git_state_not_collected_by_core: boolean; }; }; }; export {};