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§
- Stdlib
Catalog - Every embedded stdlib source a host provides.
- Stdlib
CliScript - Embedded
.harnscript that backs a CLI subcommand. Looked up by theharn-clidispatch wedge (see harn#2293 epic and harn#2294 G1) so subcommands can ship in Harn instead of Rust. - Stdlib
Entrypoint Module - Stdlib
Prompt Asset - One embedded prompt template, addressed by its path under
std/. - Stdlib
Public Function - Stdlib
Source - One embedded stdlib module, imported as
std/<module>.
Constants§
- CONNECTOR_
EVENT_ SCHEMAS_ SOURCE - Canonical normalized connector event schemas, authored as Harn
typedeclarations. This is the SOURCE OF TRUTH for the Rust event-payload structs incrates/harn-vm/src/triggers/event/schemas_generated.rs, which are generated from these declarations byharn connector-schema-codegen.
Statics§
- CATALOG
- This crate’s catalog: every embedded stdlib module, prompt asset, and CLI
script, in the order
catalog_entries.rslists 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
Noneif no script with that name is registered inCATALOG. - get_
stdlib_ prompt_ asset - get_
stdlib_ source - install
- Install
CATALOGas 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