import type { RuntimeModelReference } from "@mono-agent/runtime-adapter"; import type { MonoAgentConfig, RedactedMonoAgentConfig, ResolvedProviders, RuntimeFallbackConfig } from "./types.js"; export type MonoAgentConfigErrorCode = "missing_required_env" | "invalid_env" | "invalid_json" | "invalid_model_reference"; export interface MonoAgentConfigErrorDetails { readonly code?: MonoAgentConfigErrorCode; readonly env?: string; readonly reason?: string; readonly [key: string]: unknown; } export declare class MonoAgentConfigError extends Error { readonly code: MonoAgentConfigErrorCode; readonly details: MonoAgentConfigErrorDetails; constructor(code: MonoAgentConfigErrorCode, message: string, details?: MonoAgentConfigErrorDetails); } export interface LoadMonoAgentConfigInput { readonly env: Record; readonly cwd: string; } /** * Retired settings stay explicit here so every loader entry point gives the * same repair instead of silently dropping a fallback chain or surfacing an * unactionable unknown-key error from a host-owned schema. * * `message` repairs the JSON key; `envMessage` repairs the environment variable. * They are separate on purpose: an operator whose `.env` still sets * `MONO_AGENT_FALLBACK_MODELS` has no `runtime.fallbackModels` key to rewrite, so * pointing at the JSON shape is not a repair they can carry out. Hand-migration is * only safe if the repair names the surface the operator is actually holding. */ export declare const RETIRED_CONFIG_FIELDS: readonly [{ readonly path: "runtime.executionMode"; readonly env: "MONO_AGENT_EXECUTION_MODE"; readonly message: "`runtime.executionMode` was removed; mono-agent runs only the Pi runtime (SDK). Delete the key."; readonly envMessage: "`MONO_AGENT_EXECUTION_MODE` was removed; mono-agent runs only the Pi runtime (SDK). Remove the variable from your environment and `.env`."; }, { readonly path: "runtime.routeSafety"; readonly env: "MONO_AGENT_ROUTE_SAFETY"; readonly message: "`runtime.routeSafety` was removed; every route is Pi-native, so `per-route-native` has no meaning. Delete the key."; readonly envMessage: "`MONO_AGENT_ROUTE_SAFETY` was removed; every route is Pi-native, so `per-route-native` has no meaning. Remove the variable from your environment and `.env`."; }, { readonly path: "runtime.fallbackModels"; readonly env: "MONO_AGENT_FALLBACK_MODELS"; readonly message: "`runtime.fallbackModels` was replaced by `runtime.fallbacks: [{ \"model\": \"...\" }]`. Replace the key with that shape."; readonly envMessage: "`MONO_AGENT_FALLBACK_MODELS` was replaced by `MONO_AGENT_FALLBACKS_JSON`, a JSON array of `{ \"model\": \"...\" }` objects. Remove the variable and re-express the chain there, or drop it into `runtime.fallbacks` in mono-agent.config.json."; }, { readonly path: "memory.llm.executionMode"; readonly env: "MONO_AGENT_MEMORY_LLM_EXECUTION_MODE"; readonly message: "`memory.llm.executionMode` was removed for the same reason as `runtime.executionMode`: mono-agent runs only the Pi runtime (SDK). Delete the key."; readonly envMessage: "`MONO_AGENT_MEMORY_LLM_EXECUTION_MODE` was removed for the same reason as `MONO_AGENT_EXECUTION_MODE`: mono-agent runs only the Pi runtime (SDK). Remove the variable from your environment and `.env`."; }]; /** * Keep model first: the layered loader uses this order when attributing an * incompatible memory.llm environment field. */ export declare const MEMORY_LLM_ENV_KEYS: readonly ["MONO_AGENT_MEMORY_LLM_MODEL", "MONO_AGENT_MEMORY_LLM_PROVIDER", "MONO_AGENT_MEMORY_LLM_ENDPOINT", "MONO_AGENT_MEMORY_LLM_TRACE", "MONO_AGENT_MEMORY_LLM_TIMEOUT_MS"]; export declare const DEFAULT_ARTIFACT_RETENTION_MAX_AGE_DAYS = 365; export declare const DEFAULT_ARTIFACT_RETENTION_MAX_COUNT = 50000; export declare const DEFAULT_MEMORY_ARTIFACT_RETENTION_MAX_AGE_DAYS = 7; export declare const DEFAULT_MEMORY_ARTIFACT_RETENTION_MAX_COUNT = 5000; export declare const MAX_AGENT_NAME_LENGTH = 80; export declare function loadMonoAgentConfig(input: LoadMonoAgentConfigInput): MonoAgentConfig; /** * Normalize loaded/programmatic provider config into one deterministic view. * Loaded configs carry `entries`; the `local` fallback preserves compatibility * for embedders that still construct the pre-map shape by hand. */ export declare function resolveConfiguredProviders(config: Pick): ResolvedProviders; /** One authored model reference to validate, with the config path that owns it. */ export interface ProviderCoverageRoute { readonly model: RuntimeModelReference; /** Config path used verbatim in the failure message, e.g. `runtime.model`. */ readonly path: string; } /** * Fail early when a route names neither Pi's builtin catalog, an explicitly * configured provider, nor one of the two zero-config local discovery ids. * `additionalRoutes` carries model references authored outside * `runtime.model`/`runtime.fallbacks[]` (today: subagent profiles). */ export declare function assertConfiguredProviderCoverage(model: RuntimeModelReference, fallbacks: readonly RuntimeFallbackConfig[] | undefined, providers: ResolvedProviders, additionalRoutes?: readonly ProviderCoverageRoute[]): void; export declare function redactMonoAgentConfig(config: MonoAgentConfig): RedactedMonoAgentConfig; /** * Resolve the Supermemory container/namespace tag for an agent: an explicit * `memory.supermemory.container` wins, else the trace identity, else a shared default. SINGLE source * of truth — both the store (write path) and the recall tool (read path) must agree on this, or * recall would search a different namespace than captures were written to. */ export declare function resolveSupermemoryContainer(config: MonoAgentConfig): string; //# sourceMappingURL=config.d.ts.map