|
Entropic 2.14.3
Local-first agentic inference engine
|
Config loader implementation — YAML parsing + layered merge. More...
#include <entropic/config/loader.h>#include <entropic/config/validate.h>#include <entropic/types/logging.h>#include "yaml_util.h"#include <nlohmann/json.hpp>#include <algorithm>#include <fstream>#include <optional>#include <sstream>#include <dlfcn.h>
Go to the source code of this file.
Namespaces | |
| namespace | entropic |
| Activate model on GPU (WARM → ACTIVE). | |
Functions | |
| static void | entropic::config::parse_model_runtime_knobs (ryml::ConstNodeRef node, ModelConfig &config) |
| Read the model-runtime knobs (KV cache, batching, threads). | |
| static void | entropic::config::parse_sampler_overrides (ryml::ConstNodeRef node, TierConfig &config) |
| Read per-tier sampler overrides from a YAML model/tier node. | |
| static void | entropic::config::parse_tier_speculative_override (ryml::ConstNodeRef node, TierConfig &config) |
Parse the per-tier speculative.mtp override (gh#108, v2.9.4). | |
| static std::string | entropic::config::resolve_model_path (ryml::ConstNodeRef node, const BundledModels ®istry, ModelConfig &config) |
Resolve config.path from an explicit path: or a selector (gh#62). | |
| static void | entropic::config::parse_gpu_layers (ryml::ConstNodeRef node, ModelConfig &config) |
Parse gpu_layers, which may be a count or the word auto (gh#148). | |
| static std::string | entropic::config::parse_model_config (ryml::ConstNodeRef node, const BundledModels ®istry, ModelConfig &config) |
| Parse a ModelConfig from a YAML node. | |
| static std::string | entropic::config::parse_tier_config (ryml::ConstNodeRef node, const BundledModels ®istry, TierConfig &config) |
| Parse a TierConfig from a YAML node. | |
| static std::string | entropic::config::parse_models_config (ryml::ConstNodeRef node, const BundledModels ®istry, ModelsConfig &config) |
| Parse the models section from a YAML node. | |
| static std::string | entropic::config::parse_routing_config (ryml::ConstNodeRef node, RoutingConfig &config) |
| Parse the routing section from a YAML node. | |
| static std::string | entropic::config::parse_compaction_config (ryml::ConstNodeRef node, CompactionConfig &config) |
| Parse the compaction section from a YAML node. | |
| static std::string | entropic::config::parse_delegation_config (ryml::ConstNodeRef node, DelegationConfig &config) |
| Parse the delegation section from a YAML node (gh#160). | |
| static std::string | entropic::config::parse_permissions_config (ryml::ConstNodeRef node, PermissionsConfig &config) |
| Parse the permissions section from a YAML node. | |
| static std::string | entropic::config::parse_outside_root_access (ryml::ConstNodeRef node, FilesystemConfig &config) |
Parse mcp.filesystem.allow_outside_root (v2.13.0 tri-state). | |
| static std::string | entropic::config::parse_outside_root_list (ryml::ConstNodeRef node, c4::csubstr key, std::vector< std::filesystem::path > &out) |
Parse one outside-root path list (outside_root_allow/_deny). | |
| static std::string | entropic::config::parse_filesystem_config (ryml::ConstNodeRef node, FilesystemConfig &config) |
| Parse the filesystem section from a YAML node. | |
| static void | entropic::config::parse_tool_descriptions (ryml::ConstNodeRef node, ExternalMCPConfig &config) |
Parse mcp.external.tool_descriptions into the override map. | |
| static std::string | entropic::config::parse_external_mcp_config (ryml::ConstNodeRef node, ExternalMCPConfig &config) |
| Parse the external MCP section from a YAML node. | |
| static std::string | entropic::config::parse_bash_config (ryml::ConstNodeRef node, BashConfig &config) |
Parse mcp.bash (v2.13.0). | |
| static ExternalServerEntry | entropic::config::parse_external_server_entry (ryml::ConstNodeRef node) |
| Parse one declared external server (v2.14.0). | |
| static std::string | entropic::config::parse_external_servers (ryml::ConstNodeRef node, MCPConfig &config) |
Parse mcp.external_servers (v2.14.0). | |
| static void | entropic::config::parse_mcpjson_enablement (ryml::ConstNodeRef node, MCPConfig &config) |
Parse the .mcp.json enablement keys (v2.14.0, gh#199). | |
| static std::string | entropic::config::validate_server_timeout (const MCPConfig &config) |
| Refuse a server_timeout_seconds that cannot bound anything (gh#175). | |
| static std::string | entropic::config::parse_mcp_sections (ryml::ConstNodeRef node, MCPConfig &config) |
| Parse the MCP section's per-server sub-sections (v2.13.0). | |
| static std::string | entropic::config::parse_mcp_config (ryml::ConstNodeRef node, MCPConfig &config) |
| Parse the MCP section from a YAML node. | |
| static std::string | entropic::config::parse_generation_config (ryml::ConstNodeRef node, GenerationConfig &config) |
| Parse the generation section from a YAML node. | |
| static std::string | entropic::config::parse_lsp_config (ryml::ConstNodeRef node, LSPConfig &config) |
| Parse the LSP section from a YAML node. | |
| static std::string | entropic::config::parse_prompt_cache_config (ryml::ConstNodeRef node, PromptCacheConfig &config) |
| Parse prompt_cache config from inference YAML section. | |
| static void | entropic::config::parse_constitutional_validation_config (ryml::ConstNodeRef node, ConstitutionalValidationConfig &config) |
| Parse constitutional_validation section. | |
| static void | entropic::config::parse_speculative_config (ryml::ConstNodeRef node, const BundledModels ®istry, SpeculativeConfig &config) |
Parse inference.speculative YAML node into SpeculativeConfig. | |
| static void | entropic::config::parse_inference_subsections (ryml::ConstNodeRef root, const BundledModels ®istry, ParsedConfig &config) |
| Parse the nested optional config sub-sections. | |
| static std::string | entropic::config::parse_optional_subsections (ryml::ConstNodeRef root, const BundledModels ®istry, ParsedConfig &config) |
| Parse the nested optional config sub-sections. | |
| static void | entropic::config::extract_scalar_fields (ryml::ConstNodeRef root, ParsedConfig &config) |
| Extract the top-level scalar/path config fields. | |
| static std::string | entropic::config::validate_workspace_app_context (const ParsedConfig &config) |
| Refuse a workspace_app_context that could leave a workspace root. | |
| static std::string | entropic::config::parse_optional_sections (ryml::ConstNodeRef root, const BundledModels ®istry, ParsedConfig &config) |
| Parse the optional config sections. | |
| static std::string | entropic::config::parse_top_sections (ryml::ConstNodeRef root, const BundledModels ®istry, ParsedConfig &config) |
| Parse the top-level models/routing/optional sections. | |
| ENTROPIC_EXPORT std::string | entropic::config::parse_config_file (const std::filesystem::path &path, const BundledModels ®istry, ParsedConfig &config) |
| Parse a config YAML file and overlay onto existing config. | |
| static std::string | entropic::config::load_bundled_default (const std::filesystem::path &global_path, const BundledModels ®istry, ParsedConfig &config) |
| Load bundled default config when no user config exists. | |
| static std::string | entropic::config::load_config_layers (const std::filesystem::path &global_path, const std::filesystem::path &project_path, const BundledModels ®istry, ParsedConfig &config) |
| Load global, project, and bundled config layers in order. | |
| ENTROPIC_EXPORT std::string | entropic::config::load_config (const std::filesystem::path &global_path, const std::filesystem::path &project_path, const BundledModels ®istry, ParsedConfig &config) |
| Load config using layered resolution. | |
| ENTROPIC_EXPORT std::string | entropic::config::load_config_from_file (const std::filesystem::path &path, const BundledModels ®istry, ParsedConfig &config) |
| Load config from a single YAML file (no layering). | |
| static std::string | entropic::config::load_global_layer (const BundledModels ®istry, ParsedConfig &config) |
| Discover and parse .mcp.json from the project directory. | |
| static std::filesystem::path | entropic::config::resolve_consumer_defaults (const std::filesystem::path &consumer_defaults) |
| Resolve a relative consumer_defaults path against install prefix. | |
| static bool | entropic::config::yaml_has_key (const std::filesystem::path &path, const char *key) |
| Load the consumer/app defaults layer if present (non-fatal). | |
| static void | entropic::config::load_consumer_layer (const std::filesystem::path &consumer_defaults_in, const BundledModels ®istry, ParsedConfig &config) |
| Load the consumer-defaults layer. | |
| static std::string | entropic::config::load_project_layer (const std::filesystem::path &project_dir, const BundledModels ®istry, ParsedConfig &config) |
| Load the project-local layer if present. | |
| ENTROPIC_EXPORT std::string | entropic::config::load_layered (const std::filesystem::path &project_dir, const std::filesystem::path &consumer_defaults, const BundledModels ®istry, ParsedConfig &config) |
| Load config with consumer defaults + global + project layers. | |
| static std::string | entropic::config::parse_config_string (const std::string &content, const BundledModels ®istry, ParsedConfig &config) |
| Parse a config string (YAML or JSON) and overlay onto config. | |
| ENTROPIC_EXPORT std::string | entropic::config::load_config_from_string (const std::string &content, const BundledModels ®istry, ParsedConfig &config) |
| Load config from a YAML/JSON string (no layering). | |
Variables | |
| static auto | s_log = entropic::log::get("config") |
Config loader implementation — YAML parsing + layered merge.
Definition in file loader.cpp.
|
static |
Extract the top-level scalar/path config fields.
| root | YAML root node. |
| config | Config to populate. @dg_internal |
Definition at line 1012 of file loader.cpp.
|
static |
Load bundled default config when no user config exists.
| global_path | Path for auto-created global config. | |
| registry | Bundled models registry. | |
| [in,out] | config | Config to populate. |
Definition at line 1168 of file loader.cpp.
| std::string entropic::config::load_config | ( | const std::filesystem::path & | global_path, |
| const std::filesystem::path & | project_path, | ||
| const BundledModels & | registry, | ||
| ParsedConfig & | config | ||
| ) |
Load config using layered resolution.
Resolution order (highest wins):
| global_path | Path to global config file (may not exist). | |
| project_path | Path to project config file (may not exist). | |
| registry | Bundled models registry for path resolution. | |
| [out] | config | Output parsed config. |
| global_path | Path to global config file. | |
| project_path | Path to project config file. | |
| registry | Bundled models registry. | |
| [out] | config | Output parsed config. |
Definition at line 1249 of file loader.cpp.
| std::string entropic::config::load_config_from_file | ( | const std::filesystem::path & | path, |
| const BundledModels & | registry, | ||
| ParsedConfig & | config | ||
| ) |
Load config from a single YAML file (no layering).
Load config from a single YAML file.
Applies compiled defaults first, then overlays the file. Used by entropic_configure_from_file().
| path | Path to YAML config file. | |
| registry | Bundled models registry for path resolution. | |
| [out] | config | Output parsed config. |
| path | Path to YAML config file. | |
| registry | Bundled models registry. | |
| [out] | config | Output parsed config. |
Definition at line 1276 of file loader.cpp.
| std::string entropic::config::load_config_from_string | ( | const std::string & | content, |
| const BundledModels & | registry, | ||
| ParsedConfig & | config | ||
| ) |
Load config from a YAML/JSON string (no layering).
Load config from a YAML/JSON string with validation.
Parses the string with ryml (accepts both YAML and JSON since JSON is a YAML subset), applies env overrides, validates. Used by entropic_configure().
| content | Config string (YAML or JSON). | |
| registry | Bundled models registry for path resolution. | |
| [out] | config | Output parsed config. |
| content | Config string (YAML or JSON). | |
| registry | Bundled models registry. | |
| [out] | config | Output parsed config. |
Definition at line 1621 of file loader.cpp.
|
static |
Load global, project, and bundled config layers in order.
| global_path | Path to global config file. | |
| project_path | Path to project config file. | |
| registry | Bundled models registry. | |
| [in,out] | config | Config to overlay onto. |
Definition at line 1210 of file loader.cpp.
|
static |
Load the consumer-defaults layer.
Consumer config is a complete application config, not a patch. If the consumer file defines a models: block, existing tiers from prior layers are cleared before parsing so the consumer's tier set fully replaces the global one. Same for routing:.
| consumer_defaults_in | Consumer defaults path. | |
| registry | Bundled models registry. | |
| [in,out] | config | Config to overlay onto. @req REQ-CFG-001 @req REQ-CFG-002 @req REQ-CFG-007 |
Definition at line 1422 of file loader.cpp.
|
static |
Discover and parse .mcp.json from the project directory.
Auto-registers external MCP servers (stdio/SSE) declared in the project's .mcp.json. Format matches Claude Code / VSCode MCP config: { "mcpServers": { "name": { "type": "stdio|sse", ... } } }
Entries are merged into config.mcp.external_servers. The ServerManager initializes them during builtin setup.
| project_dir | Project directory to search for .mcp.json. | |
| [in,out] | config | Config to populate external_servers into. @utility |
Load the global user config layer if present. @req REQ-CFG-001
Definition at line 1317 of file loader.cpp.
| std::string entropic::config::load_layered | ( | const std::filesystem::path & | project_dir, |
| const std::filesystem::path & | consumer_defaults, | ||
| const BundledModels & | registry, | ||
| ParsedConfig & | config | ||
| ) |
Load config with consumer defaults + global + project layers.
Load config with global → consumer defaults → project-local layering.
Resolution order (highest wins):
| project_dir | Project config directory (empty = skip project layer). | |
| consumer_defaults | Path to consumer defaults YAML (empty = skip). | |
| registry | Bundled models registry for path resolution. | |
| [out] | config | Output parsed config. |
Later layers override earlier ones (standard config-precedence semantics: more-specific wins). Order is:
~/.entropic/config.yaml) — personal defaults.default_config.yaml) — the app knows what it needs; overrides the user's global defaults.<project_dir>/config.local.yaml) — most specific.Prior to v2.0.6 consumer defaults loaded first and were overridden by the user's global config. That meant a user's aggressive global settings (e.g. context_length: 131072) would override an app's deliberate lightweight defaults (e.g. context_length: 16384) — reversing expected precedence semantics. Now consumer defaults win over global.
| project_dir | Project config directory. |
| consumer_defaults | Path to consumer defaults YAML. |
| registry | Bundled models registry. |
| config | Output config. |
Definition at line 1523 of file loader.cpp.
|
static |
Load the project-local layer if present.
@utility
Load the project-local layer if present.
Same replace semantics as consumer layer: if the project config defines a models: or routing: block, existing entries from prior layers are cleared before parsing.
@req REQ-CFG-001 @req REQ-CFG-002
Definition at line 1468 of file loader.cpp.
|
static |
Parse mcp.bash (v2.13.0).
timeout_seconds must be a positive integer. Zero and negatives are REFUSED rather than clamped or read as "no limit": the timeout is what stops a runaway command holding a run thread (and every lock above it), and a consumer who wrote 0 meaning "off" and silently got either reading would believe a posture that is not in force. An absent key keeps 30.
| node | YAML node for the "bash" section. | |
| [out] | config | Output bash config. |
Definition at line 642 of file loader.cpp.
|
static |
Parse the compaction section from a YAML node.
| node | YAML node for "compaction" section. | |
| [out] | config | Output compaction config. |
Definition at line 380 of file loader.cpp.
| std::string entropic::config::parse_config_file | ( | const std::filesystem::path & | path, |
| const BundledModels & | registry, | ||
| ParsedConfig & | config | ||
| ) |
Parse a config YAML file and overlay onto existing config.
Fields not present in YAML retain their current values. This is the merge primitive used for layered config loading.
| path | Path to YAML file. | |
| registry | Bundled models for path resolution. | |
| [in,out] | config | Config to overlay onto. |
Passes the bundled-models registry through to optional-section parsers so inference.speculative.draft_model can be resolved (bundled key or path) at parse time. (v2.1.11)
| path | Path to YAML file. | |
| registry | Bundled models for path resolution. | |
| [in,out] | config | Config to overlay onto. |
Definition at line 1138 of file loader.cpp.
|
static |
Parse a config string (YAML or JSON) and overlay onto config.
Threads the bundled-models registry through to the optional-section parser for speculative draft_model resolution (v2.1.11).
| content | Raw config string. | |
| registry | Bundled models for path resolution. | |
| [in,out] | config | Config to overlay onto. |
Definition at line 1581 of file loader.cpp.
|
static |
Parse constitutional_validation section.
| node | YAML node for "constitutional_validation" section. | |
| [out] | config | Output constitutional validation config. @dg_internal |
Definition at line 888 of file loader.cpp.
|
static |
Parse the delegation section from a YAML node (gh#160).
An unrecognized isolation value is refused rather than silently treated as none: a consumer who asks for containment and gets the shipped default back would believe a guarantee that is not in force.
| node | YAML node for the "delegation" section. | |
| [out] | config | Output delegation config. |
Definition at line 410 of file loader.cpp.
|
static |
Parse the external MCP section from a YAML node.
| node | YAML node for "external" section. | |
| [out] | config | Output external MCP config. |
Definition at line 598 of file loader.cpp.
|
static |
Parse one declared external server (v2.14.0).
| node | YAML node for one mcp.external_servers.<name> entry. |
Definition at line 664 of file loader.cpp.
|
static |
Parse mcp.external_servers (v2.14.0).
The key has been in MCPConfig and the schema since v1.8.7; until now no config file could set it. An entry with neither command nor url is a typed error rather than a silent skip — it can only be a mistake.
| node | YAML node for the "mcp" section. | |
| [in,out] | config | MCP config to populate. |
Definition at line 692 of file loader.cpp.
|
static |
Parse the filesystem section from a YAML node.
| node | YAML node for "filesystem" section. | |
| [out] | config | Output filesystem config. |
Definition at line 533 of file loader.cpp.
|
static |
Parse the generation section from a YAML node.
| node | YAML node for "generation" section. | |
| [out] | config | Output generation config. |
Definition at line 825 of file loader.cpp.
|
static |
Parse gpu_layers, which may be a count or the word auto (gh#148).
auto is an explicit opt-in to have the engine derive the offload split from free VRAM at admission time; anything else is taken verbatim, as every gpu_layers value always has been. A tier that says auto keeps gpu_layers at its default until the gate resolves it, so nothing downstream sees a half-resolved value.
| node | YAML node for the model/tier. | |
| [out] | config | Output model config. @dg_internal @req REQ-CFG-005 @req REQ-TYPE-005 |
Definition at line 175 of file loader.cpp.
|
static |
Parse the nested optional config sub-sections.
| root | YAML root node. |
| registry | Bundled models for path resolution. |
| config | Config to populate. @dg_internal |
Parse the nested inference.* sub-sections, if present.
| root | YAML root node. |
| registry | Bundled models for path resolution. |
| config | Config to populate. @dg_internal |
Definition at line 957 of file loader.cpp.
|
static |
Parse the LSP section from a YAML node.
| node | YAML node for "lsp" section. | |
| [out] | config | Output LSP config. |
Definition at line 848 of file loader.cpp.
|
static |
Parse the MCP section from a YAML node.
| node | YAML node for "mcp" section. | |
| [out] | config | Output MCP config. |
Definition at line 791 of file loader.cpp.
|
static |
Parse the MCP section's per-server sub-sections (v2.13.0).
Split out of parse_mcp_config when mcp.bash joined filesystem and external, to keep that function inside the knots ABC gate. The first error wins; external has no failure mode of its own.
| node | YAML node for "mcp" section. | |
| [out] | config | Output MCP config. |
Definition at line 762 of file loader.cpp.
|
static |
Parse the .mcp.json enablement keys (v2.14.0, gh#199).
| node | YAML node for the "mcp" section. | |
| [in,out] | config | MCP config to populate. @dg_internal |
Definition at line 719 of file loader.cpp.
|
static |
Parse a ModelConfig from a YAML node.
| node | YAML node containing model fields. | |
| registry | Bundled models for path resolution. | |
| [out] | config | Output model config. |
Definition at line 195 of file loader.cpp.
|
static |
Read the model-runtime knobs (KV cache, batching, threads).
Extracted (gh#23 v2.3.19) to keep parse_model_config under the knots ABC gate as new MVP-10 model-load knobs land. @utility @dg_internal
Definition at line 35 of file loader.cpp.
|
static |
Parse the models section from a YAML node.
| node | YAML node for "models" section. | |
| registry | Bundled models for path resolution. | |
| [out] | config | Output models config. |
Definition at line 305 of file loader.cpp.
|
static |
Parse the optional config sections.
gh#160 (v2.13.0): no longer infallible — delegation.isolation names a safety posture, so an unrecognized value is refused instead of being quietly read as the shipped default. The same holds for the mcp.filesystem outside-root keys, whose error is reported first.
| root | YAML root node. |
| registry | Bundled models for path resolution. |
| config | Config to populate. |
Definition at line 1080 of file loader.cpp.
|
static |
Parse the nested optional config sub-sections.
| root | YAML root node. |
| registry | Bundled models for path resolution. |
| config | Config to populate. |
mcp section's error (v2.13.0: its outside-root keys are refused, not defaulted). @dg_internal Definition at line 981 of file loader.cpp.
|
static |
Parse mcp.filesystem.allow_outside_root (v2.13.0 tri-state).
true/false keep every spelling the bool parser accepted, so a pre-2.13 config means exactly what it meant. optional is new. An unrecognised value is REFUSED rather than read as a default: this key is a security boundary, and a consumer who typed maybe and silently got either extreme would believe a posture that is not in force. An absent key leaves the field untouched (default optional).
| node | YAML node for the "filesystem" section. | |
| [out] | config | Output filesystem config. |
Definition at line 461 of file loader.cpp.
|
static |
Parse one outside-root path list (outside_root_allow/_deny).
Entries are ~-expanded like every other config path, and must then be ABSOLUTE: a relative entry has no defensible anchor (the process cwd? the root it is supposed to lie outside of?), so it is refused rather than guessed. A present key replaces the list, like every other list key, so a project layer can narrow what the global layer granted.
| node | YAML node for the "filesystem" section. | |
| key | List key. | |
| [out] | out | Output list; untouched when the key is absent. |
Definition at line 502 of file loader.cpp.
|
static |
Parse the permissions section from a YAML node.
| node | YAML node for "permissions" section. | |
| [out] | config | Output permissions config. |
Definition at line 435 of file loader.cpp.
|
static |
Parse prompt_cache config from inference YAML section.
| node | YAML node for "inference.prompt_cache" section. | |
| [out] | config | Output prompt cache config. |
Definition at line 866 of file loader.cpp.
|
static |
Parse the routing section from a YAML node.
| node | YAML node for "routing" section. | |
| [out] | config | Output routing config. |
Definition at line 354 of file loader.cpp.
|
static |
Read per-tier sampler overrides from a YAML model/tier node.
gh#94 (v2.7.3): give config.local.yaml a per-tier sampler lever independent of identity frontmatter — both a consumer override and a workaround on pinned releases. Each optional is set ONLY when the key is present, so an absent key leaves the orchestrator's GenerationParams default in place (same precedence as the frontmatter path, thread_frontmatter_sampler). YAML is loaded before init_orchestrator, so unlike frontmatter these land in the orchestrator's config snapshot. @req REQ-CFG-005 @req REQ-TYPE-005
Definition at line 71 of file loader.cpp.
|
static |
Parse inference.speculative YAML node into SpeculativeConfig.
Off-by-default semantics: missing keys leave the struct defaults intact (enabled=false, n_draft=16). The draft model is configured via a nested draft: block that accepts every ModelConfig field (path, gpu_layers, n_threads, flash_attn, context_length, use_mlock, etc.); defaults for the kernel come from make_default_draft_model_config(). (v2.1.11 refactor — earlier flat draft_model/draft_n_gpu_layers/draft_cpu_threads keys are absorbed into the nested block.)
| node | YAML node for inference.speculative. | |
| [out] | config | Output speculative config. @req REQ-CFG-005 @req REQ-TYPE-005 |
Definition at line 920 of file loader.cpp.
|
static |
Parse a TierConfig from a YAML node.
gh#108 (v2.9.4): also parses the per-tier speculative.mtp override. The earlier static rejection of speculative.mtp=true + static grammar is removed in v2.10.0: to_common_sampling now propagates grammar to the MTP sampler chain, so the combination is valid.
| node | YAML node containing tier fields. | |
| registry | Bundled models for path resolution. | |
| [out] | config | Output tier config. |
Definition at line 239 of file loader.cpp.
|
static |
Parse the per-tier speculative.mtp override (gh#108, v2.9.4).
Nested under models.<tier>.speculative.mtp — a tier-scoped mirror of the global inference.speculative.mtp flag. nullopt (key absent) means inherit the global value; resolve_mtp_effective applies the precedence.
| node | YAML node for a single tier. | |
| [out] | config | Output tier config. @req REQ-CFG-005 @req REQ-TYPE-005 |
Definition at line 103 of file loader.cpp.
|
static |
Parse mcp.external.tool_descriptions into the override map.
gh#145 (v2.12.0). Keys are bare tool suffixes ("ask", "status", ...) so a consumer writes them independently of whatever tool_prefix is set to. Unknown keys are carried through and simply never matched — an unknown name is a no-op rather than an error, so a consumer's config does not break when a tool is renamed or removed.
| node | YAML node for the "tool_descriptions" map. | |
| [out] | config | Output external MCP config. @dg_internal |
Definition at line 574 of file loader.cpp.
|
static |
Parse the top-level models/routing/optional sections.
| root | YAML root node. | |
| registry | Bundled models for path resolution. | |
| [in,out] | config | Config to overlay onto. |
Definition at line 1104 of file loader.cpp.
|
static |
Resolve a relative consumer_defaults path against install prefix.
The facade passes a bare filename ("default_config.yaml") that resolves against CWD by default. For tarball-installed consumers whose CWD isn't the install prefix, the bundled <prefix>/share/entropic/<filename> is the correct fallback. Uses the same dladdr-derived discovery as src/config/data_dir.cpp.
Returns the input unchanged if it's absolute or already exists. Otherwise attempts <prefix>/share/entropic/<filename>; returns that if found, else returns the original (so the caller's error messages remain sensible).
@req REQ-CFG-001
Definition at line 1353 of file loader.cpp.
|
static |
Resolve config.path from an explicit path: or a selector (gh#62).
Precedence: an explicit path: (bundled key or literal path) wins. Otherwise, if ALL of family/size/quant are present, resolve via the bundled registry (find_by → resolve). A partial selector (some but not all three) or an unmatched triple is a clear error. Absent both leaves config.path untouched (downstream validation reports the missing model).
Definition at line 125 of file loader.cpp.
Refuse a server_timeout_seconds that cannot bound anything (gh#175).
A bound that was never consulted was a false contract; one that now is must be a usable value, and a bad one is said loudly rather than clamped.
| config | Parsed MCP config. |
Definition at line 740 of file loader.cpp.
|
static |
Refuse a workspace_app_context that could leave a workspace root.
The path is joined to every workspace's root, so an absolute path or a .. component would read the same file outside every repository — the opposite of a per-repository document.
| config | Parsed config. |
Definition at line 1053 of file loader.cpp.
|
static |
Load the consumer/app defaults layer if present (non-fatal).
@utility
Check whether a YAML file contains a top-level key.
| path | File path. |
| key | Key to look for. |
Definition at line 1395 of file loader.cpp.
|
static |
Definition at line 22 of file loader.cpp.