import { z } from 'zod'; /** * Zod schema for totem.config.ts — lives at the root of consuming projects. */ /** * Built-in chunk strategy names. Exported so the literal union derived * via `typeof BUILTIN_CHUNK_STRATEGIES[number]` keeps the runtime list * and the type signature in sync with a single source of truth. Pack- * contributed strategies extend `ChunkStrategy` via the `(string & {})` * tail and register at boot through `chunker-registry.ts`. */ export declare const BUILTIN_CHUNK_STRATEGIES: readonly ["typescript-ast", "markdown-heading", "session-log", "schema-file", "test-file", "generic"]; /** * `ChunkStrategy` schema. Per ADR-097 § 10 + mmnto-ai/totem#1769 strategy * lookup goes through `chunker-registry.ts` at runtime; this schema only * shape-checks the input string. * * **Why not refine against the registry here?** Bootstrap chicken-and-egg * (Gemini review of mmnto-ai/totem#1768 PR-A): config parse runs BEFORE * `loadInstalledPacks()` populates the registry with pack-contributed * strategies (the manifest is read AFTER config load by every command). * A strict registry-check at parse time would crash `totem sync` on the * very edit that adds the pack — user adds `@mmnto/pack-foo` to extends * AND a target with `strategy: 'foo-strat'` in the same change, sync * fails to parse the config, never writes installed-packs.json, never * registers the pack. Forever stuck. * * The actual fail-loud happens at `createChunker(strategy)` in * `chunkers/chunker.ts` — runtime lookup against the post-boot registry * with a structured error naming the missing strategy. That's the right * boundary because by then the registry IS populated. */ export declare const ChunkStrategySchema: z.ZodString; export declare const ContentTypeSchema: z.ZodEnum<["code", "session_log", "spec", "lesson"]>; export declare const IngestTargetSchema: z.ZodObject<{ glob: z.ZodString; type: z.ZodEnum<["code", "session_log", "spec", "lesson"]>; strategy: z.ZodString; }, "strip", z.ZodTypeAny, { type: "code" | "lesson" | "session_log" | "spec"; glob: string; strategy: string; }, { type: "code" | "lesson" | "session_log" | "spec"; glob: string; strategy: string; }>; export declare const OpenAIProviderSchema: z.ZodObject<{ provider: z.ZodLiteral<"openai">; model: z.ZodDefault; dimensions: z.ZodOptional; throttleMs: z.ZodOptional; }, "strip", z.ZodTypeAny, { model: string; provider: "openai"; dimensions?: number | undefined; throttleMs?: number | undefined; }, { provider: "openai"; model?: string | undefined; dimensions?: number | undefined; throttleMs?: number | undefined; }>; export declare const OllamaProviderSchema: z.ZodObject<{ provider: z.ZodLiteral<"ollama">; model: z.ZodDefault; baseUrl: z.ZodDefault; dimensions: z.ZodOptional; }, "strip", z.ZodTypeAny, { model: string; provider: "ollama"; baseUrl: string; dimensions?: number | undefined; }, { provider: "ollama"; model?: string | undefined; dimensions?: number | undefined; baseUrl?: string | undefined; }>; export declare const GeminiProviderSchema: z.ZodObject<{ provider: z.ZodLiteral<"gemini">; model: z.ZodDefault; dimensions: z.ZodOptional; throttleMs: z.ZodOptional; }, "strip", z.ZodTypeAny, { model: string; provider: "gemini"; dimensions?: number | undefined; throttleMs?: number | undefined; }, { provider: "gemini"; model?: string | undefined; dimensions?: number | undefined; throttleMs?: number | undefined; }>; export declare const EmbeddingProviderSchema: z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{ provider: z.ZodLiteral<"openai">; model: z.ZodDefault; dimensions: z.ZodOptional; throttleMs: z.ZodOptional; }, "strip", z.ZodTypeAny, { model: string; provider: "openai"; dimensions?: number | undefined; throttleMs?: number | undefined; }, { provider: "openai"; model?: string | undefined; dimensions?: number | undefined; throttleMs?: number | undefined; }>, z.ZodObject<{ provider: z.ZodLiteral<"ollama">; model: z.ZodDefault; baseUrl: z.ZodDefault; dimensions: z.ZodOptional; }, "strip", z.ZodTypeAny, { model: string; provider: "ollama"; baseUrl: string; dimensions?: number | undefined; }, { provider: "ollama"; model?: string | undefined; dimensions?: number | undefined; baseUrl?: string | undefined; }>, z.ZodObject<{ provider: z.ZodLiteral<"gemini">; model: z.ZodDefault; dimensions: z.ZodOptional; throttleMs: z.ZodOptional; }, "strip", z.ZodTypeAny, { model: string; provider: "gemini"; dimensions?: number | undefined; throttleMs?: number | undefined; }, { provider: "gemini"; model?: string | undefined; dimensions?: number | undefined; throttleMs?: number | undefined; }>]>; export declare const DEFAULT_IGNORE_PATTERNS: string[]; export declare const ShellOrchestratorSchema: z.ZodObject<{ /** Default model name if --model is not passed */ defaultModel: z.ZodOptional; /** Fallback model used automatically if the primary model fails due to quota/rate limits */ fallbackModel: z.ZodOptional; /** Per-command model overrides (e.g., { 'spec': 'gemini-3.1-pro-preview' }) */ overrides: z.ZodOptional>; /** Per-command cache TTLs in seconds (e.g., { 'triage': 3600, 'shield': 0 }) */ cacheTtls: z.ZodOptional>; /** * Enable provider-native prompt caching (mmnto/totem#1291 Proposal 217). When true and * the provider supports it (Anthropic in 1.15.0, Gemini in 1.16.0+), persistent * `systemPrompt` segments will be marked with cache_control directives to * reduce input-token cost on repeat invocations within the TTL window. * Defaults to undefined (off) — opt-in for 1.15.0 to avoid surprising existing * users mid-cycle. Distinct from `cacheTtls` above, which controls the * orthogonal response-level cache (mmnto/totem#52, closed) at * `.totem/cache/-.json`. */ enableContextCaching: z.ZodOptional; /** * Prompt cache TTL in seconds (mmnto/totem#1291). Anthropic supports exactly * two values today: 300 (5m, default ephemeral) and 3600 (1h, extended cache * — 2x write cost, ~10% read cost). Only consulted when * `enableContextCaching` is true. Defaults to 300 when omitted. * * Constrained to literals at parse time so invalid TTLs (e.g. 600, 1800) * fail fast at config load instead of silently falling through to 5m at * provider-invocation time. Caught by CodeRabbit on PR #1292 review. * Anthropic docs verified for both values: * https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching */ cacheTTL: z.ZodOptional, z.ZodLiteral<3600>]>>; /** * Declared backend-capability contract (mmnto-ai/totem#2102, strategy#474 * slice 3). `admissionClasses` lists the backend admission classes this * orchestrator is declared capable of serving; canonical values live in * core `ADMISSION_CLASSES`. Read by the `runOrchestrator` admission gate * only: a caller requesting a class above `completion_only` that is not * declared here fails loud BEFORE any provider invoke (no tokens spent, * no artifact emitted). Absent = `['completion_only']` — factually true * of every backend today. A declaration is a capability claim, never an * enforcement mechanism (output enforcement is caller-side, #2103). */ capabilities: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }>>; provider: z.ZodLiteral<"shell">; /** Shell command with {file} and {model} placeholders */ command: z.ZodString; }, "strip", z.ZodTypeAny, { provider: "shell"; command: string; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }, { provider: "shell"; command: string; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }>; export declare const GeminiOrchestratorSchema: z.ZodObject<{ /** Default model name if --model is not passed */ defaultModel: z.ZodOptional; /** Fallback model used automatically if the primary model fails due to quota/rate limits */ fallbackModel: z.ZodOptional; /** Per-command model overrides (e.g., { 'spec': 'gemini-3.1-pro-preview' }) */ overrides: z.ZodOptional>; /** Per-command cache TTLs in seconds (e.g., { 'triage': 3600, 'shield': 0 }) */ cacheTtls: z.ZodOptional>; /** * Enable provider-native prompt caching (mmnto/totem#1291 Proposal 217). When true and * the provider supports it (Anthropic in 1.15.0, Gemini in 1.16.0+), persistent * `systemPrompt` segments will be marked with cache_control directives to * reduce input-token cost on repeat invocations within the TTL window. * Defaults to undefined (off) — opt-in for 1.15.0 to avoid surprising existing * users mid-cycle. Distinct from `cacheTtls` above, which controls the * orthogonal response-level cache (mmnto/totem#52, closed) at * `.totem/cache/-.json`. */ enableContextCaching: z.ZodOptional; /** * Prompt cache TTL in seconds (mmnto/totem#1291). Anthropic supports exactly * two values today: 300 (5m, default ephemeral) and 3600 (1h, extended cache * — 2x write cost, ~10% read cost). Only consulted when * `enableContextCaching` is true. Defaults to 300 when omitted. * * Constrained to literals at parse time so invalid TTLs (e.g. 600, 1800) * fail fast at config load instead of silently falling through to 5m at * provider-invocation time. Caught by CodeRabbit on PR #1292 review. * Anthropic docs verified for both values: * https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching */ cacheTTL: z.ZodOptional, z.ZodLiteral<3600>]>>; /** * Declared backend-capability contract (mmnto-ai/totem#2102, strategy#474 * slice 3). `admissionClasses` lists the backend admission classes this * orchestrator is declared capable of serving; canonical values live in * core `ADMISSION_CLASSES`. Read by the `runOrchestrator` admission gate * only: a caller requesting a class above `completion_only` that is not * declared here fails loud BEFORE any provider invoke (no tokens spent, * no artifact emitted). Absent = `['completion_only']` — factually true * of every backend today. A declaration is a capability claim, never an * enforcement mechanism (output enforcement is caller-side, #2103). */ capabilities: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }>>; provider: z.ZodLiteral<"gemini">; }, "strip", z.ZodTypeAny, { provider: "gemini"; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }, { provider: "gemini"; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }>; export declare const AnthropicOrchestratorSchema: z.ZodObject<{ /** Default model name if --model is not passed */ defaultModel: z.ZodOptional; /** Fallback model used automatically if the primary model fails due to quota/rate limits */ fallbackModel: z.ZodOptional; /** Per-command model overrides (e.g., { 'spec': 'gemini-3.1-pro-preview' }) */ overrides: z.ZodOptional>; /** Per-command cache TTLs in seconds (e.g., { 'triage': 3600, 'shield': 0 }) */ cacheTtls: z.ZodOptional>; /** * Enable provider-native prompt caching (mmnto/totem#1291 Proposal 217). When true and * the provider supports it (Anthropic in 1.15.0, Gemini in 1.16.0+), persistent * `systemPrompt` segments will be marked with cache_control directives to * reduce input-token cost on repeat invocations within the TTL window. * Defaults to undefined (off) — opt-in for 1.15.0 to avoid surprising existing * users mid-cycle. Distinct from `cacheTtls` above, which controls the * orthogonal response-level cache (mmnto/totem#52, closed) at * `.totem/cache/-.json`. */ enableContextCaching: z.ZodOptional; /** * Prompt cache TTL in seconds (mmnto/totem#1291). Anthropic supports exactly * two values today: 300 (5m, default ephemeral) and 3600 (1h, extended cache * — 2x write cost, ~10% read cost). Only consulted when * `enableContextCaching` is true. Defaults to 300 when omitted. * * Constrained to literals at parse time so invalid TTLs (e.g. 600, 1800) * fail fast at config load instead of silently falling through to 5m at * provider-invocation time. Caught by CodeRabbit on PR #1292 review. * Anthropic docs verified for both values: * https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching */ cacheTTL: z.ZodOptional, z.ZodLiteral<3600>]>>; /** * Declared backend-capability contract (mmnto-ai/totem#2102, strategy#474 * slice 3). `admissionClasses` lists the backend admission classes this * orchestrator is declared capable of serving; canonical values live in * core `ADMISSION_CLASSES`. Read by the `runOrchestrator` admission gate * only: a caller requesting a class above `completion_only` that is not * declared here fails loud BEFORE any provider invoke (no tokens spent, * no artifact emitted). Absent = `['completion_only']` — factually true * of every backend today. A declaration is a capability claim, never an * enforcement mechanism (output enforcement is caller-side, #2103). */ capabilities: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }>>; provider: z.ZodLiteral<"anthropic">; }, "strip", z.ZodTypeAny, { provider: "anthropic"; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }, { provider: "anthropic"; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }>; export declare const OpenAIOrchestratorSchema: z.ZodObject<{ /** Default model name if --model is not passed */ defaultModel: z.ZodOptional; /** Fallback model used automatically if the primary model fails due to quota/rate limits */ fallbackModel: z.ZodOptional; /** Per-command model overrides (e.g., { 'spec': 'gemini-3.1-pro-preview' }) */ overrides: z.ZodOptional>; /** Per-command cache TTLs in seconds (e.g., { 'triage': 3600, 'shield': 0 }) */ cacheTtls: z.ZodOptional>; /** * Enable provider-native prompt caching (mmnto/totem#1291 Proposal 217). When true and * the provider supports it (Anthropic in 1.15.0, Gemini in 1.16.0+), persistent * `systemPrompt` segments will be marked with cache_control directives to * reduce input-token cost on repeat invocations within the TTL window. * Defaults to undefined (off) — opt-in for 1.15.0 to avoid surprising existing * users mid-cycle. Distinct from `cacheTtls` above, which controls the * orthogonal response-level cache (mmnto/totem#52, closed) at * `.totem/cache/-.json`. */ enableContextCaching: z.ZodOptional; /** * Prompt cache TTL in seconds (mmnto/totem#1291). Anthropic supports exactly * two values today: 300 (5m, default ephemeral) and 3600 (1h, extended cache * — 2x write cost, ~10% read cost). Only consulted when * `enableContextCaching` is true. Defaults to 300 when omitted. * * Constrained to literals at parse time so invalid TTLs (e.g. 600, 1800) * fail fast at config load instead of silently falling through to 5m at * provider-invocation time. Caught by CodeRabbit on PR #1292 review. * Anthropic docs verified for both values: * https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching */ cacheTTL: z.ZodOptional, z.ZodLiteral<3600>]>>; /** * Declared backend-capability contract (mmnto-ai/totem#2102, strategy#474 * slice 3). `admissionClasses` lists the backend admission classes this * orchestrator is declared capable of serving; canonical values live in * core `ADMISSION_CLASSES`. Read by the `runOrchestrator` admission gate * only: a caller requesting a class above `completion_only` that is not * declared here fails loud BEFORE any provider invoke (no tokens spent, * no artifact emitted). Absent = `['completion_only']` — factually true * of every backend today. A declaration is a capability claim, never an * enforcement mechanism (output enforcement is caller-side, #2103). */ capabilities: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }>>; provider: z.ZodLiteral<"openai">; /** Optional base URL for OpenAI-compatible servers (Ollama, LM Studio, etc.) */ baseUrl: z.ZodOptional; }, "strip", z.ZodTypeAny, { provider: "openai"; baseUrl?: string | undefined; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }, { provider: "openai"; baseUrl?: string | undefined; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }>; export declare const OllamaOrchestratorSchema: z.ZodObject<{ /** Default model name if --model is not passed */ defaultModel: z.ZodOptional; /** Fallback model used automatically if the primary model fails due to quota/rate limits */ fallbackModel: z.ZodOptional; /** Per-command model overrides (e.g., { 'spec': 'gemini-3.1-pro-preview' }) */ overrides: z.ZodOptional>; /** Per-command cache TTLs in seconds (e.g., { 'triage': 3600, 'shield': 0 }) */ cacheTtls: z.ZodOptional>; /** * Enable provider-native prompt caching (mmnto/totem#1291 Proposal 217). When true and * the provider supports it (Anthropic in 1.15.0, Gemini in 1.16.0+), persistent * `systemPrompt` segments will be marked with cache_control directives to * reduce input-token cost on repeat invocations within the TTL window. * Defaults to undefined (off) — opt-in for 1.15.0 to avoid surprising existing * users mid-cycle. Distinct from `cacheTtls` above, which controls the * orthogonal response-level cache (mmnto/totem#52, closed) at * `.totem/cache/-.json`. */ enableContextCaching: z.ZodOptional; /** * Prompt cache TTL in seconds (mmnto/totem#1291). Anthropic supports exactly * two values today: 300 (5m, default ephemeral) and 3600 (1h, extended cache * — 2x write cost, ~10% read cost). Only consulted when * `enableContextCaching` is true. Defaults to 300 when omitted. * * Constrained to literals at parse time so invalid TTLs (e.g. 600, 1800) * fail fast at config load instead of silently falling through to 5m at * provider-invocation time. Caught by CodeRabbit on PR #1292 review. * Anthropic docs verified for both values: * https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching */ cacheTTL: z.ZodOptional, z.ZodLiteral<3600>]>>; /** * Declared backend-capability contract (mmnto-ai/totem#2102, strategy#474 * slice 3). `admissionClasses` lists the backend admission classes this * orchestrator is declared capable of serving; canonical values live in * core `ADMISSION_CLASSES`. Read by the `runOrchestrator` admission gate * only: a caller requesting a class above `completion_only` that is not * declared here fails loud BEFORE any provider invoke (no tokens spent, * no artifact emitted). Absent = `['completion_only']` — factually true * of every backend today. A declaration is a capability claim, never an * enforcement mechanism (output enforcement is caller-side, #2103). */ capabilities: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }>>; provider: z.ZodLiteral<"ollama">; /** Base URL for the Ollama server */ baseUrl: z.ZodDefault; /** Context length passed to Ollama as num_ctx (controls KV cache / VRAM usage) */ numCtx: z.ZodOptional; }, "strip", z.ZodTypeAny, { provider: "ollama"; baseUrl: string; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; numCtx?: number | undefined; }, { provider: "ollama"; baseUrl?: string | undefined; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; numCtx?: number | undefined; }>; export declare const OrchestratorSchema: z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{ /** Default model name if --model is not passed */ defaultModel: z.ZodOptional; /** Fallback model used automatically if the primary model fails due to quota/rate limits */ fallbackModel: z.ZodOptional; /** Per-command model overrides (e.g., { 'spec': 'gemini-3.1-pro-preview' }) */ overrides: z.ZodOptional>; /** Per-command cache TTLs in seconds (e.g., { 'triage': 3600, 'shield': 0 }) */ cacheTtls: z.ZodOptional>; /** * Enable provider-native prompt caching (mmnto/totem#1291 Proposal 217). When true and * the provider supports it (Anthropic in 1.15.0, Gemini in 1.16.0+), persistent * `systemPrompt` segments will be marked with cache_control directives to * reduce input-token cost on repeat invocations within the TTL window. * Defaults to undefined (off) — opt-in for 1.15.0 to avoid surprising existing * users mid-cycle. Distinct from `cacheTtls` above, which controls the * orthogonal response-level cache (mmnto/totem#52, closed) at * `.totem/cache/-.json`. */ enableContextCaching: z.ZodOptional; /** * Prompt cache TTL in seconds (mmnto/totem#1291). Anthropic supports exactly * two values today: 300 (5m, default ephemeral) and 3600 (1h, extended cache * — 2x write cost, ~10% read cost). Only consulted when * `enableContextCaching` is true. Defaults to 300 when omitted. * * Constrained to literals at parse time so invalid TTLs (e.g. 600, 1800) * fail fast at config load instead of silently falling through to 5m at * provider-invocation time. Caught by CodeRabbit on PR #1292 review. * Anthropic docs verified for both values: * https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching */ cacheTTL: z.ZodOptional, z.ZodLiteral<3600>]>>; /** * Declared backend-capability contract (mmnto-ai/totem#2102, strategy#474 * slice 3). `admissionClasses` lists the backend admission classes this * orchestrator is declared capable of serving; canonical values live in * core `ADMISSION_CLASSES`. Read by the `runOrchestrator` admission gate * only: a caller requesting a class above `completion_only` that is not * declared here fails loud BEFORE any provider invoke (no tokens spent, * no artifact emitted). Absent = `['completion_only']` — factually true * of every backend today. A declaration is a capability claim, never an * enforcement mechanism (output enforcement is caller-side, #2103). */ capabilities: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }>>; provider: z.ZodLiteral<"shell">; /** Shell command with {file} and {model} placeholders */ command: z.ZodString; }, "strip", z.ZodTypeAny, { provider: "shell"; command: string; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }, { provider: "shell"; command: string; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }>, z.ZodObject<{ /** Default model name if --model is not passed */ defaultModel: z.ZodOptional; /** Fallback model used automatically if the primary model fails due to quota/rate limits */ fallbackModel: z.ZodOptional; /** Per-command model overrides (e.g., { 'spec': 'gemini-3.1-pro-preview' }) */ overrides: z.ZodOptional>; /** Per-command cache TTLs in seconds (e.g., { 'triage': 3600, 'shield': 0 }) */ cacheTtls: z.ZodOptional>; /** * Enable provider-native prompt caching (mmnto/totem#1291 Proposal 217). When true and * the provider supports it (Anthropic in 1.15.0, Gemini in 1.16.0+), persistent * `systemPrompt` segments will be marked with cache_control directives to * reduce input-token cost on repeat invocations within the TTL window. * Defaults to undefined (off) — opt-in for 1.15.0 to avoid surprising existing * users mid-cycle. Distinct from `cacheTtls` above, which controls the * orthogonal response-level cache (mmnto/totem#52, closed) at * `.totem/cache/-.json`. */ enableContextCaching: z.ZodOptional; /** * Prompt cache TTL in seconds (mmnto/totem#1291). Anthropic supports exactly * two values today: 300 (5m, default ephemeral) and 3600 (1h, extended cache * — 2x write cost, ~10% read cost). Only consulted when * `enableContextCaching` is true. Defaults to 300 when omitted. * * Constrained to literals at parse time so invalid TTLs (e.g. 600, 1800) * fail fast at config load instead of silently falling through to 5m at * provider-invocation time. Caught by CodeRabbit on PR #1292 review. * Anthropic docs verified for both values: * https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching */ cacheTTL: z.ZodOptional, z.ZodLiteral<3600>]>>; /** * Declared backend-capability contract (mmnto-ai/totem#2102, strategy#474 * slice 3). `admissionClasses` lists the backend admission classes this * orchestrator is declared capable of serving; canonical values live in * core `ADMISSION_CLASSES`. Read by the `runOrchestrator` admission gate * only: a caller requesting a class above `completion_only` that is not * declared here fails loud BEFORE any provider invoke (no tokens spent, * no artifact emitted). Absent = `['completion_only']` — factually true * of every backend today. A declaration is a capability claim, never an * enforcement mechanism (output enforcement is caller-side, #2103). */ capabilities: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }>>; provider: z.ZodLiteral<"gemini">; }, "strip", z.ZodTypeAny, { provider: "gemini"; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }, { provider: "gemini"; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }>, z.ZodObject<{ /** Default model name if --model is not passed */ defaultModel: z.ZodOptional; /** Fallback model used automatically if the primary model fails due to quota/rate limits */ fallbackModel: z.ZodOptional; /** Per-command model overrides (e.g., { 'spec': 'gemini-3.1-pro-preview' }) */ overrides: z.ZodOptional>; /** Per-command cache TTLs in seconds (e.g., { 'triage': 3600, 'shield': 0 }) */ cacheTtls: z.ZodOptional>; /** * Enable provider-native prompt caching (mmnto/totem#1291 Proposal 217). When true and * the provider supports it (Anthropic in 1.15.0, Gemini in 1.16.0+), persistent * `systemPrompt` segments will be marked with cache_control directives to * reduce input-token cost on repeat invocations within the TTL window. * Defaults to undefined (off) — opt-in for 1.15.0 to avoid surprising existing * users mid-cycle. Distinct from `cacheTtls` above, which controls the * orthogonal response-level cache (mmnto/totem#52, closed) at * `.totem/cache/-.json`. */ enableContextCaching: z.ZodOptional; /** * Prompt cache TTL in seconds (mmnto/totem#1291). Anthropic supports exactly * two values today: 300 (5m, default ephemeral) and 3600 (1h, extended cache * — 2x write cost, ~10% read cost). Only consulted when * `enableContextCaching` is true. Defaults to 300 when omitted. * * Constrained to literals at parse time so invalid TTLs (e.g. 600, 1800) * fail fast at config load instead of silently falling through to 5m at * provider-invocation time. Caught by CodeRabbit on PR #1292 review. * Anthropic docs verified for both values: * https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching */ cacheTTL: z.ZodOptional, z.ZodLiteral<3600>]>>; /** * Declared backend-capability contract (mmnto-ai/totem#2102, strategy#474 * slice 3). `admissionClasses` lists the backend admission classes this * orchestrator is declared capable of serving; canonical values live in * core `ADMISSION_CLASSES`. Read by the `runOrchestrator` admission gate * only: a caller requesting a class above `completion_only` that is not * declared here fails loud BEFORE any provider invoke (no tokens spent, * no artifact emitted). Absent = `['completion_only']` — factually true * of every backend today. A declaration is a capability claim, never an * enforcement mechanism (output enforcement is caller-side, #2103). */ capabilities: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }>>; provider: z.ZodLiteral<"anthropic">; }, "strip", z.ZodTypeAny, { provider: "anthropic"; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }, { provider: "anthropic"; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }>, z.ZodObject<{ /** Default model name if --model is not passed */ defaultModel: z.ZodOptional; /** Fallback model used automatically if the primary model fails due to quota/rate limits */ fallbackModel: z.ZodOptional; /** Per-command model overrides (e.g., { 'spec': 'gemini-3.1-pro-preview' }) */ overrides: z.ZodOptional>; /** Per-command cache TTLs in seconds (e.g., { 'triage': 3600, 'shield': 0 }) */ cacheTtls: z.ZodOptional>; /** * Enable provider-native prompt caching (mmnto/totem#1291 Proposal 217). When true and * the provider supports it (Anthropic in 1.15.0, Gemini in 1.16.0+), persistent * `systemPrompt` segments will be marked with cache_control directives to * reduce input-token cost on repeat invocations within the TTL window. * Defaults to undefined (off) — opt-in for 1.15.0 to avoid surprising existing * users mid-cycle. Distinct from `cacheTtls` above, which controls the * orthogonal response-level cache (mmnto/totem#52, closed) at * `.totem/cache/-.json`. */ enableContextCaching: z.ZodOptional; /** * Prompt cache TTL in seconds (mmnto/totem#1291). Anthropic supports exactly * two values today: 300 (5m, default ephemeral) and 3600 (1h, extended cache * — 2x write cost, ~10% read cost). Only consulted when * `enableContextCaching` is true. Defaults to 300 when omitted. * * Constrained to literals at parse time so invalid TTLs (e.g. 600, 1800) * fail fast at config load instead of silently falling through to 5m at * provider-invocation time. Caught by CodeRabbit on PR #1292 review. * Anthropic docs verified for both values: * https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching */ cacheTTL: z.ZodOptional, z.ZodLiteral<3600>]>>; /** * Declared backend-capability contract (mmnto-ai/totem#2102, strategy#474 * slice 3). `admissionClasses` lists the backend admission classes this * orchestrator is declared capable of serving; canonical values live in * core `ADMISSION_CLASSES`. Read by the `runOrchestrator` admission gate * only: a caller requesting a class above `completion_only` that is not * declared here fails loud BEFORE any provider invoke (no tokens spent, * no artifact emitted). Absent = `['completion_only']` — factually true * of every backend today. A declaration is a capability claim, never an * enforcement mechanism (output enforcement is caller-side, #2103). */ capabilities: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }>>; provider: z.ZodLiteral<"openai">; /** Optional base URL for OpenAI-compatible servers (Ollama, LM Studio, etc.) */ baseUrl: z.ZodOptional; }, "strip", z.ZodTypeAny, { provider: "openai"; baseUrl?: string | undefined; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }, { provider: "openai"; baseUrl?: string | undefined; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }>, z.ZodObject<{ /** Default model name if --model is not passed */ defaultModel: z.ZodOptional; /** Fallback model used automatically if the primary model fails due to quota/rate limits */ fallbackModel: z.ZodOptional; /** Per-command model overrides (e.g., { 'spec': 'gemini-3.1-pro-preview' }) */ overrides: z.ZodOptional>; /** Per-command cache TTLs in seconds (e.g., { 'triage': 3600, 'shield': 0 }) */ cacheTtls: z.ZodOptional>; /** * Enable provider-native prompt caching (mmnto/totem#1291 Proposal 217). When true and * the provider supports it (Anthropic in 1.15.0, Gemini in 1.16.0+), persistent * `systemPrompt` segments will be marked with cache_control directives to * reduce input-token cost on repeat invocations within the TTL window. * Defaults to undefined (off) — opt-in for 1.15.0 to avoid surprising existing * users mid-cycle. Distinct from `cacheTtls` above, which controls the * orthogonal response-level cache (mmnto/totem#52, closed) at * `.totem/cache/-.json`. */ enableContextCaching: z.ZodOptional; /** * Prompt cache TTL in seconds (mmnto/totem#1291). Anthropic supports exactly * two values today: 300 (5m, default ephemeral) and 3600 (1h, extended cache * — 2x write cost, ~10% read cost). Only consulted when * `enableContextCaching` is true. Defaults to 300 when omitted. * * Constrained to literals at parse time so invalid TTLs (e.g. 600, 1800) * fail fast at config load instead of silently falling through to 5m at * provider-invocation time. Caught by CodeRabbit on PR #1292 review. * Anthropic docs verified for both values: * https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching */ cacheTTL: z.ZodOptional, z.ZodLiteral<3600>]>>; /** * Declared backend-capability contract (mmnto-ai/totem#2102, strategy#474 * slice 3). `admissionClasses` lists the backend admission classes this * orchestrator is declared capable of serving; canonical values live in * core `ADMISSION_CLASSES`. Read by the `runOrchestrator` admission gate * only: a caller requesting a class above `completion_only` that is not * declared here fails loud BEFORE any provider invoke (no tokens spent, * no artifact emitted). Absent = `['completion_only']` — factually true * of every backend today. A declaration is a capability claim, never an * enforcement mechanism (output enforcement is caller-side, #2103). */ capabilities: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }>>; provider: z.ZodLiteral<"ollama">; /** Base URL for the Ollama server */ baseUrl: z.ZodDefault; /** Context length passed to Ollama as num_ctx (controls KV cache / VRAM usage) */ numCtx: z.ZodOptional; }, "strip", z.ZodTypeAny, { provider: "ollama"; baseUrl: string; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; numCtx?: number | undefined; }, { provider: "ollama"; baseUrl?: string | undefined; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; numCtx?: number | undefined; }>]>; export declare const GarbageCollectionSchema: z.ZodObject<{ /** Whether GC runs during `totem doctor` */ enabled: z.ZodDefault; /** Minimum age (days since compiledAt) before a rule is GC-eligible */ minAgeDays: z.ZodDefault; /** Rule categories exempt from GC (matches `category` field on compiled rules) */ exemptCategories: z.ZodDefault, "many">>; }, "strip", z.ZodTypeAny, { enabled: boolean; minAgeDays: number; exemptCategories: ("security" | "architecture" | "style" | "performance")[]; }, { enabled?: boolean | undefined; minAgeDays?: number | undefined; exemptCategories?: ("security" | "architecture" | "style" | "performance")[] | undefined; }>; /** * Doctor configuration (mmnto-ai/totem#1483). Controls the stale-rule * advisory window in `totem doctor`. A single integer threshold on * `RuleMetric.evaluationCount`. */ export declare const DoctorConfigSchema: z.ZodDefault; }, "strip", z.ZodTypeAny, { staleRuleWindow: number; }, { staleRuleWindow?: number | undefined; }>>; export declare const DocTargetSchema: z.ZodObject<{ /** Relative path to the document */ path: z.ZodString; /** Description of the document's purpose (included in the LLM prompt) */ description: z.ZodString; /** When to remind/auto-run: 'post-release' or 'on-change' */ trigger: z.ZodDefault>; /** Whether this doc receives user-facing post-processing (issue ref stripping, manual content, live metrics). Defaults to true for readme.md files. */ userFacing: z.ZodOptional; }, "strip", z.ZodTypeAny, { path: string; trigger: "post-release" | "on-change"; description: string; userFacing?: boolean | undefined; }, { path: string; description: string; trigger?: "post-release" | "on-change" | undefined; userFacing?: boolean | undefined; }>; export declare const ConfigTierSchema: z.ZodEnum<["lite", "standard", "full"]>; export type ConfigTier = z.infer; /** * `totem orient` configuration (mmnto-ai/totem#2044, WS2). * * `orient` derives session state from primitives (open PRs/issues/board/freeze) * with zero LLM. The GH Project board is the only piece that cannot be derived * from the current repo alone — a board lives under an `owner` and a numeric * project id. Owner is derived from `gh repo view`; the project NUMBER is the * one consumer-specific value, so it is read from this OPTIONAL field (env * `TOTEM_ORIENT_PROJECT` overrides last). When unset, orient renders the board * section as an honest "no board configured" absence — never an error * (Tenet 14). This must NOT bake the cohort's board into a shipped command — * Totem is NOT zero-user. */ export declare const OrientConfigSchema: z.ZodObject<{ /** GH Project number for the in-flight board section (e.g. 1). Optional. */ projectNumber: z.ZodOptional; /** * Config-path to the cohort parity manifest (`parity-manifest.yaml`) the * `totem doctor --parity` sensor parses for cross-repo drift * (mmnto-ai/totem-strategy#448). Mirrors `projectNumber` as the one * consumer-specific value the sensor cannot derive from the repo alone — * the manifest is strategy-owned, so its location is per-consumer. Resolved * relative to the config/repo root by `resolveParityManifestPath`. OPTIONAL: * when unset, the sensor renders an honest "no parity manifest configured" * skip — never an error (Tenet 14, honest-absent). */ parityManifest: z.ZodOptional; /** * Cross-repo read set for the `network-read-only` parity probes * (Prop 296 §14, mmnto-ai/totem-strategy#962). Each entry is an `owner/repo` * slug the doctor additionally issues read-only GitHub-settings/rulesets/ * branch-protection GETs against when sensing the posture rows * (`repo-merge-posture`, `repo-required-checks-posture`, * `repo-branch-protection-posture`). ADDITIVE + OPTIONAL: the CURRENT repo * (derived from the git remote) is ALWAYS probed; this list only widens the * roster. §14 clause 3 makes the CI/consumer default current-repo-only — * cross-repo reads need a cross-repo-privileged seat token, so a repo-scoped * CI token that cannot see siblings degrades each extra repo to a per-repo * cannot-verify line, never a manifest-wide outage. */ parityProbeRepos: z.ZodOptional>; }, "strip", z.ZodTypeAny, { projectNumber?: number | undefined; parityManifest?: string | undefined; parityProbeRepos?: string[] | undefined; }, { projectNumber?: number | undefined; parityManifest?: string | undefined; parityProbeRepos?: string[] | undefined; }>; /** * `totem ecl-gc --compact` cohort completeness roster (mmnto-ai/totem#2310; * ADR-106 § A2.2 + ecl-discipline § 4.5). * * `cohortRepos` is the declared expected-repo yardstick the compaction * completeness gate checks the live workspace glob against: a `processed/` mark * may be collected only against a PROVABLY-complete poll, and "complete" * requires every expected outbox-holding repo present + scanned. A silently- * absent cohort repo makes a live mark in its unscanned outbox look inert (the * false-unread class), so the roster is the yardstick that makes an incomplete * scan detectable. * * Values are bare workspace DIRECTORY names (e.g. `totem`, `totem-strategy`), * matched against the sibling directories of the workspace root — NOT * `owner/repo` slugs. This is CONSUMER-DECLARED config, not a baked product * identity (Tenet 16 / the A2.2 contract): an external consumer's cohort is * THEIR repos, so the roster cannot ship as a core constant. It replaces the * interim `cohortRepos()` core constant (shipped 1.90.0, product-locked). The * change-authority for OUR cohort's value stays mmnto-ai/totem-strategy#611. * * `.min(1)`: an EMPTY `cohortRepos: []` is a config BUG (loud Zod failure at * load), NEVER a synonym for "undeclared". Omitting the `ecl` block (or the * `cohortRepos` key) is the honest undeclared state → the compaction gate * hard-aborts (exit 3, non-`--force-incomplete`-waivable). A genuine single- * repo consumer declares a roster of one (completeness-1, the A2.2 line). */ export declare const EclConfigSchema: z.ZodObject<{ /** Declared cohort repo roster (bare workspace dir names) for the `totem * ecl-gc --compact` A2.2 completeness gate. Optional: absent ⇒ undeclared ⇒ * the gate hard-aborts. `.min(1)`: an empty array is a loud config error. */ cohortRepos: z.ZodOptional>; }, "strip", z.ZodTypeAny, { cohortRepos?: string[] | undefined; }, { cohortRepos?: string[] | undefined; }>; /** * Default source extensions used when computing the review content hash. * Historical hardcoded set, preserved for backward compatibility with * pre-#1527 consumers. Polyglot repos override via `review.sourceExtensions`. */ export declare const DEFAULT_REVIEW_SOURCE_EXTENSIONS: readonly [".ts", ".tsx", ".js", ".jsx"]; /** * Per-extension schema for `review.sourceExtensions`. Accepts either `"ts"` * or `".ts"` (normalizes to leading-dot form). The `.refine()` regex is the * shell-injection boundary: these strings are later passed as `git ls-files` * glob arguments on both the TS side (via safeExec) and the bash side * (via shell globs). The regex rejects `*`, `;`, quotes, backticks, spaces, * newlines, and any other character that could break out of a glob arg. */ export declare const ReviewSourceExtensionSchema: z.ZodEffects, string, string>; export declare const Stage4BaselineConfigSchema: z.ZodEffects>; exclude: z.ZodDefault>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">>; export declare const ReviewConfigSchema: z.ZodDefault, string, string>, "many">>; stage4Baseline: z.ZodOptional>; exclude: z.ZodDefault>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">>>; /** * Opt-in multi-lane review fan (Prop 304 R2, mmnto-ai/totem#2106). Each * entry is a `provider:model` lane the reviewer runs independently over the * one masked diff, converging on a verdict artifact. A DECLARED key here * (this schema is otherwise `.passthrough()`) so `config.review.lanes` is * typed rather than an untyped passthrough value (codex fold 7). * * ABSENT ⇒ the legacy single-lane path runs byte-for-byte as today * (invariant 7). PRESENT ⇒ the fan path, and present means ≥1: an * explicitly-configured EMPTY array (`lanes: []`) is a hard config PARSE * error (`.min(1)`), never a silent synonym for the legacy default * (totem-codex finding 11) — omit the key to opt out. * * Zod validates only the SHAPE here (`string[]`, nonempty). The remaining * SEMANTIC contract — known `provider:model` entries, the shell provider * rejected, no empty/duplicate normalized entries — is enforced CLI-side by * `validateReviewLanes`, which reuses the CLI's * `parseModelString`/`assertValidModelName` (core cannot import from cli). * An explicit `--model` selects a ONE-lane invocation and never joins or * overrides this fan. */ lanes: z.ZodOptional>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ sourceExtensions: z.ZodDefault, string, string>, "many">>; stage4Baseline: z.ZodOptional>; exclude: z.ZodDefault>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">>>; /** * Opt-in multi-lane review fan (Prop 304 R2, mmnto-ai/totem#2106). Each * entry is a `provider:model` lane the reviewer runs independently over the * one masked diff, converging on a verdict artifact. A DECLARED key here * (this schema is otherwise `.passthrough()`) so `config.review.lanes` is * typed rather than an untyped passthrough value (codex fold 7). * * ABSENT ⇒ the legacy single-lane path runs byte-for-byte as today * (invariant 7). PRESENT ⇒ the fan path, and present means ≥1: an * explicitly-configured EMPTY array (`lanes: []`) is a hard config PARSE * error (`.min(1)`), never a silent synonym for the legacy default * (totem-codex finding 11) — omit the key to opt out. * * Zod validates only the SHAPE here (`string[]`, nonempty). The remaining * SEMANTIC contract — known `provider:model` entries, the shell provider * rejected, no empty/duplicate normalized entries — is enforced CLI-side by * `validateReviewLanes`, which reuses the CLI's * `parseModelString`/`assertValidModelName` (core cannot import from cli). * An explicit `--model` selects a ONE-lane invocation and never joins or * overrides this fan. */ lanes: z.ZodOptional>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ sourceExtensions: z.ZodDefault, string, string>, "many">>; stage4Baseline: z.ZodOptional>; exclude: z.ZodDefault>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">>>; /** * Opt-in multi-lane review fan (Prop 304 R2, mmnto-ai/totem#2106). Each * entry is a `provider:model` lane the reviewer runs independently over the * one masked diff, converging on a verdict artifact. A DECLARED key here * (this schema is otherwise `.passthrough()`) so `config.review.lanes` is * typed rather than an untyped passthrough value (codex fold 7). * * ABSENT ⇒ the legacy single-lane path runs byte-for-byte as today * (invariant 7). PRESENT ⇒ the fan path, and present means ≥1: an * explicitly-configured EMPTY array (`lanes: []`) is a hard config PARSE * error (`.min(1)`), never a silent synonym for the legacy default * (totem-codex finding 11) — omit the key to opt out. * * Zod validates only the SHAPE here (`string[]`, nonempty). The remaining * SEMANTIC contract — known `provider:model` entries, the shell provider * rejected, no empty/duplicate normalized entries — is enforced CLI-side by * `validateReviewLanes`, which reuses the CLI's * `parseModelString`/`assertValidModelName` (core cannot import from cli). * An explicit `--model` selects a ONE-lane invocation and never joins or * overrides this fan. */ lanes: z.ZodOptional>; }, z.ZodTypeAny, "passthrough">>>; /** * Whether `value` carries a character that cannot be rendered SAFELY into the * managed git hooks (mmnto-ai/totem#2692 C4): a single quote (breaks the `sh` * single-quoted word AND the single-quoted `node -e '…'` spec-evidence reader), * a double quote or backslash (breaks the JS string literal inside that reader), * a dollar sign or a backtick (the only characters still active inside the * double-quoted `sh` words the hook guards use), or a control character / * newline (breaks both, and can forge hook lines). * * The CLI installer carries the same clause as a render-path backstop; this * refine is the primary gate, so a validated config never reaches it. Written as * a code-point walk rather than a regex so the predicate carries no escape * sequence of its own to mis-author. */ export declare function hasUnrenderableHookChar(value: string): boolean; /** * Whether `value` carries a character that cannot be rendered safely into the * managed pre-commit hook as a required SPEC HEADING (mmnto-ai/totem#2737). * Forbids the same five shell/JS-active characters as * {@link hasUnrenderableHookChar} — a single quote, a double quote, a * backslash, a dollar sign, a backtick — plus every line-breaking or control * character the reader's own `safe()` collapses: C0 (below 0x20), the DEL/C1 * band (0x7f–0x9f), and U+2028/U+2029 (LINE and PARAGRAPH SEPARATOR). Anything * outside that set could otherwise forge a second `[Totem]` line in the hook's * output. U+2028 and U+2029 are printable-plane code points that terminals and * pagers still break a line on, so banning only the two classic bands would * leave the forge channel open on exactly the characters this predicate exists * to permit the rest of. * * It PERMITS printable non-ASCII, and that is the whole difference. The path * predicate bans everything above 0x7e because git C-quotes path bytes above * 0x7e in the `diff --name-only` output the hooks' `grep -q` filters read, so a * non-ASCII directory name could never match. A required heading meets no such * filter: it is rendered by `JSON.stringify` into the reader's JS source and * compared in memory against the draft's own lines. Holding it to the path * rule would ban `### Verification (MANDATORY — do not skip)` — a heading the * built-in prompt has always asked for — over a hazard it cannot encounter. * * The round-trip is not argued, it is EXECUTED: the frozen falsifier in * `install-hooks.test.ts` runs the real hook over the four schema-constrained * R3 drafts, which carry that em-dash heading byte-identical, and requires them * to match on the EXACT pass and name no tolerance. That test fails on any CI * OS where the em dash does not survive `JSON.stringify` → the single-quoted * `node -e` word → `sh` → node intact. */ export declare function hasUnrenderableHeadingChar(value: string): boolean; /** * Normalise a configured `totemDir` to the ONE spelling every consumer joins and * every managed hook renders (mmnto-ai/totem#2692 amendment A7): backslashes → * `/`, a leading `./` dropped, trailing slashes stripped. `.totem/` and `.totem` * name the same directory, but rendered into the hooks' `grep -q '/…'` * diff filters the slash produced `dir//…`, which never matched — silently. * `'.'` is left alone (the global profile's own spelling for "this directory"); * an empty result is refused by the schema. */ export declare function normalizeTotemDir(value: string): string; export declare const TotemConfigSchema: z.ZodObject<{ /** Glob patterns and chunking strategies for each ingest target */ targets: z.ZodArray; strategy: z.ZodString; }, "strip", z.ZodTypeAny, { type: "code" | "lesson" | "session_log" | "spec"; glob: string; strategy: string; }, { type: "code" | "lesson" | "session_log" | "spec"; glob: string; strategy: string; }>, "many">; /** Embedding provider configuration (optional for Lite tier) */ embedding: z.ZodOptional; model: z.ZodDefault; dimensions: z.ZodOptional; throttleMs: z.ZodOptional; }, "strip", z.ZodTypeAny, { model: string; provider: "openai"; dimensions?: number | undefined; throttleMs?: number | undefined; }, { provider: "openai"; model?: string | undefined; dimensions?: number | undefined; throttleMs?: number | undefined; }>, z.ZodObject<{ provider: z.ZodLiteral<"ollama">; model: z.ZodDefault; baseUrl: z.ZodDefault; dimensions: z.ZodOptional; }, "strip", z.ZodTypeAny, { model: string; provider: "ollama"; baseUrl: string; dimensions?: number | undefined; }, { provider: "ollama"; model?: string | undefined; dimensions?: number | undefined; baseUrl?: string | undefined; }>, z.ZodObject<{ provider: z.ZodLiteral<"gemini">; model: z.ZodDefault; dimensions: z.ZodOptional; throttleMs: z.ZodOptional; }, "strip", z.ZodTypeAny, { model: string; provider: "gemini"; dimensions?: number | undefined; throttleMs?: number | undefined; }, { provider: "gemini"; model?: string | undefined; dimensions?: number | undefined; throttleMs?: number | undefined; }>]>>; /** Optional: LLM orchestrator for spec/triage/shield commands */ orchestrator: z.ZodOptional; /** Fallback model used automatically if the primary model fails due to quota/rate limits */ fallbackModel: z.ZodOptional; /** Per-command model overrides (e.g., { 'spec': 'gemini-3.1-pro-preview' }) */ overrides: z.ZodOptional>; /** Per-command cache TTLs in seconds (e.g., { 'triage': 3600, 'shield': 0 }) */ cacheTtls: z.ZodOptional>; /** * Enable provider-native prompt caching (mmnto/totem#1291 Proposal 217). When true and * the provider supports it (Anthropic in 1.15.0, Gemini in 1.16.0+), persistent * `systemPrompt` segments will be marked with cache_control directives to * reduce input-token cost on repeat invocations within the TTL window. * Defaults to undefined (off) — opt-in for 1.15.0 to avoid surprising existing * users mid-cycle. Distinct from `cacheTtls` above, which controls the * orthogonal response-level cache (mmnto/totem#52, closed) at * `.totem/cache/-.json`. */ enableContextCaching: z.ZodOptional; /** * Prompt cache TTL in seconds (mmnto/totem#1291). Anthropic supports exactly * two values today: 300 (5m, default ephemeral) and 3600 (1h, extended cache * — 2x write cost, ~10% read cost). Only consulted when * `enableContextCaching` is true. Defaults to 300 when omitted. * * Constrained to literals at parse time so invalid TTLs (e.g. 600, 1800) * fail fast at config load instead of silently falling through to 5m at * provider-invocation time. Caught by CodeRabbit on PR #1292 review. * Anthropic docs verified for both values: * https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching */ cacheTTL: z.ZodOptional, z.ZodLiteral<3600>]>>; /** * Declared backend-capability contract (mmnto-ai/totem#2102, strategy#474 * slice 3). `admissionClasses` lists the backend admission classes this * orchestrator is declared capable of serving; canonical values live in * core `ADMISSION_CLASSES`. Read by the `runOrchestrator` admission gate * only: a caller requesting a class above `completion_only` that is not * declared here fails loud BEFORE any provider invoke (no tokens spent, * no artifact emitted). Absent = `['completion_only']` — factually true * of every backend today. A declaration is a capability claim, never an * enforcement mechanism (output enforcement is caller-side, #2103). */ capabilities: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }>>; provider: z.ZodLiteral<"shell">; /** Shell command with {file} and {model} placeholders */ command: z.ZodString; }, "strip", z.ZodTypeAny, { provider: "shell"; command: string; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }, { provider: "shell"; command: string; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }>, z.ZodObject<{ /** Default model name if --model is not passed */ defaultModel: z.ZodOptional; /** Fallback model used automatically if the primary model fails due to quota/rate limits */ fallbackModel: z.ZodOptional; /** Per-command model overrides (e.g., { 'spec': 'gemini-3.1-pro-preview' }) */ overrides: z.ZodOptional>; /** Per-command cache TTLs in seconds (e.g., { 'triage': 3600, 'shield': 0 }) */ cacheTtls: z.ZodOptional>; /** * Enable provider-native prompt caching (mmnto/totem#1291 Proposal 217). When true and * the provider supports it (Anthropic in 1.15.0, Gemini in 1.16.0+), persistent * `systemPrompt` segments will be marked with cache_control directives to * reduce input-token cost on repeat invocations within the TTL window. * Defaults to undefined (off) — opt-in for 1.15.0 to avoid surprising existing * users mid-cycle. Distinct from `cacheTtls` above, which controls the * orthogonal response-level cache (mmnto/totem#52, closed) at * `.totem/cache/-.json`. */ enableContextCaching: z.ZodOptional; /** * Prompt cache TTL in seconds (mmnto/totem#1291). Anthropic supports exactly * two values today: 300 (5m, default ephemeral) and 3600 (1h, extended cache * — 2x write cost, ~10% read cost). Only consulted when * `enableContextCaching` is true. Defaults to 300 when omitted. * * Constrained to literals at parse time so invalid TTLs (e.g. 600, 1800) * fail fast at config load instead of silently falling through to 5m at * provider-invocation time. Caught by CodeRabbit on PR #1292 review. * Anthropic docs verified for both values: * https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching */ cacheTTL: z.ZodOptional, z.ZodLiteral<3600>]>>; /** * Declared backend-capability contract (mmnto-ai/totem#2102, strategy#474 * slice 3). `admissionClasses` lists the backend admission classes this * orchestrator is declared capable of serving; canonical values live in * core `ADMISSION_CLASSES`. Read by the `runOrchestrator` admission gate * only: a caller requesting a class above `completion_only` that is not * declared here fails loud BEFORE any provider invoke (no tokens spent, * no artifact emitted). Absent = `['completion_only']` — factually true * of every backend today. A declaration is a capability claim, never an * enforcement mechanism (output enforcement is caller-side, #2103). */ capabilities: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }>>; provider: z.ZodLiteral<"gemini">; }, "strip", z.ZodTypeAny, { provider: "gemini"; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }, { provider: "gemini"; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }>, z.ZodObject<{ /** Default model name if --model is not passed */ defaultModel: z.ZodOptional; /** Fallback model used automatically if the primary model fails due to quota/rate limits */ fallbackModel: z.ZodOptional; /** Per-command model overrides (e.g., { 'spec': 'gemini-3.1-pro-preview' }) */ overrides: z.ZodOptional>; /** Per-command cache TTLs in seconds (e.g., { 'triage': 3600, 'shield': 0 }) */ cacheTtls: z.ZodOptional>; /** * Enable provider-native prompt caching (mmnto/totem#1291 Proposal 217). When true and * the provider supports it (Anthropic in 1.15.0, Gemini in 1.16.0+), persistent * `systemPrompt` segments will be marked with cache_control directives to * reduce input-token cost on repeat invocations within the TTL window. * Defaults to undefined (off) — opt-in for 1.15.0 to avoid surprising existing * users mid-cycle. Distinct from `cacheTtls` above, which controls the * orthogonal response-level cache (mmnto/totem#52, closed) at * `.totem/cache/-.json`. */ enableContextCaching: z.ZodOptional; /** * Prompt cache TTL in seconds (mmnto/totem#1291). Anthropic supports exactly * two values today: 300 (5m, default ephemeral) and 3600 (1h, extended cache * — 2x write cost, ~10% read cost). Only consulted when * `enableContextCaching` is true. Defaults to 300 when omitted. * * Constrained to literals at parse time so invalid TTLs (e.g. 600, 1800) * fail fast at config load instead of silently falling through to 5m at * provider-invocation time. Caught by CodeRabbit on PR #1292 review. * Anthropic docs verified for both values: * https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching */ cacheTTL: z.ZodOptional, z.ZodLiteral<3600>]>>; /** * Declared backend-capability contract (mmnto-ai/totem#2102, strategy#474 * slice 3). `admissionClasses` lists the backend admission classes this * orchestrator is declared capable of serving; canonical values live in * core `ADMISSION_CLASSES`. Read by the `runOrchestrator` admission gate * only: a caller requesting a class above `completion_only` that is not * declared here fails loud BEFORE any provider invoke (no tokens spent, * no artifact emitted). Absent = `['completion_only']` — factually true * of every backend today. A declaration is a capability claim, never an * enforcement mechanism (output enforcement is caller-side, #2103). */ capabilities: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }>>; provider: z.ZodLiteral<"anthropic">; }, "strip", z.ZodTypeAny, { provider: "anthropic"; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }, { provider: "anthropic"; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }>, z.ZodObject<{ /** Default model name if --model is not passed */ defaultModel: z.ZodOptional; /** Fallback model used automatically if the primary model fails due to quota/rate limits */ fallbackModel: z.ZodOptional; /** Per-command model overrides (e.g., { 'spec': 'gemini-3.1-pro-preview' }) */ overrides: z.ZodOptional>; /** Per-command cache TTLs in seconds (e.g., { 'triage': 3600, 'shield': 0 }) */ cacheTtls: z.ZodOptional>; /** * Enable provider-native prompt caching (mmnto/totem#1291 Proposal 217). When true and * the provider supports it (Anthropic in 1.15.0, Gemini in 1.16.0+), persistent * `systemPrompt` segments will be marked with cache_control directives to * reduce input-token cost on repeat invocations within the TTL window. * Defaults to undefined (off) — opt-in for 1.15.0 to avoid surprising existing * users mid-cycle. Distinct from `cacheTtls` above, which controls the * orthogonal response-level cache (mmnto/totem#52, closed) at * `.totem/cache/-.json`. */ enableContextCaching: z.ZodOptional; /** * Prompt cache TTL in seconds (mmnto/totem#1291). Anthropic supports exactly * two values today: 300 (5m, default ephemeral) and 3600 (1h, extended cache * — 2x write cost, ~10% read cost). Only consulted when * `enableContextCaching` is true. Defaults to 300 when omitted. * * Constrained to literals at parse time so invalid TTLs (e.g. 600, 1800) * fail fast at config load instead of silently falling through to 5m at * provider-invocation time. Caught by CodeRabbit on PR #1292 review. * Anthropic docs verified for both values: * https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching */ cacheTTL: z.ZodOptional, z.ZodLiteral<3600>]>>; /** * Declared backend-capability contract (mmnto-ai/totem#2102, strategy#474 * slice 3). `admissionClasses` lists the backend admission classes this * orchestrator is declared capable of serving; canonical values live in * core `ADMISSION_CLASSES`. Read by the `runOrchestrator` admission gate * only: a caller requesting a class above `completion_only` that is not * declared here fails loud BEFORE any provider invoke (no tokens spent, * no artifact emitted). Absent = `['completion_only']` — factually true * of every backend today. A declaration is a capability claim, never an * enforcement mechanism (output enforcement is caller-side, #2103). */ capabilities: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }>>; provider: z.ZodLiteral<"openai">; /** Optional base URL for OpenAI-compatible servers (Ollama, LM Studio, etc.) */ baseUrl: z.ZodOptional; }, "strip", z.ZodTypeAny, { provider: "openai"; baseUrl?: string | undefined; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }, { provider: "openai"; baseUrl?: string | undefined; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; }>, z.ZodObject<{ /** Default model name if --model is not passed */ defaultModel: z.ZodOptional; /** Fallback model used automatically if the primary model fails due to quota/rate limits */ fallbackModel: z.ZodOptional; /** Per-command model overrides (e.g., { 'spec': 'gemini-3.1-pro-preview' }) */ overrides: z.ZodOptional>; /** Per-command cache TTLs in seconds (e.g., { 'triage': 3600, 'shield': 0 }) */ cacheTtls: z.ZodOptional>; /** * Enable provider-native prompt caching (mmnto/totem#1291 Proposal 217). When true and * the provider supports it (Anthropic in 1.15.0, Gemini in 1.16.0+), persistent * `systemPrompt` segments will be marked with cache_control directives to * reduce input-token cost on repeat invocations within the TTL window. * Defaults to undefined (off) — opt-in for 1.15.0 to avoid surprising existing * users mid-cycle. Distinct from `cacheTtls` above, which controls the * orthogonal response-level cache (mmnto/totem#52, closed) at * `.totem/cache/-.json`. */ enableContextCaching: z.ZodOptional; /** * Prompt cache TTL in seconds (mmnto/totem#1291). Anthropic supports exactly * two values today: 300 (5m, default ephemeral) and 3600 (1h, extended cache * — 2x write cost, ~10% read cost). Only consulted when * `enableContextCaching` is true. Defaults to 300 when omitted. * * Constrained to literals at parse time so invalid TTLs (e.g. 600, 1800) * fail fast at config load instead of silently falling through to 5m at * provider-invocation time. Caught by CodeRabbit on PR #1292 review. * Anthropic docs verified for both values: * https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching */ cacheTTL: z.ZodOptional, z.ZodLiteral<3600>]>>; /** * Declared backend-capability contract (mmnto-ai/totem#2102, strategy#474 * slice 3). `admissionClasses` lists the backend admission classes this * orchestrator is declared capable of serving; canonical values live in * core `ADMISSION_CLASSES`. Read by the `runOrchestrator` admission gate * only: a caller requesting a class above `completion_only` that is not * declared here fails loud BEFORE any provider invoke (no tokens spent, * no artifact emitted). Absent = `['completion_only']` — factually true * of every backend today. A declaration is a capability claim, never an * enforcement mechanism (output enforcement is caller-side, #2103). */ capabilities: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }, { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; }>>; provider: z.ZodLiteral<"ollama">; /** Base URL for the Ollama server */ baseUrl: z.ZodDefault; /** Context length passed to Ollama as num_ctx (controls KV cache / VRAM usage) */ numCtx: z.ZodOptional; }, "strip", z.ZodTypeAny, { provider: "ollama"; baseUrl: string; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; numCtx?: number | undefined; }, { provider: "ollama"; baseUrl?: string | undefined; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; numCtx?: number | undefined; }>]>, { provider: "shell"; command: string; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; } | { provider: "gemini"; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; } | { provider: "anthropic"; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; } | { provider: "openai"; baseUrl?: string | undefined; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; } | { provider: "ollama"; baseUrl: string; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; numCtx?: number | undefined; }, unknown>>; /** * Optional: override the .totem/ directory path. * * The value is RENDERED INTO the managed git hooks at install * (mmnto-ai/totem#2692) — the strict pre-commit spec-evidence reader, the * pre-push gate guards, and the post-merge / post-checkout diff filters all * name it — so re-run `totem hook install --force` after changing it, or the * installed hooks keep reading the previous directory. * * The value is normalised first — a backslash becomes `/`, a leading `./` is * dropped, trailing slashes are stripped (see {@link normalizeTotemDir}) — and * an empty result is refused. Because it is rendered into shell and into a JS * string literal inside the hook, and because git C-quotes non-ASCII bytes in * the paths the hooks' diff filters read, a value carrying a quote, a dollar * sign, a backtick, a non-ASCII character, a newline or a control character * is refused here as well as by the installer. The installer additionally * refuses `.`, a `..` segment and a leading `-`, shapes whose hook diff * filters could never match. */ totemDir: z.ZodEffects, string, string | undefined>, string, string | undefined>, string, string | undefined>, string, string | undefined>; /** Optional: override the .lancedb/ directory path */ lanceDir: z.ZodEffects, string, string | undefined>; /** * Optional: glob patterns to exclude from indexing. * * Back-compat note (mmnto-ai/totem#1748): these patterns are ALSO merged * into the lint/shield diff filter, so they remove files from review scope * — the diff layer now discloses each drop loudly. For index-only intent * ("keep on disk and lintable, out of the semantic index") use * `indexIgnorePatterns`. The 2.0.0 split that removes this key from lint * scope is registered in mmnto-ai/totem#1746. */ ignorePatterns: z.ZodDefault>; /** * Optional: glob patterns excluded ONLY from indexing — never from * lint/shield scope (mmnto-ai/totem#1748, upstream-feedback/046). This is * the clean home for "don't embed this into the semantic index" intent. */ indexIgnorePatterns: z.ZodDefault>>; /** Optional: additional glob patterns to exclude from deterministic shield scanning (merged with ignorePatterns) */ shieldIgnorePatterns: z.ZodDefault>>; /** Character count above which `search_knowledge` appends its `` measurement envelope — a size disclosure, not a risk claim (#2600) (~4 chars ≈ 1 token). Default: 40,000 (~10k tokens). */ contextWarningThreshold: z.ZodDefault; /** * Optional relevance floor (0..1). A REFUSAL THRESHOLD compared against the * BEST vector-leg relevance of ONE retrieval — never a per-item filter. * Nothing in the product withholds an individual sub-floor hit while keeping * its siblings. Two consumers: * * 1. the MCP `search_knowledge` tool (mmnto-ai/totem#2463): when a * response's best relevance is below the floor it answers * `status="no_useful_hits"` and DISCLOSES the below-floor candidates * (path + relevance, no content) instead of returning them — and a * retrieval whose EVERY hit is FAULTED (a relevance that is not a * finite number in [0, 1]) answers `no_useful_hits` too, floor or no * floor (mmnto-ai/totem#2770); * 2. `totem spec` (mmnto-ai/totem#2700): an unanchored free-text run is * REFUSED when the best relevance is below the floor. * * Floors the true relevance signal, NOT the RRF rank artifact in the * displayed `score`. Hits with no vector leg (keyword-only/FTS) carry no * comparable relevance: they are floor-EXEMPT, and in `totem spec` a single * exempt hit from a grounding partition (specs, sessions, code) saves the * run — a keyword-only lesson does not; lessons never ground a run (ruled * final, mmnto-ai/totem#2727). * * NO DEFAULT since mmnto-ai/totem#2727. Relevance is `1 / (1 + squared L2)` * on unit-norm vectors, so it ranges over [0.2, 1] — 0.25 is INSIDE that * range, but on the gemini-embedding-2-preview 768-d profile the LOWEST * best-relevance over 55 recorded `totem spec` queries was 0.559 (0.5687 over * the runs the spec refusal was even eligible to judge), so the former * default fired on none of those 55, and any value below a repo's own * measured floor is inert. An embedder returning UNNORMALIZED vectors * (custom, some Ollama models) is not bounded that way and can produce * relevances under 0.25, so on such a profile the old default could fire. * A repo that wants weak free-text runs refused sets a value just above the * best-relevance of the weakest run it still wants kept; the recipe is in * `docs/wiki/config-reference.md` and the worked measurement is the R4 record * at `.totem/fixtures/floor-arm-2026-09-03/`. * * UNSET = NO FLOOR: the below-floor arms of `no_useful_hits` and the spec * refusal can never fire (each reader's zero-hit / all-faulted arms still * can — they need no floor). The per-call * `min_relevance` MCP input still applies, and still overrides this value; * the retrieval-envelope always discloses the effective floor, or `none`. */ searchRelevanceFloor: z.ZodOptional; /** Optional: documents to auto-update via `totem docs` */ docs: z.ZodOptional>; /** Whether this doc receives user-facing post-processing (issue ref stripping, manual content, live metrics). Defaults to true for readme.md files. */ userFacing: z.ZodOptional; }, "strip", z.ZodTypeAny, { path: string; trigger: "post-release" | "on-change"; description: string; userFacing?: boolean | undefined; }, { path: string; description: string; trigger?: "post-release" | "on-change" | undefined; userFacing?: boolean | undefined; }>, "many">>; /** Optional: export targets for cross-model lesson enforcement (e.g., { gemini: '.gemini/styleguide.md' }) */ exports: z.ZodOptional>; /** Optional: GitHub repositories to aggregate issues from (e.g., ['owner/repo', 'owner/repo2']) */ repositories: z.ZodOptional>; /** Optional: bot boilerplate markers to filter from PR comments during `totem extract` (e.g., ['Using Gemini Code Assist', 'Copilot']) */ botMarkers: z.ZodOptional>; /** Optional: paths to other totem-managed directories whose indexes should be queried alongside this one (e.g., ['.strategy', '../docs-repo']) */ linkedIndexes: z.ZodOptional>; /** * Optional: pack package names to extend rules from (ADR-085 + ADR-097). * * Each entry is a pack name like `@mmnto/pack-rust-architecture`. The * pack must also appear in the consumer's `package.json` dependencies * (or devDependencies) so npm/pnpm can resolve it. Pack-merge logic * (`packages/core/src/pack-merge.ts`) reads pack rules at lint time. * Pack discovery (`packages/core/src/pack-discovery.ts`, * mmnto-ai/totem#1768) reads this field plus the project's * package.json dependencies, deduplicates, and writes the union to * `.totem/installed-packs.json` for boot-time registration. */ extends: z.ZodOptional>; /** * Optional: path override for the strategy repository (mmnto-ai/totem#1710). * * Resolved relative to the git root by `resolveStrategyRoot`, with the * `TOTEM_STRATEGY_ROOT` (or legacy `STRATEGY_ROOT`) env var taking * precedence. When unset, the resolver falls back to a sibling * `../totem-strategy/` clone, then to the legacy `.strategy/` submodule. * * Trimmed and required to be non-empty so a `strategyRoot: ''` typo * fails fast at config-parse time instead of silently falling through * to the next precedence layer (R3 — CR R3 nitpick). */ strategyRoot: z.ZodOptional; /** * Optional: path override for the substrate repository (mmnto-ai/totem#1820, * ADR-100 Phase C). * * Resolved relative to the config root by `resolveSubstratePaths`, with the * `TOTEM_SUBSTRATE_PATH` env var taking precedence. When unset, the * resolver walks up to 3 levels from the config root looking for a * `/totem-substrate/` sibling clone, then falls back to repo-local * `.handoff/` and `.journal/` sediment paths. * * Trimmed and required to be non-empty so a `substratePath: ''` typo * fails fast at config-parse time instead of silently falling through * to the next precedence layer (mirrors `strategyRoot` validation). */ substratePath: z.ZodOptional; /** Optional: named partitions mapping logical aliases to file path prefixes for context isolation (e.g., { core: ['packages/core/'], mcp: ['packages/mcp/'] }) */ partitions: z.ZodOptional>>; /** Optional: custom secret patterns for DLP redaction (shared, version-controlled) */ secrets: z.ZodOptional; value: z.ZodString; }, "strip", z.ZodTypeAny, { value: string; type: "pattern" | "literal"; }, { value: string; type: "pattern" | "literal"; }>, "many">>; /** Optional: automatically extract lessons when shield returns a FAIL verdict (#779) */ shieldAutoLearn: z.ZodDefault; /** Optional: garbage collection settings for stale compiled rules */ garbageCollection: z.ZodOptional; /** Minimum age (days since compiledAt) before a rule is GC-eligible */ minAgeDays: z.ZodDefault; /** Rule categories exempt from GC (matches `category` field on compiled rules) */ exemptCategories: z.ZodDefault, "many">>; }, "strip", z.ZodTypeAny, { enabled: boolean; minAgeDays: number; exemptCategories: ("security" | "architecture" | "style" | "performance")[]; }, { enabled?: boolean | undefined; minAgeDays?: number | undefined; exemptCategories?: ("security" | "architecture" | "style" | "performance")[] | undefined; }>>; /** Optional: doctor stale-rule advisory thresholds (mmnto-ai/totem#1483) */ doctor: z.ZodOptional; }, "strip", z.ZodTypeAny, { staleRuleWindow: number; }, { staleRuleWindow?: number | undefined; }>>>; /** Optional: pilot mode — warn-only hooks during initial adoption. * `true` uses defaults (14 days / 50 pushes). Object form overrides thresholds. */ pilot: z.ZodOptional; maxPushes: z.ZodDefault; }, "strip", z.ZodTypeAny, { maxDays: number; maxPushes: number; }, { maxDays?: number | undefined; maxPushes?: number | undefined; }>]>>; /** Optional: enforcement hook tier configuration */ hooks: z.ZodOptional/artifacts/runs/` (`.totem/artifacts/runs/` * unless `totemDir` overrides it; top-level * `admission.runMetadata.caller === 'spec'`, mmnto-ai/totem#2690) — and shield * gates. Since mmnto-ai/totem#2700 that check requires an ANCHORED artifact — * grounded on an issue, or on a design record bound with `totem spec --from * ` — whose subject carries the shape the command promises; a * free-text topic run, and any artifact written before the rule, read as * not-evidence. Agents are auto-detected and enforced at strict level regardless * of this setting. The tier is rendered into the hook at install, so re-run * `totem hook install --force` after changing it (mmnto-ai/totem#2692). */ tier: z.ZodDefault>; /** The judgment-dense path floor `totem legs gate` judges a push against * (mmnto-ai/totem#2698). A changed file matching any of these globs owes * a falsification-leg deposit for the head being pushed; the default is * the doctrine floor plus `.changeset/**` (see * {@link DEFAULT_LEGS_OWED_GLOBS}), and a repo declares its own contract * classes by REPLACING the list. * * Read at RUN time, never rendered into the hook — unlike `tier`, editing * these globs needs no `totem hook install --force`, because the hook * calls back into `totem legs gate` which loads this config itself. * * ABSENT ⇒ the default floor. PRESENT ⇒ present means ≥1: an explicitly * EMPTY array (`globs: []`) is a hard config PARSE error, never a silent * synonym for "nothing is ever owed" (the `review.lanes` precedent — * omit the key to take the default; there is deliberately no spelling * for disabling the floor by emptying it). */ legsOwed: z.ZodDefault>; /** The legs arm's OWN enforcement, decoupled from `tier` * (mmnto-ai/totem#2771). `'block'`: `totem legs gate` exits with its * derived state — 3 owed-and-unanswered, 2 could-not-derive — at EVERY * tier, so the managed pre-push hook blocks a legs-owed push on a * standard-tier install too, while the spec-evidence and shield gates * stay at the repo's tier. `'advisory'`: every gate state exits 0 at * every tier, the strict one included. ABSENT ⇒ today's tier-derived * behaviour (the strict tier and agent seats block, the others print * the same lines and pass), so no consumer changes on upgrade. * * Read at RUN time like `globs` — the gate loads it itself, so setting * it needs no `totem hook install --force`. It maps onto the verb's * `--advisory` option inside the gate: the lines are composed once and * only the exit code follows the knob. */ enforce: z.ZodOptional>; }, "strip", z.ZodTypeAny, { globs: string[]; enforce?: "advisory" | "block" | undefined; }, { globs?: string[] | undefined; enforce?: "advisory" | "block" | undefined; }>>; }, "strip", z.ZodTypeAny, { tier: "strict" | "standard"; legsOwed: { globs: string[]; enforce?: "advisory" | "block" | undefined; }; }, { tier?: "strict" | "standard" | undefined; legsOwed?: { globs?: string[] | undefined; enforce?: "advisory" | "block" | undefined; } | undefined; }>>; /** Review gate configuration. `sourceExtensions` drives the content-hash * computation in `writeReviewedContentHash()` and, where a consumer keeps * one, its pre-push reader of the published `review-extensions.txt` (this * repo's is `.claude/hooks/content-hash.sh`; a consumer may replace or * retire its copy — the JS side's own two effects, the reviewed-content-hash * stamp and the shield admission record's projection-policy hash, do not * depend on it). * Polyglot repos extend the default `['.ts', '.tsx', '.js', '.jsx']` to cover * additional source languages (e.g., `['.rs', '.gd']` for Rust + Godot). */ review: z.ZodDefault, string, string>, "many">>; stage4Baseline: z.ZodOptional>; exclude: z.ZodDefault>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">>>; /** * Opt-in multi-lane review fan (Prop 304 R2, mmnto-ai/totem#2106). Each * entry is a `provider:model` lane the reviewer runs independently over the * one masked diff, converging on a verdict artifact. A DECLARED key here * (this schema is otherwise `.passthrough()`) so `config.review.lanes` is * typed rather than an untyped passthrough value (codex fold 7). * * ABSENT ⇒ the legacy single-lane path runs byte-for-byte as today * (invariant 7). PRESENT ⇒ the fan path, and present means ≥1: an * explicitly-configured EMPTY array (`lanes: []`) is a hard config PARSE * error (`.min(1)`), never a silent synonym for the legacy default * (totem-codex finding 11) — omit the key to opt out. * * Zod validates only the SHAPE here (`string[]`, nonempty). The remaining * SEMANTIC contract — known `provider:model` entries, the shell provider * rejected, no empty/duplicate normalized entries — is enforced CLI-side by * `validateReviewLanes`, which reuses the CLI's * `parseModelString`/`assertValidModelName` (core cannot import from cli). * An explicit `--model` selects a ONE-lane invocation and never joins or * overrides this fan. */ lanes: z.ZodOptional>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ sourceExtensions: z.ZodDefault, string, string>, "many">>; stage4Baseline: z.ZodOptional>; exclude: z.ZodDefault>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">>>; /** * Opt-in multi-lane review fan (Prop 304 R2, mmnto-ai/totem#2106). Each * entry is a `provider:model` lane the reviewer runs independently over the * one masked diff, converging on a verdict artifact. A DECLARED key here * (this schema is otherwise `.passthrough()`) so `config.review.lanes` is * typed rather than an untyped passthrough value (codex fold 7). * * ABSENT ⇒ the legacy single-lane path runs byte-for-byte as today * (invariant 7). PRESENT ⇒ the fan path, and present means ≥1: an * explicitly-configured EMPTY array (`lanes: []`) is a hard config PARSE * error (`.min(1)`), never a silent synonym for the legacy default * (totem-codex finding 11) — omit the key to opt out. * * Zod validates only the SHAPE here (`string[]`, nonempty). The remaining * SEMANTIC contract — known `provider:model` entries, the shell provider * rejected, no empty/duplicate normalized entries — is enforced CLI-side by * `validateReviewLanes`, which reuses the CLI's * `parseModelString`/`assertValidModelName` (core cannot import from cli). * An explicit `--model` selects a ONE-lane invocation and never joins or * overrides this fan. */ lanes: z.ZodOptional>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ sourceExtensions: z.ZodDefault, string, string>, "many">>; stage4Baseline: z.ZodOptional>; exclude: z.ZodDefault>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">>>; /** * Opt-in multi-lane review fan (Prop 304 R2, mmnto-ai/totem#2106). Each * entry is a `provider:model` lane the reviewer runs independently over the * one masked diff, converging on a verdict artifact. A DECLARED key here * (this schema is otherwise `.passthrough()`) so `config.review.lanes` is * typed rather than an untyped passthrough value (codex fold 7). * * ABSENT ⇒ the legacy single-lane path runs byte-for-byte as today * (invariant 7). PRESENT ⇒ the fan path, and present means ≥1: an * explicitly-configured EMPTY array (`lanes: []`) is a hard config PARSE * error (`.min(1)`), never a silent synonym for the legacy default * (totem-codex finding 11) — omit the key to opt out. * * Zod validates only the SHAPE here (`string[]`, nonempty). The remaining * SEMANTIC contract — known `provider:model` entries, the shell provider * rejected, no empty/duplicate normalized entries — is enforced CLI-side by * `validateReviewLanes`, which reuses the CLI's * `parseModelString`/`assertValidModelName` (core cannot import from cli). * An explicit `--model` selects a ONE-lane invocation and never joins or * overrides this fan. */ lanes: z.ZodOptional>; }, z.ZodTypeAny, "passthrough">>>; /** Optional: `totem orient` settings (e.g. `{ projectNumber: 1 }` for the GH Project board). */ orient: z.ZodOptional; /** * Config-path to the cohort parity manifest (`parity-manifest.yaml`) the * `totem doctor --parity` sensor parses for cross-repo drift * (mmnto-ai/totem-strategy#448). Mirrors `projectNumber` as the one * consumer-specific value the sensor cannot derive from the repo alone — * the manifest is strategy-owned, so its location is per-consumer. Resolved * relative to the config/repo root by `resolveParityManifestPath`. OPTIONAL: * when unset, the sensor renders an honest "no parity manifest configured" * skip — never an error (Tenet 14, honest-absent). */ parityManifest: z.ZodOptional; /** * Cross-repo read set for the `network-read-only` parity probes * (Prop 296 §14, mmnto-ai/totem-strategy#962). Each entry is an `owner/repo` * slug the doctor additionally issues read-only GitHub-settings/rulesets/ * branch-protection GETs against when sensing the posture rows * (`repo-merge-posture`, `repo-required-checks-posture`, * `repo-branch-protection-posture`). ADDITIVE + OPTIONAL: the CURRENT repo * (derived from the git remote) is ALWAYS probed; this list only widens the * roster. §14 clause 3 makes the CI/consumer default current-repo-only — * cross-repo reads need a cross-repo-privileged seat token, so a repo-scoped * CI token that cannot see siblings degrades each extra repo to a per-repo * cannot-verify line, never a manifest-wide outage. */ parityProbeRepos: z.ZodOptional>; }, "strip", z.ZodTypeAny, { projectNumber?: number | undefined; parityManifest?: string | undefined; parityProbeRepos?: string[] | undefined; }, { projectNumber?: number | undefined; parityManifest?: string | undefined; parityProbeRepos?: string[] | undefined; }>>; /** Optional: `totem ecl-gc --compact` settings — the consumer-declared cohort * completeness roster (`{ cohortRepos: ['totem', ...] }`, mmnto-ai/totem#2310). */ ecl: z.ZodOptional>; }, "strip", z.ZodTypeAny, { cohortRepos?: string[] | undefined; }, { cohortRepos?: string[] | undefined; }>>; }, "strip", z.ZodTypeAny, { targets: { type: "code" | "lesson" | "session_log" | "spec"; glob: string; strategy: string; }[]; totemDir: string; lanceDir: string; ignorePatterns: string[]; indexIgnorePatterns: string[]; shieldIgnorePatterns: string[]; contextWarningThreshold: number; shieldAutoLearn: boolean; review: { sourceExtensions: string[]; stage4Baseline?: z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough"> | undefined; lanes?: string[] | undefined; } & { [k: string]: unknown; }; secrets?: { value: string; type: "pattern" | "literal"; }[] | undefined; embedding?: { model: string; provider: "openai"; dimensions?: number | undefined; throttleMs?: number | undefined; } | { model: string; provider: "ollama"; baseUrl: string; dimensions?: number | undefined; } | { model: string; provider: "gemini"; dimensions?: number | undefined; throttleMs?: number | undefined; } | undefined; orchestrator?: { provider: "shell"; command: string; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; } | { provider: "gemini"; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; } | { provider: "anthropic"; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; } | { provider: "openai"; baseUrl?: string | undefined; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; } | { provider: "ollama"; baseUrl: string; defaultModel?: string | undefined; fallbackModel?: string | undefined; overrides?: Record | undefined; cacheTtls?: Record | undefined; enableContextCaching?: boolean | undefined; cacheTTL?: 300 | 3600 | undefined; capabilities?: { admissionClasses?: ("completion_only" | "self_grounding_agent")[] | undefined; } | undefined; numCtx?: number | undefined; } | undefined; searchRelevanceFloor?: number | undefined; docs?: { path: string; trigger: "post-release" | "on-change"; description: string; userFacing?: boolean | undefined; }[] | undefined; exports?: Record | undefined; repositories?: string[] | undefined; botMarkers?: string[] | undefined; linkedIndexes?: string[] | undefined; extends?: string[] | undefined; strategyRoot?: string | undefined; substratePath?: string | undefined; partitions?: Record | undefined; garbageCollection?: { enabled: boolean; minAgeDays: number; exemptCategories: ("security" | "architecture" | "style" | "performance")[]; } | undefined; doctor?: { staleRuleWindow: number; } | undefined; pilot?: boolean | { maxDays: number; maxPushes: number; } | undefined; hooks?: { tier: "strict" | "standard"; legsOwed: { globs: string[]; enforce?: "advisory" | "block" | undefined; }; } | undefined; orient?: { projectNumber?: number | undefined; parityManifest?: string | undefined; parityProbeRepos?: string[] | undefined; } | undefined; ecl?: { cohortRepos?: string[] | undefined; } | undefined; }, { targets: { type: "code" | "lesson" | "session_log" | "spec"; glob: string; strategy: string; }[]; secrets?: { value: string; type: "pattern" | "literal"; }[] | undefined; embedding?: { provider: "openai"; model?: string | undefined; dimensions?: number | undefined; throttleMs?: number | undefined; } | { provider: "ollama"; model?: string | undefined; dimensions?: number | undefined; baseUrl?: string | undefined; } | { provider: "gemini"; model?: string | undefined; dimensions?: number | undefined; throttleMs?: number | undefined; } | undefined; orchestrator?: unknown; totemDir?: string | undefined; lanceDir?: string | undefined; ignorePatterns?: string[] | undefined; indexIgnorePatterns?: string[] | undefined; shieldIgnorePatterns?: string[] | undefined; contextWarningThreshold?: number | undefined; searchRelevanceFloor?: number | undefined; docs?: { path: string; description: string; trigger?: "post-release" | "on-change" | undefined; userFacing?: boolean | undefined; }[] | undefined; exports?: Record | undefined; repositories?: string[] | undefined; botMarkers?: string[] | undefined; linkedIndexes?: string[] | undefined; extends?: string[] | undefined; strategyRoot?: string | undefined; substratePath?: string | undefined; partitions?: Record | undefined; shieldAutoLearn?: boolean | undefined; garbageCollection?: { enabled?: boolean | undefined; minAgeDays?: number | undefined; exemptCategories?: ("security" | "architecture" | "style" | "performance")[] | undefined; } | undefined; doctor?: { staleRuleWindow?: number | undefined; } | undefined; pilot?: boolean | { maxDays?: number | undefined; maxPushes?: number | undefined; } | undefined; hooks?: { tier?: "strict" | "standard" | undefined; legsOwed?: { globs?: string[] | undefined; enforce?: "advisory" | "block" | undefined; } | undefined; } | undefined; review?: z.objectInputType<{ sourceExtensions: z.ZodDefault, string, string>, "many">>; stage4Baseline: z.ZodOptional>; exclude: z.ZodDefault>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ extend: z.ZodDefault>; exclude: z.ZodDefault>; }, z.ZodTypeAny, "passthrough">>>; /** * Opt-in multi-lane review fan (Prop 304 R2, mmnto-ai/totem#2106). Each * entry is a `provider:model` lane the reviewer runs independently over the * one masked diff, converging on a verdict artifact. A DECLARED key here * (this schema is otherwise `.passthrough()`) so `config.review.lanes` is * typed rather than an untyped passthrough value (codex fold 7). * * ABSENT ⇒ the legacy single-lane path runs byte-for-byte as today * (invariant 7). PRESENT ⇒ the fan path, and present means ≥1: an * explicitly-configured EMPTY array (`lanes: []`) is a hard config PARSE * error (`.min(1)`), never a silent synonym for the legacy default * (totem-codex finding 11) — omit the key to opt out. * * Zod validates only the SHAPE here (`string[]`, nonempty). The remaining * SEMANTIC contract — known `provider:model` entries, the shell provider * rejected, no empty/duplicate normalized entries — is enforced CLI-side by * `validateReviewLanes`, which reuses the CLI's * `parseModelString`/`assertValidModelName` (core cannot import from cli). * An explicit `--model` selects a ONE-lane invocation and never joins or * overrides this fan. */ lanes: z.ZodOptional>; }, z.ZodTypeAny, "passthrough"> | undefined; orient?: { projectNumber?: number | undefined; parityManifest?: string | undefined; parityProbeRepos?: string[] | undefined; } | undefined; ecl?: { cohortRepos?: string[] | undefined; } | undefined; }>; /** * `ChunkStrategy` keeps the literal union of built-in strategy names for * IntelliSense on core code paths while admitting any string registered * via Pack registration callbacks at boot. The Zod schema validates the * runtime value against the registry; this type alias lives independently * so callers don't lose type safety on built-in names. Per ADR-097 § 10 + * mmnto-ai/totem#1769. */ export type ChunkStrategy = (typeof BUILTIN_CHUNK_STRATEGIES)[number] | (string & {}); export type ContentType = z.infer; export type IngestTarget = z.infer; export type EmbeddingProvider = z.infer; export type Orchestrator = z.infer; export type GarbageCollectionConfig = z.infer; export type DoctorConfig = z.infer; export type DocTarget = z.infer; export type OrientConfig = z.infer; export type EclConfig = z.infer; export type TotemConfig = z.infer; /** * Supported config file names in resolution priority order. * .ts is preferred (full TypeScript support), static formats are fallbacks. */ export declare const CONFIG_FILES: readonly ["totem.config.ts", "totem.yaml", "totem.yml", "totem.toml"]; /** * Determine the configuration tier based on what's configured. * - lite: no embedding, no orchestrator (memory-only features) * - standard: embedding configured (sync, search, stats) * - full: embedding + orchestrator (all commands) */ export declare function getConfigTier(config: TotemConfig): ConfigTier; /** * Assert that an embedding provider is configured. Throws a friendly error * directing the user to configure one via `totem init` or `totem.config.ts`. */ export declare function requireEmbedding(config: TotemConfig): EmbeddingProvider; //# sourceMappingURL=config-schema.d.ts.map