Skip to main content

Module stdlib

Module stdlib 

Source
Expand description

Standard library builtins for the Harn VM.

Modules§

agent_state
asset_paths
Re-export of harn_modules::asset_paths plus a VM-side convenience that anchors the project-root walk at the currently-executing source file (via VM_SOURCE_DIR) and falls back to the existing source-relative resolver when the path is not an @-prefixed asset reference.
host
long_running
macros
Support module referenced by #[harn_builtin]-emitted code.
process
secret_scan
template
Prompt-template engine for .harn.prompt assets and the render / render_prompt builtins.
token_redaction
std/oauth/redaction (OA-06) — OAuth token redaction stdlib.
tracing
workflow_messages

Functions§

all_builtin_defs
Aggregate of every #[harn_builtin]-emitted VmBuiltinDef in the stdlib.
all_builtin_signatures
Driver-facing helper: flatten the macro-emitted BuiltinDefs into a &'static [&'static BuiltinSignature] slice suitable for harn_builtin_registry::install_builtin_signatures.
register_agent_stdlib
Register agent builtins (requires network access and async runtime).
register_all_macro_builtins
Register every #[harn_builtin]-emitted def on the given VM. Drivers that build the full stdlib via register_vm_stdlib get this for free — each module’s register_*_builtins walks its MODULE_BUILTINS slice. This helper is exposed for embedders / tests that want a one-call entry.
register_core_stdlib
Register core builtins: pure/deterministic, no I/O.
register_io_stdlib
Register I/O builtins (requires OS access).
register_vm_stdlib
Register all standard builtins on a VM (core + io + agent). Also installs the macro-emitted signature slice into the parser registry (idempotent under repeat calls with the same slice pointer).
register_vm_stdlib_with_deferred_llm
Register the stdlib shape used by latency-sensitive CLI execution. Also installs the macro-emitted signature slice into the parser registry.
reset_stdlib_state
Reset thread-local stdlib state. Call between test runs.
stdlib_builtin_metadata
Return discoverable metadata for registered stdlib builtins.
stdlib_builtin_names
Return the canonical list of all stdlib builtin names. Used by harn-lint and harn-lsp to avoid hardcoded duplicate lists.