pub enum KernelInputEvent {
Show 39 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>,
},
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
tools: Vec<ToolSchema>SetAvailableSkills
Fields
skills: Vec<SkillMetadata>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.
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.
SetMemoryEnabled
SetKnowledgeEnabled
SetPlanToolEnabled
SetTokenizer
AddSystemMessage
AddKnowledgeMessage
AddHistoryMessage
PreloadHistory
MountCapability
Fields
capability: CapabilityDescriptorUnmountCapability
LoadMilestoneContract
Fields
contract: MilestoneContractLoadGovernancePolicy
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>rules: Vec<PolicyRule>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.
ForceCompact
UpdateTask
Fields
update: TaskUpdateStartRun
CapabilityCommand
Fields
command: CapabilityCommandResume
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.
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
quota: ResourceQuotaProviderResult
Fields
ToolResults
Fields
results: Vec<ToolResult>Signal
Fields
signal: RuntimeSignalMilestoneResult
Fields
result: MilestoneCheckResultSpawnSubAgent
Spawn a sub-agent: registers/updates the kernel process table.
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
spec: WorkflowSpecresumed_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
result: SubAgentResultSubmitWorkflowNodes
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
nodes: Vec<WorkflowNode>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
spec: WorkflowSpecPageIn
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
WriteMemory
Write a long-term memory entry (SDK background agent calls this).
Fields
memory: MemoryWriteRequestQueryMemory
Query long-term memory for context (kernel calls this; SDK responds asynchronously).
Fields
query: MemoryQueryMemoryRetrievalResult
Feed memory selection results back after QueryMemory (SDK → kernel acknowledgment).
Fields
retrieval: MemoryRetrievalTimeout
Trait Implementations§
Source§impl Clone for KernelInputEvent
impl Clone for KernelInputEvent
Source§fn clone(&self) -> KernelInputEvent
fn clone(&self) -> KernelInputEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more