/** * trace.artifacts (M2) — project "what the agent produced" from the durable event log. * * Deterministic projection, no new write path: artifacts are DERIVED from the already-persisted * tool_start/tool_end pairs (S2 log), so they exist for every historical run and cannot drift from execution. * v1 produces two kinds: * - `file` — a successful `Write` / `Edit` call (deduped per path; the summary counts edits). * - `git-push` — a successful `bash` call whose command contains `git push` (ref = the parsed refspec tail). * `diff` is declared in the wire schema but NOT produced in v1 (we don't capture patch bodies in the log) — * consumers must treat kinds as an open set. Args in the log are already secret-redacted at persist time. */ import type { RunEvent } from "../plugins/store-contracts.js"; export interface TraceArtifact { /** Stable within the task: `:` in first-seen order — safe as a UI key + dedupe handle. */ id: string; taskId: string; /** Work-view correlation (omitted when the run has none) — lets the client group a job's artifacts. */ jobId?: string; kind: "file" | "git-push"; /** file: the workspace-relative path. git-push: the refspec tail (e.g. "origin HEAD:branch") or the command. */ ref: string; summary?: string; /** file only (additive, P2 workspace "what changed how much"): HUNK-level line counts summed over the * successful contributing calls — write_file counts its content lines as additions; edit_file counts * new_string lines as additions + old_string lines as deletions. NOT a git diff (no patch bodies in the * log); when a real patch store lands these move to the reserved `diff` kind with a patchRef. */ additions?: number; deletions?: number; /** ts of the LAST successful contributing tool call. */ createdAt: string; } /** Project the durable event log into artifacts. Events must be in seq order (getEvents guarantees it). */ export declare function projectArtifacts(events: readonly RunEvent[], run: { taskId: string; jobId?: string | null; }): TraceArtifact[]; //# sourceMappingURL=artifacts.d.ts.map