import { type ActorEnding } from "./actor-stop-cause.js"; import type { RunBundle, RunCostSummary, RunEvent, RunSimulation, RunStream, RunStreamKind } from "./run.js"; export declare const OBSERVER_DATA_SCHEMA = "humanish.observer-data.v1"; export interface ObserverArtifactLink { label: string; href: string; kind: string; } export interface ObserverData { schema: typeof OBSERVER_DATA_SCHEMA; schemaVersion: 1; generatedAt: string; /** Served-only liveness observation. Never a replacement for the recorded evidence verdict. */ runtime?: { state: "running" | "finished" | "interrupted" | "unknown"; observedAt: string; source: "local-run-status"; }; run: { runId: string; mode: RunBundle["mode"]; status: RunBundle["review"]["verdict"]; title: string; createdAt: string; simCount: number; persona: RunBundle["persona"]; scenario: RunBundle["scenario"]; packageName: string | null; redaction: RunBundle["redaction"]; lifecycle: RunBundle["lifecycle"]; knownGaps: string[]; /** * What happened to the PARTICIPANTS, with the denominator attached. `status` above collapses the * run to one word for a gate; this is the study result, and it is what the person watching * through the glass actually wants to know. Absent on a bundle with no participants. * * A viewing room that shows only vivid moments manufactures certainty from n=1 — so the count * travels with the outcome here, always (docs/principles/three-roles.md). */ participants?: RunBundle["review"]["participants"]; /** The same thing as one readable line, so a renderer cannot accidentally show a number * without its denominator. */ participantsLine?: string; /** The study's per-task completion rates (#414), when the lab declared a protocol. */ tasks?: RunBundle["review"]["tasks"]; /** Pre-formatted like participantsLine, denominator on every number. */ tasksLine?: string; }; summary: { streams: number; byKind: Record; active: number; blocked: number; warnings: number; }; laneGroups: ObserverLaneGroup[]; /** * OPTIONAL run-level cost ESTIMATE projected straight through from the bundle * (humanish.run-cost-summary.v1). Absent when the bundle carries none. The Observer LABELS every * figure as estimated (rates as of ) and never presents it as an authoritative charge. */ cost?: RunCostSummary; streams: ObserverStream[]; events: RunEvent[]; artifactLinks: ObserverArtifactLink[]; publicSafety: { publishable: false; note: string; /** * ADDITIVE + OPTIONAL (#584): the result of verification at static render or * export time. Unverified projections omit this field. The timestamp records * that check; it is not an assertion about subsequent file changes. */ share?: { status: "share_ready" | "local_only" | "blocked"; verifiedAt: string; reasons: string[]; }; }; raw: { bundleSchema: string; artifactRoot: string; }; } export interface ObserverStream extends RunStream { /** Only the attached server may grant provider-origin access for a live desktop iframe. */ embed?: NonNullable & { runtimeDesktop?: true; }; /** Participant-facing status. The actor and simulation retain their original protocol status. */ status: RunStream["status"]; /** Precise recorded interruption; absent when the source carries no cause. */ ending?: ActorEnding; sim: RunSimulation; kindLabel: string; statusLabel: string; terminalPlain: string; timeline: RunEvent[]; } /** Discard a forged or stale runtime grant before projecting persisted evidence. */ export declare function recordedStreamEmbed(embed: NonNullable): NonNullable; export interface ObserverLaneGroup { roleId: string; simId: string; streamId: string; status: string; actorType?: string; surface?: string; caseGroup?: string; } export declare function buildObserverData(bundle: RunBundle, generatedAt?: string): ObserverData; /** Refresh presentation from recorded actor evidence, including older exported snapshots. */ export declare function withObserverEndings(data: ObserverData): ObserverData; export declare function stripAnsi(value: string): string;