agent-loop: Skald adapters behind the crate traits (phase 1)
New skald-core::loop_adapters module — implements the agent-loop trait
surface over existing infrastructure, unused by the current loop (wired
in phase 2):
- SqliteHistory: HistoryStore over chat_sessions_stack/chat_history/
chat_llm_tools/chat_summaries, no schema change; CallState maps 1:1 on
the existing status strings; wire call ids synthesized as tc_{id}
- SkaldSelector: ModelSelector over LlmManager with the agent's strength
captured per-turn (D14); DtlMode → ToolRendering mapping (D15)
- SkaldActivationSource + SkaldToolActivator: DTL catalog + persistence
(activated_tools, anchored at the triggering message) behind the
crate's protocol traits; unifies the grants/persistence split
- ApprovalGate: port of run_approval_gate (pre-approved, engine, fs
fast-path, auto-deny, AwaitingHuman + block on human); a closed human
channel maps to the new GateDecision::Suspend in agent-loop
- SkaldToolSet + CoreToolBridge/McpToolBridge: core-api and MCP tools
run inside the crate's kernel (execution bridged, execute_cmd keeps
its teardown; D7 MarkInterrupted for shell)
- agent-loop: re-export async_trait at root; EventSink::new made public
17 adapter tests green (temp-DB integration); full workspace suite green
(pre-existing honcho-client doc-test failure untouched: missing dev-deps).
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
//! Skald-side adapters implementing the `agent-loop` trait surface over the
|
||||
//! existing infrastructure (blueprint §14 phase 1). **Unused by the current
|
||||
//! loop** — they compile and are unit-tested here, and get wired in phase 2.
|
||||
//!
|
||||
//! - [`history::SqliteHistory`] — `HistoryStore` over the existing
|
||||
//! `chat_sessions_stack` / `chat_history` / `chat_llm_tools` / `chat_summaries`
|
||||
//! tables (no migration, §0).
|
||||
//! - [`selector::SkaldSelector`] — `ModelSelector` over `LlmManager`, with the
|
||||
//! agent's strength captured per-turn (D14).
|
||||
//! - [`gate::ApprovalGate`] — `Gate` over `ApprovalManager` + the RunContext
|
||||
//! fast-path + auto-deny + pre-approved (port of `handler/gate.rs`).
|
||||
//! - [`toolset::SkaldToolSet`] — `ToolSet` over base/config defs + MCP grants +
|
||||
//! memory/image/interface tools, with DTL rendering (port of
|
||||
//! `AgentRunConfig::all_tool_defs`), plus the core-api→agent-loop tool bridge.
|
||||
//! - [`activation`] — `ActivationSource` + `ToolActivator` over the
|
||||
//! `activated_tools` table and the MCP provider (D15).
|
||||
|
||||
pub mod activation;
|
||||
pub mod gate;
|
||||
pub mod history;
|
||||
pub mod selector;
|
||||
pub mod toolset;
|
||||
Reference in New Issue
Block a user