pub struct SubagentTaskSpec { /* private fields */ }Expand description
Parent-authored specification for a bounded child agent task.
Implementations§
Source§impl SubagentTaskSpec
impl SubagentTaskSpec
Sourcepub fn new(
task: impl Into<String>,
max_model_turns: u32,
) -> Result<Self, SubagentError>
pub fn new( task: impl Into<String>, max_model_turns: u32, ) -> Result<Self, SubagentError>
Creates a child task specification from validated task text and model-turn bound.
Sourcepub fn with_max_model_turns_explicit(self, explicit: bool) -> Self
pub fn with_max_model_turns_explicit(self, explicit: bool) -> Self
Marks whether max_model_turns was explicitly requested by the parent
(as opposed to filled from the runtime default).
Sourcepub const fn max_model_turns_is_explicit(&self) -> bool
pub const fn max_model_turns_is_explicit(&self) -> bool
Returns true when the parent explicitly requested max_model_turns.
Sourcepub const fn max_total_tokens(&self) -> Option<u64>
pub const fn max_total_tokens(&self) -> Option<u64>
Returns the optional cumulative token circuit breaker for this task.
Sourcepub fn with_max_total_tokens(self, max_total_tokens: Option<u64>) -> Self
pub fn with_max_total_tokens(self, max_total_tokens: Option<u64>) -> Self
Sets an optional cumulative token circuit breaker for this task.
Sourcepub fn role(&self) -> Option<&str>
pub fn role(&self) -> Option<&str>
Returns the optional role name requested for this child task.
Sourcepub const fn timeout_secs(&self) -> Option<u64>
pub const fn timeout_secs(&self) -> Option<u64>
Returns the optional wall-clock timeout in seconds for this child task.
Sourcepub fn context_files(&self) -> &[ContextFileRef]
pub fn context_files(&self) -> &[ContextFileRef]
Returns the validated workspace-relative context_files references to preload.
Sourcepub fn task(&self) -> &str
pub fn task(&self) -> &str
Returns the child work description.
Workspace capability belongs to the structured scope fields and the runtime-derived scope context, not this task text.
Sourcepub fn max_model_turns(&self) -> u32
pub fn max_model_turns(&self) -> u32
Returns the maximum number of bounded child model turns.
Sourcepub fn allowed_tools(&self) -> &[ToolName]
pub fn allowed_tools(&self) -> &[ToolName]
Returns the provider/tool names the child may use.
pub fn allowed_tools_are_explicit(&self) -> bool
Sourcepub fn write_scope_is_explicit(&self) -> bool
pub fn write_scope_is_explicit(&self) -> bool
Returns whether the parent explicitly supplied the write scope, including an explicit empty scope for a read-only child.
Sourcepub fn display_name(&self) -> Option<&str>
pub fn display_name(&self) -> Option<&str>
Returns the optional compact display name.
Sourcepub fn read_scope(&self) -> &[PathBuf]
pub fn read_scope(&self) -> &[PathBuf]
Returns the workspace-relative read scope.
Sourcepub fn write_scope(&self) -> &[PathBuf]
pub fn write_scope(&self) -> &[PathBuf]
Returns the workspace-relative write scope.
Sourcepub fn forbidden_paths(&self) -> &[PathBuf]
pub fn forbidden_paths(&self) -> &[PathBuf]
Returns workspace-relative paths the child must not access.
Sourcepub fn expected_output(&self) -> Option<&str>
pub fn expected_output(&self) -> Option<&str>
Returns the optional expected-output instruction.
Sourcepub fn reasoning_effort(&self) -> Option<&ReasoningEffort>
pub fn reasoning_effort(&self) -> Option<&ReasoningEffort>
Returns the optional reasoning-effort override for this child task.
Sourcepub const fn workspace_mode(&self) -> SubagentWorkspaceMode
pub const fn workspace_mode(&self) -> SubagentWorkspaceMode
Returns the requested filesystem isolation mode (shared or worktree).
Sourcepub const fn worktree_base(&self) -> SubagentWorktreeBase
pub const fn worktree_base(&self) -> SubagentWorktreeBase
Returns the requested snapshot base when workspace_mode is worktree.
Sourcepub fn with_allowed_tools<I>(self, tools: I) -> Selfwhere
I: IntoIterator<Item = ToolName>,
pub fn with_allowed_tools<I>(self, tools: I) -> Selfwhere
I: IntoIterator<Item = ToolName>,
Replaces the child’s allowed tool list.
Sourcepub fn with_display_name(self, display_name: Option<String>) -> Self
pub fn with_display_name(self, display_name: Option<String>) -> Self
Replaces the optional display name, treating blank names as absent.
Sourcepub fn with_role(self, role: Option<String>) -> Result<Self, SubagentError>
pub fn with_role(self, role: Option<String>) -> Result<Self, SubagentError>
Sets the optional role name after validating it contains safe identifier characters.
Sourcepub fn with_timeout_secs(
self,
timeout_secs: Option<u64>,
) -> Result<Self, SubagentError>
pub fn with_timeout_secs( self, timeout_secs: Option<u64>, ) -> Result<Self, SubagentError>
Sets an optional wall-clock timeout in seconds for this child task.
Sourcepub fn with_context_files<I, S>(self, entries: I) -> Result<Self, SubagentError>
pub fn with_context_files<I, S>(self, entries: I) -> Result<Self, SubagentError>
Sets validated workspace-relative context_files to preload before turn 1.
Sourcepub fn with_read_scope<I, P>(self, paths: I) -> Result<Self, SubagentError>
pub fn with_read_scope<I, P>(self, paths: I) -> Result<Self, SubagentError>
Replaces the read scope after validating each path.
Sourcepub fn with_write_scope<I, P>(self, paths: I) -> Result<Self, SubagentError>
pub fn with_write_scope<I, P>(self, paths: I) -> Result<Self, SubagentError>
Replaces the write scope after validating each path.
Sourcepub fn with_forbidden_paths<I, P>(self, paths: I) -> Result<Self, SubagentError>
pub fn with_forbidden_paths<I, P>(self, paths: I) -> Result<Self, SubagentError>
Replaces the forbidden path scope after validating each path.
Sourcepub fn with_expected_output(self, expected_output: Option<String>) -> Self
pub fn with_expected_output(self, expected_output: Option<String>) -> Self
Replaces the optional expected-output instruction, treating blank text as absent.
Sourcepub fn with_reasoning_effort(
self,
reasoning_effort: Option<ReasoningEffort>,
) -> Self
pub fn with_reasoning_effort( self, reasoning_effort: Option<ReasoningEffort>, ) -> Self
Replaces the optional reasoning-effort override for this child task.
Sourcepub const fn with_workspace_mode(
self,
workspace_mode: SubagentWorkspaceMode,
) -> Self
pub const fn with_workspace_mode( self, workspace_mode: SubagentWorkspaceMode, ) -> Self
Sets the child’s filesystem isolation mode (shared or worktree).
Sourcepub const fn with_worktree_base(
self,
worktree_base: SubagentWorktreeBase,
) -> Self
pub const fn with_worktree_base( self, worktree_base: SubagentWorktreeBase, ) -> Self
Sets the worktree snapshot base (working_tree or head).
Trait Implementations§
Source§impl Clone for SubagentTaskSpec
impl Clone for SubagentTaskSpec
Source§impl Debug for SubagentTaskSpec
impl Debug for SubagentTaskSpec
impl Eq for SubagentTaskSpec
Source§impl PartialEq for SubagentTaskSpec
impl PartialEq for SubagentTaskSpec
impl StructuralPartialEq for SubagentTaskSpec
Auto Trait Implementations§
impl Forget for SubagentTaskSpec
impl Freeze for SubagentTaskSpecwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<ToolName>: Freeze,
PhantomData<PathBuf>: Freeze,
PhantomData<ContextFileRef>: Freeze,
impl Move for SubagentTaskSpec
impl RefUnwindSafe for SubagentTaskSpec
impl Send for SubagentTaskSpecwhere
RawVecInner: Send,
impl Sync for SubagentTaskSpecwhere
RawVecInner: Sync,
impl Unpin for SubagentTaskSpec
impl UnsafeUnpin for SubagentTaskSpecwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<ToolName>: UnsafeUnpin,
PhantomData<PathBuf>: UnsafeUnpin,
PhantomData<ContextFileRef>: UnsafeUnpin,
impl UnwindSafe for SubagentTaskSpecwhere
RawVecInner: UnwindSafe,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.