/** * The part of `usage.json` a flow run adds: its visits, its nodes and its * lives. * * This life's visits are folded from the `visit_end` events the measurement * hears, and each subagent's transcript from its `spawn`. The earlier lives * are what the run directory holds: the `usage.json` the last measured life * wrote, and the journal for a life killed before it wrote one. The runner * writes no measurement, so unplugging this leaves a run and its resume as * they were. */ import type { EventListener } from "../events.ts"; import type { VisitEnd } from "../flow/index.ts"; import type { UsageReport } from "./export.ts"; /** What a measurement heard of a flow: the visits this life ended, and where each subagent's transcript went. */ export type FlowFold = { readonly listener: EventListener; readonly ends: readonly VisitEnd[]; readonly transcripts: ReadonlyMap; }; /** Folds the visit ends and the transcripts of the stream it is subscribed to. */ export declare function flowFold(): FlowFold; /** * `report`, this life's, with the flow's part added: unchanged when the run * told no visit and `dir` holds no journal. `opened` is when this * measurement began, which tells this life's `life_start` from an earlier * one's when the run it measured never started. */ export declare function withFlow(report: UsageReport, fold: FlowFold, dir: string | undefined, opened: Date): UsageReport; //# sourceMappingURL=flow-usage.d.ts.map