/** * Structured argv refusals: closed issue vocabulary and the typed error * that carries harness, option, facet, and supported alternatives. The * helper builds the message from those fields so the two cannot drift - a * consumer branching on `issue` never has to parse English. */ import type { DiscoveryFacet, HarnessName, TurnOptionKey } from "../knowledge/descriptor.js"; export declare const REFUSAL_ISSUES: readonly ["unsupported-option", "unsupported-option-facet", "extension-option-unavailable", "unsupported-on-resume", "invalid-option-value", "unknown-effort", "unknown-model", "invalid-env", "invalid-tool-grant", "unknown-tool-name", "mutually-exclusive-options", "prompt-flag-injection", "no-autonomy-mode", "no-session-mode", "native-settings-unavailable", "native-settings-changed", "unsupported-passthrough"]; export type RefusalIssue = (typeof REFUSAL_ISSUES)[number]; /** The option a refusal names: turn-option spec keys (descriptor tables) * plus the tool-list dimensions and autonomy, which render via dedicated * descriptor fields rather than a spec table. Kept closed so consumers can * branch on it without a default arm. */ export type RefusalOption = TurnOptionKey | "context" | "tools" | "excludeTools" | "skills" | "autonomy" | "questions" | "timeout" | "nativeSettingsFingerprint" | "resumeLast" | `discovery.${string}`; /** One helper builds the message from the structured fields so message and * fields cannot drift. Every message names an alternative, not only a * negation, so an agent can pivot without reading the descriptor. A * refusal raised before a harness is chosen (argument parsing, config) * passes no harness, and the message carries no harness fragment (RFC-02 * change 11) instead of naming one the caller never picked. */ export declare const buildRefusalMessage: (issue: RefusalIssue, harness: HarnessName | undefined, option?: RefusalOption, facet?: DiscoveryFacet, supported?: readonly string[], detail?: string, bin?: string) => string; /** Raised when launch options would corrupt or subvert the spawned argv. */ export declare class ArgvRefusalError extends Error { readonly issue: RefusalIssue; /** The harness the refusal is about; absent when it was raised before * one was chosen (argument parsing, config loading). */ readonly harness?: HarnessName; readonly option?: RefusalOption; readonly facet?: DiscoveryFacet; readonly supported: readonly string[]; /** D7: which harnesses DO express the refused option, native spellings * included. Derived by the raise site from descriptors - absent when the * refusing layer has no descriptor set in scope. */ readonly supportedBy?: ReadonlyArray<{ harness: string; spelling: string; }>; /** D8: nearest-alternative suggestion for the CURRENT harness - keeps a * scanning agent on its chosen harness instead of switching. Curatorial * data set at the raise site; absent when no hint exists. */ readonly hint?: string; /** N3: the native binary of the descriptor that raised the refusal, for * message arms that name it. Set at the raise site; absent when the * raising layer has no descriptor in scope. */ readonly bin?: string; constructor(args: { readonly issue: RefusalIssue; readonly harness?: HarnessName; readonly option?: RefusalOption; readonly facet?: DiscoveryFacet; readonly supported?: readonly string[]; readonly supportedBy?: ReadonlyArray<{ harness: string; spelling: string; }>; readonly hint?: string; readonly detail?: string; readonly message?: string; readonly bin?: string; }); } //# sourceMappingURL=refusal.d.ts.map