pub struct ScriptToolSpec {
pub name: String,
pub description: String,
pub path: PathBuf,
pub allowed_tools: Option<Vec<String>>,
pub limits: ScriptToolLimits,
}Expand description
A sandboxed QuickJS tool parsed from a kind = "script" file. Names a
workspace-relative .js/.mjs source and pins the sandbox allow-list +
limits; the model supplies only inputs. Executed via the existing program
tool path — no new sandbox. The model’s call to it is permission-gated like any
tool; the script’s inner ctx.tool calls are bounded by allowed_tools + the
sandbox (NOT the session permission policy), so the allow-list is the boundary.
Fields§
§name: StringModel-visible tool name (registry key; unique within tools/).
description: StringModel-facing description (frontmatter description, else the file body).
path: PathBufWorkspace-relative path to the .js/.mjs source.
allowed_tools: Option<Vec<String>>Tools the script may call through ctx. The agent-dir loader fails closed:
an omitted list becomes Some(vec![]) (the script may call NO tools), so a
directory author must opt each tool in explicitly. program is always
excluded (no script-launches-script). This allow-list — not the session
permission policy — is what bounds a script’s inner ctx.tool calls, so it
is the security boundary for directory-authored scripts.
limits: ScriptToolLimitsSandbox limits (timeout / tool-call / output caps); defaults apply when unset.
Trait Implementations§
Source§impl Clone for ScriptToolSpec
impl Clone for ScriptToolSpec
Source§fn clone(&self) -> ScriptToolSpec
fn clone(&self) -> ScriptToolSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ScriptToolSpec
impl RefUnwindSafe for ScriptToolSpec
impl Send for ScriptToolSpec
impl Sync for ScriptToolSpec
impl Unpin for ScriptToolSpec
impl UnsafeUnpin for ScriptToolSpec
impl UnwindSafe for ScriptToolSpec
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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