import { type MuseCompaction } from "../interpretation/muse-compaction.js"; import type { Clock, SignalName, SpawnedProcess, SpawnOptions } from "./deps.js"; /** H1: the observer channel carries its own large line limit. A * judge-decided approval can carry more than 64KB of rawArgs, so the * 64KB stream limit would end a healthy turn that a poll lands in. */ export declare const OBSERVER_LINE_MAX = 4194304; /** L2: a pending native request must hold the same identity across this * many consecutive polls before the turn is stopped. Counted polls, not * wall-clock time: a laptop sleep stalls the polls too, so the first poll * after wake cannot measure a spurious 30s. Live finding (issue #179 * validation): judge-decided approvals for ordinary tool calls appear * briefly mid-turn, then clear - a single non-empty sample must not stop * a healthy turn. A judge-escalated approval reports at once instead: a * human was asked, and headless has no human. Issue #189: a sandbox * escalation reports at once too - muse never sends that class to its * approval judge, so no wait can resolve it. */ export declare const APPROVAL_STUCK_POLLS = 30; /** L4: upper bound on the `autoResolutionMs` wait, counted in polls. Past * 5 minutes the field reads as a client-screen timer rather than a * self-resolution deadline: if exec never resolves the input, an * unbounded wait is the #179 hang again (forever without --timeout). * 300 polls at gaps of at least 1s is at least 5 minutes of flowing * observation. */ export declare const MAX_AUTO_RESOLVE_POLLS = 300; export interface MuseApprovalObserver { readonly close: () => Promise; } /** L5: the installed muse helper speaks an MSP surface hcn cannot use - * the operation or handshake hcn sent was rejected as unknown. Carries * the rejected method and the JSON-RPC error code for the message. */ export interface MuseSurfaceIncompatibility { readonly code: number | null; readonly method: string; } /** Issue #179: muse exec omits pending approvals from stdout, so a * headless turn blocked on one hangs with no event until --timeout. This * read-only observer polls the native log through a helper `muse serve` * process using only the approval/listPending operation - a log fold that * takes no lease, works on loaded and unloaded sessions, and never * subscribes. It never loads a session, never decides an approval, and * never copies request payloads (no command, host, path, or tool args * leave the helper): only the blocked subject (approval vs input), the * approval's subject kind, and one boolean - whether the pending approval * is a sandbox escalation - leave the helper. The caller owns both this * helper and the one turn it observes, and reaps it with the child. * Dual-runtime: only injected spawn/clock/signal primitives. */ export declare function watchMuseApprovals(bin: string, options: Pick, deps: { readonly clock: Clock; readonly signal: (proc: SpawnedProcess, sig: SignalName) => void; readonly spawn: (argv: readonly string[], opts: SpawnOptions) => SpawnedProcess; }, sessionId: string, blocked: (subject: "approval" | "input", kind: string, sandboxEscalation: boolean) => void, unavailable: () => void, incompatible?: (info: MuseSurfaceIncompatibility) => void, /** ADR 0009 / #241: every terminal compaction the MSP view reports, * once each. Optional - an omitted sink turns the view fold off, which * is what every caller predating it gets. */ compaction?: (found: MuseCompaction) => void): MuseApprovalObserver; //# sourceMappingURL=muse-approvals.d.ts.map