pub struct ShellBuilder<I, L, O, W, T> { /* private fields */ }Expand description
Implementations§
Source§impl<I, L, O, W, T> ShellBuilder<I, L, O, W, T>
impl<I, L, O, W, T> ShellBuilder<I, L, O, W, T>
Sourcepub fn ipc(self, provider: impl IpcProvider) -> Self
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.
Sourcepub fn policy(self, policy: impl ScriptPolicy) -> Self
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.
Sourcepub fn treat_output(self, treat: impl TreatOutput) -> Self
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.
Sourcepub fn events(self, events: ShellEvents) -> Self
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.
Sourcepub fn interpreters(
self,
interpreters: impl IntoIterator<Item = Interpreter>,
) -> ShellBuilder<Given<Vec<Interpreter>>, L, O, W, T>
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.
Sourcepub fn limits(
self,
limits: ShellLimits,
) -> ShellBuilder<I, Given<ShellLimits>, O, W, T>
pub fn limits( self, limits: ShellLimits, ) -> ShellBuilder<I, Given<ShellLimits>, O, W, T>
The time bounds of every script.
Sourcepub fn output(
self,
output: OutputPolicy,
) -> ShellBuilder<I, L, Given<OutputPolicy>, W, T>
pub fn output( self, output: OutputPolicy, ) -> ShellBuilder<I, L, Given<OutputPolicy>, W, T>
The budgets of what a script’s output returns inline.
Sourcepub fn wording(
self,
wording: impl ShellWording,
) -> ShellBuilder<I, L, O, Given<AnyShellWording>, T>
pub fn wording( self, wording: impl ShellWording, ) -> ShellBuilder<I, L, O, Given<AnyShellWording>, T>
What words every text the model reads.
Sourcepub fn tools(
self,
tools: ShellToolSettings,
) -> ShellBuilder<I, L, O, W, Given<ShellToolSettings>>
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>>
impl ShellBuilder<Given<Vec<Interpreter>>, Given<ShellLimits>, Given<OutputPolicy>, Given<AnyShellWording>, Given<ShellToolSettings>>
Sourcepub async fn build(self) -> Result<Shell<Arc<AnyExecutor>>, TerminalError>
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§
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>
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>
impl<I, L, O, W, T> Sync for ShellBuilder<I, L, O, W, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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