Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion rust/contracts/rust-core-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,13 @@ or removing a command fails until the table changes in the same commit.
| `agentSessions.stats` | Sum recorded agent usage with the latest rate limits; `groupBy: "hour"` returns sparse `{kind: "hour", startMs}` keys aligned to the fixed UTC offset or optional `hourAnchorMs` |
| `agentSessions.calls` | List a page of recorded agent calls, most recent first, with their cost, cache hit rate and speed |
| `agentLibrary.configure` | Open the agent library in the platform's application data |
| `agentLibrary.read` | Read the library and what each configurable agent's instructions, skills, MCP servers and hooks hold |
| `agentLibrary.read` | Read the library and what each configurable agent's instructions, skills, MCP servers and hooks hold; optional `query`, `agent` with `presence`, and `sort` add the keys of the matching items as `matches` |
| `agentLibrary.save` | Replace the library the user edited if it is still at the revision read |
| `agentLibrary.apply` | Apply one library change the user chose to one agent's configuration |
| `agentLibrary.importSkill` | Copy a skill from an agent or a directory the user chose into the library |
| `agentLibrary.removeSkill` | Remove a library skill and its links from agents |
| `agentProviders.read` | Read each agent's model, model providers, profiles and account label through its plugin, with secrets reported as variable names only |
| `agentProviders.apply` | Apply one model, provider or profile change the plugin declares, through a checked staged copy of the agent's file |
| `plugins.declarative.validate` | Validate and normalize a declarative plugin manifest |
| `plugins.ui.applyResult` | Check a backend result for a plugin view and return the whole view to draw |
| `plugins.web.open` | Register a plugin page for a web tool window |
Expand Down
11 changes: 9 additions & 2 deletions rust/crates/agent-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
//! Core knows no agent: every agent-specific name, argument, protocol and file
//! layout comes from a plugin manifest and its backend.
//!
//! The host drives the runtime with three command families. `agents.*`
//! The host drives the runtime with four command families. `agents.*`
//! covers the catalog of declared agents and the live sessions;
//! `agentSessions.*` covers the local session records; `agentLibrary.*`
//! covers Lithe's library of MCP servers, hooks, skills and instructions and
//! applies them to the agents' own configuration (the `library` module). Backends reach it with
//! applies them to the agents' own configuration (the `library` module);
//! `agentProviders.*` reads and changes an agent's model, model providers
//! and profiles through the same staged copy. Backends reach it with
//! `lithe/host/agents/*` requests, which the engine hands to the installed
//! [`AgentHost`] and which never reach the host application.
//!
Expand Down Expand Up @@ -99,6 +101,9 @@ pub const AGENT_LIBRARY_COMMANDS: &[&str] = &[
"agentLibrary.removeSkill",
];

/// The commands of the `agentProviders.*` family.
pub const AGENT_PROVIDER_COMMANDS: &[&str] = &["agentProviders.read", "agentProviders.apply"];

/// The agent catalog, the live sessions, the session records and the
/// agent library.
pub(crate) struct Runtime {
Expand Down Expand Up @@ -162,6 +167,8 @@ impl Runtime {
"agentLibrary.apply" => self.library.apply(self, payload),
"agentLibrary.importSkill" => self.library.import_skill(self, payload),
"agentLibrary.removeSkill" => self.library.remove_skill(self, payload),
"agentProviders.read" => self.library.read_providers(self, payload),
"agentProviders.apply" => self.library.apply_providers(self, payload),
_ => Err(CoreError::new(
ErrorCode::NotSupported,
format!("Unknown agent command {command}."),
Expand Down
Loading
Loading