session
Opaque handle to an active session.
resource session;F prompt
prompt: async func(prompt: list<content-block>) -> result<prompt-response, error>;Run a prompt turn to completion. Resolves with the
terminal prompt-response when the turn ends. Intermediate
session-updates are emitted via client.notify-session
during the call.
To cancel, drop the future (or use the host's cancel
machinery); the agent MUST resolve with
stop-reason::cancelled.
F set-mode
set-mode: async func(mode-id: session-mode-id) -> result<_, error>;Switch the active mode for this session. The mode-id MUST
be one of the modes returned in the session's lifecycle
response.
F select-model
select-model: async func(model-id: session-model-id) -> result<_, error>;Switch the active model for this session. UNSTABLE.
The model-id MUST be one of the models returned in the
session's lifecycle response.
F set-config-option
set-config-option: async func(config-id: session-config-id, value: session-config-value-id) -> result<list<session-config-option>, error>;Set a configuration option (model / mode / thought-level) for
this session. The config-id and value MUST come from the
option set advertised in the session's lifecycle response.
Returns the full updated option set (mirroring the ACP
session/set_config_option response).
See: https://agentclientprotocol.com/protocol/session-config