Expand description
Runtime session orchestration for Merry.
This crate owns the MVP runtime facade for session execution:
RuntimeandRuntimeBuilderconstruct a session-scoped runtime.StepInput,StepContext, andRuntimeJournalEventStreamdrive one provider-neutral runtime step at a time.Tooldefines the typed application-tool path;RegisteredToolandToolExecutordefine the runtime-owned integration path.Runtime::read_tool_outputandRuntime::read_tool_output_previewexpose session-owned tool outputs without leaking provider wire formats.
A few lower-level primitives are currently public because the in-memory MVP
still needs explicit composition and tests around structured state:
ContextCompiler and context entries.
Treat these as unstable implementation-facing surfaces unless a Runtime
method provides the same read or mutation path.
Runtime state is structured and recorded before observable events are
emitted. The crate boundary is intentionally provider-neutral. Provider
adapters normalize requests and events in merry-llm/provider crates
rather than storing provider response formats here.
Structs§
- Accepted
Local Workspace Process Admission - Explicit admission for the process runner used by the local workspace lane.
- Accepted
Local Workspace Process Runner Profile - Accepted local workspace process lane carried by a runtime profile.
- Action
Proposal - Runtime-owned, provider-neutral proposal for a mutating registered action.
- Active
Permission Grants - Point-in-time snapshot of all active session-scoped permission grants and user-authored review guidance retained by a runtime session.
- After
Model Step Context - Read-only context supplied to an
after_model_stephook. - After
Tool Call Context - Read-only context supplied to an
after_tool_callhook. - Agent
Loop Config - Configuration for
crate::Runtime::run_agent_loop. - Agent
Loop Control - Agent
Loop Error - Runtime method error returned while an agent loop was running.
- Agent
Loop Input - Agent
Loop Result - Result of a completed or policy-blocked agent loop run.
- Agent
Run - Runtime-owned single-consumer protocol for one agent run.
- Archive
Config - Configuration for
HistoryRetention::Archive. - Background
Handoff Notice - Notice returned when a foreground wait hands active children off to background execution.
- Background
Process Id - Identifier returned to the model when a background process is retained.
- Background
Process Lookup Error - A model-supplied id did not match a retained process.
- Background
Process Output - Captured output for one retained background process.
- Background
Process Stop - Result of asking a retained process to stop.
- Background
Process Summary - Compact row for a retained background process.
- Before
Model Step Context - Read-only context supplied to a
before_model_stephook. - Before
Tool Call Context - Read-only context supplied to a
before_tool_callhook. - Built
Child Runtime - Constructed child runtime plus optional resolved per-role execution overrides.
- Cancel
Subagents Input - Provider-visible input for
cancel_subagents. - Channel
Permission Admission Source - Channel-backed human fallback source.
- Checkpoint
Id - Checkpoint
Ref - Checkpoint
RefId - Checkpoint
RefManifest - Checkpoint
Sequence Range - Child
Runtime Input - Runtime-owned input passed to
ChildRuntimeFactorywhen starting one child. - Child
Workspace Finalization - Outcome collected when finalizing an isolated child workspace after a run settles.
- Child
Workspace Policy Override - Child-session workspace overrides layered purely on top of the parent’s live baseline without disconnecting live reload propagation.
- Child
Workspace Scope - Parent-authored workspace scope carried into child runtime construction.
- Citation
Compaction Input - Citation
Compaction Policy - Summary acceptance limits and preferred raw-history retention.
- Compacted
Checkpoint - Runtime-owned checkpoint left after compacting earlier dynamic state.
- Compacted
Checkpoint Summary - Payload-free notice that a prose checkpoint is installed.
- Compaction
Config - Runtime-owned policy for checkpoint compaction.
- Compaction
Outcome - Compaction
Prompt - Optional prompt customization for automatic and manual compaction requests.
- Compiled
Context - Reproducible compiled context snapshot.
- Context
Budget - Derived context body budget and the one compaction trigger.
- Context
Compiler - Compiles allowlisted structured runtime state into a deterministic context snapshot.
- Context
File Ref - Validated workspace-relative file reference with an optional 1-based inclusive line range.
- Context
Summary - Runtime-owned dynamic context note or summary entry.
- Durable
Memory - Open memory store for one workspace, shared by parent and child runtimes.
- File
Session Store - File-backed session storage. Durable session facts append directly to
journal.jsonl. - Final
Output - Structured final output recorded by the runtime.
- Final
Output Contract - Runtime-owned final-output contract rendered as a synthetic tool.
- Hook
Invocation - One pending host-bridged hook invocation awaiting a decision.
- Hook
Invocation Id - Runtime-assigned identifier for one host-bridged hook invocation.
- Hook
Registry - Composable in-process Rust hook registry with middleware chaining and short-circuiting.
- Hook
Subscriptions - Declarative set of hook points and tool filters active for a handler or bridge.
- Image
Summary - Lightweight public summary of an attached image without raw bytes.
- Interactive
Agent Run - Interactive
Input Item - Interactive
Input Snapshot - Interactive
Primary Model - Provider-neutral model selection for subsequent interactive requests.
- Interactive
Process Execution Update - Replacement local-workspace process execution lane for subsequent tool actions in an active interactive run.
- Interactive
RunEvent Stream - Single-consumer output stream for one interactive run.
- Interactive
RunId - Interactive
Settings Update - Runtime settings applied by an interactive run at the next model-request boundary.
- Interactive
Subagent Settings - Subagent admission and concurrency settings for subsequent delegated work.
- Live
Policy Baseline - Immutable point-in-time policy baseline shared atomically across file tools, web/browser tools, host-process backends, and child sessions.
- Live
Policy Handle - Single-lock live policy handle coordinating filesystem, network, sandbox mode, and protected-path evaluation across parent and child sessions.
- Loaded
Session - A validated persisted session loaded once before runtime construction.
- Memory
Layout - Roots for the global scope and one workspace scope.
- Network
Access Policy - Single-source-of-truth outbound network and domain admission policy.
- Parent
Primary Model - Snapshot of the parent runtime’s currently active primary provider/model.
- Path
Access Rule - One platform-neutral path access rule consumed by sandbox backends.
- Path
Evaluation - Structured result of evaluating a path against Merry’s single authoritative filesystem access policy.
- Permission
Admission Context - Cancellation-aware permission admission context.
- Permission
Admission Review - Metadata for one admission decision.
- Permission
Request - Runtime-owned normalized permission request.
- Permission
Review Request - A pending host-facing permission review request.
- Permission
Review Response - Host response for one pending permission review request.
- Permission
Review Rules - User-trusted custom rules and environment notes for AI permission review.
- Preloaded
Context File - One preloaded file slice ready for injection into
<merry_subagent_handoff>. - Prepared
Process Permission - An adapter’s prepared action runner and normalized capability evidence.
- Process
Action Intent - Provider-neutral, typed intent for a local process action.
- Process
Execution Evidence - Provider-neutral evidence recorded after a process action executes.
- Process
Output Chunk - Live incremental output chunk emitted while a process action is running.
- Process
Output Envelope - Shared fields of a full process result artifact, including lossless captures.
- Process
Output Sink - Non-blocking sink for forwarding bounded live process output chunks to UI observers.
- Process
Output Stream - One captured stream, with optional metadata absent in older artifacts.
- Process
Path Grant - A normalized approved path and the constraints found while materializing it.
- Process
Permission Profile Id - Stable identifier for a runtime-owned process permission profile.
- Process
Runner Context - Context passed to a process runner.
- Process
Runner Output - Bounded output returned by a process runner.
- Process
Session Permission Snapshot - Immutable capabilities retained by one runtime session.
- Process
Session Permission View - Read-only access supplied to process adapters; it cannot record a grant.
- Process
Session Permissions - Capability state owned by a single runtime session, never a global store.
- Project
Rules - Stable project instructions explicitly loaded by runtime construction.
- Prompt
Block - One stable provider-neutral prompt block supplied by a higher-level policy.
- Prompt
Profile - Stable prompt material and its runtime placement contract.
- Queued
Input Id - Stable runtime-assigned identifier for one pending interactive input.
- Registered
Tool - Runtime-owned registered tool definition.
- Rejected
Subagent View - Compact provider-visible view of a rejected child task.
- Requested
Path Capability - Requested filesystem capability for one path.
- Resolved
Citation Compaction Budget - Soft guidance, hard acceptance, and the preferred raw-history budget.
- Resolved
Context Window - Resolved model context window and the metadata source that supplied it.
- Resumable
Child Session - Cloneable single-take container carrying a persisted child
LoadedSessionacross the synchronousChildRuntimeFactoryboundary when waking a subagent after parent session resume. - Review
Guidance Entry - One user-authored review note recorded during this session.
- Review
Guidance Id - Stable session-local identifier for one user-authored review guidance note.
- Runtime
- Merry runtime handle for one session.
- Runtime
Builder - Builder for a Merry runtime.
- Runtime
Capabilities - Merry-managed low-level capability policy.
- Runtime
Event Stream - Stream of SDK-facing runtime events.
- Runtime
Journal Event Stream - Stream of provider-neutral runtime journal events.
- Runtime
Profile - Complete runtime shape applied by
crate::RuntimeBuilder::with_profile. - Runtime
Profile Builder - Builder for a complete runtime profile.
- Send
Subagent Message Input - Provider-visible input for
send_subagent_message. - Send
Subagent Message Options - Delivery options for
SubagentManager::send_message_with_options. - Send
Subagent Message Output - Provider-visible output for
send_subagent_message. - Session
Context Snapshot - Session-owned context state and internal projections.
- Session
Grant Id - Stable session-local identifier for one retained permission grant.
- Session
Permission Grant - One active, revocable session-scoped permission grant.
- Session
Permissioned Process Runner Factory - Runtime decorator that records approved capabilities, not OS mount policy.
- Session
Reservation - Exclusive ownership of one session’s on-disk state for the lifetime of a run. The operating-system file lock is released when this value is dropped, including when the owning process is terminated.
- Session
Review Guidance - Thread-safe, cloneable handle to session-scoped human review guidance.
- Skill
Catalog - Deterministic catalog of available skill metadata.
- Skill
Load Warning - Non-fatal warning raised while loading skill roots.
- Skill
Metadata - Model-visible metadata for one skill.
- Spawn
Subagent Task Input - Provider-visible task item for
spawn_subagents. - Spawn
Subagents Input - Provider-visible input for
spawn_subagents. - Spawn
Subagents Output - Provider-visible output for
spawn_subagents. - Spawned
Subagent View - Compact provider-visible view of an accepted child task.
- Static
Permissioned Process Runner Factory - Compatibility factory that always returns the same runner.
- Step
Context - Context shared with runtime step producers.
- Step
Input - Input snapshot for a runtime step.
- Structured
Output Retry Policy - Retry policy for application-level structured final-output decoding.
- Subagent
Activity Hub - Runtime-owned latest-value activity projection for UI consumers.
- Subagent
Config - Runtime configuration for subagent delegation limits.
- Subagent
Inspect Session - Lazy inspection handle returned when a product surface drills into a subagent.
- Subagent
Manager - Runtime-owned manager for bounded child agent execution.
- Subagent
Result View - Explicit result returned by a child agent to its parent.
- Subagent
Status View - Provider-visible compact child status.
- Subagent
Task Spec - Parent-authored specification for a bounded child agent task.
- Subagent
Worktree View - Metadata reported for a child subagent executed inside an isolated Git worktree.
- Task
Anchor - Current task objective pinned by a future
/task-style control command. - Tool
- A typed application tool executed by the Merry runtime.
- Tool
Admission - Runtime-owned allowlist for tool execution.
- Tool
Execution Context - Context passed to a tool executor.
- Tool
Execution Outcome - Domain-level result from a tool execution.
- Tool
Output Preview - Bounded UTF-8 preview of a recorded tool output.
- Tool
Permission Requirement - Structured permission requirement raised by an in-process tool when a call
targets a resource outside the current
crate::WorkspaceAccessPolicy. - Tool
Spec - Provider-neutral tool specification.
- User
Image Input - A validated normalized PNG attached to one user message.
- User
Message Input - One validated user message with zero or more normalized PNG attachments.
- Wait
Subagents Input - Provider-visible input for
wait_subagents. - Wait
Subagents Output - Provider-visible compact status output for
wait_subagents. - Workspace
Access Policy - Single-source-of-truth filesystem allowlist evaluated by in-process file
tools (
read_file,apply_patch), host-process sandboxes (merry-process), and persistence guards (merry-app). - Workspace
Patch Change Evidence - Per-file metadata for a constrained workspace patch change.
- Workspace
Patch Execution Evidence - Execute-time metadata for a constrained workspace patch.
- Workspace
Patch Proposal - Deterministic metadata for a constrained workspace patch proposal.
- Workspace
Review Notes - Thread-safe, cloneable handle to live workspace-scoped human review notes injected from the host’s per-workspace persistence store.
Enums§
- Action
Execution Evidence - Provider-neutral internal evidence attached after a mutating action executes.
- Action
Proposal Error - Validation errors for runtime-owned action proposal values.
- Action
Proposal Evidence - Provider-neutral deterministic evidence attached to an action proposal.
- Action
Review Trigger - Concrete reason why a process action requires an independent action review.
- After
Model Decision - Decision returned by an
after_model_stephook. - After
Tool Decision - Decision returned by an
after_tool_callhook. - Agent
Loop Blocked Reason - Reasons a loop can stop without final model completion.
- Agent
Loop Config Error - Invalid agent loop configuration.
- Agent
Loop Status - Terminal or blocked status for an agent loop run.
- Agent
RunMessage - Message emitted by an
AgentRun. - Approval
Scope - Lifetime scope selected when approving a permission review request.
- Background
Process State - Lifecycle of one retained background process.
- Before
Model Decision - Decision returned by a
before_model_stephook. - Before
Tool Decision - Decision returned by a
before_tool_callhook. - Capability
Policy - Three-state policy governing an external capability such as network access
or a host integration (
ssh-agent,gpg-agent,dbus). - Checkpoint
Decision - Whether the dynamic body has reached the compaction threshold.
- Checkpoint
Error - Checkpoint
Source Kind - Compaction
Error - Compiled
Context Section - A section in the compiled context snapshot.
- Context
Entry - Structured input item for the public context compiler view.
- Context
Error - Errors raised while constructing or compiling structured context.
- Context
Window Source - Source used to resolve a model context window.
- Durable
Memory Error - Why a durable-memory operation failed.
- Final
Output Contract Error - Errors raised while constructing a final-output contract.
- Frontmatter
Error - Errors raised while extracting and parsing
SKILL.mdfrontmatter. - History
Retention - Policy governing how compacted session history is retained in memory and on disk.
- Hook
Decision - Typed hook decision returned over the host bridge.
- Hook
Error - Errors produced by hook execution or invalid hook decisions.
- Hook
Point - Lifecycle boundary where a runtime hook can intercept execution.
- Hook
Request - Typed hook request payload sent over the host bridge when subscribed.
- Host
Fallback Reason - Why a permission request reached the host after AI review was attempted.
- Host
Integration - Host integration and supporting client files exposed to inner process actions. Trusted global configuration is the capability ceiling and preauthorizes the inner action sandbox; an integration the configuration did not enable can still be requested for one permissioned action when the backend supports it and its endpoint is visible.
- Interactive
Error - Interactive
RunMessage - Runtime message contract shared by interactive and non-interactive runs.
Runtime message contract shared by interactive and non-interactive runs.
Runtime message contract shared by interactive and non-interactive runs.
Message emitted by an
AgentRun. - Interrupt
Reason - Local
Workspace Process Sandbox Profile - Declared sandbox/profile associated with local workspace process admission.
- Memory
Write Kind - Kind of
apply_patchchange aimed at a memory file. - Network
Access Decision - Three-state decision produced by
NetworkAccessPolicy. - Path
Access - Filesystem access granted or denied for one configured path.
- Path
Access Decision - Three-state decision produced by
WorkspaceAccessPolicy. - Path
Access Rule Source - Trust source for a path access rule.
- Path
Denial Reason - Specific reason a path evaluation returned
PathAccessDecision::Deny. - Permission
Actor - Identifies whether a permission review request originated from the main session or a managed subagent.
- Permission
Admission Decision - Result returned by a permission admission gate.
- Permission
Admission Error - Errors raised by permission request parsing or admission.
- Permission
Admission Review Source - Permission
Review Mode - Review mode for explicit permission requests.
- Permission
Review Response Error - Error returned when a host responds to a pending review request.
- Permission
Review Risk - Permission
User Authorization - Permissioned
Action - Exact action covered by a permission request.
- Plan
Error - Typed errors returned by Plan Mode state transitions and document authoring.
- Process
Action Error - Validation errors for provider-neutral process action values.
- Process
Command Tool Error - Errors raised while constructing the runtime-owned process command tool.
- Process
EnvPolicy - Minimal process environment override policy for SP1.
- Process
Exit Status - Provider-neutral process completion status.
- Process
Path Grant Constraint - Backend facts that constrain retention of an approved path capability.
- Process
Runner Error - Infrastructure errors returned by a process runner.
- Prompt
Error - Invalid typed prompt composition.
- Requested
Capability - Extra capability requested for a permissioned action.
- Review
Guidance Decision - Whether a human review guidance note accompanied an approval or a denial.
- Runtime
Error - Errors raised by Merry runtime construction and step admission.
- Runtime
Model Role - Runtime model role for a configured provider/model pair.
- Runtime
Profile Error - Errors raised while building a complete runtime profile.
- Runtime
Trust Level - How much runtime should trust the host/runtime owner for permission gates.
- Send
Subagent Message Outcome - Strongly typed, non-ambiguous delivery outcome for
send_subagent_message. - Session
Permission Grant Kind - Capability represented by one active session-scoped permission grant.
- Session
Store Error - Session
Transcript Item - Read-only public projection of persisted session transcript items.
- Skill
Error - Errors raised while validating skill metadata or configured skill roots.
- Skill
Load Warning Reason - Reason a discovered
SKILL.mdfile was left out of the catalog. - Spawn
Wait Mode - Optional wait behavior for
spawn_subagents. - Spawned
Subagent Status Label - Provider-visible status labels possible immediately after spawn.
- Subagent
Error - Validation errors for subagent task contracts and configuration.
- Subagent
Limit Behavior - Admission behavior when a spawn request exceeds
max_threads. - Subagent
Message Delivery - Delivery policy for
send_subagent_message. - Subagent
Status Label - Compact child lifecycle status.
- Subagent
Workspace Mode - Filesystem isolation mode for a child subagent.
- Subagent
Worktree Base - Snapshot source used when creating a child Git worktree.
- Tool
Action Kind - Runtime-owned action category for registered tools.
- Tool
Action Preflight - Result of a tool action preflight/proposal hook.
- Tool
Build Error - Errors raised while constructing a typed application tool.
- Tool
Concurrency - Runtime execution policy for calls that appear in the same model batch.
- Tool
Execution Error - Infrastructure-level errors raised by tool executors.
- Tool
Hook Filter - Filter selecting which tools trigger a tool-level hook point.
- Tool
Output - Complete public text or JSON output for a tool result.
- Tool
Output Kind - Kind of recorded tool output.
- Tool
Output Stream - Output stream carrying a live
RuntimeEvent::ToolCallOutputDeltachunk. - Tool
Runner - Where a registered tool is executed.
- Wait
Mode - Wait behavior for
wait_subagents.
Constants§
- AUTO_
COMPACT_ THRESHOLD_ PERCENT - Share of the dynamic body budget that starts automatic compaction.
- DEFAULT_
AGENT_ LOOP_ MAX_ MODEL_ TURNS - Generic SDK/runtime default for one top-level agent run.
- DEFAULT_
CONTEXT_ WINDOW_ FALLBACK_ TOKENS - Coding-agent fallback used when config, provider metadata, and model catalogs are absent.
- DEFAULT_
FOREGROUND_ WAIT_ BUDGET_ SECS - Default foreground wait budget in seconds before handing off to background.
- DEFAULT_
MAX_ MODEL_ TURNS - Default bounded child loop model-turn count.
- DEFAULT_
MIN_ MODEL_ TURNS - Default minimum model-turn budget for a generic child task.
- DEFAULT_
PROCESS_ WAIT_ TIMEOUT_ SECS - Default foreground wait timeout in seconds before handing off to background.
- FINAL_
OUTPUT_ TOOL_ NAME - Reserved provider-visible tool name used for structured terminal output.
- MAX_
CONTEXT_ FILES_ TOTAL_ BYTES - Maximum total UTF-8 bytes preloaded across all
context_filesfor one child task. - MAX_
CONTEXT_ FILE_ REFS - Maximum number of
context_filesreferences accepted for one child task. - MAX_
PERMISSION_ USER_ NOTE_ BYTES - Maximum UTF-8 byte length accepted for a human-supplied permission review note.
- MAX_
PROCESS_ ARGV_ ITEMS - Maximum accepted number of argv items in a process intent.
- MAX_
PROCESS_ ARG_ BYTES - Maximum accepted byte length for one argv item in a process intent.
- MAX_
PROCESS_ CWD_ BYTES - Maximum accepted byte length for a workspace-relative process cwd.
- MAX_
PROCESS_ OUTPUT_ LIMIT_ BYTES - Maximum accepted captured byte limit per process output stream.
- MAX_
PROCESS_ STDIN_ TEXT_ BYTES - Maximum accepted byte length for inline stdin text.
- MAX_
PROCESS_ WAIT_ TIMEOUT_ SECS - Maximum accepted foreground wait timeout in seconds for one
run_processcall. - MAX_
SESSION_ REVIEW_ GUIDANCE - Maximum number of user-authored review guidance entries retained per session.
- MAX_
USER_ IMAGES - Maximum number of images accepted in one user message.
- MAX_
USER_ IMAGE_ DIMENSION - Maximum width or height accepted for one image.
- MAX_
USER_ IMAGE_ PIXELS - Maximum decoded pixel count accepted for one image.
- MAX_
USER_ IMAGE_ PNG_ BYTES - Maximum encoded PNG size accepted for one image.
- MAX_
USER_ IMAGE_ TOTAL_ PNG_ BYTES - Maximum combined encoded PNG size accepted for one user message.
- SUBAGENT_
HANDOFF_ CONTEXT_ ID - Construction-context id for the child’s preloaded files and expected output handoff.
Traits§
- Background
Process Control - Session-owned control surface for retained background processes.
- Child
Runtime Factory - Object-safe factory for constructing bounded child runtimes.
- Child
Workspace Lifecycle - Runtime-owned hook invoked when a child with an isolated workspace settles.
- Permission
Admission Source - Object-safe permission admission boundary.
- Permissioned
Process Runner Factory - Factory for runners created from approved permission requests.
- Process
Runner - Object-safe runtime process runner boundary.
- Runtime
Hook Handler - Object-safe async hook handler evaluated in-process by the Rust runtime.
- Tool
Executor - Object-safe runtime tool executor boundary.
Functions§
- bundled_
model_ context_ window - Conservative bundled context window lookup for well-known model identifiers.
- citation_
compaction_ tail_ directive - Instructions appended to a compaction request.
- classify_
process_ action_ review_ triggers - Classifies all concrete AST-based action-review triggers for one process intent.
- decide_
checkpoint - Decides whether dynamic body growth has reached the compaction threshold.
- extract_
product_ private_ paths - Extracts canonicalized
ProductPrivatepaths from a slice of path rules. - host_
shell_ chain_ separator - Returns the error-propagating command chain separator for the active host
shell (
"&&"on Unix,pwsh, and Git Bash;";"on Windows PowerShell 5.1 andcmd.exe). - host_
shell_ has_ unix_ utilities - Returns whether Unix text/search utilities (
grep,find,sed,head,tail) are expected to be available in the active host shell. - host_
shell_ name - Returns the short name of the active host shell (
"bash"on Unix;"pwsh","powershell","bash", or"cmd.exe"on Windows). - is_
explicit_ local_ network_ host - Returns whether
hostexplicitly names a local loopback target (localhost,127.0.0.0/8,::1, or IPv4-mapped loopback IPv6). - is_
git_ metadata_ path - Returns whether
path(either lexically or after resolving symlinks on its existing ancestor) targets.gitmetadata. - is_
low_ risk_ process_ action_ intent - Returns whether a process intent may enter the SP3-A low-risk process lane.
- is_
protected_ host_ path_ for_ persistence - Returns whether
pathis a protected Merry host path (or covers one as an ancestor) and therefore must never be persisted toworkspace-permissions.json. - is_
protected_ in_ unrestricted_ mode - Returns whether
pathhits or overlaps (as descendant OR ancestor) any built-in MerryProductPrivatepath in unrestricted (--sandbox off) mode. - is_
read_ only_ shell_ process_ action_ intent - Returns whether a process intent is a plain read-only shell-wrapper action.
- normalize_
line_ endings - Normalizes CRLF (
\r\n) and bare CR (\r) line breaks into\n. - normalize_
network_ domain - Normalizes a hostname or IP literal for exact domain policy matching.
- normalize_
path_ lexically - Lexically normalizes
.and..components without touching the filesystem. - once_
grants_ cover_ path - Checks whether single-action
once_grantscoverpathatrequestedaccess. - parse_
permission_ request - Parses a permission request tool call without additional review context.
- preload_
context_ files - Safely preloads
context_fileswithin the child’s effective read boundary and byte cap. - process_
command_ tool - Creates a registered process command tool for runtime agent loops.
- read_
background_ process_ tool - Registers the read-only background process tool.
- render_
subagent_ handoff - Renders
<merry_subagent_handoff>when either preloaded files orexpected_outputexist. - request_
permissions_ tool - resolve_
context_ window - Resolves context window metadata without provider probing.
- resolve_
path_ with_ existing_ ancestor - Canonicalizes
path, or canonicalizes its deepest existing ancestor and appends the remaining lexical components, simplifying Windows verbatim prefixes. - sanitize_
freeform_ text - Sanitizes untrusted freeform natural-language text for runtime storage and model requests.
- shell_
command_ for_ argv - Converts an argv vector into one shell command string for a model-facing command field. Existing platform shell wrappers are unwrapped so their script is preserved; direct argv items are quoted for the host shell.
- stop_
background_ process_ tool - Registers the tool that stops one retained background process group.
- subagent_
base_ instructions - Builds dedicated base instructions for a bounded subagent runtime.
- subagent_
registered_ tools - Returns provider-visible subagent tool specs with runtime-owned executors.
- subagent_
registered_ tools_ with_ roles - Returns provider-visible subagent tool specs advertising the enabled role
catalog in
spawn_subagents’s description. - subagent_
tool_ specs - Returns provider-visible subagent tool specs.
- summarize_
action_ review_ triggers - Formats a compact human-readable reason sentence from structured triggers.
- user_
image_ label - Returns the canonical one-based label for a user image.
- validate_
no_ write_ scope_ conflicts - Rejects child batches where two shared-workspace write scopes overlap.
- validate_
permission_ user_ note - Validates and normalizes a human-supplied permission review note across interactive TUI, headless CLI, runtime admission, and workspace persistence.
Type Aliases§
- Hook
Future - Boxed async future returned by object-safe runtime hook handlers.
- Permission
Admission Future - Boxed admission review future.
- Process
Runner Future - Boxed process runner future used for object-safe runtime process boundaries.
- Process
Runner Result - Result returned by a runtime-owned process runner.
- Subagent
Activity Receiver - Receiver for the latest sorted activity snapshot set.
- Tool
Action Proposal Future - Boxed action proposal future used for object-safe async tool boundaries.
- Tool
Action Proposal Result - Optional proposal returned before a write-classified tool can be resolved by policy.
- Tool
Execution Result - Result returned by a runtime-owned tool executor.
- Tool
Executor Future - Boxed tool executor future used for object-safe async tool boundaries.