import { z } from 'zod'; import { M as McpConfig, D as DaemonConfig, T as TunnelConfig, F as FeaturesConfig, P as PairingConfig, W as WorktreesConfig, a as MaintainConfig, S as SpawnConfig, b as SessionsConfig, c as ProvenanceConfig, A as ApprovalsConfig, R as ReachConfig, d as AgentsMdConfig, e as MemoryStoreConfig, f as DeliveryConfig, g as SentinelConfig, h as TitlerConfig, C as CatalogConfig, i as ProfileConfig, j as AcpAgentConfigEntry, k as TerminalPreset } from './config-Bvuv9HOv.js'; import { S as SpawnDefaultsConfig } from './spawn-defaults-B0Yi8_MN.js'; import '@agentproto/delivery'; import '@agentproto/reach'; import '@agentproto/sentinel'; import '@agentproto/acp'; import '@agentproto/command-sandbox'; import '@agentproto/policy'; import '@agentproto/sandbox'; import '@agentproto/model-catalog'; import '@agentproto/auth'; /** * Zod mirror of `AgentprotoConfig` (`config.ts`) plus a declared registry of * every writable key path (`CONFIG_KEYS`) — apply timing, env override, * secret/lockout status, and section. `AgentprotoConfig` stays the source of * truth (loader/CLI code keeps using the plain interface); this schema exists * to VALIDATE what's on disk and to give a future `config_get`/`config_set` * (PR-2, see `.plans/agentproto-config/PLAN.md`) one declared surface instead * of N bespoke tools. * * Every object schema is `.passthrough()` so an unknown key survives a * validate-then-resave round trip exactly like `loadConfig`/`saveConfig` * already preserve unknown keys today (`config.ts:525-526`) — this schema * narrows, it never drops. */ /** `maintain` block (see `MaintainConfig`). Exported so `maintain-repos.ts` * validates the section with the same schema `config_set` uses. */ declare const maintainConfigSchema: z.ZodType; /** * Top-level mirror of `AgentprotoConfig`. `.passthrough()` at every level * (including here) means an unknown top-level key round-trips unchanged, * matching `AgentprotoConfig`'s own `[unknown: string]: unknown` index * signature. */ declare const agentprotoConfigSchema: z.ZodObject<{ version: z.ZodOptional; mcp: z.ZodOptional>>; daemon: z.ZodOptional>>; tunnel: z.ZodOptional>>; features: z.ZodOptional>>; pairing: z.ZodOptional>>; worktrees: z.ZodOptional>>; maintain: z.ZodOptional>>; spawn: z.ZodOptional>>; sessions: z.ZodOptional>>; provenance: z.ZodOptional>>; approvals: z.ZodOptional>>; reach: z.ZodOptional>>; agentsMd: z.ZodOptional>>; memory: z.ZodOptional>>; delivery: z.ZodOptional>>; sentinel: z.ZodOptional>>; models: z.ZodOptional; profile: z.ZodOptional; }, z.core.$loose>]>>>; modelRolePreset: z.ZodOptional>; titler: z.ZodOptional>>; catalog: z.ZodOptional>>; profiles: z.ZodOptional>>>; activeProfile: z.ZodOptional; accountSlots: z.ZodOptional]>>>; defaults: z.ZodOptional>>; acpAgents: z.ZodOptional>>>; terminalPresets: z.ZodOptional>>>; apps: z.ZodOptional>>; }, z.core.$loose>>; }, z.core.$loose>; type ConfigKeyApply = "hot" | "restart"; type ConfigKeySection = "wallets" | "harnesses" | "models" | "defaults" | "remote" | "daemon" | "advanced"; interface ConfigKeyEntry { /** Dot-notation path; `*` stands in for a record's dynamic key. */ path: string; /** Validates a single value written at this path. */ schema: z.ZodTypeAny; /** `"hot"`: re-read from disk at next use (next spawn / next call). * `"restart"`: read once at daemon boot; a write needs a restart to * take effect. */ apply: ConfigKeyApply; /** Env var that silently shadows this key's file value, if any. */ env?: string; /** The value is credential material — never echoed back in full, only * `{ set }` (see `redactConfigValue`). */ secret?: true; /** Field names inside the value (at any depth, arrays included) that hold * credential material: each is redacted to `{ set }` on read while the * rest of the value is shown. For a key whose value is a structure with a * secret inside, like `reach.routes.*` and its webhook `secret`. */ secretFields?: readonly string[]; /** False for a key that a future config_set must refuse (secret * credential fields and daemon-lockout fields) — hand-edit only. */ writable: boolean; section: ConfigKeySection; label: string; help: string; /** Effective default when the key is absent. Omitted when there is no * single default (e.g. the default is conditional, or the daemon * requires the operator to set it explicitly). */ default?: unknown; /** Set on a key kept only as a deprecated alias: `replacedBy` is the * canonical path, `message` the dated deprecation line. The key still * works (read as a fallback of `replacedBy`). */ deprecated?: { replacedBy: string; message: string; }; } declare const CONFIG_KEYS: readonly ConfigKeyEntry[]; /** Keys the schema declares that are deliberately NOT in {@link CONFIG_KEYS} * — every leaf the drift test finds must land in one list or the other. */ interface ConfigKeyNotExposedEntry { path: string; reason: string; } declare const CONFIG_KEYS_NOT_EXPOSED: readonly ConfigKeyNotExposedEntry[]; /** Look up a `CONFIG_KEYS` entry for a concrete dotted path (e.g. * `defaults.adapters.claude-code.skills`), matching any `*` wildcard * segment. Returns `undefined` for a path with no registered entry. */ declare function findConfigKey(path: string): ConfigKeyEntry | undefined; /** * Walk the schema and return every leaf path that has NEITHER a * {@link CONFIG_KEYS} entry NOR a {@link CONFIG_KEYS_NOT_EXPOSED} entry. * A record (`z.record`) contributes one `*` path segment and the walk * continues into its value schema; any path already classified (exact * match, including a classified record-of-object like `profiles` or * `defaults.contextContinuity`) is treated as an intentionally opaque unit * and is NOT descended into further. Exported so the drift test (and any * future tooling) can call it directly against {@link agentprotoConfigSchema}. */ declare function findUnclassifiedConfigPaths(schema?: z.ZodTypeAny): string[]; interface ConfigValidationResult { ok: boolean; issues: string[]; } /** Validate a whole config object against {@link agentprotoConfigSchema}. * Never throws — returns the list of human-readable issues on failure. */ declare function validateConfig(raw: unknown): ConfigValidationResult; interface ConfigKeyValueValidationResult { ok: boolean; error?: string; } /** * Validate a single value's TYPE against the registry entry's schema for * `path` — no writability check. An unregistered path is accepted * (`ok: true`); the CLI (`agentproto config set`, the owner's own * escape hatch) uses this, not {@link validateConfigKeyValue}, because * `writable` is a policy for the future MCP/app surface, not for the local * CLI. */ declare function validateConfigKeyType(path: string, value: unknown): ConfigKeyValueValidationResult; /** * Validate a single value against the registry entry for `path`: type AND * writability. For the future MCP/app `config_set` surface, which must * refuse secret and lockout keys outright (`writable: false`) — the local * CLI is exempt from this and uses {@link validateConfigKeyType} instead. * An unregistered path is accepted (`ok: true`). */ declare function validateConfigKeyValue(path: string, value: unknown): ConfigKeyValueValidationResult; /** * Redact a value read from a secret key path. Fingerprinting is deferred to * a later PR (see `@agentproto/auth`'s `credentialIdentity`) — for now this * only ever reveals whether a value is SET, never any part of it. A * non-secret path (or a path with no registry entry) is returned unchanged. */ declare function redactConfigValue(path: string, value: unknown): unknown; /** Redact every field named in `fields` to `{ set }`, at any depth, arrays * included. Everything else is returned unchanged. */ declare function redactSecretFields(value: unknown, fields: readonly string[]): unknown; export { CONFIG_KEYS, CONFIG_KEYS_NOT_EXPOSED, type ConfigKeyApply, type ConfigKeyEntry, type ConfigKeyNotExposedEntry, type ConfigKeySection, type ConfigKeyValueValidationResult, type ConfigValidationResult, agentprotoConfigSchema, findConfigKey, findUnclassifiedConfigPaths, maintainConfigSchema, redactConfigValue, redactSecretFields, validateConfig, validateConfigKeyType, validateConfigKeyValue };