/** * Release input-guard check (specs/2026-10-04-release-input-guard-check.md). * * Reads every live agent's input box from the running backend's real * terminal buffers (styling kept, ghost text blanked) and classifies it with * the NEW build's guard, run in a fresh node process. A build that reads an * idle agent's input box as `unknown` would hold every message delivery * (1.20.198), so the upgrade flow refuses to restart onto it. * * @module services/system/input-guard-release-check */ import type { InputGuardClassification, InputGuardViewInput } from '../../scripts/input-guard-classify.js'; /** One agent row of the report. */ export type InputGuardAgentResult = InputGuardClassification; /** Report of one check. */ export interface InputGuardReport { /** No idle agent reads as unknown */ ok: boolean; /** The check could not run at all (old build without the script): not blocking */ unavailable?: boolean; /** Script that classified (absent when unavailable) */ script?: string; checkedAt: string; agents: InputGuardAgentResult[]; /** Why it failed / could not run */ error?: string; } /** What the live backend offers. */ export interface LiveViewSource { listSessions(): string[]; captureInputView?(name: string): { lines: string[]; cursorRow: number; } | null; } /** Runs the classifier script; resolves its stdout, rejects on failure. */ export type ClassifierRunner = (script: string, stdin: string) => Promise; /** * Find the new build's classifier script under a path the caller names. * * @param build - Package root, `dist` dir, `dist/backend` dir, or the script's dir * @returns Absolute script path, or null when the build has none */ export declare function resolveClassifierScript(build: string): string | null; /** * Gather the live view of every PTY session; one without a styled capture * gets a null view and is reported as skipped. * * @param source - The session backend * @param runtimeOf - Runtime type of a session (from persisted metadata) * @param ownPastesOf - The harness's pastes into a session since the last * outside input (input ledger), so a box holding only those reads as the * harness's own (crewly#1028) * @returns One entry per session */ export declare function collectLiveViews(source: LiveViewSource, runtimeOf: (session: string) => string | undefined, ownPastesOf?: (session: string) => { pastes: string[]; shownMarkers: Array<{ marker: string; message: string; }>; }): InputGuardViewInput[]; /** * Default runner: `node