Resource

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.

See: https://agentclientprotocol.com/protocol/prompt-turn

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.