adk_kernel/agents/mod.rs
1//! Agents a person adds (spec 3.3 §5.7, §10 K7): by asking or by hand, kept by the kernel,
2//! hosted beside the primary agent, and changed, paused or removed from the web home and the
3//! terminal.
4//!
5//! | Item | Spec |
6//! |---|---|
7//! | [`AgentRecord`], [`AgentDefinition`], [`AgentRecordState`], [`AgentOrigin`], [`AvatarColor`], [`ModelChoice`], [`AgentUses`], [`FileAccess`], [`ShellAccess`], [`WebAccess`], [`agent_id_for`], [`check_agent_id`] | §5.7 "The definition", "Its identity" |
8//! | [`AgentStore`], [`InMemoryAgentStore`](crate::stores::InMemoryAgentStore), `SqliteAgentStore`, `PostgresAgentStore`, `RedisAgentStore`, `MongoAgentStore`, `FirestoreAgentStore`, `Neo4jAgentStore` | §5.7 "Where it lives", K7 |
9//! | [`AgentFactory`], [`AgentAssessment`], [`AgentCeiling`], [`AgentChoices`], [`HostedAgent`], [`HostedClose`] | §5.7 "How an added agent runs", K7 |
10//! | [`AgentCaller`], [`Presence`] | §5.7, §7.2, S-I18 |
11//! | [`AGENT_CREATE_TOOL_NAME`] | §5.7 "The decision that adds an agent" |
12//! | [`AgentAction`], [`AgentPreview`], [`EndedWork`], [`AgentChange`], [`AgentView`] | §5.7 "Changing an agent", "Pausing and removing" |
13//! | [`Agents`], [`AgentsHandle`], [`AgentProposer`], [`AgentProposal`], [`AgentOutcome`], [`suggestion_request_id`] | §5.7, K7 |
14//! | [`kernel_assessment`], [`area_limits`], [`over_ceiling`], [`changed_fields`], [`widened`] | §5.7 "Risk", S-I12 |
15//!
16//! The kernel keeps every agent in its [`AgentStore`] and changes it only through its agent
17//! table, which records each change before it acts (S-I17, S-I18). Agent definitions are
18//! never read from workspace files, a watched directory or `adk-server`'s agent registry.
19
20mod caller;
21mod change;
22mod check;
23mod factory;
24mod record;
25mod store;
26mod table;
27mod targets;
28
29pub use caller::{AgentCaller, Presence};
30pub use change::{AgentAction, AgentChange, AgentPreview, AgentView, EndedWork};
31pub use check::{
32 MONEY_PACKS, area_limits, changed_fields, kernel_assessment, over_ceiling, widened,
33};
34pub use factory::{
35 AgentAssessment, AgentCeiling, AgentChoices, AgentFactory, HostedAgent, HostedClose,
36};
37pub use record::{
38 AgentDefinition, AgentOrigin, AgentRecord, AgentRecordState, AgentUses, AvatarColor,
39 FALLBACK_AGENT_ID, FileAccess, MAX_AGENT_DESCRIPTION_LEN, MAX_AGENT_ID_LEN,
40 MAX_AGENT_INSTRUCTIONS_LEN, MAX_AGENT_NAME_LEN, ModelChoice, RESERVED_AGENT_IDS,
41 RESERVED_AGENT_NAME, ShellAccess, WebAccess, agent_id_for, check_agent_id,
42};
43pub use store::AgentStore;
44pub(crate) use table::AgentsParts;
45pub use table::{
46 AgentOutcome, AgentProposal, AgentProposer, Agents, AgentsHandle, MAX_OPEN_SUGGESTIONS,
47 suggestion_request_id,
48};
49pub(crate) use targets::Targets;
50
51/// The tool name of the inbox request that suggests an agent (spec 3.3 §5.7): a person
52/// approves it as "Add this agent" or refuses it as "Don't add"; no standing rule, mode,
53/// routine, chat or voice answers it yes (S-I11).
54///
55/// # Example
56///
57/// ```rust
58/// assert_eq!(adk_kernel::agents::AGENT_CREATE_TOOL_NAME, "kernel:agent.create");
59/// ```
60pub const AGENT_CREATE_TOOL_NAME: &str = "kernel:agent.create";