Skip to main content

ShellBuilder

Struct ShellBuilder 

Source
pub struct ShellBuilder<I, L, O, W, T> { /* private fields */ }
Expand description

Builds a Shell on the Sandbox its scripts run in.

The interpreters, limits, output policy, wording and tool identities have no defaults: build exists once every one is given.

Implementations§

Source§

impl<I, L, O, W, T> ShellBuilder<I, L, O, W, T>

Source

pub fn ipc(self, provider: impl IpcProvider) -> Self

Lets every script of the shell, and of the subagent shells it launches, call the commands provider serves back on the host. The provider is asked once per process the shell starts on the host or in a container. A process on an SSH server has no way back to this machine, so the shell asks for none there. Without a provider no script reaches a command of the embedder.

Source

pub fn policy(self, policy: impl ScriptPolicy) -> Self

Puts every script to policy, after the policies given before it. Each agent’s shell gets state of its own from the policy’s definition, see ScriptPolicies::for_agent.

Source

pub fn treat_output(self, treat: impl TreatOutput) -> Self

Lets treat choose, before each script of the shell and of the subagent shells it launches runs, whether its output reaches the model verbatim or cleaned as command output; it replaces one given before. Without it every script’s output is cleaned as command output, see OutputTreatment.

Source

pub fn events(self, events: ShellEvents) -> Self

Raises the shell’s events, and those of the subagent shells it launches, on events, which other shells may share. Without it the shell has a handle of its own, read with Shell::events.

Source

pub fn interpreters( self, interpreters: impl IntoIterator<Item = Interpreter>, ) -> ShellBuilder<Given<Vec<Interpreter>>, L, O, W, T>

The interpreters a script may run under, and the ones the model’s interpreter argument lists.

Source

pub fn limits( self, limits: ShellLimits, ) -> ShellBuilder<I, Given<ShellLimits>, O, W, T>

The time bounds of every script.

Source

pub fn output( self, output: OutputPolicy, ) -> ShellBuilder<I, L, Given<OutputPolicy>, W, T>

The budgets of what a script’s output returns inline.

Source

pub fn wording( self, wording: impl ShellWording, ) -> ShellBuilder<I, L, O, Given<AnyShellWording>, T>

What words every text the model reads.

Source

pub fn tools( self, tools: ShellToolSettings, ) -> ShellBuilder<I, L, O, W, Given<ShellToolSettings>>

What the shell tool and the job control tools are named and described as.

Source§

impl ShellBuilder<Given<Vec<Interpreter>>, Given<ShellLimits>, Given<OutputPolicy>, Given<AnyShellWording>, Given<ShellToolSettings>>

Source

pub async fn build(self) -> Result<Shell<Arc<AnyExecutor>>, TerminalError>

Builds the shell.

§Errors

Returns an error when the working directory or the output store cannot be created, when the sandbox runs its processes on an SSH server (a server is a location a script names, not a shell’s home), or when the constructor does not fit the sandbox’s backend: a host sandbox built with Shell::builder, or a container sandbox built with Shell::builder_on_host.

Trait Implementations§

Source§

impl<I: Debug, L: Debug, O: Debug, W: Debug, T: Debug> Debug for ShellBuilder<I, L, O, W, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<I, L, O, W, T> !RefUnwindSafe for ShellBuilder<I, L, O, W, T>

§

impl<I, L, O, W, T> !Unpin for ShellBuilder<I, L, O, W, T>

§

impl<I, L, O, W, T> !UnsafeUnpin for ShellBuilder<I, L, O, W, T>

§

impl<I, L, O, W, T> !UnwindSafe for ShellBuilder<I, L, O, W, T>

§

impl<I, L, O, W, T> Forget for ShellBuilder<I, L, O, W, T>

§

impl<I, L, O, W, T> Freeze for ShellBuilder<I, L, O, W, T>
where I: Freeze, L: Freeze, O: Freeze, W: Freeze, T: Freeze,

§

impl<I, L, O, W, T> Move for ShellBuilder<I, L, O, W, T>

§

impl<I, L, O, W, T> Send for ShellBuilder<I, L, O, W, T>
where I: Send, L: Send, O: Send, W: Send, T: Send,

§

impl<I, L, O, W, T> Sync for ShellBuilder<I, L, O, W, T>
where I: Sync, L: Sync, O: Sync, W: Sync, T: Sync,

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
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
Source§

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

Source§

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.

Source§

impl<T> Instrument for T

Source§

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

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

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

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

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