import type { BrainStatus } from "../core/types.js"; /** Run `fn` with a per-task brain-status sink in scope. ALS propagates it through the async brain calls * inside `fn` (the harness's prompt → brain.stream → connect/retry loop), so {@link emitBrainStatus} * reaches THIS task's sink and nothing else. */ export declare function runWithStatusSink(emit: (s: BrainStatus) => void, fn: () => Promise): Promise; /** Report a brain-layer liveness status to the active per-task sink, if any. A no-op outside a * {@link runWithStatusSink} scope (e.g. compaction's `complete`, or a brain used standalone). */ export declare function emitBrainStatus(status: BrainStatus): void; /** * Silent-fallback telemetry (service [398] C1/C4/C5/C6) — the brain→runner TELEMETRY channel, a * SECOND ALS sink parallel to the status one. Statuses are user-facing liveness frames (wire * `status` events); telemetry is operator-facing fallback accounting the Runner bridges to trace * events (`brain.failover` / `breaker.transition` / `brain.retry` / `vision.placeholder`). Kept * separate so widening telemetry never bloats the shell-visible status vocabulary. Same contract: * fire-and-forget, no-op outside a {@link runWithBrainTelemetry} scope, MUST NOT throw. */ export type BrainTelemetry = { kind: "failover"; servedIndex: number; total: number; errorCode?: string; } | { kind: "breaker"; key: string; phase: "open" | "half-open" | "closed"; failures: number; } | { kind: "retry"; attempt: number; phase: "connect" | "midstream"; } | { kind: "vision_placeholder"; count: number; } /** PDF read: a `document` content block was substituted with a text placeholder because the serving * API/model cannot take native document input (openai brain always; anthropic brain when the model * declares no vision). Silent quality loss → frame (same [398] C4 discipline as vision_placeholder). */ | { kind: "document_placeholder"; count: number; }; /** Run `fn` with a per-task brain-telemetry sink in scope (Runner-side; compose with runWithStatusSink). */ export declare function runWithBrainTelemetry(emit: (t: BrainTelemetry) => void, fn: () => Promise): Promise; /** Report a brain-layer fallback/telemetry event to the active per-task sink, if any. */ export declare function emitBrainTelemetry(t: BrainTelemetry): void; //# sourceMappingURL=status-sink.d.ts.map