Skip to main content

Initialize

Struct Initialize 

Source
pub struct Initialize {
Show 19 fields pub hooks: Option<HashMap<HookEventKind, Vec<HookMatcherConfig>>>, pub system_prompt: Option<String>, pub append_system_prompt: Option<String>, pub agents: Option<Value>, pub json_schema: Option<Value>, pub title: Option<String>, pub skills: Option<Vec<String>>, pub plugins: Option<Vec<Value>>, pub mcp_servers: Option<Map<String, Value>>, pub plan_mode_instructions: Option<String>, pub exclude_dynamic_sections: Option<bool>, pub system_prompt_snapshot: Option<bool>, pub prompt_suggestions: Option<bool>, pub agent_progress_summaries: Option<bool>, pub forward_subagent_text: Option<bool>, pub tool_aliases: Option<HashMap<String, String>>, pub supported_dialog_kinds: Option<Vec<String>>, pub per_task_stop_affordance: Option<bool>, pub workspace_trust: Option<WorkspaceTrust>,
}
Expand description

Body of the initialize control request — the first stdin line.

Process-level settings (cwd, model, permission mode, session id) are CLI flags, not initialize fields; they live on SessionOptions. hooks is filled in by Session::spawn from SessionOptions::hooks. Source: binary initialize schema (subtype “initialize”, hooks, agents, systemPrompt, appendSystemPrompt, jsonSchema, …); query.py:150–155

Fields§

§hooks: Option<HashMap<HookEventKind, Vec<HookMatcherConfig>>>

Hook matchers per event; matches arrive as hook_callback requests.

§system_prompt: Option<String>

systemPrompt: the custom system prompt slot, same as --system-prompt.

§append_system_prompt: Option<String>

appendSystemPrompt: appended to the system prompt.

§agents: Option<Value>

Subagent definitions, keyed by agent name.

§json_schema: Option<Value>

JSON schema for structured output; the result arrives in TurnResult::structured_output.

§title: Option<String>

Session title; skips automatic title generation.

§skills: Option<Vec<String>>

Load only the skills with these names.

§plugins: Option<Vec<Value>>

Plugins to load, e.g. {"type": "local", "path": "./my-plugin"}.

§mcp_servers: Option<Map<String, Value>>

MCP servers the CLI runs or connects to, keyed by name: stdio ({"command": …, "args": […]}), http or sse configs. In-process servers go in SessionOptions::mcp_servers.

§plan_mode_instructions: Option<String>

Replaces the default plan-mode workflow text.

§exclude_dynamic_sections: Option<bool>

Omit per-user dynamic sections (working directory, memory path) from the system prompt, so it caches across users.

§system_prompt_snapshot: Option<bool>

Record the system prompt once per conversation and reuse it verbatim.

§prompt_suggestions: Option<bool>

Emit prompt_suggestion frames after turns.

§agent_progress_summaries: Option<bool>

Emit progress summaries of running subagents.

§forward_subagent_text: Option<bool>

Forward subagent text and thinking.

§tool_aliases: Option<HashMap<String, String>>

Tool-name aliases applied before tool-name resolution.

§supported_dialog_kinds: Option<Vec<String>>

request_user_dialog kinds SessionOptions::on_user_dialog renders; the CLI sends only these kinds.

§per_task_stop_affordance: Option<bool>

Declares that the host renders a per-task stop control (stop_task).

§workspace_trust: Option<WorkspaceTrust>

Workspace trust the host obtained from the user for directory.

Trait Implementations§

Source§

impl Clone for Initialize

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 Initialize

Source§

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

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

impl Default for Initialize

Source§

fn default() -> Self

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

impl Serialize for Initialize

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> 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