pub struct WorkerAgentSpec {
pub name: String,
pub description: String,
pub kind: WorkerAgentKind,
pub hidden: bool,
pub permissions: Option<PermissionPolicy>,
pub model: Option<ModelConfig>,
pub prompt: Option<String>,
pub max_steps: Option<usize>,
pub confirmation_inheritance: Option<ConfirmationInheritance>,
}Expand description
Reproducible recipe for a disposable worker/subagent.
This is the public “cattle mode” API: callers define a small, serializable
worker spec and register/spawn it repeatedly. The spec compiles to an
AgentDefinition consumed by the existing delegation/runtime pipeline.
Fields§
§name: StringStable worker name used in task delegation (e.g., “frontend-fixer”).
description: StringHuman-readable purpose shown to users and model selectors.
kind: WorkerAgentKindPreset permission/prompt/step profile.
Hide from UI lists while still allowing explicit delegation.
permissions: Option<PermissionPolicy>Optional permission policy override.
model: Option<ModelConfig>Optional model override.
prompt: Option<String>Optional worker-specific prompt appended to the core agentic prompt.
max_steps: Option<usize>Maximum execution steps/tool rounds.
confirmation_inheritance: Option<ConfirmationInheritance>How child runs resolve Ask decisions.
Implementations§
Source§impl WorkerAgentSpec
impl WorkerAgentSpec
Sourcepub fn new(
kind: WorkerAgentKind,
name: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn new( kind: WorkerAgentKind, name: impl Into<String>, description: impl Into<String>, ) -> Self
Create a worker spec from an explicit preset.
Sourcepub fn read_only(
name: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn read_only( name: impl Into<String>, description: impl Into<String>, ) -> Self
Read-only exploration worker.
Sourcepub fn planner(name: impl Into<String>, description: impl Into<String>) -> Self
pub fn planner(name: impl Into<String>, description: impl Into<String>) -> Self
Read-only planning worker.
Sourcepub fn implementer(
name: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn implementer( name: impl Into<String>, description: impl Into<String>, ) -> Self
Implementation worker with read/write/bash capability and no recursive task spawning.
Sourcepub fn verifier(name: impl Into<String>, description: impl Into<String>) -> Self
pub fn verifier(name: impl Into<String>, description: impl Into<String>) -> Self
Verification worker for tests/checks/reproductions without edits.
Sourcepub fn reviewer(name: impl Into<String>, description: impl Into<String>) -> Self
pub fn reviewer(name: impl Into<String>, description: impl Into<String>) -> Self
Review worker for correctness/regression/security findings.
Sourcepub fn custom(name: impl Into<String>, description: impl Into<String>) -> Self
pub fn custom(name: impl Into<String>, description: impl Into<String>) -> Self
Strict custom worker. Provide permissions explicitly for non-HITL execution.
Hide or show this worker in UI lists.
Sourcepub fn with_permissions(self, permissions: PermissionPolicy) -> Self
pub fn with_permissions(self, permissions: PermissionPolicy) -> Self
Override the preset permission policy.
Sourcepub fn with_model(self, model: ModelConfig) -> Self
pub fn with_model(self, model: ModelConfig) -> Self
Override the preset model.
Sourcepub fn with_model_ref(self, model_ref: impl AsRef<str>) -> Self
pub fn with_model_ref(self, model_ref: impl AsRef<str>) -> Self
Override the preset model using provider/model or a model id.
Sourcepub fn with_provider_model(
self,
provider: impl Into<String>,
model: impl Into<String>,
) -> Self
pub fn with_provider_model( self, provider: impl Into<String>, model: impl Into<String>, ) -> Self
Override the preset model using provider and model separately.
Sourcepub fn with_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_prompt(self, prompt: impl Into<String>) -> Self
Override the preset prompt.
Sourcepub fn with_max_steps(self, max_steps: usize) -> Self
pub fn with_max_steps(self, max_steps: usize) -> Self
Override the preset step budget.
Sourcepub fn with_confirmation(self, inheritance: ConfirmationInheritance) -> Self
pub fn with_confirmation(self, inheritance: ConfirmationInheritance) -> Self
Set confirmation inheritance policy for child runs.
Sourcepub fn into_agent_definition(self) -> AgentDefinition
pub fn into_agent_definition(self) -> AgentDefinition
Compile this worker recipe into a runtime agent definition.
Trait Implementations§
Source§impl Clone for WorkerAgentSpec
impl Clone for WorkerAgentSpec
Source§fn clone(&self) -> WorkerAgentSpec
fn clone(&self) -> WorkerAgentSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkerAgentSpec
impl Debug for WorkerAgentSpec
Source§impl<'de> Deserialize<'de> for WorkerAgentSpec
impl<'de> Deserialize<'de> for WorkerAgentSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<WorkerAgentSpec> for AgentDefinition
impl From<WorkerAgentSpec> for AgentDefinition
Source§fn from(spec: WorkerAgentSpec) -> Self
fn from(spec: WorkerAgentSpec) -> Self
Auto Trait Implementations§
impl Freeze for WorkerAgentSpec
impl RefUnwindSafe for WorkerAgentSpec
impl Send for WorkerAgentSpec
impl Sync for WorkerAgentSpec
impl Unpin for WorkerAgentSpec
impl UnsafeUnpin for WorkerAgentSpec
impl UnwindSafe for WorkerAgentSpec
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
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