Expand description
WhyCodes configuration: load, merge, validate.
Leaf types (Message, Tool, sandbox policy) live in whycodes-core.
This crate owns the user-facing Config tree and I/O.
Modules§
- dotted
- Dotted keys over the config tree (
session.tool_profile,agents.build.model,mcp_servers."my.server".command).
Structs§
- Automation
Config - Process-local background shell jobs and schedule/loop knobs.
- Bash
Config [tools.bash]— auto-background a still-running shell after idle.- Command
Config - Config
- Main configuration structure
- Custom
Command Config - Custom slash command definition (
/commands) - Custom
Tool Config - Format
Config [tools.format]— run the project’s own formatter (rustfmt, prettier, ruff, black, gofmt) on a fileedit/writechanged, when the project shows it uses one.- General
Config - Hook
Config - A single shell hook attached to tool execution.
- LspConfig
- Language-server overlay stored in
config.tomlunder[lsp]. - LspServer
Config - One language-server overlay entry.
- Magic
Keywords Config - Per-turn hidden notices when the user writes a magic keyword in prose.
- McpServer
Config - MCP server definition stored in config.
- Memory
Config - Cross-session semantic / auto memory (Claude-style index + local recall).
- Notify
Config - Session notifications over Discord Incoming Webhooks, Telegram bots, and/or the terminal (desktop notification via OSC 9 / OSC 777).
- Price
Config [pricing."provider/model"]: USD per million tokens.- Question
Tool Config - Settings for the interactive
questiontool (questionnaire). - Runtime
LspServer - JSON-valued overlay sent to
whycodes-lsp(avoids a config → lsp edge). - Sandbox
Settings - Resolved sandbox policy carried on
crate::ToolContext. - Security
Config - Settings for shell safety: risk classification, OS sandbox, and network domain policy for HTTP tools.
- Session
Config - Slop
Config - Verbosity / erosion / ΔLOC tripwires. Default
verdictisreview, not block. - Stream
Rule Config - One time-traveling stream rule (abort + inject).
- Swarm
Config - Concurrent multi-agent work (
swarmtool). - System
Prompt Overlays - Provider / model system-prompt extras loaded from markdown files.
- Tools
Config - TuiConfig
- WebSearch
Config [websearch]— which engine thewebsearchtool queries.- WebSearch
Custom Config [websearch.custom]— a JSON search API mapped with JSON Pointers.
Enums§
- Config
Target - The file
Config::set_dottedwrites. - Headless
AskMode - Structured-run policy for permission
ask(issue #122). - Hook
Event - When a hook runs relative to a tool call.
- McpTransport
Kind - How to reach an MCP server.
- Notify
Event - Lifecycle events that can fire a session notification.
- Sandbox
Fallback - What to do when the requested sandbox backend is missing.
- Sandbox
Mode - How aggressively shell commands are OS-sandboxed.
- Stream
Rule Repeat repeat = "once" | "always" | { after_turns = N }.- Stream
Rule Scope - Streamed channel a stream rule watches.
Constants§
- CONFIG_
SCHEMA_ VERSION - Current
config.tomlschema. Bump when a load-time rewrite is required. - DEFAULT_
MODEL_ ID - OpenRouter model id used as the first-run default.
- DEFAULT_
PROVIDER - First-run / CLI fallback provider when nothing is configured.
Functions§
- is_
discord_ webhook_ url - Discord Incoming Webhook host allowlist (no arbitrary POST target).
- parse_
rule_ markdown - Parse one rule file.
Nonewhen it has no frontmatterpattern. - project_
slop_ path .whycodes/slop.tomlnext to project config.- stream_
rule_ files - Stream rules defined by files in the first
whycodes_core::project_rule_dirsentry (.whycodes/rules/*.md), sorted by path.