Skip to main content

AgentTypeDefinition

Struct AgentTypeDefinition 

Source
pub struct AgentTypeDefinition {
Show 14 fields pub name: String, pub source: AgentTypeSource, pub description: String, pub allowed_tools: Vec<String>, pub disallowed_tools: Vec<String>, pub model: Option<String>, pub provider: Option<String>, pub permission_mode: Option<PermissionMode>, pub effort: Option<String>, pub max_turns: Option<u32>, pub skills: Vec<String>, pub mcp_servers: Vec<String>, pub scene: Option<String>, pub system_prompt: String,
}
Expand description

A named agent type definition with associated system prompt and tool set.

Fields§

§name: String

Unique name (e.g. “explore”, “plan”, “code-reviewer”).

§source: AgentTypeSource

Provenance, for the override clamp — see AgentTypeSource.

§description: String

Short description of the agent type’s purpose.

§allowed_tools: Vec<String>

Tool names the agent type is allowed to use (empty = all tools).

§disallowed_tools: Vec<String>

Tool names removed from the pool, applied before allowed_tools (deny first, then allow).

§model: Option<String>

The model its sub-agents use: strong, balanced or fast (also opus, sonnet, haiku, as Claude Code writes them), inherit for the parent’s, or a model id.

§provider: Option<String>

The provider its sub-agents’ calls go to first, the rest following model.order. One the session’s pair does not define is ignored.

§permission_mode: Option<PermissionMode>

Optional permission mode for spawned subagents of this type. Whether it may be looser than the parent session’s depends on source.

§effort: Option<String>

Optional ModelSettings::effort override for spawned subagents, by name (low … max).

§max_turns: Option<u32>

Maximum API calls a spawned subagent of this type may make, applied as this subagent’s own turn.max_model_calls instead of inheriting the parent’s cap wholesale. None = inherit parent’s cap.

§skills: Vec<String>

Skill names to preload in full at subagent startup (not just their descriptions) — see AgentTool’s spawn path. A name that doesn’t resolve, or resolves to a disable_model_invocation: true skill, is skipped with a tracing::warn! rather than failing the spawn.

§mcp_servers: Vec<String>

MCP server names to grant this subagent, referencing servers already connected in the parent session (settings.mcp_servers keys) — the parent’s live connections are reused, not reconnected. A subagent gets zero MCP tools by default — MCP access is opt-in per subagent, not inherited; this is the opt-in list. Only name references to an already-configured server are supported, not inline server config.

§scene: Option<String>

Scene id (code/harnix/mini) this agent type forces its sub-agents into, overriding the scene inherited from the parent. None (the default) inherits — see Delegator::scene_for_subagent. An unknown id is ignored with a tracing::warn! and the inherited scene is kept, same non-fatal handling as an unrecognized effort.

§system_prompt: String

System prompt injected into the sub-agent’s context.

Trait Implementations§

Source§

impl Clone for AgentTypeDefinition

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AgentTypeDefinition

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for AgentTypeDefinition

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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<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