Skip to main content

Crate whycodes_config

Crate whycodes_config 

Source
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§

AutomationConfig
Process-local background shell jobs and schedule/loop knobs.
BashConfig
[tools.bash] — auto-background a still-running shell after idle.
CommandConfig
Config
Main configuration structure
CustomCommandConfig
Custom slash command definition (/commands)
CustomToolConfig
FormatConfig
[tools.format] — run the project’s own formatter (rustfmt, prettier, ruff, black, gofmt) on a file edit / write changed, when the project shows it uses one.
GeneralConfig
HookConfig
A single shell hook attached to tool execution.
LspConfig
Language-server overlay stored in config.toml under [lsp].
LspServerConfig
One language-server overlay entry.
MagicKeywordsConfig
Per-turn hidden notices when the user writes a magic keyword in prose.
McpServerConfig
MCP server definition stored in config.
MemoryConfig
Cross-session semantic / auto memory (Claude-style index + local recall).
NotifyConfig
Session notifications over Discord Incoming Webhooks, Telegram bots, and/or the terminal (desktop notification via OSC 9 / OSC 777).
PriceConfig
[pricing."provider/model"]: USD per million tokens.
QuestionToolConfig
Settings for the interactive question tool (questionnaire).
RuntimeLspServer
JSON-valued overlay sent to whycodes-lsp (avoids a config → lsp edge).
SandboxSettings
Resolved sandbox policy carried on crate::ToolContext.
SecurityConfig
Settings for shell safety: risk classification, OS sandbox, and network domain policy for HTTP tools.
SessionConfig
SlopConfig
Verbosity / erosion / ΔLOC tripwires. Default verdict is review, not block.
StreamRuleConfig
One time-traveling stream rule (abort + inject).
SwarmConfig
Concurrent multi-agent work (swarm tool).
SystemPromptOverlays
Provider / model system-prompt extras loaded from markdown files.
ToolsConfig
TuiConfig
WebSearchConfig
[websearch] — which engine the websearch tool queries.
WebSearchCustomConfig
[websearch.custom] — a JSON search API mapped with JSON Pointers.

Enums§

ConfigTarget
The file Config::set_dotted writes.
HeadlessAskMode
Structured-run policy for permission ask (issue #122).
HookEvent
When a hook runs relative to a tool call.
McpTransportKind
How to reach an MCP server.
NotifyEvent
Lifecycle events that can fire a session notification.
SandboxFallback
What to do when the requested sandbox backend is missing.
SandboxMode
How aggressively shell commands are OS-sandboxed.
StreamRuleRepeat
repeat = "once" | "always" | { after_turns = N }.
StreamRuleScope
Streamed channel a stream rule watches.

Constants§

CONFIG_SCHEMA_VERSION
Current config.toml schema. 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. None when it has no frontmatter pattern.
project_slop_path
.whycodes/slop.toml next to project config.
stream_rule_files
Stream rules defined by files in the first whycodes_core::project_rule_dirs entry (.whycodes/rules/*.md), sorted by path.