Light Dark

Functions

exists

fn (rel-path: Str): Bool

Return true when rel-path is present in the registry.

list

fn (): Vec

Return every registered resource as a Vec<ResourceRef>. Order matches the order in which roots were declared, then alphabetical within each root.

list-matching

fn (glob: Str): Vec

Return every resource whose relative path matches glob. Uses .gitignore-style globbing (**, *, ?, character classes).

Example

docs list-matching("docs/**/*.md")

load

fn (rel-path: Str): Bytes

Read a resource as raw Bytes. Errors when the path is not in the resource registry.

Example

bytes load("images/logo.png")

load-str

fn (rel-path: Str): Str

Read a resource as a UTF-8 Str. Errors when the path is missing or the file is not valid UTF-8.

Example

text load-str("prompts/welcome.md")

ns alias

Alias of ::hot::resource/

Read-only access to project resources — files and directories bundled with a Hot deploy via hot.project.<name>.resources.paths.

Resources use a "classpath" lookup model: the union of files under every configured root is exposed by relative path. Use this module to read prompts, schemas, JSON config, container payloads, or any other static asset that should travel with your code.

Example

::res ::hot::resource

prompt ::res/load-str("prompts/welcome.md")
schema from-json(::res/load-str("schemas/user.json"))
js-files ::res/list-matching("**/*.js")

path

fn (rel-path: Str): Str

Return the canonical hot://res/<rel-path> URI for a resource. Useful for handing references to subsystems (Box mounts, file pipelines) that resolve hot:// URIs themselves.

Types

ResourceRef

ResourceRef type {
    path: Str,
    hash: Str,
    size: Int
}

Metadata about a single resource entry.

  • path — relative path used for lookup, e.g. "prompts/welcome.md".
  • hash — Blake3 content hash. Empty in dev mode until first read; populated at hot build/hot deploy time.
  • size — file size in bytes.