Expand description
Portable durable Code Mode runtime for multicast tools.
This crate owns connector discovery, model-facing type generation, approval policy, deterministic replay, snippets, and lifecycle state. Sandbox execution and durable persistence are supplied through traits so the same runtime can run through local or remote executors.
Re-exports§
pub use multicast::telemetry::opentelemetry;
Modules§
- workflow_
schema - Bounded input and output validation shared with workflow command adapters. A bounded JSON Schema checker for workflow input.
Structs§
- Artifact
Ref - Durable reference to a JSON artifact stored outside execution state.
- Call
Attempt - Identity and durable attempt count of the current connector call.
- Capability
Snapshot - Immutable connector metadata captured when an execution begins.
- Code
Mode - Generic Code Mode lifecycle over interchangeable execution and storage adapters.
- Code
Mode RunOptions - Transport context inherited by one Code Mode execution pass.
- Code
Mode Runtime - Portable deterministic replay and approval state machine.
- Connector
Description - Model-visible description of a connector.
- Connector
Example - One model-facing connector usage example.
- Connector
Tool - Metadata for one connector method.
- Default
Tool Policy Resolver - Conservative default policy resolver.
- Describe
Output - Documentation for one connector, method, or snippet.
- Dispatch
Response - Wire-safe result of one connector dispatch.
- Dispatch
Session - One replay pass’s sequenced bridge between a sandbox and Rust connectors.
- Execute
Result - Result returned by a Code Mode program executor.
- Execution
Checkpoint - Engine-owned continuation saved independently of the model-facing execution record.
- Execution
Host - Execution-scoped bridge from a local engine into durable dispatch.
- Execution
State - Durable state for one sandbox program.
- Execution
Trace - Last active pass’s tracing identity, safe to retain in the execution store.
- LogEntry
- One entry in the deterministic replay spine.
- McpConnector
- Exposes a remote MCP connection as a Code Mode connector.
- McpTool
- MCP tool metadata used by the transport-neutral MCP adapter.
- Memory
Artifact Store - In-memory artifact store for local use and tests.
- Memory
Store - In-memory runtime store for native use and deterministic tests.
- Multicast
Connector - Adapts a multicast command graph into one Code Mode connector.
- Open
ApiConnector - Derives typed Code Mode tools from an OpenAPI document.
- Open
ApiRequest - Authenticated request derived from an OpenAPI operation.
- Pending
Action - A pending connector action shown to an approval UI.
- Program
Source Options - Adapter-specific settings for the shared Code Mode JavaScript harness.
- Retry
Policy - Opt-in budget for transient connector failures, including the first attempt.
- Search
Output - Bounded ranked search response.
- Search
Result - One ranked connector method or snippet match.
- Snippet
- A saved, addressable sandbox program.
- Step
Response - Wire-safe decision for a local
codemode.stepcallback. - System
Clock - Native system clock used by default.
- Tool
Annotations - Runtime annotations for one connector method.
- Tool
Context - Stable execution context passed to connector calls and compensation.
- Tool
Policy - Resolved approval and deterministic replay policy for one method.
- Workflow
Child - Bounded descendant diagnostic; authority and connector arguments stay private.
- Workflow
Definition - Portable source and explicit data; no lexical environment is serialized.
- Workflow
Identity - Saved workflow identity attached to execution spans, never metric labels.
- Workflow
Limits - Host-owned limits shared by every descendant of one root execution.
- Workflow
Reference - Non-secret, store-qualified immutable workflow identity.
- Workflow
Wait - Explicit child wait, distinct from approval and uncertain-effect reconciliation.
Enums§
- Call
Recovery - Host reconciliation of a call whose result was not committed locally.
- Code
Value - A value that preserves JavaScript-only primitives across JSON and RPC.
- Dispatch
Request - Host request emitted by an executing Code Mode program.
- Execution
Event - Ordered event retained with one execution.
- Execution
Status - Durable execution status.
- LogEntry
State - Durable state of one logged call.
- Replay
Policy - Replay behavior for a connector call.
- Runtime
Error - Runtime state and persistence failures.
- Tool
Decision - Runtime decision for the next deterministic call.
- Tool
Origin - Trust boundary used while resolving tool policy.
Constants§
- CALL_
NOT_ SENT - Error code a local command returns when its call provably never reached the remote system, for example because the caller’s credential is missing. The run pauses and the call executes again after resume instead of being reconciled as uncertain.
- DEFAULT_
AUTO_ PRUNE_ GRACE_ MS - Minimum age after completion before automatic history pruning may remove a result.
- DEFAULT_
MAX_ EVENTS - Maximum number of ordered lifecycle events retained per execution.
- DEFAULT_
MAX_ EXECUTIONS - Default number of older terminal executions retained by automatic pruning.
- DEFAULT_
PAUSED_ TTL_ MS - Default age after which a paused or abandoned running execution expires.
- MAX_
CALL_ ATTEMPTS - Maximum host invocations allowed for one call between successful results.
- MAX_
DURABLE_ VALUE_ BYTES - Maximum serialized bytes for one durable value.
Traits§
- Artifact
Store - Storage contract for oversized replay and final values.
- Clock
- Supplies monotonic-enough Unix millisecond timestamps to Code Mode.
- Code
Executor - Executes model-generated JavaScript for one replay pass.
- Code
Mode Service - Send-safe lifecycle boundary used by transports and native actor handles.
- Connector
- A transport-neutral source of sandbox-callable tools.
- McpClient
- Minimal MCP client contract required by Code Mode.
- Open
ApiClient - Host operations required by the OpenAPI connector.
- Runtime
Store - Persistent operations required by the portable runtime.
- Tool
Policy Resolver - Resolves approval and replay behavior from tool metadata.
Functions§
- build_
checkpoint_ source - Builds a promise queue whose continuation belongs entirely to the JavaScript heap.
- build_
program_ source - Builds the shared body used by local and remote Code Mode executors.
- decode_
value - Decodes a JSON-safe tagged representation into a Code Mode value.
- describe
- Describes one connector, method, or saved snippet.
- encode_
value - Encodes a Code Mode value into a JSON-safe tagged representation.
- generate_
types - Generates the TypeScript declarations shown to the model for a connector.
- json_
schema_ to_ type - Converts a JSON Schema value into a model-facing TypeScript type.
- normalize_
code - Normalizes model-generated JavaScript into an async zero-argument function.
- sanitize_
identifier - Makes an arbitrary tool name safe for use as a JavaScript identifier.
- sanitize_
namespace - Validates and normalizes a namespace from a CLI or connector name.
- search
- Searches connector methods and saved snippets with weighted token matching.