Final review fixes: - docs/ARCHITECTURE.md: add kebab-mcp to UI subgraph + directory tree (CLAUDE.md "add new crate" rule required this; missed in Task 12 doc sync). - state.rs: replace forward-reference Task 10 comment with current-state doc (config_path now wired by Task 10 commit4a30959). - tools_call_schema.rs: assert capabilities.mcp_server == true (already pinned in schema_report + cli_schema, this closes the gap in mcp's own test). Version bump 0.3.0 → 0.4.0 deferred to separate `chore/bump-v0.4.0` PR mirroring fb-27 precedent (commit73f5d73/ PR #105). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
27 lines
731 B
Rust
27 lines
731 B
Rust
//! Long-lived server state — holds Config so per-request handlers don't
|
|
//! reload from disk. Future: cache opened SqliteStore / Lance handles
|
|
//! here so first tool call pays the cost, subsequent calls hit warm
|
|
//! state.
|
|
|
|
use std::path::PathBuf;
|
|
use std::sync::Arc;
|
|
|
|
use kebab_config::Config;
|
|
|
|
#[derive(Clone)]
|
|
pub struct KebabAppState {
|
|
pub config: Arc<Config>,
|
|
/// `--config <path>` from CLI when present, else `None` (XDG default
|
|
/// fallback applies in `doctor_with_config_path`).
|
|
pub config_path: Option<PathBuf>,
|
|
}
|
|
|
|
impl KebabAppState {
|
|
pub fn new(config: Config, config_path: Option<PathBuf>) -> Self {
|
|
Self {
|
|
config: Arc::new(config),
|
|
config_path,
|
|
}
|
|
}
|
|
}
|