pub struct ClaudeHandler { /* private fields */ }Expand description
Starts and resumes Claude Code streams for AI6 Agent Runs.
Trait Implementations§
Source§impl AgentHandler for ClaudeHandler
impl AgentHandler for ClaudeHandler
Source§fn usage_support(&self) -> Result<UsageSupport, ProviderError>
fn usage_support(&self) -> Result<UsageSupport, ProviderError>
Claude Code states its usage only in a turn’s events: a result carries the process’s
running spend and a rate_limit_event a window. Nothing reads it between turns, so a
Station keeps a timed retry for a limited account instead of polling.
Source§fn stdio(&self) -> Result<HarnessStdio, ProviderError>
fn stdio(&self) -> Result<HarnessStdio, ProviderError>
Claude Code with -p and stream-json reads JSON lines from standard input, which must not
be a terminal: on one it exits at once.
Source§fn session_commands(&self) -> Result<SessionCommands, ProviderError>
fn session_commands(&self) -> Result<SessionCommands, ProviderError>
/compact and /clear are slash commands Claude Code runs as user turns in stream-json
input, in the process that holds the conversation.
Source§fn loadout_support(&self) -> Result<LoadoutSupport, ProviderError>
fn loadout_support(&self) -> Result<LoadoutSupport, ProviderError>
Claude Code takes stdio MCP servers (--mcp-config) and filters a server’s tools by rule; its
sandbox, where one runs (macOS, Linux and WSL2 with bwrap and socat), limits the commands
a Run starts to the profile’s writes and hosts.
Source§fn image_input(&self) -> Result<Option<String>, ProviderError>
fn image_input(&self) -> Result<Option<String>, ProviderError>
stream-json’s user message takes base64 image blocks beside its text.
Source§fn run_record(
&self,
query: RunRecordQuery,
) -> Result<Option<RunRecordFile>, ProviderError>
fn run_record( &self, query: RunRecordQuery, ) -> Result<Option<RunRecordFile>, ProviderError>
Claude Code keeps each Run as projects/<directory>/<run>.jsonl under its
configuration directory (CLAUDE_CONFIG_DIR, else ~/.claude), one JSON object per
line.
Source§fn assistant_scripts(
&self,
environment: BTreeMap<String, String>,
) -> Result<Option<String>, ProviderError>
fn assistant_scripts( &self, environment: BTreeMap<String, String>, ) -> Result<Option<String>, ProviderError>
Claude Code’s sandbox runs on macOS (Seatbelt, built in) and on Linux and WSL2 with
bwrap and socat on the harness’s PATH; on native Windows it runs commands
unsandboxed (code.claude.com/docs/en/sandboxing). WSL1 passes this check and is caught
by failIfUnavailable, which makes Claude Code exit at start.
Source§fn assistant_network(&self) -> Result<Option<String>, ProviderError>
fn assistant_network(&self) -> Result<Option<String>, ProviderError>
An assistant’s web tools are offered only to the hosts its network lists, and its scripts run in the sandbox with those hosts and no other.
Source§fn assistant_skills(&self) -> Result<Option<String>, ProviderError>
fn assistant_skills(&self) -> Result<Option<String>, ProviderError>
Under --restricted, Claude Code 2.1.311 loads skills only from a --plugin-dir
plugin, which holds exactly the assistant’s.
Source§fn weakenings(&self) -> Result<Vec<String>, ProviderError>
fn weakenings(&self) -> Result<Vec<String>, ProviderError>
Each rule of allowed_tools that a default list does not hold. A rule the settings deny as
well allows nothing, so it is not one. A rule for what only desk keeps out is one however
the Agent is configured, since any Agent can come to work at desk.
Source§fn start_options(
&self,
environment: BTreeMap<String, String>,
) -> Result<StartOptions, ProviderError>
fn start_options( &self, environment: BTreeMap<String, String>, ) -> Result<StartOptions, ProviderError>
Claude Code answers an initialize control request with the models its account may
pick (models[].value, displayName, resolvedModel, the efforts each takes), before
any model turn and with no network. The list follows the kind of login the environment
gives it (an API key, a subscription, a gateway), not a check of the account’s standing.
Its efforts and permission modes are what its command line takes; it has no other
option to choose and no command that lists its sessions, so those are not supported.
Source§fn read_only_refusal(&self) -> Result<Option<String>, ProviderError>
fn read_only_refusal(&self) -> Result<Option<String>, ProviderError>
READ_CLEARANCE and then
give it the Mission’s tools on a resume of the same Run, in a sentence; None when it
can. The default: it cannot say it can, so a Mission whose plan is reviewed does not start
on it.Source§fn program(&self) -> Result<Option<String>, ProviderError>
fn program(&self) -> Result<Option<String>, ProviderError>
PATH or a
path, so a Station can say a harness cannot be found before it asks a terminal to start
it. The default: None, and the Station does not look.Source§fn start(
&self,
request: AgentStart,
terminal: Object<dyn AgentTerminal>,
) -> Result<Object<dyn AgentSession>, ProviderError>
fn start( &self, request: AgentStart, terminal: Object<dyn AgentTerminal>, ) -> Result<Object<dyn AgentSession>, ProviderError>
Source§fn resume(
&self,
request: AgentResume,
terminal: Object<dyn AgentTerminal>,
) -> Result<Object<dyn AgentSession>, ProviderError>
fn resume( &self, request: AgentResume, terminal: Object<dyn AgentTerminal>, ) -> Result<Object<dyn AgentSession>, ProviderError>
Source§fn clearance_refusal(
&self,
clearance: String,
) -> Result<Option<String>, ProviderError>
fn clearance_refusal( &self, clearance: String, ) -> Result<Option<String>, ProviderError>
clearance, in a
sentence; None when it holds such a Run to what the clearance promises. A route of
an Agent that would be refused is passed over. The default: it can hold any.Source§fn usage(
&self,
environment: BTreeMap<String, String>,
) -> Result<UsageReport, ProviderError>
fn usage( &self, environment: BTreeMap<String, String>, ) -> Result<UsageReport, ProviderError>
environment (the variables a Run would start with),
read with no model turn. The report holds the account’s buckets, each with the models it
covers, how much is used and when it refills; a handler never puts a credential from
environment in it. The default: this handler reports no usage.