import type { PhaseOptions } from "@boardwalk-labs/workflow/runtime"; import type { TurnEventSink } from "./agent/events.js"; export type PhaseCloseStatus = "completed" | "failed" | "cancelled"; export interface PhaseTrackerOptions { /** The run's shared event emitter — phases ride the one ordered stream. */ sink: TurnEventSink; } /** * Tracks the author-visible `phase("...")` marker for live run details. v1 wire semantics: a * `phase` event is a MARKER — everything after it belongs to that phase until the next marker or * run end (no phase_completed/failed events on the wire; consumers derive spans from positions). * This is observability only: it never checkpoints JS execution or replays/skips user code. */ export declare class PhaseTracker { private readonly sink; private readonly storage; private readonly seenIds; private current; private seq; constructor(opts: PhaseTrackerOptions); set(name: string, opts: PhaseOptions | undefined): void; /** v1 phases are markers — nothing to emit at close; clear the current span. */ close(_status: PhaseCloseStatus): void; capture(): string | null; runInPhase(phaseId: string | null, fn: () => Promise): Promise; }