Skip to main content

Module ctx_agent

Module ctx_agent 

Source

Structs§

MessageArgs
Arguments of the Hive message actions (send, reply, inbox).
PostFields
The Queen-network fields of a post (QN0): its kind (one of the fourteen Queen kinds, posted only by the registered Queen), the task it belongs to and its conversation.

Constants§

WAIT_DEFAULT_SECS
wait without timeout_secs, and its ceiling.
WAIT_MAX_SECS

Functions§

handle
A ctx_agent call. What Hive answered to this agent’s earlier lease requests (asked off the tool call) comes in front of the answer, except for read, whose answer is a delivery of its sources only.
handle_message
send: a typed message to the vault bus of the checkout. reply: answers a received message in its thread (type defaults to answer). inbox: the unread messages, Hive deliveries fenced as foreign data (lean_ctx_hive::bus::messages_v2).
handle_read
action=read with a typed outcome: Ok is the reply, Err is the text of a failed read — the same text handle answers. read is the one action of this tool that declares every source (CtxAgentTool::publishes_every_source), so its failure must reach the registered tool as a failure and never as a reply that could be recorded as a delivery of the sources captured before it failed.
handle_wait
The text of wait for the MCP tool: the messages, or the timeout line (after the renewal note, when there is one).
handle_with
handle with a post’s Queen-network fields.
read_messages_as
The unread messages of agent_id, oldest first and at most READ_PAGE_BYTES per call; only the ones shown are marked read. own_process: the call comes from the agent’s own session, which renews its lease (and revives an expired one); lean-ctx agent wait reads for it from another process.
register
register: register (or refresh) this process’s presence with role and name and answer exactly what was stored. A re-register on the same presence takes over the new role and name.
role_and_name
What register stores from the caller’s role and name: role is a role id (lean_ctx::core::agents::role_id), name the display name (a bounded single line). Free text given as role is never stored as a role; it becomes the display name when no name is given. The warnings say what was not taken as asked.
wait_messages
action=wait: block until a message for agent_id (to it or broadcast, not its own) is waiting in project_root, then answer exactly like read; Ok(None) after timeout_secs (default 600, at most 1800). own_process as in read_messages_as: the agent’s own session keeps its lease alive while it waits.
wait_timeout_line
The stable reply of a wait that saw no message.