Skip to main content

Crate incurs_codemode

Crate incurs_codemode 

Source
Expand description

Portable durable Code Mode runtime for incurs 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.

Structs§

ArtifactRef
Durable reference to a JSON artifact stored outside execution state.
CapabilitySnapshot
Immutable connector metadata captured when an execution begins.
CodeMode
Generic Code Mode lifecycle over interchangeable execution and storage adapters.
CodeModeRunOptions
Transport context inherited by one Code Mode execution pass.
CodeModeRuntime
Portable deterministic replay and approval state machine.
ConnectorDescription
Model-visible description of a connector.
ConnectorExample
One model-facing connector usage example.
ConnectorTool
Metadata for one connector method.
DefaultToolPolicyResolver
Conservative default policy resolver.
DescribeOutput
Documentation for one connector, method, or snippet.
DispatchResponse
Wire-safe result of one connector dispatch.
DispatchSession
One replay pass’s sequenced bridge between a sandbox and Rust connectors.
ExecuteResult
Result returned by a Code Mode program executor.
ExecutionHost
Execution-scoped bridge from a local engine into durable dispatch.
ExecutionState
Durable state for one sandbox program.
IncurConnector
Adapts an incurs command graph into one Code Mode connector.
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.
MemoryArtifactStore
In-memory artifact store for local use and tests.
MemoryStore
In-memory runtime store for native use and deterministic tests.
OpenApiConnector
Derives typed Code Mode tools from an OpenAPI document.
OpenApiRequest
Authenticated request derived from an OpenAPI operation.
PendingAction
A pending connector action shown to an approval UI.
ProgramSourceOptions
Adapter-specific settings for the shared Code Mode JavaScript harness.
SearchOutput
Bounded ranked search response.
SearchResult
One ranked connector method or snippet match.
Snippet
A saved, addressable sandbox program.
StepResponse
Wire-safe decision for a local codemode.step callback.
SystemClock
Native system clock used by default.
ToolAnnotations
Runtime annotations for one connector method.
ToolContext
Stable execution context passed to connector calls and compensation.
ToolPolicy
Resolved approval and deterministic replay policy for one method.

Enums§

CodeValue
A value that preserves JavaScript-only primitives across JSON and RPC.
DispatchRequest
Host request emitted by an executing Code Mode program.
ExecutionEvent
Ordered event retained with one execution.
ExecutionStatus
Durable execution status.
LogEntryState
Durable state of one logged call.
ReplayPolicy
Replay behavior for a connector call.
RuntimeError
Runtime state and persistence failures.
ToolDecision
Runtime decision for the next deterministic call.
ToolOrigin
Trust boundary used while resolving tool policy.

Constants§

DEFAULT_MAX_EVENTS
Maximum number of ordered lifecycle events retained per execution.
DEFAULT_MAX_EXECUTIONS
Default number of terminal executions retained by a runtime.
DEFAULT_PAUSED_TTL_MS
Default age after which a paused or abandoned running execution expires.
MAX_DURABLE_VALUE_BYTES
Maximum serialized bytes for one durable value.

Traits§

ArtifactStore
Storage contract for oversized replay and final values.
Clock
Supplies monotonic-enough Unix millisecond timestamps to Code Mode.
CodeExecutor
Executes model-generated JavaScript for one replay pass.
CodeModeService
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.
OpenApiClient
Host operations required by the OpenAPI connector.
RuntimeStore
Persistent operations required by the portable runtime.
ToolPolicyResolver
Resolves approval and replay behavior from tool metadata.

Functions§

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.