Skip to main content

Crate oxdock_cli

Crate oxdock_cli 

Source

Re-exports§

pub use __oxdock_embed_UsageAssets::UsageAssets;

Modules§

__oxdock_embed_UsageAssets

Structs§

EndpointFlags
Endpoint exposure flags from CLI args. Built by Options::parse, consumed by build_registry.
Engine
Host-extension engine: the single front door for registering Rust functions and types and running scripts against them.
EngineOutput
Output of one Engine run: the final working directory, the filesystem handle the run executed against, and the top-level script variable bindings captured at completion.
ExecState
Execution state for one script run. Public so hosts can register functions and introspect listings; all fields stay crate-private so the scope, recursion-budget, and task invariants cannot be broken from outside.
ExecutionResult
Output of a script execution (issue #131).
ExitRequest
Pipeline exit request carrying the numeric code. Produced by EXIT, re-raised by REMOTE when the guest exits, and mapped to the process exit status by the CLI.
FuncMeta
Introspectable metadata for one function. Single source for DESCRIBE(name) output and the static function reference. rpn names whether the function also runs on the compiled math path (true for pure functions and opted-in stateful ones); everything runs on the AST path.
FuncParam
One declared parameter of a registered function. param_type is None for unconstrained Value parameters (the macro accepts any value). allowed names the closed value set for constrained STRING parameters, declared once via #[values(...)]: the generated extractor enforces membership and the reference renders the set, so the list cannot rot apart from the check. docs carries the parameter’s description (parsed from the # Arguments doc section for macro functions, written inline for hand-built entries) and renders into every reference surface. options declares the known keys of a MAP options parameter: same single-source rule as allowed, with per-key types, required flags, defaults, and docs. optional marks a trailing MAP parameter callers may omit: the runtime fills an empty MAP, and signatures render = {}. Only trailing MAP params may be optional (run-start validation rejects anything else), so omission always means “no options”. The macro never emits optional params: only hand-built entries use them, and only for options MAPs.
HostModule
One host library: functions and types registered under a single module name. Engine::register_module stages these; runs expose them as MODULE::NAME calls with MODULE provenance on every entry.
Options
Step
StepCtx
Per-step execution context handed to every command handler.
TypeDescriptor
Value-model re-exports: the word, its payload, type descriptors, and the export hook live in crate::value, the single representation for every type. Vtable for one type: lifecycle plus operations. All hooks are plain function pointers (never closures) so descriptors stay Copy and the global table hands them out by value. Every hook documents the payload domain it expects; calling one with a foreign payload is unsound, and every call site is a single choke point reviewed with the layout.
Value
Value-model re-exports: the word, its payload, type descriptors, and the export hook live in crate::value, the single representation for every type.

Enums§

FuncKind
Origin of a callable in the unified function registry. Script is an interpreted FUNC body; HostCtx and HostPure are compiled Rust functions (the #[oxdock_func] host export macro). Builtins and runtime-registered hosts share the host kinds; only DESCRIBE output shows the label, and both host kinds keep rendering as host.
Guard
One namespaced guard predicate. Every guard in the language is a namespace plus an optional subject plus an optional value; the single disjointness rule compares the whole triple, so no domain ever needs its own table.
HostRegistration
One host-registered function, grouped into a HostModule and passed to Engine::register_module. Build the entry with the #[oxdock_func]- generated registration marker, or by hand. Pure entries run on both the AST and the compiled RPN math paths; Stateful entries run on the AST path with full step context. Both entries carry a stateful body plus a pure string projection: every context with step IO runs the body, while {{ }} placeholder expansion (which has no step context) runs the projection.
ScriptSource
StepKind

Traits§

OxDockFn
Export hook for a DSL function, implemented by #[oxdock_func] on a registration marker. The engine calls registration() and never names a generated symbol.
OxDockType
Value-model re-exports: the word, its payload, type descriptors, and the export hook live in crate::value, the single representation for every type. Export hook for a DSL payload type, implemented by #[oxdock_type] on the payload struct itself. The canonical descriptor singleton backs every word of the type; user code never names a generated symbol.

Functions§

build_registry
Build the run’s endpoint registry from CLI flags and bind every mapped socket now: callers run this before parsing so bind conflicts fail fast, never parse-then-fail-on-bind.
dry_run_closure
execute
execute_with_result
exit_code_of
Outermost EXIT code in the chain, if any. Relays preserve the code unchanged, so first-found and last-found agree; outermost wins because it is the most recent relay decision.
parse_script
Parse a script using the production lower_command dispatcher. The typed ParseError converts into anyhow::Error at this boundary with no intermediate .context() wrapping, so the message survives. Builtin function names seed the reserved set, so FUNC shadowing a native fails here; hosts unknown at parse time fall back to the runtime define_func guard.
parse_script_with_modules
Parse with a module provenance table so calls resolve statically: qualified MODULE::NAME checks membership, bare NAME resolves through SCRIPT definitions and IMPORTed modules. Reserved covers builtins plus every table module, so FUNC shadowing any of them fails here; hosts unknown at parse time fall back to the runtime define_func guard.
process_exit_code
Process exit status for a failed CLI run: relays an EXIT code (host or guest-relayed) clamped to the portable 0..=255 range, 1 for every other failure.
run
run_script
run_steps
Execute the DSL with the CLI default: a lazily-created snapshot. No temporary directory exists until the first snapshot-targeted resolution. Reads of existing workspace files fall through to the build context, but directory listings (GLOB, LS) are snapshot-scoped, so workspace discovery belongs before the lazy run or under WORKSPACE LOCAL. Fire-and-forget form of run_steps_with_lazy_snapshot: for bindings and the snapshot handle, call that directly. For runs that must land exactly in a given root with no snapshot, use run_steps_without_snapshot.
run_steps_with_context
run_steps_with_context_result
Execute the DSL and return the final working directory after all steps.
run_steps_with_lazy_snapshot_and_modules_and_entry
Same as run_steps_with_lazy_snapshot_and_modules, plus the entry script file (#115): top-level relative IMPORT paths resolve against its parent directory.
run_steps_with_manager_with_modules
Same as run_steps_with_manager, plus host modules and types. Each module’s functions become callable as MODULE::NAME with full step context; each type descriptor becomes visible to TYPES() and valid for LET $x: NAME declarations carrying same-named opaque payloads. Authors should derive entries with #[oxdock_func] / #[oxdock_type] (see oxdock-func-macro) and group them into HostModule instead of hand-writing metadata and glue.
run_steps_with_manager_with_modules_and_entry
Same as run_steps_with_manager_with_modules, plus the entry script file (#115): top-level relative IMPORT paths resolve against its parent directory. None resolves imports against the workspace root.
run_steps_without_snapshot
Without snapshot: execute directly against fs_root with no snapshot, so writes land exactly in the given root and read-backs observe them. Tests pinning on-disk state and hosts with caller-built filesystems want this; interactive runs want run_steps.
shell_program
usage
Human-readable CLI usage, printed for --help/-h. The full text, version line included, is rendered once at compile time by the UsageAssets script above. Feature selection stays in Rust #[cfg]: the DSL has no feature namespace, so each variant lives in its own asset file.
version
Human-readable CLI version, printed for --version/-V.

Type Aliases§

NativeFn
Stateful/IO function with full step context (fs, cwd, envs, vars, pipes).
PureFn
Pure scalar function: no filesystem, no scope, no process access. Usable from both AST evaluation and compiled RPN math.
PushManifestSink
Shared append-only manifest of executed --to-host declarations.