import type { EngineGraphSnapshot } from "./monitor-reader-types.ts"; /** * Scan every `engine-*.json` file in `stateDir` and return a rich * {@link EngineGraphSnapshot} per persisted graph execution engine (v2). * * Each file is read and parsed via {@link loadEngineStateFromJson}, the same * version-gated loader the engine's own persistence layer uses. Files that are * corrupt JSON, not a version-`2` engine file, or unreadable are **skipped * honestly** — they never surface an error and never fabricate a snapshot. * Terminal graphs whose last update predates {@link TERMINAL_GRAPH_STALE_MS} * are gated out (unless a node is running/blocked) so dead persisted graphs * are not rendered as live activity. Returns an empty array when no engine * files exist. */ export declare function readEngineGraphs(stateDir: string): EngineGraphSnapshot[]; /** * Read engine-graph snapshots from the process's **live** in-memory graph * registry, falling back to the disk scan when no live toolset is registered. * * Live path: the process's active `GraphToolSet` (registered by the platform * assembly layer through `src/graph/tools/live-state.ts`'s * `registerLiveGraphToolSet`) owns the in-memory graph registry. Each registry * runtime is projected through {@link projectEngineGraph} via * `EngineRuntime.status()` — the exact same snapshot surface the disk path * produces, so the monitor renders live and persisted graphs identically. * * This is the opencode-platform fix: there the engine runs fully in-memory and * never writes `engine-*.json` (see the platform contract in * `src/core/services/tool-service.ts`), so a disk scan alone would show an * empty engine-graph list while graphs are genuinely executing. When no * toolset is registered (no platform assembly / different process), `stateDir` * (default `process.cwd()` — matching the graph tools' persisted-scan default) * drives the unchanged disk fallback. */ export declare function readLiveEngineGraphs(stateDir?: string): EngineGraphSnapshot[]; /** * Merge the disk-persisted engine-graph snapshots with the live registry * snapshots for display, **live winning by graphId**. * * The live registry is the freshest source of truth (opencode runs the engine * fully in-memory; disk `engine-*.json` may be absent, stale, or from an * abandoned prior run). Every graph the live registry holds therefore replaces * any disk snapshot with the same graphId. The **disk-only remainder** — * graphs the live registry does not hold (e.g. completed graphs still within * the staleness window) — survives only if it passes the subtask-2 stale * terminal gate ({@link isStaleTerminalGraph}), so a dead persisted complete * graph is never resurrected by the merge. * * Live graphs are ordered first so actively executing graphs are never pushed * below the fold by the disk remainder. Pure and total — never throws. */ export declare function mergeLiveEngineGraphs(diskGraphs: readonly EngineGraphSnapshot[], liveGraphs: readonly EngineGraphSnapshot[], now?: number): EngineGraphSnapshot[]; //# sourceMappingURL=monitor-reader-engine.d.ts.map