Skip to main content

KernelInputEvent

Enum KernelInputEvent 

Source
pub enum KernelInputEvent {
Show 40 variants SetTools { tools: Vec<ToolSchema>, }, SetAvailableSkills { skills: Vec<SkillMetadata>, }, SkillActivated { name: String, }, SetStableCoreTools { tool_ids: Vec<String>, }, SetMemoryEnabled { enabled: bool, }, SetKnowledgeEnabled { enabled: bool, }, SetPlanToolEnabled { enabled: bool, }, SetTokenizer { name: String, }, AddSystemMessage { content: String, tokens: u32, }, AddKnowledgeMessage { content: String, tokens: u32, }, AddHistoryMessage { message: Message, tokens: Option<u32>, }, PreloadHistory { messages: Vec<Message>, }, MountCapability { capability: CapabilityDescriptor, }, UnmountCapability { capability_kind: CapabilityKind, id: String, }, LoadMilestoneContract { contract: MilestoneContract, }, LoadGovernancePolicy { default_action: Option<PolicyAction>, rules: Vec<PolicyRule>, vetoed_tools: Vec<String>, rate_limits: Vec<RateLimitSpec>, constraints: Vec<ConstraintSpec>, }, SetAttentionPolicy { max_queue_size: u32, }, ForceCompact, UpdateTask { update: TaskUpdate, }, StartRun { task: RuntimeTask, run_spec: Option<AgentRunSpec>, }, ConfigureRun { config: RunConfig, }, CapabilityCommand { command: CapabilityCommand, }, Resume { approved_calls: Vec<String>, denied_calls: Vec<String>, }, SetSchedulerBudget { max_wall_ms: Option<u64>, }, SetResourceQuota { quota: ResourceQuota, }, ProviderResult { message: Message, observed_input_tokens: Option<u32>, observed_output_tokens: Option<u32>, now_ms: Option<u64>, }, ToolResults { results: Vec<ToolResult>, }, Signal { signal: RuntimeSignal, }, MilestoneResult { result: MilestoneCheckResult, }, SpawnSubAgent { spec: AgentRunSpec, parent_session_id: String, }, LoadWorkflow { spec: WorkflowSpec, parent_session_id: String, resumed_completed: Vec<String>, resumed_submissions: Vec<Vec<WorkflowNode>>, }, SubAgentCompleted { result: SubAgentResult, }, SubmitWorkflowNodes { nodes: Vec<WorkflowNode>, submitter_agent_id: Option<String>, }, SubmitWorkflow { spec: WorkflowSpec, parent_session_id: String, submitter_agent_id: Option<String>, }, PageIn { entries: Vec<PageInEntry>, }, SetMemoryPolicy { memory_path: String, stale_warning_days: u32, retrieval_top_k: usize, validation_enabled: bool, max_content_bytes: Option<u32>, max_name_length: Option<usize>, }, WriteMemory { memory: MemoryWriteRequest, }, QueryMemory { query: MemoryQuery, }, MemoryRetrievalResult { retrieval: MemoryRetrieval, }, Timeout,
}

Variants§

§

SetTools

Fields

§

SetAvailableSkills

Fields

§

SkillActivated

P1-B tool gating: the model loaded a skill (name). The SDK emits this when it resolves a skill tool call. The kernel records it in the active-skill set and resolves the skill’s allowed_tools from the catalog to narrow the toolset on subsequent turns.

Fields

§name: String
§

SetStableCoreTools

P1-B/D: configure the stable-core tool ids (always exposed under skill gating). Set once by the SDK; empty/absent ⇒ skills narrow to exactly their declared tools + meta-tools.

Fields

§tool_ids: Vec<String>
§

SetMemoryEnabled

Fields

§enabled: bool
§

SetKnowledgeEnabled

Fields

§enabled: bool
§

SetPlanToolEnabled

Fields

§enabled: bool
§

SetTokenizer

Fields

§name: String
§

AddSystemMessage

Fields

§content: String
§tokens: u32
§

AddKnowledgeMessage

Fields

§content: String
§tokens: u32
§

AddHistoryMessage

Fields

§message: Message
§tokens: Option<u32>
§

PreloadHistory

Fields

§messages: Vec<Message>
§

MountCapability

Fields

§

UnmountCapability

Fields

§capability_kind: CapabilityKind
§

LoadMilestoneContract

Fields

§

LoadGovernancePolicy

Install a governance policy. Once loaded, every model-proposed tool call is evaluated in-kernel before execution. Omitting this event leaves the gate disabled (pre-governance behavior).

Fields

§default_action: Option<PolicyAction>
§vetoed_tools: Vec<String>
§rate_limits: Vec<RateLimitSpec>
§constraints: Vec<ConstraintSpec>
§

SetAttentionPolicy

Override the default in-kernel signal router queue size (default 64). The router is always active; this only adjusts capacity.

Fields

§max_queue_size: u32
§

ForceCompact

§

UpdateTask

Fields

§update: TaskUpdate
§

StartRun

Fields

§

ConfigureRun

