Skip to main content

Crate harn_stdlib

Crate harn_stdlib 

Source
Expand description

Canonical embedded Harn standard library source catalog.

This crate intentionally contains only static source strings. The compiler, runtime, and tooling read them through harn-stdlib-catalog and never depend on this crate, so editing a stdlib module rebuilds only this crate and the binaries that link it. A host calls install once at startup. Loading this catalog is pure: modules cannot register ambient effects, and every effectful stdlib function must receive its typed Harness capability explicitly from the caller, including callbacks that may perform effects.

The sources are embedded as one zstd archive, about a fifth of their size, which the first catalog read decodes for the rest of the process.

Structs§

StdlibCatalog
Every embedded stdlib source a host provides.
StdlibCliScript
Embedded .harn script that backs a CLI subcommand. Looked up by the harn-cli dispatch wedge (see harn#2293 epic and harn#2294 G1) so subcommands can ship in Harn instead of Rust.
StdlibEntrypointModule
StdlibPromptAsset
One embedded prompt template, addressed by its path under std/.
StdlibPublicFunction
StdlibSource
One embedded stdlib module, imported as std/<module>.

Constants§

CONNECTOR_EVENT_SCHEMAS_SOURCE
Canonical normalized connector event schemas, authored as Harn type declarations. This is the SOURCE OF TRUTH for the Rust event-payload structs in crates/harn-vm/src/triggers/event/schemas_generated.rs, which are generated from these declarations by harn connector-schema-codegen.

Statics§

CATALOG
This crate’s catalog: every embedded stdlib module, prompt asset, and CLI script, in the order catalog_entries.rs lists them.

Functions§

builtin_reexports
Builtins a stdlib module re-exports under its own name, so import { assert_eq } from "std/testing" resolves.
entrypoint_modules
find_cli_script
Find an embedded CLI subcommand script by name. Returns the embedded source string when present, or None if no script with that name is registered in CATALOG.
get_stdlib_prompt_asset
get_stdlib_source
install
Install CATALOG as the process’s standard library. Hosts call this once at startup, before running Harn code; calling it again is a no-op.
public_functions_for_module