Skip to main content

Module agents

Module agents 

Source
Expand description

Agents a person adds (spec 3.3 §5.7, §10 K7): by asking or by hand, kept by the kernel, hosted beside the primary agent, and changed, paused or removed from the web home and the terminal.

ItemSpec
AgentRecord, AgentDefinition, AgentRecordState, AgentOrigin, AvatarColor, ModelChoice, AgentUses, FileAccess, ShellAccess, WebAccess, agent_id_for, check_agent_id§5.7 “The definition”, “Its identity”
AgentStore, InMemoryAgentStore, SqliteAgentStore, PostgresAgentStore, RedisAgentStore, MongoAgentStore, FirestoreAgentStore, Neo4jAgentStore§5.7 “Where it lives”, K7
AgentFactory, AgentAssessment, AgentCeiling, AgentChoices, HostedAgent, HostedClose§5.7 “How an added agent runs”, K7
AgentCaller, Presence§5.7, §7.2, S-I18
AGENT_CREATE_TOOL_NAME§5.7 “The decision that adds an agent”
AgentAction, AgentPreview, EndedWork, AgentChange, AgentView§5.7 “Changing an agent”, “Pausing and removing”
Agents, AgentsHandle, AgentProposer, AgentProposal, AgentOutcome, suggestion_request_id§5.7, K7
kernel_assessment, area_limits, over_ceiling, changed_fields, widened§5.7 “Risk”, S-I12

The kernel keeps every agent in its AgentStore and changes it only through its agent table, which records each change before it acts (S-I17, S-I18). Agent definitions are never read from workspace files, a watched directory or adk-server’s agent registry.

Structs§

AgentAssessment
What an agent definition lets it do, as a factory or the kernel assesses it (spec 3.3 §5.7): the risk of adding it, whether it can spend money, and its abilities in plain sentences.
AgentCaller
The caller of the agent table (spec 3.3 §5.7, S-I18): who, from which surface and how, through which device and transport, with what presence, and the calling process where the operating system reports it. Every kernel.agent.* record carries these.
AgentCeiling
The most a suggesting agent may give an agent it suggests: its own limits now (spec 3.3 §5.7, S-I12).
AgentChoices
What a person may choose for an agent on this host (spec 3.3 §5.7, decision 21): the models of every provider whose key the host has, and the packs it can give.
AgentDefinition
What a person defines when they add an agent (spec 3.3 §5.7): every field a decision shows and the digest binds, and nothing the kernel keeps about its life.
AgentPreview
What a change would do, shown before it is applied (spec 3.3 §5.7): the agent’s abilities and risk as it would be, what the change touches, and the digest that confirms it.
AgentProposal
A suggestion the table keeps (spec 3.3 §5.7): the suggested agent and its inbox request.
AgentProposer
The agent that suggests an agent, and where (spec 3.3 §5.7): propose_agent’s caller.
AgentRecord
An agent the kernel keeps (spec 3.3 §5.7, §10 K7): its definition, beside its id, state, how it was added, who added and approved it, when, a version per change and the digest of its definition.
AgentUses
What an agent can use (spec 3.3 §5.7): files in its area’s workspace or one folder inside it, a shell, the web, packs, and drivers mounted for its area. Adding an agent never mounts a driver (K-I13).
AgentView
An agent as the table lists it (spec 3.3 §5.7): its record, and why the host cannot build it when it cannot (“Can’t start”).
Agents
The kernel’s audited agent table (spec 3.3 §5.7, §10 K7), from Kernel::agents: the one front door for adding, changing, pausing and removing the agents a person adds, whichever surface asks.
AgentsHandle
A handle on a kernel’s agent table that does not keep the kernel alive, bound when the kernel is built (spec 3.3 §10 K7): the harness’s propose_agent tool exists before the kernel that hosts it, as propose_followup’s AgendaHandle does.
EndedWork
What removing an agent ends, named before it happens and recorded when it has (spec 3.3 §5.7, S-I16).
HostedAgent
An agent a factory built: its runner, and the progress source its harness reports usage, goal progress and loop-guard verdicts through (spec 3.3 §5.7). The kernel attaches the source when it hosts the agent, so the agent’s spending reaches its own processes.
ModelChoice
The provider and model an agent runs on (spec 3.3 §5.7, decision 21). Never a key: keys stay in the kernel’s environment.

Enums§

