Skip to main content

kintsugi_intercept/
lib.rs

1//! Kintsugi interception adapters.
2//!
3//! Three sources, one normalized event. Each adapter turns an agent's proposed
4//! command into a [`kintsugi_core::ProposedCommand`], sends it to the daemon, and
5//! enforces the returned [`kintsugi_core::Verdict`].
6
7#![forbid(unsafe_code)]
8
9pub mod dialect;
10pub mod holdcard;
11pub mod hook;
12pub mod mcp;
13pub mod shim;
14
15/// One trait, three impls (shim, hook, MCP). Each normalizes a source and runs.
16pub trait Adapter {
17    /// Stable name of the adapter, e.g. `"shim"`, `"claude-code"`, `"mcp"`.
18    fn name(&self) -> &'static str;
19    /// Run the adapter. Long-running for hook/MCP servers; one-shot for the shim.
20    fn run(&self) -> anyhow::Result<()>;
21}
22
23pub const VERSION: &str = env!("CARGO_PKG_VERSION");