Skip to main content

Module runtime

Module runtime 

Source
Expand description

Runtime Module - Workflow execution

Contains the runtime execution components:

  • runner: DAG execution with tokio concurrency
  • executor: Individual task execution (infer, exec, fetch, invoke, agent)
    • Includes decompose: modifier expansion
  • output: Output format handling and schema validation
  • structured_output: 5-layer defense system for ~99.99% JSON compliance
    • Layer 0: DynamicSubmitTool injection (executor/verbs.rs + rig_agent_loop)
    • Layers 2-4: Extract+Validate, Retry, LLM Repair (StructuredOutputEngine)
  • submit_tool: DynamicSubmitTool for provider-native structured output (Layer 0)
  • rig_agent_loop: Rig-based agentic execution
  • spawn: Nested agent spawning
  • chat_workflow: Chat-as-DAG wrapper
  • builtin: Builtin nika:* tools
  • hitl: Human-In-The-Loop handler trait
  • context_loader: Context file loading at workflow start
  • resolver: Agent and skill resolution
  • boot: Boot sequence with 6-phase initialization
  • policy: Security policy enforcement for exec/fetch/tokens
  • security: Command validation and blocklist
  • artifact_processor: Task output file persistence
  • limit_tracker: Agent execution limits tracking
  • partial: Partial completion checkpointing

This module represents the “how” - runtime execution. For static structure, see the ast module.

Re-exports§

pub use builtin::AssertTool;
pub use builtin::BuiltinTool;
pub use builtin::BuiltinToolRouter;
pub use builtin::EmitTool;
pub use builtin::LogLevel;
pub use builtin::LogTool;
pub use builtin::NikaBuiltinToolAdapter;
pub use builtin::PromptParams;
pub use builtin::PromptResponse;
pub use builtin::PromptTool;
pub use builtin::RunParams;
pub use builtin::RunResponse;
pub use builtin::RunTool;
pub use chat_workflow::ChatMessage;
pub use chat_workflow::ChatWorkflow;
pub use chat_workflow::Role;
pub use context::WorkflowMeta;
pub use context_loader::load_context;
pub use context_loader::LoadedContext;
pub use hitl::DefaultHitlHandler;
pub use hitl::HitlError;
pub use hitl::HitlHandler;
pub use hitl::HitlRequest;
pub use hitl::HitlResponse;
pub use output::make_task_result;
pub use resolver::resolve_assets;
pub use resolver::AgentSource;
pub use resolver::ResolvedAgent;
pub use resolver::ResolvedAgents;
pub use resolver::ResolvedAssets;
pub use resolver::ResolvedSkills;
pub use spawn::SpawnAgentParams;
pub use spawn::SpawnAgentTool;
pub use boot::BootContext;
pub use boot::BootPhase;
pub use boot::BootSequence;
pub use boot::BootstrapConfig;
pub use boot::EditorConfig;
pub use boot::PhaseResult;
pub use boot::PolicyConfig;
pub use boot::ProviderConfig;
pub use boot::SessionConfig;
pub use boot::ToolsConfig;
pub use boot::TraceConfig;
pub use policy::PolicyDecision;
pub use policy::PolicyEnforcer;
pub use policy::TokenBudget;
pub use security::check_blocklist;
pub use security::check_shell_mode_blocklist;
pub use security::validate_command_string;
pub use security::validate_exec_command;
pub use security::validate_exec_command_with_shell;
pub use artifact_processor::process_task_artifacts;
pub use artifact_processor::ArtifactProcessResult;
pub use structured_output::validate_structured_output;
pub use structured_output::InferCallback;
pub use structured_output::StructuredOutputEngine;
pub use structured_output::StructuredOutputResult;
pub use limit_tracker::LimitTracker;
pub use submit_tool::DynamicSubmitTool;
pub use partial::PartialCheckpoint;
pub use partial::PartialResult;
pub use partial::StopReason;

Modules§

artifact_processor
Artifact Processor - Write task outputs to disk
boot
Boot Sequence - 7-phase startup with progress reporting
builtin
Builtin Tools Module - nika:* tools for HITL, workflow composition, file operations, and completion
chat_workflow
ChatWorkflow - DAG wrapper for chat conversations
context
WorkflowMeta — read-only workflow metadata for execution.
context_loader
Context Loader - Load files at workflow start
hitl
Human-In-The-Loop (HITL) Handler for interactive workflows
limit_tracker
LimitTracker - Runtime limit tracking for agent execution
output
Output Handling - task result processing
partial
Partial completion support for agent execution
policy
Policy Enforcer - Security policy enforcement
resolver
Agent and Skill Resolver
security
Security Module - Command validation and blocklist
spawn
Spawn Agent Tool (MVP 8 Phase 2)
structured_output
Structured Output Engine
submit_tool
DynamicSubmitTool — Provider-native structured output via tool injection

Structs§

RigAgentLoop
Rig-based agentic execution loop
RigAgentLoopResult
Result of running the rig-based agent loop
Runner
DAG workflow runner with event sourcing
SkillInjector
Thread-safe skill content cache
TaskExecutor
Task executor with cached providers, shared HTTP client, and event logging

Enums§

RigAgentStatus
Status of the rig-based agent execution