Skip to main content

ClaudeHandler

Struct ClaudeHandler 

Source
pub struct ClaudeHandler { /* private fields */ }
Expand description

Starts and resumes Claude Code streams for AI6 Agent Runs.

Trait Implementations§

Source§

impl AgentHandler for ClaudeHandler

Source§

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>

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>

/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>

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>

stream-json’s user message takes base64 image blocks beside its text.

Source§

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>

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>

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>

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>

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>

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>

Why this handler cannot hold a Mission’s Run to reading at 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>

The program the harness is started as, a name looked up on the Run’s 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>

Starts an Agent Run with context established before its task prompt. Read more
Source§

fn resume( &self, request: AgentResume, terminal: Object<dyn AgentTerminal>, ) -> Result<Object<dyn AgentSession>, ProviderError>

Reattaches to the same provider ID after an interruption.
Source§

fn clearance_refusal( &self, clearance: String, ) -> Result<Option<String>, ProviderError>

Why this handler, with its settings, would refuse a Mission’s Run at 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>

The usage of the account behind 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.
Source§

impl ProviderDecl for ClaudeHandler

Source§

const KINDS: &'static [&'static str]

The name of every kind this provider serves, so a library can declare them at compile time.
Source§

fn provider(host: Host, alloc: Alloc) -> Result<ProviderParts, ValueError>

Builds this provider’s descriptor, its tables and its configuration schema, once. host is what the library was loaded by; alloc is what the schema is built through.
Source§

impl TryFrom<ClaudeConfig> for ClaudeHandler

Source§

type Error = ProviderError

The type returned in the event of a conversion error.
Source§

fn try_from(config: ClaudeConfig) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoMaybeUndefined<T> for T

§

fn into_maybe_undefined(self) -> MaybeUndefined<T>

Converts this value into a three-state builder argument.
§

impl<T> IntoOption<T> for T

§

fn into_option(self) -> Option<T>

Converts this value into an optional builder argument.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more