import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent"; import { digestPhasePayload } from "../transcript-archive.js"; export { digestPhasePayload }; import type { IndexEntry, ProjectsRegistry, RunManifest } from "../transcript-archive-types.js"; export interface ListRow { runId: string; projectKey: string; projectName: string; entityId: string; entityKind: string; sprintId?: string; startedAt: string; outcome: string; input: number; output: number; cost: number; durationMs?: number; } export interface ListFilter { entityId?: string; project?: string; sinceDays?: number; } /** * Assemble list rows from the index, refreshed against each run's manifest * when readable — the index line is append-only and can be stale for * resumed runs (manifest is the source of truth; index is the timeline). */ export declare function collectListRows(filter?: ListFilter): ListRow[]; export declare function formatList(rows: ListRow[]): string[]; export interface ResolvedRun { entry: IndexEntry; manifest: RunManifest; runDir: string; /** Other runs that matched an entityId lookup (newest first, incl. this). */ siblingCount: number; } /** * Resolve `show` target: exact runId match first, else latest run for the * entityId (or sprintId back-reference). Null when nothing matches or the * manifest is unreadable. */ export declare function resolveRun(idArg: string): ResolvedRun | null; export declare function formatShow(manifest: RunManifest, digest?: { role: string; file: string; lines: string[]; }): string[]; export type TimelineBy = "day" | "model" | "phase" | "outcome"; export interface TimelineRow { key: string; runs: number; phases: number; input: number; output: number; cost: number; } /** * Aggregate archived runs along one dimension. Day/outcome come from the * (manifest-refreshed) list rows; model/phase need the per-run manifests. */ export declare function collectTimeline(filter: ListFilter, by: TimelineBy): TimelineRow[]; export declare function formatTimeline(rows: TimelineRow[], by: TimelineBy): string[]; export declare function formatProjects(registry: ProjectsRegistry): string[]; export interface ParsedArgs { subcommand: "list" | "show" | "timeline" | "projects"; positional: string[]; project?: string; sinceDays?: number; by?: TimelineBy; json: boolean; error?: string; } export declare function parseTranscriptsArgs(args: string): ParsedArgs; /** * Browse → replay re-entry loop. Overlays run strictly SEQUENTIALLY (each * pushOverlay/popOverlay pair completes before the next overlay opens) so * the input-router depth stays at exactly 1 — never stacked. Closing the * replay dashboard (Esc) lands back in the browser; quitting the browser * (q / Esc) ends the loop. */ export declare function openTranscriptsBrowser(ctx: ExtensionCommandContext): Promise; /** * Register /forge:transcripts. Takes no forgeRoot — the archive is central * and the command must work outside any Forge project (cross-project recall). */ export declare function registerTranscriptsCommand(pi: ExtensionAPI, _opts?: Record): void;