Skip to main content

Module session

Module session 

Source
Expand description

Agent sessions (ACP) methods + supporting types.

Ported from packages/core/src/agent-os.ts (session methods) and agent-session-types.ts (session/mode/config/capability/permission types). Agent types are resolved dynamically from the configured /opt/agentos package manifests (keyed by manifest name), exactly as the TS client does — there is no hardcoded agent registry.

ACP = JSON-RPC 2.0 over stdio. Sessions are referenced by string ID and return JSON-serializable data only. JSON-RPC errors are NOT Rust Err; methods that issue requests return a JsonRpcResponse whose error field may be set.

Structs§

AgentCapabilities
Agent capabilities (all optional booleans + prompt capabilities + extras).
AgentExitEvent
An unexpected ACP adapter process exit — a crash from the host’s perspective (any spontaneous exit without close_session, including exit code 0) — plus the sidecar’s bounded auto-restart outcome. Mirrors the wire AcpAgentExitedEvent and the TS AgentExitEvent.
AgentInfo
Agent info ({ name; title?; version?; [k]: unknown }).
AgentRegistryEntry
A registry agent entry from list_agents. Mirrors the TS AgentRegistryEntry. The client is npm-agnostic and parses no manifests: list_agents is a sidecar ACP RPC that enumerates the projected /opt/agentos packages. The entry is just the agent id; installed is always true (the package is materialized into the VM at boot).
ConfigAllowedValue
An allowed value for a config option.
CreateSessionOptions
Options for create_session.
PermissionRequest
A permission request delivered to a subscriber. Carries a Clone-able one-shot responder.
PermissionResponder
A Clone-able one-shot responder for a permission request.
PromptCapabilities
Prompt capabilities sub-object.
PromptResult
Result of prompt.
ResumeSessionOptions
Options for resume_session. Mirrors the durability-dependent fields the sidecar fallback tier needs to re-launch the adapter, plus the transcript pointer.
ResumeSessionResult
Result of resume_session. session_id is the live ACP session id in the fresh VM: equal to the requested id for native loads, or a freshly assigned id for the fallback tier — the caller (e.g. the actor) remaps external -> live. mode is "native" or "fallback".
SessionConfigOption
A session config option.
SessionId
The id returned by create_session.
SessionInfo
In-memory session registry entry summary.
SessionInitData
Initial hydration data for a session.
SessionMode
A single session mode ({ id; name?; label?; description?; [k]: unknown }).
SessionModeState
Session mode state ({ currentModeId; availableModes }).

Enums§

McpServerConfig
MCP server config used by create_session.
PermissionReply
A permission reply.

Type Aliases§

AgentExitStream
AgentExitSubscription
PermissionRequestStream
PermissionRequestSubscription
SessionEventStream
SessionEventSubscription