AgentAction
A change a person asks the agent table for (spec 3.3 §5.7). Every change is previewed first and applied only with its preview’s digest.
AgentChange
What happened to an agent, as KernelEvent::Agent and the kernel.agent.* records name it (spec 3.3 §5.7, §10 K7).
AgentOrigin
How an agent was added (spec 3.3 §5.7).
AgentOutcome
What Agents::apply did.
AgentRecordState
Where an agent is in its life (spec 3.3 §5.7). Never named AgentState or AgentStatus, which adk-surface uses for a roster row.
AvatarColor
One of the eight avatar colours the surfaces draw an agent’s monogram in (spec 3.3 §5.7, §9), in the order of adk-surface’s avatar palette. The kernel keeps the name, never a colour value.
FileAccess
What an agent may do with files in its area’s workspace (spec 3.3 §5.7).
Presence
How sure the kernel is that the caller is the person at a screen (spec 3.3 §7.2).
ShellAccess
Whether an agent has a shell (spec 3.3 §5.7).
WebAccess
Which sites an agent may reach (spec 3.3 §5.7).

Constants§

AGENT_CREATE_TOOL_NAME
The tool name of the inbox request that suggests an agent (spec 3.3 §5.7): a person approves it as “Add this agent” or refuses it as “Don’t add”; no standing rule, mode, routine, chat or voice answers it yes (S-I11).
FALLBACK_AGENT_ID
The id an agent gets when its name has no letter or digit (spec 3.3 §5.7).
MAX_AGENT_DESCRIPTION_LEN
The longest “What it does” line, in characters.
MAX_AGENT_ID_LEN
The longest id the kernel gives an agent.
MAX_AGENT_INSTRUCTIONS_LEN
The longest instructions an agent may have, in characters.
MAX_AGENT_NAME_LEN
The longest name an agent may have, in characters (spec 3.3 §5.7).
MAX_OPEN_SUGGESTIONS
The most suggestions one agent may have waiting at once (spec 3.3 §5.7).
MONEY_PACKS
The packs that let an agent spend money (spec 3.3 §5.7): payments and computer use.
RESERVED_AGENT_IDS
Ids no added agent ever gets, beside any containing @ or . and the host’s own targets (spec 3.3 §5.7).
RESERVED_AGENT_NAME
The name no added agent may take beside the primary agent’s (spec 3.3 §5.7).

Traits§

AgentFactory
How a host builds the agents a person adds (spec 3.3 §5.7, §10 K7), registered with KernelBuilder::agent_factory beside the agent store. adk-rust up’s factory builds a harness agent with the composition the primary agent uses.
AgentStore
Where the kernel keeps the agents a person adds (spec 3.3 §5.7, §10 K7), beside the partition and driver stores, on every kernel backend, with one conformance suite (agent_store_conformance_tests!, feature conformance):
HostedClose
What a hosted agent holds beyond its runner, closed once the kernel stops serving that build of the agent: when a change replaced it, the agent was removed, or the kernel stops (spec 3.3 §5.7). A harness closes its toolsets, its container shell’s sessions and distils its sessions’ turns into long-term memory.

Functions§

agent_id_for
The id an agent named display_name gets (spec 3.3 §5.7, S-I14): its name in lowercase ASCII letters and digits joined by -, at most MAX_AGENT_ID_LEN characters, or FALLBACK_AGENT_ID when it has no letter or digit; then -2, -3, … while taken says the id was ever used or is reserved.
area_limits
Why definition exceeds its area (spec 3.3 §5.7): a mode looser than the area’s, a daily limit above the area’s, or a driver not mounted for it. Empty when it fits.
changed_fields
The definition fields now changes from was, by their wire names, sorted.
check_agent_id
Checks id against the id rules every added agent keeps (spec 3.3 §5.7): the pattern [a-z0-9][a-z0-9-]{0,39} and no reserved id (RESERVED_AGENT_IDS); @ and . never match the pattern. The host’s own targets are the agent table’s to check.
kernel_assessment
What the kernel itself knows of definition’s risk (spec 3.3 §5.7’s risk table), the floor under any factory’s assessment: its mode, files, shell, web and money packs; each of its drivers by the effect classes of its tools (drivers: id and classes; a driver with no class listed counts as undescribed); and a suggestion from work the person did not start at a screen, which is high (decision 20). Abilities name only the drivers; the factory words the rest.
over_ceiling
Why a suggested definition exceeds its suggester (spec 3.3 S-I12): what is over the suggester’s ceiling — its mode, uses and daily spending limit — and what a suggestion never carries — a shell on this computer, payments or computer use. Empty when it fits.
suggestion_request_id
The inbox request id of the suggestion record: agent-<id>-<12 hex>, the hex from its definition’s digest and the instant it was suggested, so a suggestion made again after a refusal freed its id gets a request of its own (spec 3.3 §5.7).
widened
What now lets an agent do that was did not (spec 3.3 §5.7): a looser mode, more uses, a higher or no daily limit. Empty when the change only makes it do less or the same; its name, colour, line, instructions and model never count.