/** * The panel's host-side digest read: the session-scoped facts no dashboard DTO * carries — `enforcement`, `knowledge`, `selection` — plus the ONE envelope read * the per-view path does not replace (`iteration`, the delivery line's * no-answer fallback). * * WHY the shrink (plan dsh-panel-unification Task 4, compass D23): the panel * used to compose FIVE dashboard views on every poll tick. Each of those views * is a `DashboardView` the dashboard already serves, so every screen now reads * its own view through `mstar/dashboardView` when it mounts and nothing polls. * What is left here is what no view answers. * * SEQUENTIAL BY CONSTRUCTION: the iteration fallback may refresh the execution * projections (a WRITE), so reads never overlap. * * DEGRADATION IS EXPLICIT: a member that refuses becomes * `{ state: 'unavailable', reason }` (the store's own message); the digest is * `unavailable` only when the store itself could not answer. A store fault * never throws out of here. * * @module @mstar-harness/dsh/panel/read-panel-snapshot */ import type { MstarEngineStatusPayload } from '../types.ts'; import type { PanelSnapshotRead } from './panel-snapshot.ts'; /** * One cached catalog payload and the instant it was built — the shape * `readCatalogPayload` answers (threaded in from the apply scope, where the * cache and its TTL live). */ export interface PanelRetainedRead { readonly payload: MstarEngineStatusPayload; /** Epoch millis the payload was built at (the retained members' OWN freshness). */ readonly builtAt: number; } /** * The apply-scoped catalog reader the plugin threads into this service. * * WHY injected rather than reached for: the cache, its TTL and the * session-keyed invalidation map are created per apply in `index.ts`. Passing * the reader keeps ONE catalog implementation (the pre-step's) and leaves this * module free of `gates/` imports. */ export type PanelRetainedReader = (harnessDir: string, sessionId: string, cwd: string) => Promise; /** * Compose one panel snapshot from the store authorities. * * `harnessDir === null` (no workspace harness) is the `no-harness` state — an * inactive workspace, never a fabricated empty one and never a store error. * @param input - the resolved harness dir, the optional client-asserted ids, * the validated session the catalog cache is keyed by, the apply-scoped * catalog reader, and the carrier signal. * @returns the composed snapshot, `no-harness`, or the explicit unavailable * state with a reason (`aborted` when the carrier cancelled mid-read). */ export declare function readPanelSnapshot(input: { harnessDir: string | null; /** A client-asserted workflow id; the resolved session's pick is used when absent. */ workflowId?: string; /** A client-asserted iteration id; the harness catalog resolves one when absent. */ iterationId?: string; /** A client-asserted project id; the harness catalog resolves one when absent. */ projectId?: string; /** The validated session the catalog cache is keyed by (absent ⇒ no retained read). */ sessionId?: string; /** The validated session workspace, the cache key's second half. */ cwd?: string; /** The apply-scoped catalog reader; absent in a host without the catalog wiring. */ retained?: PanelRetainedReader; /** Carrier lifetime: checked before every read so a cancelled call stops paying. */ signal?: AbortSignal; }): Promise;