K2: apply a bundle of run-setup configuration in a single event — the consolidation of the ~10 discrete Set* / Load* config events the SDK used to fire one-by-one before StartRun. Every field is optional; an absent field leaves that aspect untouched. The granular events remain for runtime mutation (a skill mount changing tools, a mid-run budget change). ABI-additive.

Fields

§config: RunConfig
§

CapabilityCommand

Fields

§

Resume

Fields

§approved_calls: Vec<String>
§denied_calls: Vec<String>
§

SetSchedulerBudget

Adjust the wall-clock budget at runtime (e.g. to extend or set a deadline after a run has already started). Additive: omit to keep the value from LoopPolicy passed at construction.

Fields

§max_wall_ms: Option<u64>
§

SetResourceQuota

M2 资源配额: install a declarative crate::governance::quota::ResourceQuota at the single syscall trap. Like governance/attention/scheduler config, quotas flow in through the versioned JSON event ABI (replayable, session-loggable) rather than a side-channel setter — sending it is opt-in, and omitting it preserves the pre-M2 unconditional Allow for spawn / memory-write syscalls.

Fields

§

ProviderResult

Fields

§message: Message
§observed_input_tokens: Option<u32>
§observed_output_tokens: Option<u32>
§now_ms: Option<u64>
§

ToolResults

Fields

§results: Vec<ToolResult>
§

Signal

Fields

§

MilestoneResult

§

SpawnSubAgent

Spawn a sub-agent: registers/updates the kernel process table.

Fields

§parent_session_id: String
§

LoadWorkflow

W0-ABI: load a workflow DAG and spawn its first gated batch. The kernel drives the DAG; each node spawn passes the syscall trap and is reported via workflow_batch_spawned. Completions feed back through SubAgentCompleted (reused); finish emits workflow_completed.

Fields

§parent_session_id: String
§resumed_completed: Vec<String>

W0-ABI resume: node agent-ids already completed (recovered from the log). Empty = fresh.

§resumed_submissions: Vec<Vec<WorkflowNode>>

R3-1 resume: the runtime submit_workflow_nodes batches (in order) recovered from the log, re-applied before completions so dynamically-appended nodes are reconstructed. Additive: empty for a fresh run or a resume without dynamic submissions.

§

SubAgentCompleted

Feed a completed sub-agent result back into the parent loop.

Fields

§

SubmitWorkflowNodes

R3-1: append nodes to the in-flight workflow DAG at runtime (dynamic fan-out / loop-until-done). Sent by the SDK while the submitting node is still running — the appended nodes spawn on the next gated drive. No-op if no workflow is active. Additive ABI: a brand-new event variant, so existing SDKs that never send it are byte-identical on the wire.

Fields

§submitter_agent_id: Option<String>

G1: the agent id of the node that requested this submission. When it names a quarantined node, the kernel coerces every submitted node to quarantined (no privilege escalation across the trust boundary). Additive: omitted by older SDKs → None → no coercion.

§

SubmitWorkflow

M5/G1: an agent authors a whole WorkflowSpec (the article’s “model writes its own harness”). The agent-reachable analogue of the host-only LoadWorkflow: bootstraps the DAG when no workflow is active, else flattens the spec’s nodes onto the running DAG (bootstrap-or-flatten, one kernel / one quota — never a workflow stack). Gated by Syscall::LoadWorkflow. Additive ABI: a brand-new variant, byte-identical on the wire for SDKs that never send it.

Fields

§parent_session_id: String

Used only on bootstrap (no workflow active) to seed child session ids; ignored on flatten.

§submitter_agent_id: Option<String>

G1: the authoring node’s agent id (flatten case) — a quarantined author’s nodes are coerced quarantined. Additive: omitted (top-level bootstrap) → None → the run’s own trust applies.

§

PageIn

Feed long-term memory entries into the knowledge partition (page-in). SDK performs retrieval I/O; kernel only applies the result.

Fields

§entries: Vec<PageInEntry>
§

SetMemoryPolicy

Configure long-term memory management policy (Phase 7). Opt-in: installing the policy makes validation_enabled, retrieval_top_k, and the optional size/name overrides authoritative.

Fields

§memory_path: String
§stale_warning_days: u32
§retrieval_top_k: usize
§validation_enabled: bool
§max_content_bytes: Option<u32>

Override the validation content-size limit (bytes). Omit to keep the kernel default.

§max_name_length: Option<usize>

Override the validation name-length limit. Omit to keep the kernel default.

§

WriteMemory

Write a long-term memory entry (SDK background agent calls this).

Fields

§

QueryMemory

Query long-term memory for context (kernel calls this; SDK responds asynchronously).

Fields

§

MemoryRetrievalResult

Feed memory selection results back after QueryMemory (SDK → kernel acknowledgment).

Fields

§

Timeout

Trait Implementations§

Source§

impl Clone for KernelInputEvent

Source§

fn clone(&self) -> KernelInputEvent

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 KernelInputEvent

Source§

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

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

impl<'de> Deserialize<'de> for KernelInputEvent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for KernelInputEvent

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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 = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.