/** * Option resolution: the precedence chain args > user config > built-in * profile, plus provenance. Pure - the config FILE is read by the CLI layer * and passed in as data; this layer only decides what wins. * * Launch-only: resume passes explicit turn options. Omitted settings follow * native behavior, which may use current configuration rather than saved settings. */ import type { HarnessDescriptor } from "../knowledge/descriptor.js"; import type { TurnOptions } from "./argv.js"; import type { QuestionMode } from "./question.js"; import type { ToolMapConfig } from "./tool-vocabulary.js"; export type ProvenanceTier = "arg" | "project-config" | "user-config" | "profile" | "harness"; export interface ProvenanceEntry { readonly key: string; readonly value: unknown; readonly tier: ProvenanceTier; } /** D5: the project floor caps arg grants; exceeding it refuses naming both * sets. Structured-first: fields, not prose parsing. */ export declare class FloorExceededError extends Error { readonly harness: string; readonly excess: readonly string[]; readonly floor: readonly string[]; constructor(harness: string, excess: readonly string[], floor: readonly string[]); } /** A dimension some tier attempted that this harness cannot express * (skip-and-report, never refuse): rendered as divergence, not failure. * The entry names the tier that set it so provenance can print which tier * (profile default, user config, project config, or an arg that reached a * harness with no spec) attempted the dimension. */ export interface UnrenderableEntry { readonly key: string; readonly tier: ProvenanceTier; } export interface ResolvedOptions { readonly options: TurnOptions; readonly provenance: readonly ProvenanceEntry[]; readonly unrenderable: readonly UnrenderableEntry[]; } export declare function assertAccessExclusivity(harness: HarnessDescriptor, options: Partial, explicit?: (key: keyof TurnOptions) => boolean): void; /** What one parsed config file carries: the turn options it may set, plus * the keys that are not turn options - named toolsets, the raw toolMap * (harness -> canonical -> native, merged into the one ToolMap shape * here), and the wall-clock timeout. */ export type ConfigTier = Readonly, "toolMap">> & { readonly toolMap?: ToolMapConfig; readonly toolsets?: Readonly>; readonly timeout?: number; }; export interface ConfigTiers { /** ~/.config/hcn/config.json (XDG) - machine-wide defaults. */ readonly user?: ConfigTier; /** /.hcn/config.json - auto-discovered (ratified A), the ALL- * OFF tier; its `tools` key is both the default grant and the FLOOR: an * arg grant exceeding it refuses, naming both sets (D5). */ readonly project?: ConfigTier; } /** Where a resolved behaviour value came from; `default` is hcn's own. */ export type BehaviorTier = "arg" | "project-config" | "user-config" | "default"; /** The hcn-owned behaviour instructions a run resolves on every path, * launch, resume, and session alike (RFC-02 change 6): question mode, * which rides the prompt rather than the argv, and the wall-clock * timeout hcn enforces itself. Neither is a turn option, so the * launch-only turn-option resolver never sees them. */ export interface ResolvedBehavior { readonly questions: { readonly value: QuestionMode; readonly tier: BehaviorTier; }; readonly timeoutSeconds: { readonly value: number | undefined; readonly tier: BehaviorTier; }; } /** Precedence arg > project > user > default, with the tier the * provenance line prints. Timeout 0 is an explicit disable. */ export declare const resolveBehavior: (args: { readonly questions?: QuestionMode; readonly timeoutSeconds?: number; }, tiers: ConfigTiers) => ResolvedBehavior; /** Memory precedence for SESSION spawns (ratified 2026-08-26): sessions * resolve the memory dimension like a bare launch does - arg > project > * user > profile default false - because the decision is made once at * spawn, not per turn. Pure so the precedence is unit-pinnable; the * session CLI reports the tier and passes the value to openSession. */ export interface MemoryResolution { readonly memory: boolean; readonly tier: "arg" | "project-config" | "user-config" | "profile"; } export declare const resolveSessionMemory: (arg: boolean | undefined, tiers: { readonly user?: Readonly<{ memory?: boolean; }>; readonly project?: Readonly<{ memory?: boolean; }>; }) => MemoryResolution; export declare const resolveEffectiveOptions: (h: HarnessDescriptor, args: TurnOptions, tiers?: ConfigTiers) => ResolvedOptions; //# sourceMappingURL=resolve-options.d.ts.map