Skip to main content

Crate alwith_api

Crate alwith_api 

Source
Expand description

ALwith’s app-side Rust: the types of the alwith-runtime-v1 protocol (always present) and the client (feature client, on by default). Protocol definitions are exported from the Runtime binary; Runtime never depends on this client crate.

Modules§

process
Platform details for spawning child processes (hiding the console on Windows, etc.), shared by module subprocesses and the host. Platform details for spawning child processes: no console window pops up on Windows spawn. The client spawning Runtime and modules spawning their own child processes both use it; it is a no-op on non-Windows, so call sites need no #[cfg(windows)].

Structs§

AgentMetadata
AttachInfo
PendingAgentRequest
Agent requests still unanswered at attach time (session/request_permission etc.); the new owner answers them with acpRespond using the same id.
ResponseError
The error in a response frame, in JSON-RPC shape. Runtime’s own errors use the codes below; ACP errors returned by the agent (acpRequest etc.) pass through unchanged, code/data come from the agent.
RuntimeClient
SessionEventFrame
One frame in the journal. line is the raw ACP JSON-RPC text (before the Runtime envelope).
SessionLifecycleFrame
SessionRunState
SessionTask

Enums§

ClientEvent
An event frame coming from Runtime. Protocol events are decoded as RuntimeEvent; host extension events go to Other.
FrameDirection
RunState
Session run state. The first three are values of ACP v2 StateUpdate directly (reported by the agent, no longer derived by Runtime from traffic); Done is a product state we synthesize ourselves: the protocol has no notion of “finished but unseen”. It = idle + unread, synthesized by upsert_run_state on a running/done -> idle transition and consumed only by markRead.
RuntimeEvent

Type Aliases§

RequestHandler
The answer to cliStatus. How to answer requests coming from the peer (Runtime): a module subprocess uses it to serve calls forwarded from modules/<name>/<method>.