/** * Capability resolution: capabilitiesOf(h, model, mode) answers what this * harness/model/mode combination can actually do, always with a source. * This layer serves the CURATED baseline (or degrades to unknown for a * model outside the vocabulary); runtime verification against a live * harness/registry happens at attach time in the consumer, which upgrades * source to runtime-verified. An LLM self-asserting capability is neither. */ import type { CompactionState, HarnessDescriptor, HarnessMode, SessionDelivery, StreamingGranularity } from "../knowledge/descriptor.js"; export interface EscalationObservedOn { readonly harness: string; readonly model: string; readonly version: string; readonly date: string; } /** * Escalation claim: whether this harness and model were observed to emit * the structured hcn-question block when instructed, NOT "this harness can * ask" - live probes show models ask unprompted, so capability-to-ask would * be false. */ export interface EscalationClaim { /** True when this harness and model were observed to emit the structured block when instructed. */ readonly supported: boolean; readonly source: "runtime-verified" | "curated" | "unknown"; readonly confidence: "high" | "medium" | "none"; readonly observedOn?: EscalationObservedOn; } export interface CapabilityResult { readonly vision: boolean; readonly images: boolean; readonly streaming: StreamingGranularity; readonly session: boolean; readonly source: "runtime-verified" | "curated" | "unknown"; readonly confidence: "high" | "medium" | "none"; readonly escalation: EscalationClaim; /** ADR 0009: whether this harness reports its compaction, and on which * channel, or null where nothing hcn reads carries it. It rides the * identity event so a caller branching on compaction events gets the * answer once per session, on the same channel, with no stderr parsing. * * Unlike the claims above, this does NOT degrade for an uncurated * model. It is a fact about which channel carries the signal, and the * MSP view or a `compact_boundary` record exists whatever model runs. */ readonly compactionReporting: { readonly source: "stream" | "view"; readonly states: readonly CompactionState[]; readonly tokens: boolean; } | null; /** Map #288: whether this harness selects a named agent at launch * (`--agent `). Derived from the descriptor's `agent` turn-option * spec - the spec table is the single owner of the fact - so this does * not degrade for an uncurated model, exactly like `compactionReporting`. */ readonly namedAgents: boolean; /** Issue #426: the explicit live-session controls, or null for a harness * with no persistent session. A protocol fact from the descriptor, so it * does not degrade for an uncurated model. */ readonly sessionControls: SessionControlsCapability | null; } export interface SessionControlsCapability { readonly deliveryModes: readonly SessionDelivery[]; readonly interrupt: { readonly supported: true; readonly toolCancellation: "best-effort"; } | { readonly supported: false; }; /** Issue #454: whether the harness can forward native permission requests * to the session host. Potential support is a descriptor fact; a live * session advertises it only when it was opened with `--native-approvals`. */ readonly approvals: { readonly supported: boolean; }; /** Stopping one background job while the same process continues. A * descriptor fact (claude's native `stop_task` control request), not * gated on a process advertisement. */ readonly stopBackground: { readonly supported: boolean; }; } export declare const sessionControlsOf: (h: HarnessDescriptor) => SessionControlsCapability | null; export declare const capabilitiesOf: (h: HarnessDescriptor, model: string, mode: HarnessMode) => CapabilityResult; //# sourceMappingURL=capabilities.d.ts.map