UNPKG

framework

Version:

The (AI) Framework: turnkey, zero-config AI orchestration that wraps a coding-agent CLI (Claude Code) as a black box and takes you from an idea to a running app. Vite for AI.

62 lines 3.1 kB
import { type HandoffLevel } from './handoff-level.js'; import { type FrameworkFileConfig } from './config.js'; /** * Resolving an agent's settings across config layers (#841). * * The layers used to combine with `||`, which meant a flag could only ever turn a mode *on* and * the-framework.yml could only ever turn one *on*: no layer could say `false`. #800 needs "a * project overrides only what it sets", which cannot be built on OR. * * So: nearest layer that set a key wins, and a layer that left a key unset does not participate. * Absent stays absent, so an existing setup resolves the same way; the one behaviour change is * that an explicit `false` in a nearer layer now wins. */ /** The agent settings a config layer can carry. Keys left `undefined` mean "this layer said nothing". */ export interface AgentConfigValues { /** Remove the built-in #326 system prompt, keeping the session controls (#314/C3). */ vanilla?: boolean | undefined; /** Run the wrapped agent fully raw (#625). */ transparent?: boolean | undefined; /** How far a finished session publishes itself (#1102/#1216/B5). */ handoff?: HandoffLevel | undefined; } /** One tier of config, with the label the agent narrates when this tier wins a key. */ export interface ConfigLayer { /** Where these values came from, e.g. `flag` or `the-framework.yml`. */ name: string; values: AgentConfigValues; } /** What a key resolves to when no layer set it. */ export declare const RUN_CONFIG_DEFAULTS: { readonly vanilla: false; readonly transparent: false; readonly handoff: HandoffLevel; }; /** * The nearest layer that set `key`, or `undefined` when none did. Layers are ordered * nearest-first: run flags > project user > repo yml > global. */ export declare function resolveConfigKey<K extends keyof AgentConfigValues>(layers: readonly ConfigLayer[], key: K): { value: NonNullable<AgentConfigValues[K]>; from: string; } | undefined; /** An agent's settled config, plus which layer supplied each key a layer actually set. */ export interface ResolvedAgentConfig { vanilla: boolean; transparent: boolean; /** How far this session publishes itself (#1102/#1216/B5). */ handoff: HandoffLevel; /** Winning layer name per key; a key left to its default is absent here. */ sources: Partial<Record<keyof AgentConfigValues, string>>; } /** Resolve every agent setting over `layers` (nearest first), falling back to {@link RUN_CONFIG_DEFAULTS}. */ export declare function resolveAgentConfig(layers: readonly ConfigLayer[]): ResolvedAgentConfig; /** The repo tier: `the-framework.yml` as a layer. */ export declare function fileConfigLayer(file: FrameworkFileConfig, name?: string): ConfigLayer; /** * A one-line summary of what a layer set and which one won, e.g. * `vanilla=off (flag), handoff=local (the-framework.yml)`. Keys nobody set are * left out, so an agent with no config anywhere narrates nothing. */ export declare function describeResolvedConfig(config: ResolvedAgentConfig): string; //# sourceMappingURL=config-layers.d.ts.map