e7738de6d2
CI / Deep Native Runtime Cases (1/6) (push) Has been skipped
CI / Native Preflight (push) Failing after 1s
CI / Native Runtime Cases (1/2) (push) Failing after 0s
CI / Native Runtime Cases (2/2) (push) Failing after 1s
CI / Native Metadata Reports (push) Failing after 0s
CI / Native Direct Backend Artifacts (push) Failing after 0s
CI / Native Sanitizer Smoke (push) Failing after 1s
CI / Command Contract Snapshots (push) Failing after 1s
CI / Deep Conformance Suite (push) Has been skipped
CI / Graph Build Perf (push) Failing after 1s
CI / Deep Native Preflight (push) Has been skipped
CI / Deep Native Runtime Cases (2/6) (push) Has been skipped
CI / Deep Native Runtime Cases (3/6) (push) Has been skipped
CI / Conformance Suite (push) Failing after 1s
CI / Workspace Checks (push) Failing after 0s
CI / Deep Native Runtime Cases (5/6) (push) Has been skipped
CI / Deep Native Runtime Cases (6/6) (push) Has been skipped
CI / Deep Native Runtime Cases (4/6) (push) Has been skipped
CI / Deep Graph Build Perf (push) Has been skipped
116 lines
142 KiB
C++
116 lines
142 KiB
C++
/* Generated from Zero skill data. Run node --experimental-strip-types --disable-warning=ExperimentalWarning scripts/embed-skill-data.mts to refresh. */
|
|
#ifndef ZERO_EMBEDDED_SKILLS_INC
|
|
#define ZERO_EMBEDDED_SKILLS_INC
|
|
|
|
typedef struct {
|
|
const char *name;
|
|
const char *description;
|
|
bool hidden;
|
|
const char *const *content;
|
|
} ZeroEmbeddedSkill;
|
|
|
|
static const char *const zero_embedded_skill_agent_chunks[] = {
|
|
"---\nname: agent\ndescription: Graph-first agent workflow for making focused Zero changes with CLI feedback.\n---\n\n# Zero Agent Workflow\n\nUse this when editing Zero code. `zero.graph` is compiler input; `.0` is the human projection. Use JSON only when another tool must parse stable fields.\n\n## Edit Through Patch\n\nAnchored edits win. Do not retype a function for one line or rewrite `.0` for one declaration.\n\n1. `--replace-in-fn`: edit one function's canonical body text.\n\n```sh\nzero patch . --replace-in-fn handleLine --old 'limit + 1' --new 'limit + 2'\n```\n\n`--old` must match `zero view --fn <name>` output exactly once.\n\n2. `--replace-fn` for one whole body:\n\n```sh\nzero patch . --replace-fn greet --body-file - <<'EOF'\ncheck world.out.write(\"hello agent\\n\")\nEOF\n```\n\n3. Declaration work stays in ops; call sites update:\n\n```sh\nzero patch . --op 'setConst name=\"limit\" value=\"64\"'\nzero patch . --op 'addParamTo fn=\"scan\" name=\"bias\" type=\"i32\" default=\"0\"' # updates every call site\nzero patch . --op 'setReturnType fn=\"scan\" type=\"i64\"'\n```\n\n4. New helpers stay graph-native:\n\n```text\nzero-program-graph-patch v1\nupsertFunction handle\nfn handle(request: Span<u8>, response: MutSpan<u8>) -> Maybe<Span<u8>> {\n return null\n}\nend\n```\n\nPass a patch file, or stream full `zero-program-graph-patch v1` text with `zero patch . --patch-text -`.\n\nUse `addReturnExpr fn=\"maybe\" expr=\"null\"` for non-id returns and `appendStmt fn=\"main\" stmt=\"check std.http.listen(world, 3000_u16)\"` for one stmt. For pure helper tests, use `addTest name=\"addition works\" call=\"add\" arg0=\"2\" arg1=\"3\" expect=\"5\" type=\"i32\"`; reserve `addTestBody name=\"api add\" ... end` for custom bodies and remove bad ones with `deleteTest name=\"api add\"`. Labels are display names, not `__zero_test_*`.\n\nRunnable CLIs keep `World` on `pub fn main`; helpers are value-based. HTTP uses `handle(request, response)`.\n\nAfter `validated: check-equivalent`, the graph is saved and checked. Do not run `zero check`, `zero view`, or `zero export` just to confirm. `zero run . -- <args>` / `zero test` prove behavior or debug. Export only for requested `.0` review. Repeat `--op` to batch edits. For rewrites/handles: `zero skills get graph`.\n\nRead only for current code or handles:\n\n- `zero view --fn <name>`: one function source.\n- `zero view --fn <name> --around <text>`: enclosing block only.\n- `zero view --outline <module-or-file>`: signatures plus one-line docs.\n\nFor a new package: `zero init`, then `zero patch --op 'addMain'`.\n\n## zero query\n\n```text\nzero query [--json] [--fn <name>] [--find <text>] [--refs <name>] [--calls <name>]\n [--node <id>] [--depth <n>] [--full] [--handles] [--no-help] [graph-input|name]\n```\n\n- bare name that is not an existing path: runs `--find` against the current package\n- `zero query --fn <name> --handles`: patch handles for one function\n",
|
|
"- add `--no-help` when you need handles without the patch-operation footer\n- `--find <text>`: search names, ids, types, values, and node kinds; prints matches with spans\n- `--calls <name>` / `--refs <name>`: resolved calls and semantic references\n- `--node <id>`: one node's span, parents, and children; short handles resolve here too\n\nImport/export, identity recovery, structural edits, and merge live in `graph`. Direct `.0` edits are a last resort; never delete `zero.graph`.\n\n## Verify Before Done\n\nAfter a fix works, exercise typical and boundary inputs.\n\n```sh\nzero run . -- <typical input>\nzero run . -- <empty or boundary input>\nzero test\n```\n\nIf behavior changed, add or update a `test` block. On a diagnostic, run `zero explain <code>`.\n\n## Rules\n\n- Treat effects as capabilities, not ambient globals: `World`, `std.fs`, `std.args`, `std.env`.\n- Use `Maybe<T>`, explicit `raises` / `raises [...]`, and `check` / `rescue` instead of hidden failure.\n- Do not invent syntax or CLI fields; load `language` when unsure.\n- Check `stdlib` before hand-writing parsing or validation; it ships validators such as `std.time`, `std.inet`, `std.regex`, and `std.unicode`. Fetch one module with `zero skills get stdlib --topic std.time`.\n",
|
|
NULL
|
|
};
|
|
|
|
static const char *const zero_embedded_skill_builds_chunks[] = {
|
|
"---\nname: builds\ndescription: Build, run, target, and profile Zero programs.\n---\n\n# Zero Builds\n\nUse this when an agent needs to run, build, cross-build, inspect artifacts, or explain target support for a Zero program.\n\n## Inputs\n\nMost build commands accept one of these graph-backed inputs:\n\n- a direct `.graph` or `.program-graph` artifact\n- a package directory containing `zero.toml` or `zero.json`\n- a direct path to `zero.toml` or `zero.json`\n\nWhen both manifests are present in the same package root, Zero uses\n`zero.toml`. Prefer one checked-in manifest unless testing precedence.\n\nFor packages, normal check, build, run, test, size, and mem commands compile from the checked-in `zero.graph` store. When the `.0` source projection was edited, those commands refresh the stale store from source first and note it on stderr; set `ZERO_STALE=fail` to make staleness an error (RGP008) instead. They never rewrite `.0` files. Use `zero verify-projection` when CI or review needs projection drift to fail, and `zero export` only when a human-readable projection needs regeneration. When already inside a package, omit the input and commands default to the current directory.\n\n## Run\n\nUse `zero run` for the host development loop:\n\n```sh\nzero run\nzero run -- input.txt\nzero run examples/hello.graph\nzero run examples/cli-file.graph -- input.txt\n```\n\nArguments after `--` are passed to the Zero program.\n\n## Build\n\nUse `zero build` when the user asks for an artifact. It is the normal command\nfor executables, object files, LLVM IR, cross-target artifacts, and CI outputs.\nUse direct emitters. The removed generated-C backend is not a fallback path.\n\n```sh\nzero build --emit exe --out .zero/out/app\nzero build --emit obj --out .zero/out/app.o\nzero build --emit exe examples/hello.graph --out .zero/out/hello\nzero build --emit obj examples/hello.graph --out .zero/out/hello.o\n```\n\nUse LLVM only when the request is explicit. LLVM is experimental: it is not the\ndefault backend and not release eligible. Textual IR is inspectable with\n`--emit llvm-ir`; host executable builds require a ready clang toolchain. LLVM\ncurrently lowers scalar code, direct calls, branches, loops, primitive fixed\narrays, byte views, readonly strings, and primitive `std.mem` helpers:\n\n```sh\nzero build --backend llvm --emit llvm-ir examples/hello.graph --out .zero/out/hello.ll\nzero build --backend llvm --emit exe examples/hello.graph --out .zero/out/hello-llvm\nzero run --backend llvm examples/hello.graph\n```\n\nUse `--json` when a tool will read exact build fields:\n\n```sh\nzero build --json --target linux-musl-x64 examples/memory-package\n```\n\nUseful JSON fields include `artifact`, `sizeBytes`, `toolchain`, `releaseTargetContract`, selected target facts, linker flavor, and sysroot status.\n\n## Graph Inputs\n\nWhen an agent is authoring a repository graph package, patch the package graph\n",
|
|
"and use normal build/run commands. They compile from `zero.graph` and do not\nrequire `.0` projections to exist:\n\n```sh\nzero patch --op 'addMain'\nzero run\nzero build --out .zero/out/app\n```\n\nUse `zero export` when humans need checked-in `.0` projections. After a human edits a projection, the next graph-store compile refreshes the store automatically, or run `zero import` to refresh it explicitly. `zero status` reports the active store format.\n\nBuild, run, test, size, and mem commands maintain a derived final-MIR cache in the native cache, keyed by graph hash, compiler version, target, emit kind, and backend request. Agents should not patch `.zmir` files; JSON outputs report cache reuse in a `mappedFinalMir` row.\n\nIf another tool hands you a standalone `.program-graph`, normal `zero build`\nand `zero run` can validate it as an interchange artifact. Do not create a\nstandalone graph artifact for the ordinary package loop; use the package path so\nthe compiler reads `zero.graph` directly.\n\n## Targets\n\nInspect target names and capability facts before cross-building:\n\n```sh\nzero targets\nzero check --target linux-musl-x64 examples/memory-package\nzero inspect --target linux-musl-x64 examples/memory-package\n```\n\nHosted APIs such as process args, environment, filesystem, net, and proc are target-gated. A non-host target may reject code that checks on the host.\n\n## Profiles\n\nCommon profile names are `debug`, `dev`, `release-fast`, `release-small`, `tiny`, and `audit`.\n\n```sh\nzero build --profile release-small examples/hello.graph\nzero size --profile tiny examples/hello.graph\n```\n\nUse `zero size` to explain retained functions, sections, literals, runtime shims, imports, debug metadata, and optimization hints. Add `--json` when a tool needs exact fields.\nUse `zero size --backend llvm` when the question is specifically about the explicit LLVM backend; the report includes LLVM target triple, optimization level, retained runtime/helper facts, toolchain readiness, and direct-vs-LLVM comparison rows.\n\n## Troubleshooting\n\n- `zero doctor` checks host and target readiness.\n- `zero doctor --json` reports `llvmToolchain` readiness for explicit LLVM host builds.\n- LLVM JSON facts include `backendLifecycle` so tools can distinguish explicit experimental readiness from release support.\n- `BLD003` means an old backend flag was requested; remove it.\n- `BLD004` with `backendBlocker.backend: \"llvm\"` means the selected LLVM artifact, target, command, MIR subset, or clang toolchain is not ready.\n- Missing sysroot facts identify the required `ZERO_SYSROOT_*` variable.\n- Unsupported targets fail explicitly instead of silently choosing another backend.\n",
|
|
NULL
|
|
};
|
|
|
|
static const char *const zero_embedded_skill_diagnostics_chunks[] = {
|
|
"---\nname: diagnostics\ndescription: Read Zero diagnostics, explanations, and typed fix plans.\n---\n\n# Zero Diagnostics\n\nUse this when Zero code fails to parse, typecheck, build, test, or target-check.\nZero diagnostics are intended for agents: start with the readable command\noutput. Use JSON only when an automation tool needs stable fields or a debugging\nsession needs exact spans, repair metadata, or machine-readable diagnostics.\n\n## Commands\n\n```sh\nzero check\nzero explain <diagnostic-code>\n```\n\nUse machine-readable output when a tool needs exact fields:\n\n```sh\nzero check --json\nzero explain --json <diagnostic-code>\nzero fix --plan --json\n```\n\n`zero fix` reads graph-backed inputs. It reports candidate repairs for graph diagnostics; projection-only source must be imported before repair planning.\n\n## Diagnostic Shape\n\nImportant fields from `zero check --json`:\n\n- `code`: stable diagnostic code such as `NAM003` or `TAR002`\n- `message`: short human summary\n- `path`, `line`, `column`, `length`: source span\n- `expected` and `actual`: structured mismatch facts when available\n- `help`: concise next action\n- `fixSafety`: safety label for an agent repair\n- `repair`: optional repair id and summary\n- `related`: extra spans or facts\n\nDo not scrape terminal prose for automation. Use JSON when a script or tool needs stable fields.\n\n## Fix Safety\n\n`zero fix --plan --json` reports `safetyLevels` and per-fix `safety`:\n\n- `format-only`: formatting or trivia only\n- `behavior-preserving`: intended not to change runtime behavior\n- `api-changing`: signatures, exports, or call sites may change\n- `target-changing`: target support or capability use may change\n- `requires-human-review`: the compiler cannot prove the edit is safe\n\nApply only the edit you can justify from the source and fix plan. Treat `requires-human-review` as a planning hint, not an automatic patch.\n\n## Common Codes\n\n- `NAM003`: unknown name; declare it, import it, or fix spelling.\n- `IMP001`: unknown package-local import.\n- `IMP002`: package-local import cycle.\n- `PKG001`: local dependency path lacks `zero.toml` or a compatibility\n `zero.json`.\n- `PKG002`: package dependency cycle.\n- `PKG003`: one package name resolves to conflicting versions.\n- `PKG004`: selected target is not supported by a dependency.\n- `TAR001`: unknown target; inspect `zero targets`.\n- `TAR002`: capability unavailable for selected target.\n- `BLD003`: removed backend flag; use direct emitters.\n- `STD002`: unknown standard-library helper; use a documented `std.<module>.<helper>` name.\n- `STD003`: standard-library capability or contract mismatch; inspect the helper signature and required capability.\n- `TYP009`: immutable value used where a mutable destination is required; make the binding `var` or pass mutable storage.\n",
|
|
"- `MEM003`: one function's fixed locals exceed the 128 KiB frame limit; split the buffer into smaller buffers in helper functions, or process the data in fixed-size chunks.\n- `RGP007`: ambiguous source identity during import; split the text edit into smaller passes or make the change with `zero patch`.\n- `RGP008`: stale package projection while `ZERO_STALE=fail` is set; run `zero import`, or unset the variable to let the command refresh automatically.\n- `RGP009`: binary `zero.graph` store unreadable by this compiler, usually written by a different zero build; rebuild it with this binary via `zero import .` or install the matching compiler (compare `zero --version` build hashes).\n\n## Agent Triage\n\n1. Run the failing command normally first.\n2. If a debugging session needs exact machine fields, rerun with `--json` and use the span to inspect only the relevant source.\n3. Run `zero explain <code>` before broad refactors.\n4. If multiple diagnostics share a root cause, fix the earliest source issue.\n5. Re-run the same command after the patch.\n",
|
|
NULL
|
|
};
|
|
|
|
static const char *const zero_embedded_skill_graph_chunks[] = {
|
|
"---\nname: graph\ndescription: Use ProgramGraph commands as the primary agent authoring and inspection surface.\n---\n\n# Zero Graph Authoring\n\nUse this when creating, inspecting, patching, importing, or exporting Zero programs through the graph interface, the primary agent authoring surface. `zero.graph` is the repository graph store for packages, `.0` files are the human-readable source projection, and `.program-graph` files are derived debug/interchange artifacts.\n\n## Source Boundary\n\n- Normal `zero check`, `zero run`, `zero test`, `zero build`, `zero size`, and `zero mem` compile packages from `zero.graph` (`zero.toml` takes precedence over `zero.json`). When the `.0` projection was edited, those commands refresh the stale store from source first and note it on stderr; `ZERO_STALE=fail` turns that refresh into an RGP008 error instead.\n- `zero import` refreshes `zero.graph` from edited source explicitly. It accepts the package root, manifest, or any source path inside the package, updates an existing store in place, and preserves node handles where the edit is unambiguous. When several edited nodes could claim one handle, import picks the structurally closest match and notes it on stderr. A whole-file rewrite that keeps the file's function set (names and signatures) is accepted in one pass with regenerated node identities for that file, noted on stderr; only ties that span files or change the function set fail (RGP007) with a split-the-edit strategy. Never delete the store to force a reimport, and omit `--out` for package imports.\n- `zero export [package]` materializes `.0` projections for human review; do not export just to silence stale-projection notes or after every patch. Compiler commands report projection state but never rewrite `.0` files. `zero verify-projection [package]` fails on drift without writing anything.\n- `zero.graph` is binary by default. Reads auto-detect text and binary stores, writes preserve the existing encoding, and `zero status` reports `store format: text|binary`. Use `--format text` only for a deliberately readable debug store. Stdlib `std/*.graph` stores are binary; sibling `std/*.0` files are projections, not the stdlib compile source.\n\n## Create\n\n```sh\nzero init\nzero patch --op 'addMain'\n```\n\n`zero init` defaults to the current directory and that folder's name. Use `zero init app` for a new subdirectory, `--manifest json` only for explicit compatibility, and `--template cli|lib|package` only when the user asks for starter files.\n\n## Inspect\n\n```sh\nzero query userTotals # bare name that is not a path = --find in the current package\nzero query --fn main # one function's signature and call summary\nzero query --fn main --handles # adds stmt/param patch handles; use before patching\nzero query --calls std # resolved call targets\nzero query --refs add # semantic references\nzero query --node '#expr_2cad38f9' --depth 2 # node-scoped: span, parents, children\n",
|
|
"zero view --fn main # one function's canonical source\nzero view --fn main --handles # the same source with a trailing // #handle per statement\nzero view --fn main --around minLength # only the enclosing block containing the text\nzero view --outline src/main.0 # signatures plus one-line docs, no bodies\nzero status # store format and projection state\n```\n\n`--node` defaults to depth 1; add `--full` for the whole-module report. Use handles from `zero view --fn <name> --handles`, `--find`, or `--fn <name> --handles` for checked edits (`set`, `insert`, `insertEdge`, `replace`, `replaceExpr`, `rename`, `delete`); delete compacts ordered graph groups so valid sibling order is preserved. Handles accept short forms: the id segment (`#55ae541c`), any unique prefix (`#55ae`), or `#head..tail` for ids with long shared prefixes; `--handles` views print the shortest form that resolves, and a missing handle fails with the nearest existing one. Reserve unfiltered `zero query` dumps for tools that need every node and edge.\n\n## Patches\n\nEdit through the graph: `zero patch` covers everything from one-line changes (`addCheckWrite`, `rename`, `set`) to whole function bodies (`--replace-fn <fn> --body-file -` with a heredoc). Direct `.0` text edits are a last resort for changes no patch op expresses; the compiler will refresh the graph from edited source, but patch keeps the loop faster (0.2s validation, no reconcile pass) and preserves node identity for queries.\n\nA successful patch loads, applies, validates, and saves `zero.graph`, and prints the saved path, new graph hash, functions, and tests. Do not run `zero check`, `zero view`, `zero query`, or `zero export` just to confirm that the patch applied. Use those only when you need current text/handles, projection review, or a diagnostic loop.\n\n```sh\nzero patch \\\n --op 'addFunction name=\"add\" ret=\"i32\"' \\\n --op 'addParam fn=\"add\" name=\"left\" type=\"i32\"' \\\n --op 'addParam fn=\"add\" name=\"right\" type=\"i32\"' \\\n --op 'addReturnBinary fn=\"add\" name=\"+\" left=\"left\" right=\"right\" type=\"i32\"' \\\n --op 'addTest name=\"addition works\" call=\"add\" arg0=\"40\" arg1=\"2\" expect=\"42\" type=\"i32\"'\n```\n\nUse `addTest` for one pure helper call; reserve `addTestBody` for custom body rows. Test labels are display names, not `__zero_test_*` function names. If a custom test fails as an unknown function label, delete it and recreate simple coverage with `addTest` instead of renaming the label.\n\n",
|
|
"For declaration-level edits, stay in patch ops instead of rewriting files. `setConst name=\"limit\" value=\"64\"` replaces a top-level const's initializer by package-scoped name. `addParamTo fn=\"scan\" name=\"bias\" type=\"i32\" default=\"0\"` appends a parameter to an existing function and updates every call site in the package (nested calls included) to pass the default explicitly, reporting `updated N call sites`; without `default` it fails with the call-site count. `setReturnType fn=\"scan\" type=\"i64\"` changes a declared return type. All three revalidate and batch like any other op.\n\nFor a new or replacement multi-statement helper, use complete source through `upsertFunction` instead of editing `.0` and importing:\n\n```text\nzero-program-graph-patch v1\nupsertFunction handle\nfn handle(request: Span<u8>, response: MutSpan<u8>) -> Maybe<Span<u8>> {\n return null\n}\nend\n```\n\nFor runnable CLI programs, keep `World` on `pub fn main`; value-based helpers build and run more reliably. HTTP server helpers use `handle(request, response)`.\n\n`upsertFunction` parses exactly one complete function declaration, inserts it if missing, and replaces the prior declaration and body if it already exists. For smaller append-only work, `appendStmt fn=\"main\" stmt=\"check std.http.listen(world, 3000_u16)\"` appends one canonical statement, and `addReturnExpr fn=\"maybe\" expr=\"null\"` appends a return statement for any expression. `addReturnValue` is only for identifier returns.\n\nFor sub-line edits, think in graph: take a handle from `zero view --fn <name> --handles` and change exactly one thing. `set` edits one field (a literal `value`, a declared `type`, a `name`/operator); `replaceExpr` swaps any expression subtree, and aimed at a statement handle it replaces that statement's expression (initializer, condition, return value). Repeat `--op` to batch several micro-ops into one patch with a single revalidation:\n\n```sh\nzero patch . \\\n --op 'set node=\"#a647\" field=\"value\" expect=\"1\" value=\"8\"' \\\n --op 'replaceExpr node=\"#5f15\" with=\"i < k + 1\"'\n```\n\nTo express one cross-cutting transformation instead of editing N sites, use structural rewrite by example. `--rewrite '<pattern>' --to '<template>'` matches canonical projection expressions structurally; `$A`, `$B` bind arbitrary subtrees and the same metavariable twice must match equal subtrees. The default is a dry run that lists every site as `path fn:handle` with rendered before/after; `--apply` rewrites all sites in one batch with one revalidation, and `--fn <name>` scopes matching to one function. Patterns are expression-level only; unsupported subtree kinds are skipped and counted.\n\n```sh\nzero patch . --rewrite 'bnCmp($A, $B) == 0' --to 'bnEq($A, $B)' # dry run\nzero patch . --rewrite 'bnCmp($A, $B) == 0' --to 'bnEq($A, $B)' --apply # rewrite every site\n```\n\n",
|
|
"For multi-statement bodies, use `replaceFunctionBody` for a whole function or `replaceBlockBody` for one selected `Block` node. Body rows accept canonical projection syntax, the same text `zero view` prints:\n\n```text\nzero-program-graph-patch v1\nexpect graphHash \"graph:a7f7e6899a73f3b4\"\nreplaceFunctionBody main\n let name: Maybe<String> = std.args.get(1)\n if name.has {\n check world.out.write(\"hello \")\n check world.out.write(name.value)\n check world.out.write(\"\\n\")\n } else {\n check world.out.write(\"hello anonymous\\n\")\n }\nend\n```\n\nTo replace one function body without patch syntax or shell quoting, use `--replace-fn` with `--body-file`. `--body-file -` reads the body rows from stdin, so a heredoc does the whole edit in one call:\n\n```sh\nzero patch --replace-fn main --body-file - <<'EOF'\n let name: Maybe<String> = std.args.get(1)\n if name.has {\n check world.out.write(\"hello \")\n check world.out.write(name.value)\n check world.out.write(\"\\n\")\n } else {\n check world.out.write(\"hello anonymous\\n\")\n }\nEOF\n```\n\nThe body holds only the new rows, exactly what `zero view --fn <name>` prints between the signature braces (no header, no `end`). Quotes, `$variables`, and backslashes pass through a quoted heredoc untouched. The alternative is a file path: `zero patch --replace-fn <name> --body-file /tmp/main.body`.\n\nTo change a few characters inside a large function, do not retype the body: `--replace-in-fn` replaces one unique literal occurrence of `--old` in the function's canonical body text with `--new` (Edit semantics), then revalidates exactly like `--replace-fn`:\n\n```sh\nzero patch --replace-in-fn handleLine --old 'limit + 1' --new 'limit + 2'\n```\n\nA missing or non-unique `--old` fails with the occurrence count; extend `--old` with surrounding lines from `zero view --fn <name>` until it matches once. Inline `--old`/`--new` accept `\\n` escapes; `--old-file`/`--new-file <file|->` read multi-line text from a file or stdin.\n\nTo patch one branch instead of rewriting the whole function, find the block handle first:\n\n```sh\nzero query --find Block\n```\n\n```text\nzero-program-graph-patch v1\nreplaceBlockBody #block_32cefdd9\n check world.out.write(\"updated\\n\")\nend\n```\n\nPreview without writing, and list operation shapes without loading a graph:\n\n```sh\nzero patch --check-only /tmp/body.patch\nzero patch --dry-run --json /tmp/body.patch\nzero patch --op help\n```\n\nSupported graph patch operations (authoring ops first; node-handle ops are the advanced surface):\n\n```text\naddMain\naddCheckWrite fn=\"main\" text=\"hello\\n\"\naddFunction name=\"add\" ret=\"i32\"\naddParam fn=\"add\" name=\"left\" type=\"i32\"\naddParamTo fn=\"add\" name=\"bias\" type=\"i32\" default=\"0\"\nsetConst name=\"limit\" value=\"64\"\nsetReturnType fn=\"add\" type=\"i64\"\naddReturnBinary fn=\"add\" name=\"+\" left=\"left\" right=\"right\" type=\"i32\"\n",
|
|
"addLetLiteral fn=\"main\" name=\"count\" type=\"u32\" value=\"0\"\naddLetBinary fn=\"add\" name=\"sum\" type=\"i32\" operator=\"+\" left=\"left\" right=\"right\"\naddReturnValue fn=\"identity\" value=\"input\" type=\"i32\"\naddReturnExpr fn=\"maybe\" expr=\"null\"\nappendStmt fn=\"main\" stmt=\"check std.http.listen(world, 3000_u16)\"\naddCheckWriteValue fn=\"main\" value=\"message\" type=\"String\"\naddTest name=\"addition works\" call=\"add\" arg0=\"40\" arg1=\"2\" expect=\"42\" type=\"i32\"\naddTestBody name=\"api add\"\n expect apiAddOk()\nend\nrenameTest name=\"api add\" value=\"api add route\"\ndeleteTest name=\"api add\"\nupsertFunction handle\nfn handle(request: Span<u8>, response: MutSpan<u8>) -> Maybe<Span<u8>> {\n return null\n}\nend\nreplaceFunctionBody main\n let name Maybe<String> = std.args.get 1\n if name.has\n check world.out.write \"hello \"\n check world.out.write name.value\n check world.out.write \"\\n\"\n else\n check world.out.write \"hello anonymous\\n\"\nend\nreplaceBlockBody #block_id\n check world.out.write \"updated\\n\"\nend\nexpect graphHash \"graph:a7f7e6899a73f3b4\"\nset node=\"#id\" field=\"value\" expect=\"old\" value=\"new\"\ninsert node=\"#id\" kind=\"Literal\" parent=\"#parent\" edge=\"arg\" order=\"0\" type=\"String\" value=\"text\"\ninsertEdge from=\"#from\" to=\"#to\" edge=\"arg\" target=\"node\" order=\"0\"\nreplace node=\"#id\" expect=\"nodehash:abc123\" kind=\"Literal\" type=\"String\" value=\"text\"\nreplaceExpr node=\"#id\" with=\"left + 1\"\ndelete node=\"#id\" expect=\"nodehash:abc123\"\ndelete node=\"#id\"\nrename node=\"#id\" expect=\"old\" value=\"new\"\n```\n\n`insert` and `insertEdge` default `order` to `0`, which fits singular edges like `expr`, `left`, and `declaredType`. For precise existing-node edits, pin the graph hash and node facts:\n\n```sh\nzero patch \\\n --expect-graph-hash graph:a7f7e6899a73f3b4 \\\n --op 'set node=\"#expr_653eeb6e\" field=\"value\" expect=\"hello from zero\\n\" value=\"hello agent\\n\"'\n```\n\nFor larger edits, write a patch file under `/tmp` or pass `--patch-text`; `--patch-text -` reads a complete `zero-program-graph-patch v1` patch from stdin. Always include `expect graphHash` when a patch is carried across tool calls.\n\n## Artifacts, Reconcile, And Diff\n\nCreate a derived artifact only to carry a graph between tools, and validate it before applying accepted changes back to a package store:\n\n```sh\nzero dump --out .zero/agent/app.program-graph\nzero validate .zero/agent/app.program-graph\nzero view .zero/agent/app.program-graph\n```\n\nDo not commit `.program-graph` files unless the user explicitly asks. `zero source-map` connects graph nodes to source ranges. When a human edited source after a graph was captured, reconcile before relying on old node IDs:\n\n```sh\nzero reconcile .zero/agent/app.before.program-graph --source <projection-or-package>\n```\n\n",
|
|
"`zero reconcile` reports unchanged, edited, inserted, deleted, ambiguous, and identity-changed nodes; ambiguous matches fail instead of assigning stale handles.\n\nFor readable Git diffs of `.graph` files, mark them with `*.graph diff=zero-graph` in `.gitattributes` and set `git config diff.zero-graph.textconv 'zero diff'` (`bin/zero diff` inside a Zero checkout). `zero diff` prints canonical review text for textconv, and `zero diff --fn <name>` scopes it to one function; keep using `zero query`, `zero inspect`, and `zero patch` for graph work.\n\n`zero merge --base <base-zero.graph> --left <left-zero.graph> --right <right-zero.graph> <package>` combines independent node-hash edits and writes only the target store; run `export` separately if a human needs the refreshed projection. Build and run commands may also write a derived final-MIR cache in the native cache; agents should not patch `.zmir` files.\n",
|
|
NULL
|
|
};
|
|
|
|
static const char *const zero_embedded_skill_language_chunks[] = {
|
|
"---\nname: language\ndescription: Compact zerolang syntax and semantics guide for agents.\n---\n\n# zerolang Language\n\nUse this when reading or writing Zero source. `.0` files are the human-readable projection syntax, not the package compiler input: package commands compile from `zero.graph` and refresh it automatically after `.0` edits. Read one function with `zero view --fn <name>` instead of whole files.\n\n## Minimal Program\n\n```zero\npub fn main(world: World) -> Void raises {\n check world.out.write(\"hello from zerolang\\n\")\n}\n```\n\n`pub fn` exports a function. `World` carries runtime capabilities. `raises` marks a fallible function. `check` calls a fallible operation and propagates failure.\n\n## Declarations\n\n- `use std.mem` or `use helpers`\n- `const answer: i32 = 42` (top-level consts work in functions and tests)\n- `type Point { x: i32, y: i32, }`\n- `enum Mode { fast, small, }`\n- `choice Result { ok: i32, err: String, }`\n- `fn answer() -> i32 { return 42 }`\n- `pub fn main(world: World) -> Void raises { ... }`\n- `test \"name\" { expect true }`\n\n## Values, Mutation, And Control Flow\n\nUse `let` by default and `var` only when a binding changes. Conditions are `Bool`; do not rely on truthy integers or strings. Operators are normal infix expressions: `a + b`, `a % b`, `a == b`, `a < b`, `a && b`. Comments start with `//`.\n\n```zero\nfn sum_odds(n: i32) -> i32 {\n var i: i32 = 0\n var total: i32 = 0\n while i < n {\n i = i + 1\n if i % 2 == 0 {\n continue\n }\n if total > 100 {\n break\n }\n total = total + i\n }\n return total\n}\n```\n\n`break` exits the nearest loop and `continue` skips to its next iteration.\n\n## Types\n\nPrimitive and scalar types:\n\n```text\nBool Void String char Type\ni8 i16 i32 i64 isize\nu8 u16 u32 u64 usize\nf32 f64\n```\n\nBare integer literals adopt the other operand's integer type when in range, so `i * 12` works for `i: usize`. Use suffixes such as `_u8` or `_usize` only when no operand gives context, and `as` for intentional casts.\n\nCore capability, resource, and helper types recognized by the compiler:\n\n```text\nWorld WorldStream\nFs File ByteBuf\nNullAlloc FixedBufAlloc PageAlloc GeneralAlloc\nVec Duration RandSource ProcStatus ProcChild\nAddress Net Conn Listener\nHttpMethod HttpClient HttpServer HttpResult HttpError HttpHeaderValue\nJsonDoc BufferedReader BufferedWriter FixedReader FixedWriter\nEnv Args Clock Rand Proc Alloc\nMaybe<T> Span<T> MutSpan<T>\nref<T> mutref<T> owned<T>\n```\n\n## Shapes, Enums, And Choices\n\n```zero\nlet point: Point = Point { x: 1, y: 2 }\nlet result: Result = Result.ok(42)\n```\n\nMatches must be exhaustive unless they use the fallback arm `_`:\n\n```zero\nmatch result {\n .ok(value) {\n expect value == 42\n }\n .err(message) {\n expect true\n }\n}\n```\n\n## Errors\n\n```zero\nfn value(i: i32) -> i32 raises [Odd] {\n if i % 2 == 0 {\n",
|
|
" return i\n }\n raise Odd\n}\n\npub fn main(world: World) -> Void raises {\n let item: i32 = rescue value(3) err 1\n if item == 1 {\n check world.out.write(\"fallible ok\\n\")\n }\n}\n```\n\n`raises [Error]` restricts the error set. Plain `raises` is open. Calling a fallible function requires `check` or `rescue`.\n\n## Borrowing And Memory Views\n\n- `ref<T>` is a read-only borrow, passed with `&value`.\n- `mutref<T>` is a mutable borrow, passed with `&mut value`. Shape parameters such as `mutref<Point>` work, including field mutation and nested calls.\n- `[N]T` is a fixed array; `Span<T>` is a read-only view; `MutSpan<T>` is a writable view.\n- Returning a span backed by local fixed-array storage is rejected; return an owned value or keep the view local.\n- `Maybe<T>` represents absence; read `.value` only inside a visible `.has` guard, or use `check` / `rescue`. `var name: Maybe<String> = null` declares an absent local to assign or return later.\n- `owned<T>` marks explicit resource ownership.\n- One function's fixed locals are limited to 128 KiB (MEM003). Split large buffers into smaller buffers in helper functions, or process data in fixed-size chunks.\n\n```zero\nfn bump(point: mutref<Point>) -> Void {\n point.x = point.x + 1\n}\n\npub fn main() -> Void {\n var storage: [4]u8 = [1, 2, 3, 4]\n let view: MutSpan<u8> = storage\n let first: u8 = storage[0]\n storage[0] = 9\n}\n```\n\nArray and span indexing is bounds-checked at runtime; an out-of-range index traps with a signal exit and no output, so exercise boundary inputs before declaring a change done.\n\n## Generics\n\n```zero\ntype Box<T: Type> {\n value: T,\n}\n\nfn id<T: Type>(value: T) -> T {\n return value\n}\n\ntype FixedVec<T: Type, static N: usize> {\n len: usize,\n items: [N]T,\n}\n```\n\n## Standard Library Call Shapes\n\nLoad `zero skills get stdlib` for the full signature catalog. Beyond the `std.mem`/`std.parse`/`std.rand`/`std.json` helpers shown below, it ships ready-made validators: `std.time` (RFC 3339 date/time incl. the exact leap-second rule), `std.inet` (IPv4/IPv6/hostname), `std.regex` (ECMA subset), and `std.unicode` (strict UTF-8). Check the catalog before hand-writing parsing or validation logic. Target-neutral helpers follow these shapes:\n\n```zero\npub fn main() -> Void {\n let bytes: Span<u8> = std.mem.span(\"zero\")\n let n: usize = std.mem.len(bytes)\n let same: Bool = std.mem.eql(\"zero\", \"zero\")\n\n let parsed: Maybe<u16> = std.parse.parseU16(\"8080\")\n if parsed.has {\n expect parsed.value == 8080\n }\n\n var rng: RandSource = std.rand.seed(7_u32)\n let random: u32 = std.rand.nextU32(&mut rng)\n let count: Maybe<u32> = std.json.u32(\"{\\\"count\\\":42}\", \"count\")\n expect same && random == 1025555898_u32 && count.has\n}\n```\n\n",
|
|
"Hosted helpers are capability-gated by target. There is no stdin; hosted programs take input from `std.args` and files through `std.fs`:\n\n```zero\npub fn main(world: World) -> Void raises {\n let first: Maybe<String> = std.args.get(1)\n if first.has {\n check world.out.write(first.value)\n }\n\n var path_storage: [16]u8 = [0; 16]\n let path: String = check std.path.join(path_storage, \".zero\", \"x\")\n let fs: Fs = std.fs.host()\n var file: owned<File> = check std.fs.createOrRaise(fs, path)\n check std.fs.writeAllOrRaise(&mut file, std.mem.span(\"hello\\n\"))\n}\n```\n\nIf unsure, run `zero check` instead of inventing syntax, and pair behavior changes with a `test` block:\n\n```zero\nfn point_sum(point: Point) -> i32 {\n return point.x + point.y\n}\n\ntest \"shape\" {\n let point: Point = Point { x: 40, y: 2 }\n expect point_sum(point) == 42\n}\n```\n",
|
|
NULL
|
|
};
|
|
|
|
static const char *const zero_embedded_skill_packages_chunks[] = {
|
|
"---\nname: packages\ndescription: Create, inspect, and repair Zero packages and manifests.\n---\n\n# Zero Packages\n\nUse this when working with `zero.toml`, compatibility `zero.json`, package-local modules, package tests, or multi-file Zero projects.\n\n## Create\n\nFor agent-authored packages, start graph-first:\n\n```sh\nzero init\nzero patch --op 'addMain'\n```\n\n`zero.graph` is the package graph store and compiler input. `.0` files are the\nhuman-readable projection; export them only when a human asks to review or edit\nthe projection. `zero init` defaults to the current directory and uses that\ndirectory's folder name as the package name. Use `zero init app` when the\nuser asks for a new subdirectory. It writes TOML metadata by default; use\n`zero init --manifest json [package]` only for explicit compatibility cases.\nUse `zero init --template cli|lib|package [package]` only when the user\nexplicitly asks for starter files.\n\n## Manifest\n\nMinimal executable package in TOML:\n\n```toml\n[package]\nname = \"hello\"\nversion = \"0.1.0\"\n\n[targets.cli]\nkind = \"exe\"\nmain = \"src/main.0\"\n```\n\nThe target `main` path names the human-readable projection for source maps,\nexport/import, and review. Normal package commands compile from `zero.graph`.\n\nJSON is also accepted for compatibility, but new agent-authored packages should\nuse TOML:\n\n```json\n{\n \"package\": { \"name\": \"hello\", \"version\": \"0.1.0\" },\n \"targets\": { \"cli\": { \"kind\": \"exe\", \"main\": \"src/main.0\" } }\n}\n```\n\nIf both `zero.toml` and `zero.json` exist in the same package root, Zero uses\n`zero.toml`. Keep one manifest checked in unless the task is specifically\ntesting precedence.\n\nPass either the package directory or manifest to commands:\n\n```sh\nzero check\nzero check zero.toml\nzero run examples/systems-package\n```\n\n## Module Imports\n\nPackage-local imports resolve from `src/`:\n\n- `use helpers` resolves `src/helpers.0`\n- `use config.parser` resolves `src/config/parser.0`\n- `use config.parser` may also resolve `src/config/parser/mod.0`\n\nStandard library imports use the same `use` form:\n\n```zero\nuse std.mem\nuse std.parse\n```\n\nAvoid implicit files. If an import is unknown, run:\n\n```sh\nzero check\nzero inspect\n```\n\n## Dependencies\n\nCurrent packages support local path dependencies and registry metadata. Local\ndependencies must point at a directory containing `zero.toml` or compatibility\n`zero.json`; `zero.toml` takes precedence.\n\nTOML dependency metadata:\n\n```toml\n[dependencies.local-tools]\npath = \"../local-tools\"\nversion = \"0.1.0\"\n```\n\n```json\n{\n \"dependencies\": {\n \"local-tools\": { \"path\": \"../local-tools\", \"version\": \"0.1.0\" }\n }\n}\n```\n\nThe resolver is declarative; it records deterministic lock facts under `.zero/package-locks/` and does not fetch remote package code.\n\n",
|
|
"Package compiler commands validate and compile from a checked-in `zero.graph` store, including target and package metadata, and can operate when `.0` source projections are missing. When the projection was edited, commands that consume the store (`zero check`, `zero build`, `zero run`, `zero test`, `zero query`, `zero view`, `zero diff`, and friends) refresh the stale store from source and note it on stderr (`ZERO_STALE=fail` makes that an error); they never rewrite `.0` files. When `zero.graph` is the newer side, for example right after `zero patch`, they keep using the graph and note that too; when both sides changed independently they fail with `RGP006` and offer `zero import` or `zero export` as repairs. Drift is classified by content (each store write records a source projection hash), never by file timestamps, so staged or cloned workspaces behave identically. Use `zero verify-projection` when drift must fail the workflow, and `zero export` only when a human-readable projection needs regeneration.\n\n## Inspect\n\n```sh\nzero inspect\nzero doc\nzero dev\n```\n\nUse `--json` when a tool needs exact graph, doc, or dev fields. Useful `graph`\nfacts include modules, source paths, import edges, public and private symbol\ncounts, function effects, required capabilities, target facts, dependency\nfacts, and package cache key inputs.\n\n## Graph Authoring\n\nFor agent-authored packages, prefer the repository graph surface:\n\n```sh\nzero init\nzero patch --op 'addMain'\n```\n\nInspect and patch existing packages through the graph. Create an artifact under\n`.zero/` only when another tool needs a file artifact:\n\n```sh\nzero view\nzero patch --op 'addMain'\n```\n\nPackage-level patches write `zero.graph`; successful patch output includes the new graph hash and top-level symbols. Use `zero export` only to materialize `.0` for human review, and `zero import` after humans edit that projection; import accepts the package root or any source path inside it and updates the existing store in place. Keep derived graph artifacts out of the package source unless the user explicitly asks for them.\n\nRepository graph stores are binary by default. Use `zero init --format text` or\n`zero import --format text [package]` only when the package\nintentionally needs a readable debug store. Normal reads auto-detect both\nencodings, and normal writes preserve an existing text or binary store. Stdlib\n`std/*.graph` stores are binary graph stores; `std/*.0` siblings are human\nprojections and are not used as the stdlib compile source.\n\n## Common Repairs\n\n- `IMP001`: create the imported module, fix its path, or adjust `use`.\n- `IMP002`: break a direct import cycle.\n- `PKG001`: fix a local dependency path so it contains `zero.toml` or a compatibility `zero.json`.\n- `PKG002`: break a package dependency cycle.\n- `PKG003`: avoid resolving one package name to multiple versions.\n- `PKG004`: update target metadata or choose a supported target.\n\n",
|
|
"Prefer a package-local fix over moving unrelated files.\n",
|
|
NULL
|
|
};
|
|
|
|
static const char *const zero_embedded_skill_stdlib_chunks[] = {
|
|
"---\nname: stdlib\ndescription: Use Zero standard library modules and target-gated capabilities.\n---\n\n# Zero Standard Library\n\nUse this for common library calls, memory helpers, hosted I/O, or target-capability guidance.\n\n## Import\n\n```zero\nuse std.mem\n\nuse std.parse\n```\n\nCall functions with their module path, such as `std.mem.len(value)`.\n\n## Target-Neutral Helpers\n\n- `std.mem`: spans, byte copy/fill, non-owned scalar item copy/fill/search/compare, scalar item slicing, chunking, cursor helpers, length, safe indexed `get`, fixed-buffer allocation, byte buffers, and caller-owned vectors.\n- `std.collections`: fixed-capacity push/pop, deque front/back operations, first/last access, indexed insert/replace/remove, unique insert, append, clear, truncate, fill, reverse, rotate, live-prefix and set/map views, `FixedSet<T>`, `FixedDeque<T>`, `FixedRingBuffer<T>`, and `FixedMap<K,V>` storage wrappers, set/map/ring-buffer capacity state, count, contains, value removal, swap, swap-remove, move-to-front, and parallel key/value map helpers over caller-owned array or allocator-returned span storage plus explicit lengths.\n- `std.search`: generic scalar index search plus typed min/max, lower-bound, upper-bound, and binary-search helpers.\n- `std.sort`: in-place insertion, stable, unstable, swap, rotate, reverse, partition, sorted dedupe, and sortedness helpers for ascending and descending `i32`, `u32`, and `usize` storage.\n- `std.ascii`: ASCII byte predicates, case conversion, and digit value helpers.\n- `std.fmt`: caller-buffer and fixed-writer formatting for booleans, 32-bit and 64-bit integer text, integer bases, signs, and padding.\n- `std.text`: ASCII and UTF-8 byte-backed text validation.\n- `std.unicode`: strict UTF-8 codepoint decode/encode iteration, cursor status helpers, and codepoint-class helpers; pair with `std.text.utf8Valid`/`std.text.utf8Len` for whole-span validation and counting.\n- `std.math`: fixed-width min/max/clamp, checked and saturating integer arithmetic, GCD/LCM, powers, modular power, roots, combinatorics, primality, and divisor routines.\n- `std.path`: target-neutral lexical path basename, dirname, extension, stem, component, abs, join, normalize, and relative helpers.\n- `std.codec`: endian reads/writes, unsigned and signed varints, base32/base64/hex encode/decode, CRC helpers, and byte checksums.\n- `std.csv`: allocation-free CSV validation, record scanning, field decoding, and fixed-arity writers.\n- `std.parse`: byte scanners plus decimal, radix, prefix integer width, bool, duration, and byte-size parsers returning `Maybe<T>`.\n- `std.regex`: compile-once and one-shot regular expression matching/search/split/replace for a documented ECMA-262-leaning subset (literals, classes, anchors, word boundaries, greedy quantifiers, alternation, groups); unsupported constructs fail with structured status codes and offsets.\n",
|
|
"- `std.inet`: target-neutral IPv4/IPv6/hostname literal validation and parsing; no network capability needed.\n- `std.time`: duration construction, conversion, comparison, elapsed-window helpers, hosted sleep, RFC 3339 date/time validation and epoch parsing, and target-gated clock helpers.\n- `std.rand`: explicit deterministic random sources, random bits, unbiased bounded/range helpers, target entropy helpers, and caller-buffer entropy IDs.\n- `std.crypto`: small hashes, SHA-256 digest writers, fixed-width hash text, byte-oriented crypto helpers, and caller-buffer IDs.\n- `std.json`: explicit-buffer JSON validation, structured status/location diagnostics, object/array cursor lookup, typed scalar decode, parsing, and string/object writing helpers.\n- `std.toml`: no-allocation TOML validation, shallow/dotted field lookup, and typed scalar decode helpers.\n- `std.url`: target-neutral URL splitting, percent/query/form encoding and decoding, query/form lookup, and query append helpers.\n- `std.str`: byte-span string helpers, including non-overlapping reverse, copy/concat/repeat/replace, prefix/suffix, split, fields, lines, trim, and word counts.\n- `std.io`: buffered reader/writer surfaces, cursor writes, line scanning, and byte copy over caller-owned storage.\n- `std.testing`: Bool-returning helpers for test blocks and byte-output checks.\n- `std.term`: ANSI terminal style, cursor, clear, alternate-screen sequence helpers, target-neutral key-byte decoding, and hosted TTY/size/raw-mode/input helpers.\n- `std.log`: explicit-buffer JSON Lines record formatting.\n\nPrefer `Maybe<T>` return checks over assuming an operation succeeded.\n\n## Hosted Capabilities\n\nThese modules depend on host or runtime capabilities:\n\n- `std.args`: process arguments\n- `std.cli`: command-line flag, option, and typed option helpers over process arguments\n- `std.env`: process environment lookup, comparisons, and typed fallback parsing\n- `std.fs`: hosted filesystem, explicit `Fs` or `owned<File>` handles, and file-level byte helpers\n- `std.net`: bootstrap network handles\n- `std.http`: HTTP request/response helpers and loopback listeners\n- `std.proc`: process execution and exit-status helpers\n- `std.pty`: hosted pseudoterminal child processes\n- `World.out` and `World.err`: program output capabilities\n\nNon-host targets may reject these APIs with target diagnostics. Inspect target facts before cross-building:\n\n```sh\nzero targets\nzero check --target linux-musl-x64 [graph-input]\nzero inspect --target linux-musl-x64 [graph-input]\n```\n\nAdd `--json` only when a tool needs exact target facts or diagnostics.\n\n## Memory Pattern\n\n```zero\nuse std.mem\n\npub fn main(world: World) -> Void raises {\n let bytes: Span<u8> = std.mem.span(\"zero\")\n if std.mem.len(bytes) == 4 {\n check world.out.write(\"memory ok\\n\")\n }\n}\n```\n\nFor writable buffers, use caller-owned fixed arrays and `MutSpan<T>`:\n\n```zero\npub fn main() -> Void {\n",
|
|
" var storage: [8]u8 = [0, 0, 0, 0, 0, 0, 0, 0]\n let writable: MutSpan<u8> = storage\n let copied: usize = std.mem.copy(writable, std.mem.span(\"zero\"))\n}\n```\n\nFor non-byte scalar item storage, use the generic item helpers. Current direct\ntargets support `Bool`, `u8`, `u16`, `usize`, `i32`, `u32`, `i64`, and `u64`\nelements for these helpers.\n\n```zero\npub fn main() -> Void {\n var values: [4]i32 = [1, 2, 3, 4]\n var scratch: [4]i32 = [0, 0, 0, 0]\n let copied: usize = std.mem.copyItems(scratch, values)\n let prefix: Span<i32> = std.mem.prefix(scratch, 2)\n let suffix: Span<i32> = std.mem.suffix(scratch, 2)\n let before: Span<i32> = std.mem.splitBefore(scratch, 3)\n let after: Span<i32> = std.mem.splitAfter(scratch, 3)\n let middle: Span<i32> = std.mem.slice(scratch, 1, 2)\n let chunk: Span<i32> = std.mem.chunk(scratch, 1_usize, 2_usize)\n let sliding: Span<i32> = std.mem.window(scratch, 1_usize, 2_usize)\n let cursor: usize = std.mem.advance(scratch, 0_usize, 2_usize)\n let rest: Span<i32> = std.mem.remaining(scratch, cursor)\n expect copied == 4 && std.mem.contains(prefix, 1) && std.mem.compareI32(prefix, suffix) < 0 && std.mem.len(suffix) == 2 && std.mem.len(before) == 2 && std.mem.len(after) == 1 && std.mem.len(middle) == 2 && std.mem.len(chunk) == 2 && std.mem.len(sliding) == 2 && std.mem.len(rest) == 2\n}\n```\n\nFixed-capacity collection helpers keep storage and length explicit:\n\n```zero\npub fn main() -> Void {\n var values: [4]i32 = [0, 0, 0, 0]\n var len: usize = 0\n len = std.collections.push(values, len, 3)\n len = std.collections.push(values, len, 1)\n len = std.collections.setInsert(values, len, 5)\n len = std.collections.insertAt(values, len, 1_usize, 4)\n let replaced: Bool = std.collections.replaceAt(values, len, 1_usize, 9)\n let swapped: Bool = std.collections.swapAt(values, len, 0_usize, 1_usize)\n let reversed: Bool = std.collections.reverse(values, len)\n let filled: Bool = std.collections.fill(values, 2_usize, 7)\n let rotated_left: Bool = std.collections.rotateLeft(values, len, 1_usize)\n let rotated_right: Bool = std.collections.rotateRight(values, len, 1_usize)\n len = std.collections.removeAt(values, len, 2_usize)\n let last: Maybe<i32> = std.collections.last(values, len)\n len = std.collections.dequePushFront(values, len, 2)\n let front: Maybe<i32> = std.collections.dequeFront(values, len)\n len = std.collections.dequePopFront(values, len)\n let back_len: usize = std.collections.dequePopBack(values, len)\n len = std.collections.truncate(values, len, 3)\n let set_live: Span<i32> = std.collections.setView(values, len)\n let set_remaining: usize = std.collections.setRemaining(values, len)\n let live: Span<i32> = std.collections.view(values, len)\n var fixed_storage: [4]i32 = [1, 2, 0, 0]\n var fixed_set: FixedSet<i32> = std.collections.fixedSet(fixed_storage, 2_usize)\n",
|
|
" let fixed_inserted: Bool = std.collections.fixedSetInsert(&mut fixed_set, 3)\n let fixed_removed: Bool = std.collections.fixedSetRemove(&mut fixed_set, 1)\n let fixed_live: Span<i32> = std.collections.fixedSetView(&fixed_set)\n var fixed_deque_storage: [4]i32 = [0, 0, 0, 0]\n var fixed_deque: FixedDeque<i32> = std.collections.fixedDeque(fixed_deque_storage, 0_usize)\n let fixed_deque_back_pushed: Bool = std.collections.fixedDequePushBack(&mut fixed_deque, 2)\n let fixed_deque_front_pushed: Bool = std.collections.fixedDequePushFront(&mut fixed_deque, 1)\n let fixed_deque_front: Maybe<i32> = std.collections.fixedDequeFront(&fixed_deque)\n let fixed_deque_popped: Maybe<i32> = std.collections.fixedDequePopBack(&mut fixed_deque)\n var fixed_ring_storage: [4]i32 = [0, 0, 0, 0]\n var fixed_ring: FixedRingBuffer<i32> = std.collections.fixedRingBuffer(fixed_ring_storage, 0_usize, 0_usize)\n let fixed_ring_back_pushed: Bool = std.collections.fixedRingBufferPushBack(&mut fixed_ring, 2)\n let fixed_ring_front_pushed: Bool = std.collections.fixedRingBufferPushFront(&mut fixed_ring, 1)\n let fixed_ring_front: Maybe<i32> = std.collections.fixedRingBufferFront(&fixed_ring)\n let fixed_ring_popped: Maybe<i32> = std.collections.fixedRingBufferPopBack(&mut fixed_ring)\n var fixed_keys: [3]u8 = [1_u8, 2_u8, 0_u8]\n var fixed_scores: [3]u16 = [10_u16, 20_u16, 0_u16]\n var fixed_map: FixedMap<u8, u16> = std.collections.fixedMap(fixed_keys, fixed_scores, 2_usize)\n let fixed_map_added: Bool = std.collections.fixedMapPut(&mut fixed_map, 3_u8, 30_u16)\n let fixed_map_score: Maybe<u16> = std.collections.fixedMapGet(&fixed_map, 3_u8)\n var keys: [3]u8 = [1_u8, 2_u8, 0_u8]\n var scores: [3]u16 = [10_u16, 20_u16, 0_u16]\n var map_len: usize = 2\n map_len = std.collections.mapPut(keys, scores, map_len, 3_u8, 30_u16)\n let has_score: Bool = std.collections.mapContains(keys, map_len, 3_u8)\n let score: Maybe<u16> = std.collections.mapGet(keys, scores, map_len, 3_u8)\n let live_keys: Span<u8> = std.collections.mapKeys(keys, map_len)\n let live_scores: Span<u16> = std.collections.mapValues(keys, scores, map_len)\n",
|
|
" expect replaced && swapped && reversed && filled && rotated_left && rotated_right && std.collections.clear(values, len) == 0 && std.collections.setClear(values, len) == 0 && std.collections.pop(values, len) == 2 && last.has && last.value == 5 && front.has && front.value == 2 && back_len == 2 && std.collections.setContains(values, len, 5) && set_remaining == 1 && std.mem.len(set_live) == 3 && std.mem.len(live) == 3 && fixed_inserted && fixed_removed && std.mem.len(fixed_live) == 2 && std.collections.fixedSetRemaining(&fixed_set) == 2 && std.collections.fixedSetLen(&fixed_set) == 2 && fixed_deque_back_pushed && fixed_deque_front_pushed && fixed_deque_front.has && fixed_deque_front.value == 1 && fixed_deque_popped.has && fixed_deque_popped.value == 2 && fixed_map_added && fixed_map_score.has && fixed_map_score.value == 30_u16 && map_len == 3 && std.collections.mapRemaining(keys, scores, map_len) == 0 && std.collections.mapIsFull(keys, scores, map_len) && std.collections.mapClear(keys, scores, map_len) == 0 && has_score && score.has && score.value == 30_u16 && std.mem.len(live_keys) == 3 && std.mem.len(live_scores) == 3\n}\n```\n\nFor byte-oriented dynamic storage, request mutable byte spans explicitly with\n`std.mem.allocBytes`. The fixed collection wrappers can use those returned spans\nas backing storage:\n\n```zero\npub fn main() -> Void {\n var key_storage: [4]u8 = [0_u8; 4]\n var value_storage: [4]u8 = [0_u8; 4]\n var key_alloc: FixedBufAlloc = std.mem.fixedBufAlloc(key_storage)\n var value_alloc: FixedBufAlloc = std.mem.fixedBufAlloc(value_storage)\n let keys_maybe: Maybe<MutSpan<u8>> = std.mem.allocBytes(key_alloc, 4_usize)\n let values_maybe: Maybe<MutSpan<u8>> = std.mem.allocBytes(value_alloc, 4_usize)\n if keys_maybe.has && values_maybe.has {\n var map: FixedMap<u8, u8> = std.collections.fixedMap(keys_maybe.value, values_maybe.value, 0_usize)\n let ok: Bool = std.collections.fixedMapPut(&mut map, 7_u8, 42_u8)\n let value: Maybe<u8> = std.collections.fixedMapGet(&map, 7_u8)\n expect ok && value.has && value.value == 42_u8\n }\n}\n```\n\nUse `std.sort` and `std.search` for common scalar algorithms instead of\nhand-rolling loops:\n\n```zero\npub fn main() -> Void {\n var values: [5]i32 = [5, 1, 4, 2, 3]\n std.sort.stableI32(values)\n expect std.sort.isSortedI32(values)\n std.sort.unstableI32(values)\n expect std.sort.isSortedI32(values)\n std.sort.reverseI32(values)\n expect std.sort.isSortedDescI32(values)\n let swapped: Bool = std.sort.swapI32(values, 0_usize, 4_usize)\n expect swapped\n std.sort.rotateLeftI32(values, 2_usize)\n expect values[0] == 3\n std.sort.rotateRightI32(values, 2_usize)\n expect values[0] == 1\n std.sort.insertionDescI32(values)\n expect std.sort.isSortedDescI32(values)\n std.sort.stableDescI32(values)\n expect std.sort.isSortedDescI32(values)\n std.sort.unstableDescI32(values)\n",
|
|
" expect std.sort.isSortedDescI32(values)\n std.sort.insertionI32(values)\n expect std.search.binaryI32(values, 4) == 3\n expect std.search.containsSortedI32(values, 4)\n expect std.search.upperBoundI32(values, 4) == 4\n expect std.search.countSortedI32(values, 4) == 1\n std.sort.insertionDescI32(values)\n expect std.search.binaryDescI32(values, 4) == 1\n expect std.search.containsSortedDescI32(values, 4)\n expect std.search.upperBoundDescI32(values, 4) == 2\n expect std.search.countSortedDescI32(values, 4) == 1\n let high_len: usize = std.sort.partitionDescI32(values, 3)\n expect high_len == 2\n let minimum: Maybe<i32> = std.search.minI32(values)\n expect minimum.has && minimum.value == 1\n expect std.search.maxIndexI32(values) == 0\n}\n```\n\nString helpers are byte-oriented and allocation-free. `std.str.reverse` writes\ninto caller storage and requires that destination storage does not overlap the\ninput text:\n\n```zero\npub fn main() -> Void {\n var reversed: [4]u8 = [0, 0, 0, 0]\n let out: Maybe<Span<u8>> = std.str.reverse(reversed, \"zero\")\n if out.has {\n expect std.mem.eql(out.value, \"orez\")\n }\n}\n```\n\nUse `std.parse` and `std.fmt` instead of hand-rolled decimal loops in ordinary\nCLIs and examples:\n\n```zero\npub fn main() -> Void {\n let parsed: Maybe<i32> = std.parse.parseI32(\"-42\")\n var out: [12]u8 = [0_u8; 12]\n if parsed.has {\n let formatted: Maybe<Span<u8>> = std.fmt.i32(out, parsed.value)\n expect formatted.has && std.mem.eql(formatted.value, \"-42\")\n }\n}\n```\n\nUse codec, JSON, and URL helpers for common wire-format work instead of\nhand-rolled loops:\n\n```zero\npub fn main() -> Void {\n var decoded: [4]u8 = [0_u8; 4]\n let text: Maybe<Span<u8>> = std.codec.base64Decode(decoded, \"emVybw==\")\n\n let input: Span<u8> = \"{\\\"count\\\":42,\\\"ok\\\":true}\"\n let count: Maybe<u32> = std.json.u32(input, \"count\")\n\n var url_buf: [48]u8 = [0_u8; 48]\n var param_buf: [16]u8 = [0_u8; 16]\n let param: Maybe<Span<u8>> = std.url.writeQueryParam(param_buf, \"q\", \"zero lang\")\n var url: Maybe<Span<u8>> = null\n if param.has {\n url = std.url.appendQuery(url_buf, \"https://example.com/path\", param.value)\n }\n\n expect text.has && count.has && url.has\n}\n```\n\nUse `std.math` checked helpers when overflow is a normal input outcome:\n\n```zero\npub fn main() -> Void {\n let value: Maybe<u32> = std.math.checkedMulU32(6_u32, 7_u32)\n if value.has {\n expect value.value == 42_u32\n }\n expect std.math.sqrtFloorU32(99) == 9\n}\n```\n\nKeep random sources explicit and durations typed:\n\n```zero\npub fn main() -> Void {\n var rng: RandSource = std.rand.seed(7_u32)\n let first: u32 = std.rand.nextU32(&mut rng)\n let bit: Bool = std.rand.nextBool(&mut rng)\n let bounded: Maybe<u32> = std.rand.nextBelow(&mut rng, 10_u32)\n",
|
|
" let ranged: Maybe<u32> = std.rand.rangeU32(&mut rng, 40_u32, 50_u32)\n let delay: Duration = std.time.add(std.time.ms(250), std.time.seconds(1))\n expect first == 1025555898_u32 && bit && bounded.has && ranged.has && std.time.asMsFloor(delay) == 1250\n}\n```\n\nUse `std.testing` inside `expect` when the comparison shape matters to readers\nor agents:\n\n```zero\ntest \"output shape\" {\n expect std.testing.equalBytes(\"zero\", \"zero\")\n expect std.testing.containsBytes(\"zerolang\", \"lang\")\n expect std.testing.jsonPathEquals(\"{\\\"service\\\":{\\\"ok\\\":true}}\", \"service.ok\", \"true\")\n}\n```\n\nUse `std.log` as a caller-buffer formatter, then write the resulting span\nthrough an explicit output capability:\n\n```zero\npub fn main(world: World) -> Void raises {\n var storage: [128]u8 = [0_u8; 128]\n var field_storage: [64]u8 = [0_u8; 64]\n let field: Maybe<Span<u8>> = std.log.stringField(field_storage, \"event\", \"startup\")\n if field.has {\n let entry: Maybe<Span<u8>> = std.log.messageField(storage, std.log.levelInfo(), \"started\", field.value)\n if entry.has {\n check world.out.write(entry.value)\n }\n }\n}\n```\n\n## Function Signatures\n\nThis catalog is generated from the compiler's standard-library signature table. Use these names exactly; helpers with `T` are generic over the concrete span or item type inferred from the call.\n\nFetch one module's section instead of this whole catalog with `zero skills get stdlib --topic <prefix>`, for example `zero skills get stdlib --topic std.time`.\n\n### std.args\n\n```text\nlen() -> usize\nget(arg0: usize) -> Maybe<String>\nhas(arg0: usize) -> Bool\ngetOr(arg0: usize, arg1: String) -> String\nfind(arg0: String) -> Maybe<usize>\nvalueAfter(arg0: String) -> Maybe<String>\nparseU32(arg0: usize) -> Maybe<u32>\n```\n\n### std.ascii\n\n```text\ndigitValue(arg0: u8) -> Maybe<u8>\nhexValue(arg0: u8) -> Maybe<u8>\nisAlnum(arg0: u8) -> Bool\nisAlpha(arg0: u8) -> Bool\nisDigit(arg0: u8) -> Bool\nisHexDigit(arg0: u8) -> Bool\nisLower(arg0: u8) -> Bool\nisUpper(arg0: u8) -> Bool\nisWhitespace(arg0: u8) -> Bool\ntoLower(arg0: u8) -> u8\ntoUpper(arg0: u8) -> u8\n```\n\n### std.cli\n\n```text\nargEquals(arg0: usize, arg1: String) -> Bool\ncommand() -> Maybe<String>\ncommandOr(arg0: String) -> String\ncommandEquals(arg0: String) -> Bool\nargOr(arg0: usize, arg1: String) -> String\nargU32Or(arg0: usize, arg1: u32) -> u32\nhasFlag(arg0: String) -> Bool\noptionValue(arg0: String) -> Maybe<String>\noptionValueOr(arg0: String, arg1: String) -> String\noptionU32(arg0: String) -> Maybe<u32>\nsuccessExitCode() -> i32\nusageExitCode() -> i32\nisHelp(arg0: Span<u8>) -> Bool\nneedsHelp() -> Bool\ncommandIn2(arg0: Span<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Bool\ncommandIn3(arg0: Span<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Bool\nformatUsage(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\n",
|
|
"formatCommand(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nformatOption(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nformatSection(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nformatHelpRow(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nformatHelpRowCustom(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: usize, arg4: usize) -> Maybe<Span<u8>>\nformatHelpRowWithWidth(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: usize) -> Maybe<Span<u8>>\nformatHelp(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nformatError(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nformatUnknownCommand(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nformatMissingOperand(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nformatInvalidOption(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\n```\n\n### std.codec\n\n```text\ncrc32(arg0: String) -> u32\ncrc32Bytes(arg0: Span<u8>) -> u32\nencodedVarintLen(arg0: u32) -> usize\nencodedVarintLen64(arg0: u64) -> usize\nencodedSignedVarintLen(arg0: i32) -> usize\nencodedSignedVarintLen64(arg0: i64) -> usize\nhexDecodedLen(arg0: Span<u8>) -> Maybe<usize>\nhexDecode(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nbase32EncodedLen(arg0: usize) -> usize\nbase32Encode(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nbase32DecodedLen(arg0: Span<u8>) -> Maybe<usize>\nbase32Decode(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nbase32RawEncodedLen(arg0: usize) -> usize\nbase32RawEncode(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nbase32RawDecodedLen(arg0: Span<u8>) -> Maybe<usize>\nbase32RawDecode(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nbase64DecodedLen(arg0: Span<u8>) -> Maybe<usize>\nbase64Decode(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nbase64RawEncodedLen(arg0: usize) -> usize\nbase64RawEncode(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nbase64RawDecodedLen(arg0: Span<u8>) -> Maybe<usize>\nbase64RawDecode(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nbase64UrlEncodedLen(arg0: usize) -> usize\nbase64UrlEncode(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nbase64UrlDecodedLen(arg0: Span<u8>) -> Maybe<usize>\nbase64UrlDecode(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nreadU16Le(arg0: Span<u8>) -> Maybe<u16>\nreadU16Be(arg0: Span<u8>) -> Maybe<u16>\nreadU32Le(arg0: Span<u8>) -> Maybe<u32>\nreadU32Be(arg0: Span<u8>) -> Maybe<u32>\nreadU64Le(arg0: Span<u8>) -> Maybe<u64>\nreadU64Be(arg0: Span<u8>) -> Maybe<u64>\nwriteU16Le(arg0: MutSpan<u8>, arg1: u16) -> Maybe<Span<u8>>\nwriteU16Be(arg0: MutSpan<u8>, arg1: u16) -> Maybe<Span<u8>>\nwriteU32Le(arg0: MutSpan<u8>, arg1: u32) -> Maybe<Span<u8>>\nwriteU32Be(arg0: MutSpan<u8>, arg1: u32) -> Maybe<Span<u8>>\nwriteU64Le(arg0: MutSpan<u8>, arg1: u64) -> Maybe<Span<u8>>\n",
|
|
"writeU64Be(arg0: MutSpan<u8>, arg1: u64) -> Maybe<Span<u8>>\nvarintEncode(arg0: MutSpan<u8>, arg1: u32) -> Maybe<Span<u8>>\nvarintDecode(arg0: Span<u8>) -> Maybe<u32>\nvarintEncode64(arg0: MutSpan<u8>, arg1: u64) -> Maybe<Span<u8>>\nvarintDecode64(arg0: Span<u8>) -> Maybe<u64>\nsignedVarintEncode(arg0: MutSpan<u8>, arg1: i32) -> Maybe<Span<u8>>\nsignedVarintDecode(arg0: Span<u8>) -> Maybe<i32>\nsignedVarintEncode64(arg0: MutSpan<u8>, arg1: i64) -> Maybe<Span<u8>>\nsignedVarintDecode64(arg0: Span<u8>) -> Maybe<i64>\nbase64EncodedLen(arg0: usize) -> usize\nbase64Encode(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<String>\nhexEncode(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<String>\nutf8Valid(arg0: Span<u8>) -> Bool\nurlEncode(arg0: MutSpan<u8>, arg1: String) -> Maybe<String>\n```\n\n### std.collections\n\n```text\nappend(storage: MutSpan<T>, len: usize, values: Span<T>) -> usize\nclear(storage: Span<T>, len: usize) -> usize\ncontains(storage: Span<T>, len: usize, value: T) -> Bool\ncount(storage: Span<T>, len: usize, value: T) -> usize\ndequeBack(storage: Span<T>, len: usize) -> Maybe<T>\ndequeFront(storage: Span<T>, len: usize) -> Maybe<T>\ndequePopBack(storage: Span<T>, len: usize) -> usize\ndequePopFront(storage: MutSpan<T>, len: usize) -> usize\ndequePushBack(storage: MutSpan<T>, len: usize, value: T) -> usize\ndequePushFront(storage: MutSpan<T>, len: usize, value: T) -> usize\nfill(storage: MutSpan<T>, len: usize, value: T) -> Bool\nfirst(storage: Span<T>, len: usize) -> Maybe<T>\nfixedDeque(storage: MutSpan<T>, len: usize) -> FixedDeque<T>\nfixedDequeBack(deque: ref<FixedDeque<T>>) -> Maybe<T>\nfixedDequeClear(deque: mutref<FixedDeque<T>>) -> usize\nfixedDequeFront(deque: ref<FixedDeque<T>>) -> Maybe<T>\nfixedDequeIsFull(deque: ref<FixedDeque<T>>) -> Bool\nfixedDequeLen(deque: ref<FixedDeque<T>>) -> usize\nfixedDequePopBack(deque: mutref<FixedDeque<T>>) -> Maybe<T>\nfixedDequePopFront(deque: mutref<FixedDeque<T>>) -> Maybe<T>\nfixedDequePushBack(deque: mutref<FixedDeque<T>>, value: T) -> Bool\nfixedDequePushFront(deque: mutref<FixedDeque<T>>, value: T) -> Bool\nfixedDequeRemaining(deque: ref<FixedDeque<T>>) -> usize\nfixedDequeTruncate(deque: mutref<FixedDeque<T>>, newLen: usize) -> usize\nfixedDequeView(deque: ref<FixedDeque<T>>) -> Span<T>\nfixedRingBuffer(storage: MutSpan<T>, head: usize, len: usize) -> FixedRingBuffer<T>\nfixedRingBufferBack(ring: ref<FixedRingBuffer<T>>) -> Maybe<T>\nfixedRingBufferCapacity(ring: ref<FixedRingBuffer<T>>) -> usize\nfixedRingBufferClear(ring: mutref<FixedRingBuffer<T>>) -> usize\nfixedRingBufferFront(ring: ref<FixedRingBuffer<T>>) -> Maybe<T>\nfixedRingBufferGet(ring: ref<FixedRingBuffer<T>>, index: usize) -> Maybe<T>\nfixedRingBufferIsFull(ring: ref<FixedRingBuffer<T>>) -> Bool\nfixedRingBufferLen(ring: ref<FixedRingBuffer<T>>) -> usize\nfixedRingBufferPopBack(ring: mutref<FixedRingBuffer<T>>) -> Maybe<T>\nfixedRingBufferPopFront(ring: mutref<FixedRingBuffer<T>>) -> Maybe<T>\n",
|
|
"fixedRingBufferPushBack(ring: mutref<FixedRingBuffer<T>>, value: T) -> Bool\nfixedRingBufferPushFront(ring: mutref<FixedRingBuffer<T>>, value: T) -> Bool\nfixedRingBufferRemaining(ring: ref<FixedRingBuffer<T>>) -> usize\nfixedRingBufferTruncate(ring: mutref<FixedRingBuffer<T>>, newLen: usize) -> usize\nfixedMap(keys: MutSpan<K>, values: MutSpan<V>, len: usize) -> FixedMap<K,V>\nfixedMapClear(map: mutref<FixedMap<K,V>>) -> usize\nfixedMapContains(map: ref<FixedMap<K,V>>, key: K) -> Bool\nfixedMapGet(map: ref<FixedMap<K,V>>, key: K) -> Maybe<V>\nfixedMapIndex(map: ref<FixedMap<K,V>>, key: K) -> usize\nfixedMapIsFull(map: ref<FixedMap<K,V>>) -> Bool\nfixedMapKeys(map: ref<FixedMap<K,V>>) -> Span<K>\nfixedMapLen(map: ref<FixedMap<K,V>>) -> usize\nfixedMapPut(map: mutref<FixedMap<K,V>>, key: K, value: V) -> Bool\nfixedMapRemaining(map: ref<FixedMap<K,V>>) -> usize\nfixedMapRemove(map: mutref<FixedMap<K,V>>, key: K) -> Bool\nfixedMapTruncate(map: mutref<FixedMap<K,V>>, newLen: usize) -> usize\nfixedMapValues(map: ref<FixedMap<K,V>>) -> Span<V>\nfixedSet(storage: MutSpan<T>, len: usize) -> FixedSet<T>\nfixedSetClear(set: mutref<FixedSet<T>>) -> usize\nfixedSetContains(set: ref<FixedSet<T>>, value: T) -> Bool\nfixedSetInsert(set: mutref<FixedSet<T>>, value: T) -> Bool\nfixedSetIsFull(set: ref<FixedSet<T>>) -> Bool\nfixedSetLen(set: ref<FixedSet<T>>) -> usize\nfixedSetRemaining(set: ref<FixedSet<T>>) -> usize\nfixedSetRemove(set: mutref<FixedSet<T>>, value: T) -> Bool\nfixedSetTruncate(set: mutref<FixedSet<T>>, newLen: usize) -> usize\nfixedSetView(set: ref<FixedSet<T>>) -> Span<T>\ninsertAt(storage: MutSpan<T>, len: usize, index: usize, value: T) -> usize\ninsertUnique(storage: MutSpan<T>, len: usize, value: T) -> usize\nisFull(storage: Span<T>, len: usize) -> Bool\nlast(storage: Span<T>, len: usize) -> Maybe<T>\nmapClear(keys: Span<K>, values: Span<V>, len: usize) -> usize\nmapContains(keys: Span<K>, len: usize, key: K) -> Bool\nmapGet(keys: Span<K>, values: Span<V>, len: usize, key: K) -> Maybe<V>\nmapIndex(keys: Span<K>, len: usize, key: K) -> usize\nmapIsFull(keys: Span<K>, values: Span<V>, len: usize) -> Bool\nmapKeys(keys: Span<K>, len: usize) -> Span<K>\nmapPut(keys: MutSpan<K>, values: MutSpan<V>, len: usize, key: K, value: V) -> usize\nmapRemaining(keys: Span<K>, values: Span<V>, len: usize) -> usize\nmapRemove(keys: MutSpan<K>, values: MutSpan<V>, len: usize, key: K) -> usize\nmapTruncate(keys: Span<K>, values: Span<V>, len: usize, newLen: usize) -> usize\nmapValues(keys: Span<K>, values: Span<V>, len: usize) -> Span<V>\nmoveToFront(storage: MutSpan<T>, len: usize, index: usize) -> usize\npop(storage: Span<T>, len: usize) -> usize\npush(storage: MutSpan<T>, len: usize, value: T) -> usize\nremaining(storage: Span<T>, len: usize) -> usize\nreplaceAt(storage: MutSpan<T>, len: usize, index: usize, value: T) -> Bool\nremoveAt(storage: MutSpan<T>, len: usize, index: usize) -> usize\nremoveValue(storage: MutSpan<T>, len: usize, value: T) -> usize\n",
|
|
"removeSwap(storage: MutSpan<T>, len: usize, index: usize) -> usize\nreverse(storage: MutSpan<T>, len: usize) -> Bool\nrotateLeft(storage: MutSpan<T>, len: usize, count: usize) -> Bool\nrotateRight(storage: MutSpan<T>, len: usize, count: usize) -> Bool\nsetClear(storage: Span<T>, len: usize) -> usize\nsetContains(storage: Span<T>, len: usize, value: T) -> Bool\nsetInsert(storage: MutSpan<T>, len: usize, value: T) -> usize\nsetIsFull(storage: Span<T>, len: usize) -> Bool\nsetRemaining(storage: Span<T>, len: usize) -> usize\nsetRemove(storage: MutSpan<T>, len: usize, value: T) -> usize\nsetTruncate(storage: Span<T>, len: usize, newLen: usize) -> usize\nsetView(storage: Span<T>, len: usize) -> Span<T>\nswapAt(storage: MutSpan<T>, len: usize, left: usize, right: usize) -> Bool\ntruncate(storage: Span<T>, len: usize, newLen: usize) -> usize\nview(storage: Span<T>, len: usize) -> Span<T>\n```\n\n### std.crypto\n\n```text\nhash32(arg0: Span<u8>) -> u32\nhmac32(arg0: Span<u8>, arg1: Span<u8>) -> u32\nconstantTimeEql(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nsecureRandomU32() -> u32\nfixedHex32(arg0: MutSpan<u8>, arg1: u32) -> Maybe<Span<u8>>\nhashHex32(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nhmacHex32(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nstableId32(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nrandomId32(arg0: MutSpan<u8>) -> Maybe<Span<u8>>\nsha256(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nsha256Hex(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nhmacSha256(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nhmacSha256Hex(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\n```\n\n### std.csv\n\n```text\nvalid(arg0: Span<u8>) -> Bool\nrecordCount(arg0: Span<u8>) -> Maybe<usize>\nrecord(arg0: Span<u8>, arg1: usize) -> Maybe<Span<u8>>\nfieldCount(arg0: Span<u8>) -> Maybe<usize>\nfield(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: usize) -> Maybe<Span<u8>>\nencodedFieldLen(arg0: Span<u8>) -> usize\nwriteField(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteRecord2(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteRecord3(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\n```\n\n### std.diag\n\n```text\ncolumn(arg0: Span<u8>, arg1: usize) -> usize\nformatLocation(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: usize, arg3: usize) -> Maybe<Span<u8>>\nformatOffsetLocation(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: usize) -> Maybe<Span<u8>>\nline(arg0: Span<u8>, arg1: usize) -> usize\nlineEnd(arg0: Span<u8>, arg1: usize) -> usize\nlineStart(arg0: Span<u8>, arg1: usize) -> usize\nlineText(arg0: Span<u8>, arg1: usize) -> Span<u8>\nrangeLen(arg0: Span<u8>, arg1: usize, arg2: usize) -> usize\nrangeText(arg0: Span<u8>, arg1: usize, arg2: usize) -> Span<u8>\n```\n\n### std.env\n\n```text\nget(arg0: String) -> Maybe<String>\nhas(arg0: String) -> Bool\n",
|
|
"getOr(arg0: String, arg1: String) -> String\nequals(arg0: String, arg1: String) -> Bool\nparseBool(arg0: String) -> Maybe<Bool>\nparseBoolOr(arg0: String, arg1: Bool) -> Bool\nparseI32(arg0: String) -> Maybe<i32>\nparseI32Or(arg0: String, arg1: i32) -> i32\nparseU32(arg0: String) -> Maybe<u32>\nparseU32Or(arg0: String, arg1: u32) -> u32\nparseUsize(arg0: String) -> Maybe<usize>\nparseUsizeOr(arg0: String, arg1: usize) -> usize\n```\n\n### std.fmt\n\n```text\nbool(arg0: MutSpan<u8>, arg1: Bool) -> Maybe<Span<u8>>\nhexLowerU32(arg0: MutSpan<u8>, arg1: u32) -> Maybe<Span<u8>>\ni32(arg0: MutSpan<u8>, arg1: i32) -> Maybe<Span<u8>>\ni32Base(arg0: MutSpan<u8>, arg1: i32, arg2: u32) -> Maybe<Span<u8>>\ni32Sign(arg0: MutSpan<u8>, arg1: i32) -> Maybe<Span<u8>>\ni64(arg0: MutSpan<u8>, arg1: i64) -> Maybe<Span<u8>>\ni64Base(arg0: MutSpan<u8>, arg1: i64, arg2: u32) -> Maybe<Span<u8>>\ni64Sign(arg0: MutSpan<u8>, arg1: i64) -> Maybe<Span<u8>>\npadLeft(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: usize, arg3: u8) -> Maybe<Span<u8>>\npadRight(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: usize, arg3: u8) -> Maybe<Span<u8>>\nu32(arg0: MutSpan<u8>, arg1: u32) -> Maybe<Span<u8>>\nu32Base(arg0: MutSpan<u8>, arg1: u32, arg2: u32) -> Maybe<Span<u8>>\nu64(arg0: MutSpan<u8>, arg1: u64) -> Maybe<Span<u8>>\nu64Base(arg0: MutSpan<u8>, arg1: u64, arg2: u32) -> Maybe<Span<u8>>\nusize(arg0: MutSpan<u8>, arg1: usize) -> Maybe<Span<u8>>\nusizeBase(arg0: MutSpan<u8>, arg1: usize, arg2: u32) -> Maybe<Span<u8>>\nwriteBool(arg0: mutref<FixedWriter>, arg1: Bool) -> Bool\nwriteI32(arg0: mutref<FixedWriter>, arg1: i32) -> Bool\nwriteI32Sign(arg0: mutref<FixedWriter>, arg1: i32) -> Bool\nwriteI64(arg0: mutref<FixedWriter>, arg1: i64) -> Bool\nwriteI64Sign(arg0: mutref<FixedWriter>, arg1: i64) -> Bool\nwriteSpan(arg0: mutref<FixedWriter>, arg1: Span<u8>) -> Bool\nwriteU32(arg0: mutref<FixedWriter>, arg1: u32) -> Bool\nwriteU64(arg0: mutref<FixedWriter>, arg1: u64) -> Bool\nwriteUsize(arg0: mutref<FixedWriter>, arg1: usize) -> Bool\n```\n\n### std.fs\n\n```text\nhost() -> Fs\nopen(arg0: Fs, arg1: String) -> Maybe<owned<File>>\nopenOrRaise(arg0: Fs, arg1: String) -> owned<File> raises [NotFound, TooLarge, Io]\ncreate(arg0: Fs, arg1: String) -> Maybe<owned<File>>\ncreateOrRaise(arg0: Fs, arg1: String) -> owned<File> raises [NotFound, TooLarge, Io]\nread(arg0: String, arg1: MutSpan<u8>) -> usize\nreadOrRaise(arg0: mutref<File>, arg1: MutSpan<u8>) -> usize raises [NotFound, TooLarge, Io]\nwrite(arg0: String, arg1: String) -> usize\nwriteAll(arg0: mutref<File>, arg1: Span<u8>) -> Bool\nwriteAllOrRaise(arg0: mutref<File>, arg1: Span<u8>) -> Void raises [NotFound, TooLarge, Io]\nfileLenOrRaise(arg0: mutref<File>) -> usize raises [NotFound, TooLarge, Io]\nreadAll(allocator: Alloc, fs: Fs, path: String, max: usize) -> Maybe<owned<ByteBuf>>\nreadAllOrRaise(allocator: Alloc, fs: Fs, path: String, max: usize) -> owned<ByteBuf> raises [NotFound, TooLarge, Io]\nexists(arg0: String) -> Bool\n",
|
|
"readBytes(arg0: String, arg1: MutSpan<u8>) -> Maybe<usize>\nreadBytesAt(arg0: String, arg1: usize, arg2: MutSpan<u8>) -> Maybe<usize>\nwriteBytes(arg0: String, arg1: Span<u8>) -> Maybe<usize>\nappendBytes(arg0: String, arg1: Span<u8>) -> Maybe<usize>\nisDir(arg0: String) -> Bool\nmakeDir(arg0: String) -> Bool\nremoveDir(arg0: String) -> Bool\nremove(arg0: String) -> Bool\nrename(arg0: String, arg1: String) -> Bool\ndirEntryCount(arg0: String) -> Maybe<usize>\ndirEntryName(arg0: MutSpan<u8>, arg1: String, arg2: usize) -> Maybe<Span<u8>>\ntempName(arg0: MutSpan<u8>, arg1: String) -> Maybe<String>\natomicWrite(arg0: String, arg1: String, arg2: Span<u8>) -> Bool\nfileLen(arg0: mutref<File>) -> Maybe<usize>\nclose(arg0: mutref<File>) -> Void\nreadFile(arg0: Fs, arg1: String, arg2: MutSpan<u8>) -> Maybe<usize>\nwriteFile(arg0: Fs, arg1: String, arg2: Span<u8>) -> Bool\nappendFile(arg0: Fs, arg1: String, arg2: Span<u8>) -> Bool\nreadFileBytes(arg0: Fs, arg1: String, arg2: MutSpan<u8>) -> Maybe<Span<u8>>\nreadFileEquals(arg0: Fs, arg1: String, arg2: MutSpan<u8>, arg3: Span<u8>) -> Bool\ncopyFile(arg0: String, arg1: String, arg2: MutSpan<u8>) -> Bool\nfileSize(arg0: Fs, arg1: String) -> Maybe<usize>\nisFile(arg0: String) -> Bool\nensureDir(arg0: String) -> Bool\n```\n\n`readBytes` and `readFile` fill the caller buffer and return the TOTAL file size\n(snprintf convention): a value above `len(buffer)` means the buffer holds only the\nfirst `len(buffer)` bytes, so compare the result against the buffer length instead\nof assuming the whole file arrived. `readFileBytes` returns `null` when the file\nexceeds the buffer. Process files larger than your buffer with `readBytesAt`:\nloop `offset += len(buffer)` until `offset` reaches the returned total, taking\n`min(len(buffer), total - offset)` valid bytes per chunk.\n\n### std.http\n\n```text\nparseMethod(arg0: String) -> HttpMethod\nclient(arg0: Net) -> HttpClient\nserver(arg0: Net, arg1: Address) -> HttpServer\nlisten(arg0: World, arg1: u16) -> Void raises [Io]\nfetch(arg0: HttpClient, arg1: Span<u8>, arg2: MutSpan<u8>, arg3: Duration) -> HttpResult\nresultOk(arg0: HttpResult) -> Bool\nresultStatus(arg0: HttpResult) -> u16\nresultBodyLen(arg0: HttpResult) -> usize\nresultError(arg0: HttpResult) -> HttpError\nerrorNone() -> HttpError\nerrorInvalidUrl() -> HttpError\nerrorUnsupportedProtocol() -> HttpError\nerrorDns() -> HttpError\nerrorConnect() -> HttpError\nerrorTls() -> HttpError\nerrorTimeout() -> HttpError\nerrorTooLarge() -> HttpError\nerrorProviderUnavailable() -> HttpError\nerrorIo() -> HttpError\nerrorInvalidRequest() -> HttpError\nerrorName(arg0: HttpError) -> String\nresponseLen(arg0: Span<u8>) -> usize\nresponseHeadersLen(arg0: Span<u8>) -> usize\nresponseBodyOffset(arg0: Span<u8>) -> usize\nheaderValue(arg0: Span<u8>, arg1: Span<u8>) -> HttpHeaderValue\nheaderFound(arg0: HttpHeaderValue) -> Bool\nheaderOffset(arg0: HttpHeaderValue) -> usize\nheaderLen(arg0: HttpHeaderValue) -> usize\n",
|
|
"tlsBoundary() -> String\nstatusReason(arg0: u16) -> String\nstatusIsInformational(arg0: u16) -> Bool\nstatusIsSuccess(arg0: u16) -> Bool\nstatusIsRedirect(arg0: u16) -> Bool\nstatusIsClientError(arg0: u16) -> Bool\nstatusIsServerError(arg0: u16) -> Bool\nwriteRequest(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteMethodRequest(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nwriteGetRequest(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteHeadRequest(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteDeleteRequest(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonRequest(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonMethodRequest(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nwritePostJsonRequest(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nwritePutJsonRequest(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nwritePatchJsonRequest(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteResponse(arg0: MutSpan<u8>, arg1: u16, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonResponse(arg0: MutSpan<u8>, arg1: u16, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteResponseWithHeader(arg0: MutSpan<u8>, arg1: u16, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nwriteResponseWithHeaders(arg0: MutSpan<u8>, arg1: u16, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonResponseWithHeader(arg0: MutSpan<u8>, arg1: u16, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonResponseWithHeaders(arg0: MutSpan<u8>, arg1: u16, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonResponseWithCookie(arg0: MutSpan<u8>, arg1: u16, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonError(arg0: MutSpan<u8>, arg1: u16, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteCorsPreflight(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nwriteCorsJsonResponse(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nwriteTextResponse(arg0: MutSpan<u8>, arg1: u16, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteTextOk(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteHtmlResponse(arg0: MutSpan<u8>, arg1: u16, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteHtmlOk(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteRedirect(arg0: MutSpan<u8>, arg1: u16, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteFound(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteSeeOther(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteMovedPermanently(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwritePermanentRedirect(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\ncontentTypeForPath(arg0: Span<u8>) -> String\nwriteStaticResponse(arg0: MutSpan<u8>, arg1: u16, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\n",
|
|
"writeJsonOk(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonCreated(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonBadRequest(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonUnauthorized(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonForbidden(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonNotFound(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonMethodNotAllowed(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonConflict(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonUnprocessable(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonTooManyRequests(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonInternalServerError(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nwriteNoContent(arg0: MutSpan<u8>) -> Maybe<Span<u8>>\nwriteRequestWithHeader(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nwriteRequestWithHeaders(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonRequestWithHeader(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nwriteJsonRequestWithHeaders(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nrequestMethodName(arg0: Span<u8>) -> Maybe<Span<u8>>\nrequestTarget(arg0: Span<u8>) -> Maybe<Span<u8>>\nrequestPath(arg0: Span<u8>) -> Maybe<Span<u8>>\npathSegmentCount(arg0: Span<u8>) -> usize\npathSegment(arg0: Span<u8>, arg1: usize) -> Maybe<Span<u8>>\npathMatchesPattern(arg0: Span<u8>, arg1: Span<u8>) -> Bool\npathParam(arg0: Span<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nrequestPathSegmentCount(arg0: Span<u8>) -> usize\nrequestPathSegment(arg0: Span<u8>, arg1: usize) -> Maybe<Span<u8>>\nrequestQuery(arg0: Span<u8>) -> Maybe<Span<u8>>\nrequestQueryValue(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nrequestHeader(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nrequestBearerToken(arg0: Span<u8>) -> Maybe<Span<u8>>\nrequestCookie(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nrequestContentLength(arg0: Span<u8>) -> Maybe<usize>\nrequestContentType(arg0: Span<u8>) -> Maybe<Span<u8>>\nrequestAccepts(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nrequestAcceptsJson(arg0: Span<u8>) -> Bool\nrequestBody(arg0: Span<u8>) -> Maybe<Span<u8>>\nrequestBodyWithin(arg0: Span<u8>, arg1: usize) -> Maybe<Span<u8>>\nrequestHasJsonContentType(arg0: Span<u8>) -> Bool\nrequestJsonBodyWithin(arg0: Span<u8>, arg1: usize) -> Maybe<Span<u8>>\nrequestJsonField(arg0: Span<u8>, arg1: Span<u8>, arg2: usize) -> Maybe<Span<u8>>\nrequestMatches(arg0: Span<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Bool\nmethodAllowed(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nrequestMethodAllowed(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nrequestMethodIs(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nrequestIsGet(arg0: Span<u8>, arg1: Span<u8>) -> Bool\n",
|
|
"requestIsHead(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nrequestIsOptions(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nrequestIsPost(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nrequestIsPut(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nrequestIsPatch(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nrequestIsDelete(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nrequestPathStartsWith(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nrequestPathTailAfter(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nrequestRouteMatches(arg0: Span<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Bool\nrequestRouteMethodAllowed(arg0: Span<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Bool\nrequestPathParam(arg0: Span<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nheaderBlockSafe(arg0: Span<u8>) -> Bool\nheaderBytes(arg0: Span<u8>, arg1: HttpHeaderValue) -> Maybe<Span<u8>>\nresponseBody(arg0: Span<u8>, arg1: HttpResult) -> Maybe<Span<u8>>\nresponseBodyBytes(arg0: Span<u8>) -> Maybe<Span<u8>>\nresponseBodyEquals(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nresponseStatus(arg0: Span<u8>) -> Maybe<u16>\nresponseStatusIs(arg0: Span<u8>, arg1: u16) -> Bool\nresponseHeader(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nresponseContentType(arg0: Span<u8>) -> Maybe<Span<u8>>\nresponseRedirectLocation(arg0: Span<u8>) -> Maybe<Span<u8>>\nresponseMatches(arg0: Span<u8>, arg1: u16, arg2: Span<u8>, arg3: Span<u8>) -> Bool\ntestRequest(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\ntestJsonRequest(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\n```\n\n### std.io\n\n```text\nbufferedReader(arg0: MutSpan<u8>) -> BufferedReader\nbufferedWriter(arg0: MutSpan<u8>) -> BufferedWriter\nreaderCapacity(arg0: ref<BufferedReader>) -> usize\nwriterCapacity(arg0: ref<BufferedWriter>) -> usize\ncopy(arg0: MutSpan<u8>, arg1: Span<u8>) -> usize\ncopyN(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: usize) -> Maybe<usize>\ncopyBuffer(arg0: mutref<FixedReader>, arg1: mutref<FixedWriter>, arg2: MutSpan<u8>) -> usize\ncopyReaderN(arg0: mutref<FixedReader>, arg1: mutref<FixedWriter>, arg2: usize, arg3: MutSpan<u8>) -> Maybe<usize>\ndiscard(arg0: mutref<FixedReader>, arg1: MutSpan<u8>) -> usize\nerrorCapacity() -> u32\nerrorEof() -> u32\nerrorIo() -> u32\nerrorName(arg0: u32) -> String\nerrorNone() -> u32\nerrorPermission() -> u32\nerrorShortRead() -> u32\nerrorShortWrite() -> u32\nerrorTimeout() -> u32\nfixedReader(arg0: Span<u8>, arg1: usize) -> FixedReader\nfixedReaderCursor(arg0: ref<FixedReader>) -> usize\nfixedReaderDone(arg0: ref<FixedReader>) -> Bool\nfixedReaderLen(arg0: ref<FixedReader>) -> usize\nfixedReaderLimit(arg0: ref<FixedReader>, arg1: usize) -> FixedReader\nfixedReaderRead(arg0: mutref<FixedReader>, arg1: MutSpan<u8>) -> usize\nfixedReaderReadAll(arg0: mutref<FixedReader>, arg1: MutSpan<u8>) -> Maybe<Span<u8>>\nfixedReaderReadAt(arg0: ref<FixedReader>, arg1: usize, arg2: MutSpan<u8>) -> Maybe<usize>\n",
|
|
"fixedReaderReadByte(arg0: mutref<FixedReader>) -> Maybe<u8>\nfixedReaderReadExact(arg0: mutref<FixedReader>, arg1: MutSpan<u8>) -> Bool\nfixedReaderReadLine(arg0: mutref<FixedReader>) -> Maybe<Span<u8>>\nfixedReaderReadUntilDelimiter(arg0: mutref<FixedReader>, arg1: u8) -> Maybe<Span<u8>>\nfixedReaderRemaining(arg0: ref<FixedReader>) -> usize\nfixedReaderSeek(arg0: mutref<FixedReader>, arg1: usize) -> Bool\nfixedWriter(arg0: MutSpan<u8>, arg1: usize) -> FixedWriter\nfixedWriterCapacity(arg0: ref<FixedWriter>) -> usize\nfixedWriterClear(arg0: mutref<FixedWriter>) -> usize\nfixedWriterCursor(arg0: ref<FixedWriter>) -> usize\nfixedWriterRemaining(arg0: ref<FixedWriter>) -> usize\nfixedWriterSeek(arg0: mutref<FixedWriter>, arg1: usize) -> Bool\nfixedWriterTruncate(arg0: mutref<FixedWriter>, arg1: usize) -> usize\nfixedWriterView(arg0: ref<FixedWriter>) -> Span<u8>\nfixedWriterWrite(arg0: mutref<FixedWriter>, arg1: Span<u8>) -> Bool\nfixedWriterWriteAll(arg0: mutref<FixedWriter>, arg1: Span<u8>) -> Bool\nfixedWriterWriteAt(arg0: mutref<FixedWriter>, arg1: usize, arg2: Span<u8>) -> Bool\nfixedWriterWriteByte(arg0: mutref<FixedWriter>, arg1: u8) -> Bool\nmultiRead(arg0: mutref<FixedReader>, arg1: mutref<FixedReader>, arg2: MutSpan<u8>) -> usize\nread(arg0: Span<u8>, arg1: usize, arg2: MutSpan<u8>) -> Maybe<usize>\nreadAll(arg0: Span<u8>, arg1: MutSpan<u8>) -> Maybe<Span<u8>>\nreadAt(arg0: Span<u8>, arg1: usize, arg2: MutSpan<u8>) -> Maybe<usize>\nreadByte(arg0: Span<u8>, arg1: usize) -> Maybe<u8>\nreadExact(arg0: Span<u8>, arg1: usize, arg2: MutSpan<u8>) -> Maybe<usize>\nreadLine(arg0: Span<u8>, arg1: usize) -> Maybe<Span<u8>>\nreadLineStart(arg0: Span<u8>, arg1: usize) -> usize\nreadUntilDelimiter(arg0: Span<u8>, arg1: usize, arg2: u8) -> Maybe<Span<u8>>\nreadUntilDelimiterStart(arg0: Span<u8>, arg1: usize, arg2: u8) -> usize\nteeRead(arg0: mutref<FixedReader>, arg1: mutref<FixedWriter>, arg2: MutSpan<u8>) -> Maybe<usize>\nwriteByte(arg0: MutSpan<u8>, arg1: usize, arg2: u8) -> Maybe<usize>\nwriteAll(arg0: MutSpan<u8>, arg1: usize, arg2: Span<u8>) -> Maybe<usize>\nwriteAt(arg0: MutSpan<u8>, arg1: usize, arg2: Span<u8>) -> Maybe<usize>\nwriteSpan(arg0: MutSpan<u8>, arg1: usize, arg2: Span<u8>) -> Maybe<usize>\nwritten(arg0: Span<u8>, arg1: usize) -> Span<u8>\nremaining(arg0: Span<u8>, arg1: usize) -> usize\nnextLine(arg0: Span<u8>, arg1: usize) -> Maybe<Span<u8>>\nnextLineStart(arg0: Span<u8>, arg1: usize) -> usize\ncountLines(arg0: Span<u8>) -> usize\n```\n\n### std.inet\n\n```text\nisIpv4(text: Span<u8>) -> Bool\nparseIpv4(text: Span<u8>) -> Maybe<u32>\nwriteIpv4(buffer: MutSpan<u8>, value: u32) -> Maybe<Span<u8>>\nisIpv4Unspecified(value: u32) -> Bool\nisIpv4Loopback(value: u32) -> Bool\nisIpv4Private(value: u32) -> Bool\nisIpv4LinkLocal(value: u32) -> Bool\nisIpv4Multicast(value: u32) -> Bool\nisIpv6(text: Span<u8>) -> Bool\nparseIpv6(buffer: MutSpan<u8>, text: Span<u8>) -> Maybe<Span<u8>>\nisIp(text: Span<u8>) -> Bool\n",
|
|
"parseIp(buffer: MutSpan<u8>, text: Span<u8>) -> Maybe<Span<u8>>\nisIpv6Unspecified(bytes: Span<u8>) -> Bool\nisIpv6Loopback(bytes: Span<u8>) -> Bool\nisIpv6Multicast(bytes: Span<u8>) -> Bool\nisIpv6LinkLocal(bytes: Span<u8>) -> Bool\nisIpv6Private(bytes: Span<u8>) -> Bool\nisIpv6UniqueLocal(bytes: Span<u8>) -> Bool\nisIpv6MappedIpv4(bytes: Span<u8>) -> Bool\nipv6MappedIpv4(bytes: Span<u8>) -> Maybe<u32>\nisHostname(text: Span<u8>) -> Bool\n```\n\nInternet address literal helpers, kept separate from `std.net` so they stay\nusable on targets without the Net capability. `isIpv4`/`parseIpv4` accept\nstrict dotted quads (four 0-255 octets, no leading zeros; the parse packs\nbig-endian), and `writeIpv4` writes a packed value back to dotted-quad text.\nIPv4 classification helpers cover unspecified, loopback, RFC 1918 private,\nlink-local, and multicast ranges. `isIpv6`/`parseIpv6` accept RFC 4291 forms\nincluding `::` compression and embedded IPv4, writing 16 network-order bytes\ninto the caller buffer. IPv6 helpers classify unspecified, loopback,\nmulticast, link-local, unique-local/private, and IPv4-mapped addresses;\n`parseIp` accepts either family and writes 4 or 16 network-order bytes.\n`isHostname` enforces RFC 1123: dot-separated labels of 1-63 alphanumeric/hyphen\nbytes, no leading/trailing hyphens, 253 bytes total.\n\n### std.json\n\n```text\nvalidate(arg0: String) -> Bool\nvalidateBytes(arg0: Span<u8>) -> Bool\nparse(allocator: Alloc, text: String) -> Maybe<JsonDoc>\nparseBytes(allocator: Alloc, bytes: Span<u8>) -> Maybe<JsonDoc>\nstreamTokens(arg0: String) -> usize\nstreamTokensBytes(arg0: Span<u8>) -> usize\nwriteString(arg0: MutSpan<u8>, arg1: String) -> Maybe<String>\ndecodeBoundary() -> String\nerrorNone() -> u32\nerrorInvalid() -> u32\nerrorTrailing() -> u32\nerrorName(arg0: u32) -> String\nerrorExpected(arg0: u32) -> String\nvalidateError(arg0: Span<u8>) -> u32\nerrorOffset(arg0: Span<u8>) -> usize\nerrorLine(arg0: Span<u8>) -> usize\nerrorColumn(arg0: Span<u8>) -> usize\nfield(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nobjectFieldCount(arg0: Span<u8>) -> Maybe<usize>\nobjectKey(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: usize) -> Maybe<Span<u8>>\nobjectValue(arg0: Span<u8>, arg1: usize) -> Maybe<Span<u8>>\narrayCount(arg0: Span<u8>) -> Maybe<usize>\narrayValue(arg0: Span<u8>, arg1: usize) -> Maybe<Span<u8>>\npath(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\npathString(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\npathU32(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<u32>\npathBool(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<Bool>\nstringDecode(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nstring(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nu32(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<u32>\nbool(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<Bool>\nwriteStringBytes(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\n",
|
|
"writeObject1String(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteObject1U32(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: u32) -> Maybe<Span<u8>>\nwriteObject1Bool(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Bool) -> Maybe<Span<u8>>\nwriteFieldRaw(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteFieldString(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteFieldU32(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: u32) -> Maybe<Span<u8>>\nwriteFieldBool(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Bool) -> Maybe<Span<u8>>\nwriteObject2Fields(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteObject2StringField(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nwriteObject2U32Field(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: u32, arg3: Span<u8>) -> Maybe<Span<u8>>\nwriteObject2BoolField(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Bool, arg3: Span<u8>) -> Maybe<Span<u8>>\nwriteArray2Strings(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteArray2U32(arg0: MutSpan<u8>, arg1: u32, arg2: u32) -> Maybe<Span<u8>>\nwriteArray2Bools(arg0: MutSpan<u8>, arg1: Bool, arg2: Bool) -> Maybe<Span<u8>>\n```\n\n### std.toml\n\n```text\nvalidate(arg0: String) -> Bool\nvalidateBytes(arg0: Span<u8>) -> Bool\nfield(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nstringDecode(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nstring(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nu32(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<u32>\ni32(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<i32>\nbool(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<Bool>\narrayCount(arg0: Span<u8>) -> Maybe<usize>\narrayValue(arg0: Span<u8>, arg1: usize) -> Maybe<Span<u8>>\narrayString(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: usize) -> Maybe<Span<u8>>\narrayU32(arg0: Span<u8>, arg1: usize) -> Maybe<u32>\narrayI32(arg0: Span<u8>, arg1: usize) -> Maybe<i32>\narrayBool(arg0: Span<u8>, arg1: usize) -> Maybe<Bool>\nwriteKeyValueString(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteKeyValueU32(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: u32) -> Maybe<Span<u8>>\nwriteKeyValueBool(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Bool) -> Maybe<Span<u8>>\nwriteTableHeader(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\n```\n\n### std.log\n\n```text\nmessage(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nkeyValue(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nlevelDebug() -> String\nlevelInfo() -> String\nlevelWarn() -> String\nlevelError() -> String\nstringField(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nmessageField(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nredacted(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\n```\n\n### std.term\n\n```text\nreset() -> String\n",
|
|
"bold() -> String\ndim() -> String\nunderline() -> String\ninverse() -> String\nfgDefault() -> String\nfgBlack() -> String\nfgRed() -> String\nfgGreen() -> String\nfgYellow() -> String\nfgBlue() -> String\nfgMagenta() -> String\nfgCyan() -> String\nfgWhite() -> String\nbgDefault() -> String\nbgBlack() -> String\nbgRed() -> String\nbgGreen() -> String\nbgYellow() -> String\nbgBlue() -> String\nbgMagenta() -> String\nbgCyan() -> String\nbgWhite() -> String\nclearScreen() -> String\nclearScreenDown() -> String\nclearScreenUp() -> String\nclearLine() -> String\nclearLineRight() -> String\nclearLineLeft() -> String\ncursorHome() -> String\ncursorTo(arg0: MutSpan<u8>, arg1: usize, arg2: usize) -> Maybe<Span<u8>>\ncursorUp(arg0: MutSpan<u8>, arg1: usize) -> Maybe<Span<u8>>\ncursorDown(arg0: MutSpan<u8>, arg1: usize) -> Maybe<Span<u8>>\ncursorRight(arg0: MutSpan<u8>, arg1: usize) -> Maybe<Span<u8>>\ncursorLeft(arg0: MutSpan<u8>, arg1: usize) -> Maybe<Span<u8>>\nsaveCursor() -> String\nrestoreCursor() -> String\nhideCursor() -> String\nshowCursor() -> String\nenterAltScreen() -> String\nleaveAltScreen() -> String\nenterBracketedPaste() -> String\nleaveBracketedPaste() -> String\nenterMouseCapture() -> String\nleaveMouseCapture() -> String\nkeyNone() -> u32\nkeyEscape() -> u32\nkeyEnter() -> u32\nkeyTab() -> u32\nkeyBackspace() -> u32\nkeyCtrlA() -> u32\nkeyCtrlC() -> u32\nkeyCtrlD() -> u32\nkeyCtrlE() -> u32\nkeyCtrlK() -> u32\nkeyCtrlL() -> u32\nkeyCtrlN() -> u32\nkeyCtrlP() -> u32\nkeyCtrlR() -> u32\nkeyCtrlU() -> u32\nkeyCtrlW() -> u32\nkeyArrowUp() -> u32\nkeyArrowDown() -> u32\nkeyArrowRight() -> u32\nkeyArrowLeft() -> u32\nkeyDelete() -> u32\nkeyHome() -> u32\nkeyEnd() -> u32\nkeyPageUp() -> u32\nkeyPageDown() -> u32\nkeyInsert() -> u32\nkeyShiftTab() -> u32\nkeyF1() -> u32\nkeyF2() -> u32\nkeyF3() -> u32\nkeyF4() -> u32\nkeyF5() -> u32\nkeyF6() -> u32\nkeyF7() -> u32\nkeyF8() -> u32\nkeyF9() -> u32\nkeyF10() -> u32\nkeyF11() -> u32\nkeyF12() -> u32\nkeyPasteStart() -> u32\nkeyPasteEnd() -> u32\nkeyCode(arg0: Span<u8>) -> u32\nkeyByteLen(arg0: Span<u8>) -> usize\nstdinIsTty() -> Bool\nstdoutIsTty() -> Bool\nwidthOr(arg0: usize) -> usize\nheightOr(arg0: usize) -> usize\nenterRawMode() -> Bool\nleaveRawMode() -> Bool\nreadInput(arg0: MutSpan<u8>) -> Maybe<usize>\n```\n\n`std.term.readInput(buffer)` fills the caller buffer with currently available\nstdin bytes without blocking. It returns `null` when no bytes are available, the\nbuffer is empty, or the hosted input source cannot be read.\n\n### std.math\n\n```text\nabsI32(arg0: i32) -> u32\nabsI64(arg0: i64) -> u64\nbinomialU32(arg0: u32, arg1: u32) -> Maybe<u32>\ncheckedAddI32(arg0: i32, arg1: i32) -> Maybe<i32>\ncheckedAddU32(arg0: u32, arg1: u32) -> Maybe<u32>\ncheckedAddUsize(arg0: usize, arg1: usize) -> Maybe<usize>\ncheckedLcmU32(arg0: u32, arg1: u32) -> Maybe<u32>\ncheckedMulI32(arg0: i32, arg1: i32) -> Maybe<i32>\ncheckedMulU32(arg0: u32, arg1: u32) -> Maybe<u32>\n",
|
|
"checkedMulUsize(arg0: usize, arg1: usize) -> Maybe<usize>\ncheckedPowU32(arg0: u32, arg1: u32) -> Maybe<u32>\ncheckedSubI32(arg0: i32, arg1: i32) -> Maybe<i32>\ncheckedSubU32(arg0: u32, arg1: u32) -> Maybe<u32>\ncheckedSubUsize(arg0: usize, arg1: usize) -> Maybe<usize>\nclampI32(arg0: i32, arg1: i32, arg2: i32) -> i32\nclampI64(arg0: i64, arg1: i64, arg2: i64) -> i64\nclampU32(arg0: u32, arg1: u32, arg2: u32) -> u32\nclampU64(arg0: u64, arg1: u64, arg2: u64) -> u64\nclampUsize(arg0: usize, arg1: usize, arg2: usize) -> usize\ndivisorCountU32(arg0: u32) -> u32\nfactorialU32(arg0: u32) -> Maybe<u32>\ngcdU32(arg0: u32, arg1: u32) -> u32\nisEvenU32(arg0: u32) -> Bool\nisOddU32(arg0: u32) -> Bool\nisPrimeU32(arg0: u32) -> Bool\nlcmU32(arg0: u32, arg1: u32) -> u32\nmaxI32(arg0: i32, arg1: i32) -> i32\nmaxI64(arg0: i64, arg1: i64) -> i64\nmaxU32(arg0: u32, arg1: u32) -> u32\nmaxU64(arg0: u64, arg1: u64) -> u64\nmaxUsize(arg0: usize, arg1: usize) -> usize\nminI32(arg0: i32, arg1: i32) -> i32\nminI64(arg0: i64, arg1: i64) -> i64\nminU32(arg0: u32, arg1: u32) -> u32\nminU64(arg0: u64, arg1: u64) -> u64\nminUsize(arg0: usize, arg1: usize) -> usize\nmodPowU32(arg0: u32, arg1: u32, arg2: u32) -> u32\npowU32(arg0: u32, arg1: u32) -> u32\nproperDivisorSumU32(arg0: u32) -> u32\nsaturatingAddI32(arg0: i32, arg1: i32) -> i32\nsaturatingAddU32(arg0: u32, arg1: u32) -> u32\nsaturatingAddUsize(arg0: usize, arg1: usize) -> usize\nsaturatingMulI32(arg0: i32, arg1: i32) -> i32\nsaturatingMulU32(arg0: u32, arg1: u32) -> u32\nsaturatingMulUsize(arg0: usize, arg1: usize) -> usize\nsaturatingSubI32(arg0: i32, arg1: i32) -> i32\nsaturatingSubU32(arg0: u32, arg1: u32) -> u32\nsaturatingSubUsize(arg0: usize, arg1: usize) -> usize\nsqrtFloorU32(arg0: u32) -> u32\n```\n\n### std.mem\n\n```text\ncopy(arg0: MutSpan<u8>, arg1: Span<u8>) -> usize\ncopyItems(dst: MutSpan<T>, src: Span<T>) -> usize\nfill(arg0: MutSpan<u8>, arg1: u8) -> usize\nfillItems(dst: MutSpan<T>, value: T) -> usize\neql(arg0: String, arg1: String) -> Bool\nspan(arg0: String) -> Span<u8>\ncontains(items: Span<T>, value: T) -> Bool\ncompareI32(arg0: Span<i32>, arg1: Span<i32>) -> i32\ncompareU8(arg0: Span<u8>, arg1: Span<u8>) -> i32\ncompareBytes(arg0: Span<u8>, arg1: Span<u8>) -> i32\ncompareU32(arg0: Span<u32>, arg1: Span<u32>) -> i32\ncompareUsize(arg0: Span<usize>, arg1: Span<usize>) -> i32\nstartsWith(items: Span<T>, prefix: Span<T>) -> Bool\nendsWith(items: Span<T>, suffix: Span<T>) -> Bool\nsplitBefore(items: Span<T>, delimiter: T) -> Span<T>\nsplitAfter(items: Span<T>, delimiter: T) -> Span<T>\nisEmpty(items: Span<T>) -> Bool\nchunkCount(items: Span<T>, chunkSize: usize) -> usize\nchunk(items: Span<T>, chunkIndex: usize, chunkSize: usize) -> Span<T>\nwindowCount(items: Span<T>, windowSize: usize) -> usize\nwindow(items: Span<T>, windowIndex: usize, windowSize: usize) -> Span<T>\nadvance(items: Span<T>, cursor: usize, count: usize) -> usize\ncursorDone(items: Span<T>, cursor: usize) -> Bool\n",
|
|
"remaining(items: Span<T>, cursor: usize) -> Span<T>\ncursorChunk(items: Span<T>, cursor: usize, count: usize) -> Span<T>\nprefix(items: Span<T>, len: usize) -> Span<T>\ndropPrefix(items: Span<T>, len: usize) -> Span<T>\nsuffix(items: Span<T>, len: usize) -> Span<T>\ndropSuffix(items: Span<T>, len: usize) -> Span<T>\nslice(items: Span<T>, start: usize, len: usize) -> Span<T>\nlen(items: Span<T>) -> usize\nget(items: Span<T>, index: usize) -> Maybe<T>\neqlBytes(left: Span<T>, right: Span<T>) -> Bool\nnullAlloc() -> NullAlloc\nfixedBufAlloc(arg0: MutSpan<u8>) -> FixedBufAlloc\narena(arg0: MutSpan<u8>) -> FixedBufAlloc\npageAlloc() -> PageAlloc\ngeneralAlloc() -> GeneralAlloc\nallocBytes(allocator: Alloc, len: usize) -> Maybe<MutSpan<u8>>\nbyteBuf(allocator: Alloc, capacity: usize) -> Maybe<owned<ByteBuf>>\nvec(arg0: MutSpan<u8>) -> Vec\nvecPush(arg0: mutref<Vec>, arg1: u8) -> Bool\nvecBytes(arg0: ref<Vec>) -> Span<u8>\nvecGet(arg0: ref<Vec>, arg1: usize) -> Maybe<u8>\nvecSet(arg0: mutref<Vec>, arg1: usize, arg2: u8) -> Bool\nvecClear(arg0: mutref<Vec>) -> usize\nvecPop(arg0: mutref<Vec>) -> Bool\nvecTruncate(arg0: mutref<Vec>, arg1: usize) -> usize\nvecRemoveSwap(arg0: mutref<Vec>, arg1: usize) -> Bool\nvecIndex(arg0: ref<Vec>, arg1: u8) -> usize\nvecContains(arg0: ref<Vec>, arg1: u8) -> Bool\nvecInsertUnique(arg0: mutref<Vec>, arg1: u8) -> Bool\nvecRemoveValue(arg0: mutref<Vec>, arg1: u8) -> Bool\nvecLen(arg0: ref<Vec>) -> usize\nvecCapacity(arg0: ref<Vec>) -> usize\nvecRemaining(arg0: ref<Vec>) -> usize\nvecIsEmpty(arg0: ref<Vec>) -> Bool\nvecIsFull(arg0: ref<Vec>) -> Bool\nbufBytes(arg0: ref<ByteBuf>) -> MutSpan<u8>\nbufLen(arg0: ref<ByteBuf>) -> usize\nreset(arg0: mutref<FixedBufAlloc>) -> Void\ncapacity(arg0: FixedBufAlloc) -> usize\n```\n\n### std.net\n\n```text\nhost() -> Net\naddress(arg0: String, arg1: u16) -> Address\ndnsName(arg0: Address) -> String\nconnect(arg0: Net, arg1: Address) -> Maybe<Conn>\nlisten(arg0: Net, arg1: Address) -> Maybe<Listener>\nwithTimeout(arg0: Address, arg1: Duration) -> Address\nlocalhost(arg0: u16) -> Address\nloopback(arg0: u16) -> Address\n```\n\n### std.parse\n\n```text\nisAsciiDigit(arg0: Span<u8>) -> Bool\nisAsciiAlpha(arg0: Span<u8>) -> Bool\nisIdentifierStart(arg0: Span<u8>) -> Bool\nisWhitespace(arg0: Span<u8>) -> Bool\nscanDigits(arg0: Span<u8>) -> usize\nscanIdentifier(arg0: Span<u8>) -> usize\nscanUntilByte(arg0: Span<u8>, arg1: u8) -> usize\nscanWhitespace(arg0: Span<u8>) -> usize\ntokenAscii(arg0: Span<u8>) -> Span<u8>\nparseBool(arg0: Span<u8>) -> Maybe<Bool>\nparseByteSize(arg0: Span<u8>) -> Maybe<usize>\nparseDuration(arg0: Span<u8>) -> Maybe<Duration>\nparseI32(arg0: Span<u8>) -> Maybe<i32>\nparseI32Base(arg0: Span<u8>, arg1: u32) -> Maybe<i32>\nparseI32Prefix(arg0: Span<u8>) -> Maybe<i32>\nparseI64(arg0: Span<u8>) -> Maybe<i64>\nparseI64Base(arg0: Span<u8>, arg1: u32) -> Maybe<i64>\nparseI64Prefix(arg0: Span<u8>) -> Maybe<i64>\nparseU8(arg0: Span<u8>) -> Maybe<u8>\n",
|
|
"parseU16(arg0: Span<u8>) -> Maybe<u16>\nparseU32(arg0: Span<u8>) -> Maybe<u32>\nparseU32Base(arg0: Span<u8>, arg1: u32) -> Maybe<u32>\nparseU32Prefix(arg0: Span<u8>) -> Maybe<u32>\nparseU64(arg0: Span<u8>) -> Maybe<u64>\nparseU64Base(arg0: Span<u8>, arg1: u32) -> Maybe<u64>\nparseU64Prefix(arg0: Span<u8>) -> Maybe<u64>\nparseUsize(arg0: Span<u8>) -> Maybe<usize>\nparseUsizeBase(arg0: Span<u8>, arg1: u32) -> Maybe<usize>\nparseUsizePrefix(arg0: Span<u8>) -> Maybe<usize>\n```\n\n### std.path\n\n```text\nbasename(arg0: String) -> String\ndirname(arg0: String) -> String\nextension(arg0: String) -> String\nstem(arg0: String) -> String\nsplitDir(arg0: String) -> String\nsplitBase(arg0: String) -> String\ncomponentCount(arg0: String) -> usize\ncomponent(arg0: String, arg1: usize) -> Maybe<String>\nisAbs(arg0: String) -> Bool\nabs(arg0: MutSpan<u8>, arg1: String, arg2: String) -> Maybe<String>\njoin(arg0: MutSpan<u8>, arg1: String, arg2: String) -> Maybe<String>\nnormalize(arg0: MutSpan<u8>, arg1: String) -> Maybe<String>\nrelative(arg0: MutSpan<u8>, arg1: String, arg2: String) -> Maybe<String>\n```\n\n### std.proc\n\n```text\nspawn(arg0: String) -> ProcStatus\nspawnInherit(arg0: String) -> ProcStatus\nspawnInheritArgs(arg0: String, arg1: Span<u8>, arg2: String, arg3: Span<u8>) -> ProcStatus\nexitCode(arg0: ProcStatus) -> i32\nsucceeded(arg0: ProcStatus) -> Bool\nfailed(arg0: ProcStatus) -> Bool\nrunOk(arg0: String) -> Bool\nrunCode(arg0: String) -> i32\ncapture(arg0: String, arg1: MutSpan<u8>) -> Maybe<usize>\ncaptureArgs(arg0: String, arg1: Span<u8>, arg2: MutSpan<u8>) -> Maybe<usize>\ncaptureFiles(arg0: String, arg1: String, arg2: String) -> ProcStatus\ncaptureFilesArgs(arg0: String, arg1: Span<u8>, arg2: String, arg3: String) -> ProcStatus\nspawnChild(arg0: String) -> ProcChild\nspawnChildIn(arg0: String, arg1: String) -> ProcChild\nspawnChildInEnv(arg0: String, arg1: String, arg2: Span<u8>) -> ProcChild\nspawnChildArgs(arg0: String, arg1: Span<u8>, arg2: String, arg3: Span<u8>) -> ProcChild\nchildValid(arg0: ProcChild) -> Bool\nrunning(arg0: ProcChild) -> Bool\nwait(arg0: ProcChild) -> ProcStatus\nkill(arg0: ProcChild) -> Bool\ninterrupt(arg0: ProcChild) -> Bool\nclose(arg0: ProcChild) -> Bool\ncloseStdin(arg0: ProcChild) -> Bool\npid(arg0: ProcChild) -> i32\npidRunning(arg0: i32) -> Bool\nkillPid(arg0: i32) -> Bool\ninterruptPid(arg0: i32) -> Bool\nkillGroupPid(arg0: i32) -> Bool\ninterruptGroupPid(arg0: i32) -> Bool\nreadStdout(arg0: ProcChild, arg1: MutSpan<u8>) -> Maybe<usize>\nreadStderr(arg0: ProcChild, arg1: MutSpan<u8>) -> Maybe<usize>\nwriteStdin(arg0: ProcChild, arg1: Span<u8>) -> Maybe<usize>\n```\n\n### std.pty\n\n```text\nspawn(arg0: String) -> ProcChild\nspawnIn(arg0: String, arg1: String) -> ProcChild\nspawnInEnv(arg0: String, arg1: String, arg2: Span<u8>) -> ProcChild\nspawnArgs(arg0: String, arg1: Span<u8>, arg2: String, arg3: Span<u8>) -> ProcChild\nvalid(arg0: ProcChild) -> Bool\nchildValid(arg0: ProcChild) -> Bool\n",
|
|
"running(arg0: ProcChild) -> Bool\nwait(arg0: ProcChild) -> ProcStatus\nkill(arg0: ProcChild) -> Bool\ninterrupt(arg0: ProcChild) -> Bool\nclose(arg0: ProcChild) -> Bool\npid(arg0: ProcChild) -> i32\nread(arg0: ProcChild, arg1: MutSpan<u8>) -> Maybe<usize>\nwrite(arg0: ProcChild, arg1: Span<u8>) -> Maybe<usize>\nresize(arg0: ProcChild, arg1: usize, arg2: usize) -> Bool\n```\n\n`std.pty` starts hosted children attached to a pseudoterminal instead of\nseparate stdin/stdout/stderr pipes. It returns the same `ProcChild` handle shape\nas `std.proc`, so `running`, `wait`, `interrupt`, `kill`, `close`, and `pid`\nhave the same lifecycle meaning. `read` and `write` are nonblocking; `read`\nreturns `null` when no bytes are currently available or the terminal has closed.\nFor short-lived PTY children, drain output with `read` before `wait`; once the\nchild exits, host PTYs may report the terminal as closed.\nUse PTY children for interactive programs that need terminal behavior such as\nline editing, prompts, color, cursor control, or terminal-size awareness.\n\n### std.rand\n\n```text\nseed(arg0: u32) -> RandSource\nnextU32(arg0: mutref<RandSource>) -> u32\nnextBool(arg0: mutref<RandSource>) -> Bool\nnextBelow(arg0: mutref<RandSource>, arg1: u32) -> Maybe<u32>\nrangeU32(arg0: mutref<RandSource>, arg1: u32, arg2: u32) -> Maybe<u32>\nentropyU32() -> u32\nentropySeed() -> RandSource\nentropyHex32(arg0: MutSpan<u8>) -> Maybe<Span<u8>>\n```\n\n### std.regex\n\n```text\ncompile(buffer: MutSpan<u8>, pattern: Span<u8>) -> Maybe<Span<u8>>\ncompileErrorOffset(buffer: MutSpan<u8>, pattern: Span<u8>) -> Maybe<usize>\ncompileStatus(buffer: MutSpan<u8>, pattern: Span<u8>) -> u32\ncontains(pattern: Span<u8>, text: Span<u8>) -> Maybe<Bool>\nfind(pattern: Span<u8>, text: Span<u8>) -> Maybe<Span<u8>>\nfindCount(pattern: Span<u8>, text: Span<u8>) -> Maybe<usize>\nfindIndex(pattern: Span<u8>, text: Span<u8>) -> Maybe<usize>\nfindNth(pattern: Span<u8>, text: Span<u8>, index: usize) -> Maybe<Span<u8>>\nfindNthIndex(pattern: Span<u8>, text: Span<u8>, index: usize) -> Maybe<usize>\nreplace(buffer: MutSpan<u8>, pattern: Span<u8>, text: Span<u8>, replacement: Span<u8>) -> Maybe<Span<u8>>\nsplit(pattern: Span<u8>, text: Span<u8>, index: usize) -> Maybe<Span<u8>>\nsplitCount(pattern: Span<u8>, text: Span<u8>) -> Maybe<usize>\nstatusName(status: u32) -> String\nisMatch(program: Span<u8>, text: Span<u8>) -> Bool\nmatches(pattern: Span<u8>, text: Span<u8>) -> Maybe<Bool>\n```\n\nSupported pattern subset (ECMA-262-leaning syntax, matching by codepoint,\nunanchored search like `RegExp.prototype.test`): literals, `.`, classes with negation,\nranges, and `\\d \\D \\w \\W \\s \\S`, anchors `^` `$`, word boundaries `\\b` `\\B`,\ngreedy quantifiers `* + ? {m} {m,} {m,n}`, alternation `|`, capturing and\n`(?:...)` groups (matching only). Compile once into a caller buffer, then call\n`isMatch` repeatedly. Unsupported constructs are compile errors with status\n",
|
|
"codes: 1 backreference, 2 lookahead, 3 lookbehind, 4 named group, 5 lazy\nquantifier, 6 group modifier, 7 unicode property escape, 8 syntax, 9 quantifier\nrange, 10 over buffer/2048-byte program limit, 11 pattern not UTF-8, 12 nesting\ndepth over 32. `statusName` names a code for diagnostics. Search, split, and\nreplace helpers use the leftmost start and longest end for each match; `split`\nand `splitCount` use non-empty matches as separators and ignore zero-length\nmatches.\n\n### std.search\n\n```text\nbinaryI32(arg0: Span<i32>, arg1: i32) -> usize\nbinaryDescI32(arg0: Span<i32>, arg1: i32) -> usize\nbinaryU32(arg0: Span<u32>, arg1: u32) -> usize\nbinaryDescU32(arg0: Span<u32>, arg1: u32) -> usize\nbinaryUsize(arg0: Span<usize>, arg1: usize) -> usize\nbinaryDescUsize(arg0: Span<usize>, arg1: usize) -> usize\ncontainsSortedI32(arg0: Span<i32>, arg1: i32) -> Bool\ncontainsSortedDescI32(arg0: Span<i32>, arg1: i32) -> Bool\ncontainsSortedU32(arg0: Span<u32>, arg1: u32) -> Bool\ncontainsSortedDescU32(arg0: Span<u32>, arg1: u32) -> Bool\ncontainsSortedUsize(arg0: Span<usize>, arg1: usize) -> Bool\ncontainsSortedDescUsize(arg0: Span<usize>, arg1: usize) -> Bool\ncountSortedI32(arg0: Span<i32>, arg1: i32) -> usize\ncountSortedDescI32(arg0: Span<i32>, arg1: i32) -> usize\ncountSortedU32(arg0: Span<u32>, arg1: u32) -> usize\ncountSortedDescU32(arg0: Span<u32>, arg1: u32) -> usize\ncountSortedUsize(arg0: Span<usize>, arg1: usize) -> usize\ncountSortedDescUsize(arg0: Span<usize>, arg1: usize) -> usize\nequalRangeI32(arg0: Span<i32>, arg1: i32) -> Span<i32>\nequalRangeDescI32(arg0: Span<i32>, arg1: i32) -> Span<i32>\nequalRangeU32(arg0: Span<u32>, arg1: u32) -> Span<u32>\nequalRangeDescU32(arg0: Span<u32>, arg1: u32) -> Span<u32>\nequalRangeUsize(arg0: Span<usize>, arg1: usize) -> Span<usize>\nequalRangeDescUsize(arg0: Span<usize>, arg1: usize) -> Span<usize>\npartitionPointI32(arg0: Span<i32>, arg1: i32) -> usize\npartitionPointDescI32(arg0: Span<i32>, arg1: i32) -> usize\npartitionPointU32(arg0: Span<u32>, arg1: u32) -> usize\npartitionPointDescU32(arg0: Span<u32>, arg1: u32) -> usize\npartitionPointUsize(arg0: Span<usize>, arg1: usize) -> usize\npartitionPointDescUsize(arg0: Span<usize>, arg1: usize) -> usize\nindexOf(items: Span<T>, value: T) -> usize\nlastIndexOf(items: Span<T>, value: T) -> usize\nlowerBoundI32(arg0: Span<i32>, arg1: i32) -> usize\nlowerBoundDescI32(arg0: Span<i32>, arg1: i32) -> usize\nlowerBoundU32(arg0: Span<u32>, arg1: u32) -> usize\nlowerBoundDescU32(arg0: Span<u32>, arg1: u32) -> usize\nlowerBoundUsize(arg0: Span<usize>, arg1: usize) -> usize\nlowerBoundDescUsize(arg0: Span<usize>, arg1: usize) -> usize\nminI32(arg0: Span<i32>) -> Maybe<i32>\nminU32(arg0: Span<u32>) -> Maybe<u32>\nminUsize(arg0: Span<usize>) -> Maybe<usize>\nminIndexI32(arg0: Span<i32>) -> usize\nminIndexU32(arg0: Span<u32>) -> usize\nminIndexUsize(arg0: Span<usize>) -> usize\nmaxI32(arg0: Span<i32>) -> Maybe<i32>\nmaxU32(arg0: Span<u32>) -> Maybe<u32>\n",
|
|
"maxUsize(arg0: Span<usize>) -> Maybe<usize>\nmaxIndexI32(arg0: Span<i32>) -> usize\nmaxIndexU32(arg0: Span<u32>) -> usize\nmaxIndexUsize(arg0: Span<usize>) -> usize\nupperBoundI32(arg0: Span<i32>, arg1: i32) -> usize\nupperBoundDescI32(arg0: Span<i32>, arg1: i32) -> usize\nupperBoundU32(arg0: Span<u32>, arg1: u32) -> usize\nupperBoundDescU32(arg0: Span<u32>, arg1: u32) -> usize\nupperBoundUsize(arg0: Span<usize>, arg1: usize) -> usize\nupperBoundDescUsize(arg0: Span<usize>, arg1: usize) -> usize\n```\n\n### std.sort\n\n```text\ninsertionI32(arg0: MutSpan<i32>) -> Void\ninsertionDescI32(arg0: MutSpan<i32>) -> Void\ninsertionU32(arg0: MutSpan<u32>) -> Void\ninsertionDescU32(arg0: MutSpan<u32>) -> Void\ninsertionUsize(arg0: MutSpan<usize>) -> Void\ninsertionDescUsize(arg0: MutSpan<usize>) -> Void\nstableI32(arg0: MutSpan<i32>) -> Void\nstableU32(arg0: MutSpan<u32>) -> Void\nstableUsize(arg0: MutSpan<usize>) -> Void\nstableDescI32(arg0: MutSpan<i32>) -> Void\nstableDescU32(arg0: MutSpan<u32>) -> Void\nstableDescUsize(arg0: MutSpan<usize>) -> Void\nunstableI32(arg0: MutSpan<i32>) -> Void\nunstableU32(arg0: MutSpan<u32>) -> Void\nunstableUsize(arg0: MutSpan<usize>) -> Void\nunstableDescI32(arg0: MutSpan<i32>) -> Void\nunstableDescU32(arg0: MutSpan<u32>) -> Void\nunstableDescUsize(arg0: MutSpan<usize>) -> Void\nreverseI32(arg0: MutSpan<i32>) -> Void\nswapI32(arg0: MutSpan<i32>, arg1: usize, arg2: usize) -> Bool\nrotateLeftI32(arg0: MutSpan<i32>, arg1: usize) -> Void\nrotateRightI32(arg0: MutSpan<i32>, arg1: usize) -> Void\nreverseU32(arg0: MutSpan<u32>) -> Void\nswapU32(arg0: MutSpan<u32>, arg1: usize, arg2: usize) -> Bool\nrotateLeftU32(arg0: MutSpan<u32>, arg1: usize) -> Void\nrotateRightU32(arg0: MutSpan<u32>, arg1: usize) -> Void\nreverseUsize(arg0: MutSpan<usize>) -> Void\nswapUsize(arg0: MutSpan<usize>, arg1: usize, arg2: usize) -> Bool\nrotateLeftUsize(arg0: MutSpan<usize>, arg1: usize) -> Void\nrotateRightUsize(arg0: MutSpan<usize>, arg1: usize) -> Void\nisSortedI32(arg0: Span<i32>) -> Bool\nisSortedDescI32(arg0: Span<i32>) -> Bool\nisSortedU32(arg0: Span<u32>) -> Bool\nisSortedDescU32(arg0: Span<u32>) -> Bool\nisSortedUsize(arg0: Span<usize>) -> Bool\nisSortedDescUsize(arg0: Span<usize>) -> Bool\npartitionI32(arg0: MutSpan<i32>, arg1: i32) -> usize\npartitionDescI32(arg0: MutSpan<i32>, arg1: i32) -> usize\npartitionU32(arg0: MutSpan<u32>, arg1: u32) -> usize\npartitionDescU32(arg0: MutSpan<u32>, arg1: u32) -> usize\npartitionUsize(arg0: MutSpan<usize>, arg1: usize) -> usize\npartitionDescUsize(arg0: MutSpan<usize>, arg1: usize) -> usize\nisPartitionedI32(arg0: Span<i32>, arg1: i32) -> Bool\nisPartitionedDescI32(arg0: Span<i32>, arg1: i32) -> Bool\nisPartitionedU32(arg0: Span<u32>, arg1: u32) -> Bool\nisPartitionedDescU32(arg0: Span<u32>, arg1: u32) -> Bool\nisPartitionedUsize(arg0: Span<usize>, arg1: usize) -> Bool\nisPartitionedDescUsize(arg0: Span<usize>, arg1: usize) -> Bool\nselectNthI32(arg0: MutSpan<i32>, arg1: usize) -> Bool\n",
|
|
"selectNthDescI32(arg0: MutSpan<i32>, arg1: usize) -> Bool\nselectNthU32(arg0: MutSpan<u32>, arg1: usize) -> Bool\nselectNthDescU32(arg0: MutSpan<u32>, arg1: usize) -> Bool\nselectNthUsize(arg0: MutSpan<usize>, arg1: usize) -> Bool\nselectNthDescUsize(arg0: MutSpan<usize>, arg1: usize) -> Bool\nmergeSortedI32(arg0: MutSpan<i32>, arg1: Span<i32>, arg2: Span<i32>) -> usize\nmergeSortedDescI32(arg0: MutSpan<i32>, arg1: Span<i32>, arg2: Span<i32>) -> usize\nmergeSortedU32(arg0: MutSpan<u32>, arg1: Span<u32>, arg2: Span<u32>) -> usize\nmergeSortedDescU32(arg0: MutSpan<u32>, arg1: Span<u32>, arg2: Span<u32>) -> usize\nmergeSortedUsize(arg0: MutSpan<usize>, arg1: Span<usize>, arg2: Span<usize>) -> usize\nmergeSortedDescUsize(arg0: MutSpan<usize>, arg1: Span<usize>, arg2: Span<usize>) -> usize\ndedupeSortedI32(arg0: MutSpan<i32>) -> usize\ndedupeSortedU32(arg0: MutSpan<u32>) -> usize\ndedupeSortedUsize(arg0: MutSpan<usize>) -> usize\n```\n\n### std.str\n\n```text\ncontains(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nconcat(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\ncopy(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\ncount(arg0: Span<u8>, arg1: Span<u8>) -> usize\ncountByte(arg0: Span<u8>, arg1: u8) -> usize\neqlIgnoreAsciiCase(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nendsWith(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nfieldAscii(arg0: Span<u8>, arg1: usize) -> Maybe<Span<u8>>\nfieldCountAscii(arg0: Span<u8>) -> usize\nindexOf(arg0: Span<u8>, arg1: Span<u8>) -> usize\nlastIndexOf(arg0: Span<u8>, arg1: Span<u8>) -> usize\nline(arg0: Span<u8>, arg1: usize) -> Maybe<Span<u8>>\nlineCount(arg0: Span<u8>) -> usize\nrepeat(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: usize) -> Maybe<Span<u8>>\nreplace(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nreverse(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nsplit(arg0: Span<u8>, arg1: Span<u8>, arg2: usize) -> Maybe<Span<u8>>\nsplitCount(arg0: Span<u8>, arg1: Span<u8>) -> usize\nstartsWith(arg0: Span<u8>, arg1: Span<u8>) -> Bool\ntoLowerAscii(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\ntoUpperAscii(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\ntrimAscii(arg0: Span<u8>) -> Span<u8>\ntrimEndAscii(arg0: Span<u8>) -> Span<u8>\ntrimStartAscii(arg0: Span<u8>) -> Span<u8>\nwordCountAscii(arg0: Span<u8>) -> usize\n```\n\n### std.testing\n\n```text\nisTrue(arg0: Bool) -> Bool\nisFalse(arg0: Bool) -> Bool\nequalBool(arg0: Bool, arg1: Bool) -> Bool\nequalUsize(arg0: usize, arg1: usize) -> Bool\nequalU32(arg0: u32, arg1: u32) -> Bool\nequalI32(arg0: i32, arg1: i32) -> Bool\nequalBytes(arg0: Span<u8>, arg1: Span<u8>) -> Bool\ncontainsBytes(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nstartsWith(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nendsWith(arg0: Span<u8>, arg1: Span<u8>) -> Bool\nnotEqualBytes(arg0: Span<u8>, arg1: Span<u8>) -> Bool\ndiffIndexBytes(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<usize>\n",
|
|
"jsonFieldEquals(arg0: Span<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Bool\njsonPathEquals(arg0: Span<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Bool\ncaseName(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: usize) -> Maybe<Span<u8>>\n```\n\n### std.text\n\n```text\nisAscii(arg0: Span<u8>) -> Bool\nutf8Len(arg0: Span<u8>) -> Maybe<usize>\nutf8Valid(arg0: Span<u8>) -> Bool\n```\n\n### std.time\n\n```text\nns(arg0: i64) -> Duration\nus(arg0: i64) -> Duration\nms(arg0: i32) -> Duration\nseconds(arg0: i32) -> Duration\nminutes(arg0: i32) -> Duration\nhours(arg0: i32) -> Duration\nzero() -> Duration\nadd(arg0: Duration, arg1: Duration) -> Duration\nmonotonic() -> Duration\nwallSeconds() -> i64\nsub(arg0: Duration, arg1: Duration) -> Duration\nasNs(arg0: Duration) -> i64\nasUsFloor(arg0: Duration) -> i64\nasMsFloor(arg0: Duration) -> i32\nasSecondsFloor(arg0: Duration) -> i64\nmin(arg0: Duration, arg1: Duration) -> Duration\nmax(arg0: Duration, arg1: Duration) -> Duration\nclamp(arg0: Duration, arg1: Duration, arg2: Duration) -> Duration\nlessThan(arg0: Duration, arg1: Duration) -> Bool\nisZero(arg0: Duration) -> Bool\nabs(arg0: Duration) -> Duration\nbetween(arg0: Duration, arg1: Duration) -> Duration\nhasElapsed(arg0: Duration, arg1: Duration, arg2: Duration) -> Bool\ndeadlineAfter(arg0: Duration, arg1: Duration) -> Duration\nremainingUntil(arg0: Duration, arg1: Duration) -> Duration\ndeadlineExpired(arg0: Duration, arg1: Duration) -> Bool\nsleep(arg0: Duration) -> Bool\nisRfc3339Date(text: Span<u8>) -> Bool\nisRfc3339Time(text: Span<u8>) -> Bool\nisRfc3339DateTime(text: Span<u8>) -> Bool\nparseRfc3339DateTimeOr(text: Span<u8>, fallback: i64) -> i64\nisLeapYear(year: u32) -> Bool\ndaysInMonth(year: u32, month: u32) -> u32\nwriteDurationNs(arg0: MutSpan<u8>, arg1: Duration) -> Maybe<Span<u8>>\nwriteDurationMs(arg0: MutSpan<u8>, arg1: Duration) -> Maybe<Span<u8>>\nwriteDurationSeconds(arg0: MutSpan<u8>, arg1: Duration) -> Maybe<Span<u8>>\n```\n\nThe RFC 3339 helpers are target-neutral and validate calendar dates (leap\nyears, days-in-month), times with fractional seconds and numeric offsets, and\ndate-times joined by `T` or `t`. The leap-second rule is exact: seconds `60`\nis valid only when the time normalized by its offset equals `23:59:60` UTC,\nwrapping modulo 24 hours (`00:29:60+00:30` is valid; `23:59:60-01:00` is not).\n`parseRfc3339DateTimeOr` returns UTC epoch seconds, truncating fractions and\nmapping a valid leap second to the same epoch second as `:59`; it returns the\nfallback for invalid text.\nUse `writeDurationNs`, `writeDurationMs`, or `writeDurationSeconds` when a\ntyped `Duration` needs a compact textual value in caller-owned storage.\nUse `deadlineAfter`, `remainingUntil`, and `deadlineExpired` to model request\nbudgets against monotonic `Duration` instants without observing the clock inside\nthe helper.\n`std.time.sleep` is hosted and returns `false` on host failure. Timer and\nfake-clock handles are not exposed in the current surface.\n\n",
|
|
"### std.unicode\n\n```text\ndecodeAt(text: Span<u8>, index: usize) -> Maybe<u32>\ndecodeStatusAt(text: Span<u8>, index: usize) -> u32\nwidthAt(text: Span<u8>, index: usize) -> Maybe<usize>\nencode(buffer: MutSpan<u8>, cp: u32) -> Maybe<Span<u8>>\nencodedWidth(cp: u32) -> Maybe<usize>\ninvalidIndex(text: Span<u8>) -> usize\nisDigit(cp: u32) -> Bool\nisWord(cp: u32) -> Bool\nisSpace(cp: u32) -> Bool\nnextIndex(text: Span<u8>, index: usize) -> Maybe<usize>\nstatusName(status: u32) -> String\n```\n\nDecoding is strict UTF-8 (overlong encodings, surrogates, values above\nU+10FFFF, and truncated sequences return `null`). Iterate codepoints by\nadvancing a byte index with `nextIndex` or `widthAt`. `invalidIndex` returns\nthe first invalid byte index or the input length, and `decodeStatusAt` plus\n`statusName` provide allocation-free decode diagnostics. The class helpers use\nECMA-262 regex semantics by codepoint (`\\d` `\\w` `\\s`).\n\n### std.url\n\n```text\npercentEncode(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\npercentDecode(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nqueryEscape(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nqueryUnescape(arg0: MutSpan<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nscheme(arg0: Span<u8>) -> Maybe<Span<u8>>\nauthority(arg0: Span<u8>) -> Maybe<Span<u8>>\nhost(arg0: Span<u8>) -> Maybe<Span<u8>>\npath(arg0: Span<u8>) -> Span<u8>\nquery(arg0: Span<u8>) -> Maybe<Span<u8>>\nfragment(arg0: Span<u8>) -> Maybe<Span<u8>>\nqueryValue(arg0: Span<u8>, arg1: Span<u8>) -> Maybe<Span<u8>>\nqueryValueDecoded(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteQueryParam(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteFormField(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nappendFormField(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nformValue(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nappendQuery(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\nwriteUrl(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>, arg3: Span<u8>) -> Maybe<Span<u8>>\nappendFragment(arg0: MutSpan<u8>, arg1: Span<u8>, arg2: Span<u8>) -> Maybe<Span<u8>>\n```\n\n## Maybe Pattern\n\n```zero\npub fn main(world: World) -> Void raises {\n let first: Maybe<String> = std.args.get(1)\n if first.has {\n check world.out.write(first.value)\n }\n}\n```\n\nUse the CLI helpers for command, fallback, exact flag, and option conventions\nbefore writing a custom argument loop:\n\n```zero\npub fn main(world: World) -> Void raises {\n let command: String = std.cli.commandOr(\"help\")\n let name: String = std.cli.argOr(2, \"world\")\n if std.mem.eql(command, \"hello\") {\n check world.out.write(\"hello \")\n check world.out.write(name)\n check world.out.write(\"\\n\")\n }\n}\n```\n\n",
|
|
"Use `check maybeValue` only when absence should propagate as a failure in a fallible function.\nRead `maybeValue.value` only inside a visible `if maybeValue.has { ... }` guard.\n\n## HTTP Pattern\n\nUse the request/response envelope helpers instead of hand-building byte\nheaders when possible. `std.http.writeRequest` and\n`std.http.writeJsonRequest` take a start line such as `\"GET /health\"` or\n`\"POST https://example.com/api\"` and write into caller-owned storage. Use\n`std.http.writeMethodRequest`, `std.http.writeGetRequest`, and the POST/PUT/PATCH\nJSON request helpers when method and target are already separate values.\n\n```zero\npub fn main() -> Void {\n var request_buf: [128]u8 = [0_u8; 128]\n let request: Maybe<Span<u8>> = std.http.writeJsonRequest(request_buf, \"POST /users\", \"{\\\"id\\\":7}\")\n expect request.has\n}\n```\n\nFor API-style handlers, parse the request envelope with route helpers such as\n`std.http.requestIsGet`, `std.http.requestIsHead`,\n`std.http.requestIsOptions`, `std.http.requestIsPost`,\n`std.http.requestPathStartsWith`, `std.http.requestPathTailAfter`,\n`std.http.requestRouteMatches`, `std.http.requestPathParam`,\n`std.http.pathMatchesPattern`, `std.http.pathParam`,\n`std.http.pathSegmentCount`, `std.http.pathSegment`,\n`std.http.requestPathSegmentCount`, `std.http.requestPathSegment`,\n`std.http.requestQueryValue`, `std.http.requestHeader`,\n`std.http.requestContentLength`, `std.http.requestContentType`,\n`std.http.requestAccepts`, `std.http.requestAcceptsJson`,\n`std.http.requestBearerToken`, `std.http.requestCookie`,\n`std.http.requestHasJsonContentType`, `std.http.requestJsonBodyWithin`, and\n`std.http.requestJsonField`. Use `std.http.methodAllowed`,\n`std.http.requestMethodAllowed`, and `std.http.requestRouteMethodAllowed` for\nexplicit handler dispatch across a comma-separated method allow list. Use path\nsegment helpers for resource routes such as `/users/7`; they borrow zero-based,\nnon-empty segments and ignore leading, trailing, or repeated `/`. Pattern routes\nmatch literal segments, `:name` parameters, and a trailing `*` wildcard.\nPrefer the status-specific JSON writers for common success responses and\n`std.http.writeJsonError(response, status, code)` for conventional\n`{\"error\":\"code\"}` failures. `writeJsonError` validates the code before writing\nJSON, so agents do not need to hand-build simple error bodies. The full custom\nbody writers remain available:\n`std.http.writeJsonOk`, `std.http.writeJsonCreated`,\n`std.http.writeJsonBadRequest`, `std.http.writeJsonUnauthorized`,\n`std.http.writeJsonForbidden`, `std.http.writeJsonNotFound`,\n`std.http.writeJsonMethodNotAllowed`, `std.http.writeJsonConflict`,\n`std.http.writeJsonUnprocessable`, `std.http.writeJsonTooManyRequests`, and\n`std.http.writeJsonInternalServerError`. Use `std.http.writeNoContent` for\n204 responses, `std.http.writeCorsPreflight` for `OPTIONS` preflight responses,\n",
|
|
"and `std.http.writeCorsJsonResponse` when a JSON response also needs\n`access-control-allow-origin`. `writeCorsJsonResponse` takes a status-line\nfragment such as `\"200 OK\"` or `\"422 Unprocessable Entity\"`. Use\n`std.http.writeResponseWithHeader`, `std.http.writeJsonResponseWithHeader`, or\n`std.http.writeJsonResponseWithCookie` when a response needs one explicit safe\nheader line or cookie value. Use the `WithHeaders` variants with\n`std.http.headerBlockSafe` for newline-separated header blocks. Use\n`std.http.writeRequestWithHeader`, `std.http.writeRequestWithHeaders`,\n`std.http.writeJsonRequestWithHeader`, or\n`std.http.writeJsonRequestWithHeaders` for outbound request envelopes with\nexplicit safe headers. These writers reject headers they manage themselves:\nrequest writers reject `content-length` and `transfer-encoding`; JSON request\nwriters also reject `content-type`; response writers reject `content-length`,\n`transfer-encoding`, and `connection`; JSON response writers also reject\n`content-type`. Use `std.http.writeTextOk` or\n`std.http.writeHtmlOk` for simple non-JSON responses such as health text,\n`robots.txt`, or a small HTML page. Use `std.http.contentTypeForPath` and\n`std.http.writeStaticResponse` for small static responses whose media type can\ncome from a path suffix. Use redirect helpers such as\n`std.http.writeFound`, `std.http.writeSeeOther`,\n`std.http.writeMovedPermanently`, or `std.http.writePermanentRedirect` instead\nof hand-writing `Location` headers; they reject empty or control-character\nlocation values before writing. Use\n`std.http.responseStatus`, `std.http.responseStatusIs`,\n`std.http.responseHeader`, `std.http.responseContentType`,\n`std.http.responseRedirectLocation`, `std.http.responseBodyBytes`,\n`std.http.responseBodyEquals`, and `std.http.responseMatches` to inspect a\nlocal response envelope produced by the response writers. Use\n`std.http.testRequest` and `std.http.testJsonRequest` to build synthetic request\nenvelopes for handler checks without opening a socket.\n\nFor a runnable local API server, define a same-module handler and call\n`std.http.listen(world)` from `main`. The handler signature is\n`fn handle(request: Span<u8>, response: MutSpan<u8>) -> Maybe<Span<u8>>`.\nWhen no port is passed, `std.http.listen(world)` starts at development port\n`3000` and increments by one until it finds a free loopback port. It prints the\nactual URL, such as `listening on http://127.0.0.1:3001`; use that printed port\nfor local HTTP requests. Do not assume `3000`, because another local server may\nalready be using it. When a port is explicit,\n`std.http.listen(world, 3000_u16)` tries exactly that port and fails with a bind\ndiagnostic if it is occupied.\n\n```zero\npub fn main(world: World) -> Void raises {\n check std.http.listen(world)\n}\n\nfn handle(request: Span<u8>, response: MutSpan<u8>) -> Maybe<Span<u8>> {\n if std.http.requestIsGet(request, \"/ping\") {\n",
|
|
" return std.http.writeJsonOk(response, \"{\\\"message\\\":\\\"pong\\\"}\")\n }\n return std.http.writeJsonError(response, 404, \"not_found\")\n}\n```\n\n```zero\npub fn main() -> Void {\n let request: Span<u8> = \"POST /users?tenant=demo\\ncontent-type: application/json\\n\\n{\\\"id\\\":7}\"\n var response_buf: [192]u8 = [0_u8; 192]\n let body: Maybe<Span<u8>> = std.http.requestJsonBodyWithin(request, 64)\n let tenant: Maybe<Span<u8>> = std.http.requestQueryValue(request, \"tenant\")\n let resource: Maybe<Span<u8>> = std.http.requestPathSegment(request, 0)\n if std.http.requestIsPost(request, \"/users\") && resource.has && std.mem.eql(resource.value, \"users\") && tenant.has && body.has {\n let response: Maybe<Span<u8>> = std.http.writeJsonCreated(response_buf, \"{\\\"created\\\":true}\")\n expect response.has\n }\n}\n```\n\nFor browser-facing APIs, handle preflight and CORS in the response writer\ninstead of hand-assembling headers:\n\n```zero\npub fn main() -> Void {\n let request: Span<u8> = \"OPTIONS /users\\naccess-control-request-method: POST\\n\\n\"\n var response_buf: [256]u8 = [0_u8; 256]\n if std.http.requestIsOptions(request, \"/users\") {\n let response: Maybe<Span<u8>> = std.http.writeCorsPreflight(response_buf, \"*\", \"GET, POST, OPTIONS\", \"content-type, authorization\")\n expect response.has\n }\n}\n```\n\nFor authenticated APIs, use header-specific helpers rather than parsing\n`authorization` or `cookie` by hand:\n\n```zero\npub fn main() -> Void {\n let request: Span<u8> = \"GET /me\\nauthorization: Bearer token-123\\ncookie: sid=abc; theme=dark\\n\\n\"\n let token: Maybe<Span<u8>> = std.http.requestBearerToken(request)\n let session: Maybe<Span<u8>> = std.http.requestCookie(request, \"sid\")\n expect token.has && session.has\n}\n```\n\nFor hosted client calls, keep the network capability explicit and read response\nbytes through `std.http.responseBody`. Use `std.http.headerBytes` when a\nheader value from `std.http.headerValue` must be borrowed as a span.\n\n## Resource Pattern\n\nHosted file APIs can use explicit handles:\n\n```zero\npub fn main(world: World) -> Void raises {\n let fs: Fs = std.fs.host()\n var read_buf: [32]u8 = [0_u8; 32]\n if std.fs.writeFile(fs, \".zero/out/log.txt\", \"hello\\n\") && std.fs.appendFile(fs, \".zero/out/log.txt\", \"again\\n\") && std.fs.readFileEquals(fs, \".zero/out/log.txt\", read_buf, \"hello\\nagain\\n\") {\n check world.out.write(\"wrote\\n\")\n }\n}\n```\n\nOwned resources are deterministic. Do not invent hidden heap, global logger, or ambient filesystem APIs.\n",
|
|
NULL
|
|
};
|
|
|
|
static const char *const zero_embedded_skill_testing_chunks[] = {
|
|
"---\nname: testing\ndescription: Write and run Zero test blocks.\n---\n\n# Zero Testing\n\nUse this when adding tests, debugging failing tests, or wiring Zero checks into CI and editor workflows.\n\n## Test Blocks\n\nZero test blocks live beside source:\n\n```zero\nfn add(left: i32, right: i32) -> i32 {\n return left + right\n}\n\ntest \"addition works\" {\n expect add(2, 3) == 5\n}\n```\n\n`expect` requires a `Bool`. A false expectation fails the test.\n\nUse `std.testing` helpers when a predicate should be explicit in the source:\n\n```zero\ntest \"output shape\" {\n expect std.testing.equalBytes(\"zero\", \"zero\")\n expect std.testing.containsBytes(\"zerolang\", \"lang\")\n}\n```\n\n`std.testing` does not register tests or print output. It only returns `Bool`\nvalues for ordinary `expect` statements.\n\n## Run\n\n```sh\nzero test conformance/native/pass/test-blocks.graph\nzero test --filter addition conformance/native/pass/test-blocks.graph\nzero test conformance/packages/test-app\n```\n\nUse `--filter` for a narrow loop. The filter matches test names by substring.\n\nFor packages, normal `zero test [package]` compiles from `zero.graph` and can\nrun before `.0` projections exist:\n\n```sh\nzero patch --op 'addTest name=\"addition works\" call=\"add\" arg0=\"2\" arg1=\"3\" expect=\"5\" type=\"i32\"'\nzero test\nzero test --filter addition\n```\n\nPrefer `addTest` for one pure function call with literal arguments. Use\n`addTestBody name=\"...\" ... end` only when the test needs custom body rows.\nTest labels are display names, not callable function names; do not rename them\nto `__zero_test_*`.\nIf `zero test` reports an unknown function for a display label, do not rename\nthe label to chase runner internals. Delete the malformed custom test and\nrecreate simple pure coverage with `addTest`, or use behavior smoke checks for\neffectful paths.\n\nIf another tool hands you a derived ProgramGraph artifact, `zero test` can\nvalidate it. Do not create a standalone graph artifact for the ordinary package\ntest loop; test the package path so the compiler reads `zero.graph` directly.\n\n## JSON Fields\n\nUse `zero test --json` when a tool or CI job needs exact fields. Useful fields:\n\n- `testDiscovery`: how files and tests were found\n- `fixtures`: fixture inputs and snapshot metadata\n- `snapshotKey`: stable test snapshot contract\n- `discoveredTests`, `selectedTests`, `passedTests`, `failedTests`\n- `expectedFailures`, `unexpectedPasses`\n- `targetFacts`: selected target and capability facts\n- `results`: per-test name, status, duration, source location, and failure span\n- `stdout`, `stderr`, `durationMs`\n\nUse JSON for machines and CI contracts. Normal test output is the default agent loop.\n\n## Expected Failures\n\nExpected-fail tests use one of these name markers:\n\n- `xfail:`\n- `expected fail:`\n- `[xfail]`\n\nExample:\n\n```zero\ntest \"xfail: pending parser edge case\" {\n expect false\n}\n```\n\n",
|
|
"An expected-fail test passes the command only when it fails as expected. If it starts passing, the command fails with `unexpectedPasses`.\n\n## Agent Workflow\n\n1. Add the smallest test that owns the behavior.\n2. Run a filtered test while editing.\n3. Run the containing package or fixture before finishing.\n4. Do not leave an expected-fail marker on a fixed bug.\n5. Use `zero check` first when the failure is a compile error; rerun with `--json` only if you need exact diagnostic fields.\n",
|
|
NULL
|
|
};
|
|
|
|
static const char *const zero_embedded_skill_zero_chunks[] = {
|
|
"---\nname: zero\ndescription: Install Zero and load version-matched workflows with zero skills.\n---\n\n# Zero\n\nZero is an agent-first programming language. zero.graph is the program; `.0` files are projections of it. Edit through `zero patch`.\n\nInstall this skill once in an agent's skill manager. Keep it thin; Zero's own CLI serves the version-matched workflow for each installed compiler.\n\nUse the zero already on PATH or at `~/.zero/bin/zero` when one exists; environments often pin a specific compiler, and replacing it silently breaks version-matched stores and workflows. Install only when zero is missing:\n\n```sh\ncommand -v zero >/dev/null 2>&1 || { curl -fsSL https://zerolang.ai/install.sh | bash; }\nexport PATH=\"$PATH:$HOME/.zero/bin\"\nzero --version\n```\n\n## Version-Matched Skills\n\nThis file is only a discovery stub. Do not treat it as the full Zero workflow\nor as command reference.\n\nBefore editing, checking, testing, or repairing Zero code, ask the installed compiler for the skill content that matches that exact binary:\n\n```sh\nzero skills\nzero skills get zero\nzero skills get zero --full\nzero skills get stdlib --topic std.time # one section instead of the whole topic\n```\n\nIf the user has multiple Zero binaries, use the same binary that will run the project:\n\n```sh\n/path/to/zero skills\n/path/to/zero skills get zero --full\n```\n\nUse `zero skills get <name>` to load only what the task needs, and fetch each\ntopic at most once per session: the content is fixed for a given compiler\nbinary, so refetching a loaded topic returns the same text. Topics and\napproximate served sizes:\n\n- `zero` (~2 KB): this discovery stub\n- `agent` (~4 KB): read-edit-verify loop, zero query usage, edit surfaces, verification\n- `language` (~6 KB): syntax, types, effects, control flow, generics\n- `graph` (~9 KB): zero.graph store, query/view, patch operations, import/export/merge\n- `diagnostics` (~4 KB): reading diagnostics, zero explain, typed fix plans\n- `packages` (~5 KB): manifests, package layout, creation and repair\n- `builds` (~5 KB): build/run, targets, profiles, emitted artifacts\n- `testing` (~3 KB): test blocks, filters, runtime checks\n- `stdlib` (~39 KB): full signature reference, including ready-made validators: `std.time` (RFC 3339 incl. the exact leap-second rule), `std.inet` (IPv4/IPv6/hostname), `std.regex` (ECMA subset), `std.unicode` (strict UTF-8). Check here before hand-writing any parsing or validation logic. Fetch one module's section (~1 KB) with `zero skills get stdlib --topic <prefix>`, e.g. `--topic std.time`.\n\nBefore hand-writing any parsing or validation, check the stdlib catalog: `zero skills get stdlib --topic <module>` serves one section (`std.time` covers RFC 3339 incl. leap seconds).\n\n",
|
|
"Edit through the graph: `zero patch` covers everything from surgical in-function text edits (`--replace-in-fn <fn> --old <text> --new <text>`, Edit semantics) to complete helper creation (`upsertFunction ... end`) and whole function bodies (`--replace-fn <fn> --body-file -` with a heredoc). Direct `.0` text edits are a last resort for changes no patch op expresses; package commands refresh `zero.graph` from edited source, but patch keeps the loop faster and preserves node identity. Read one function with `zero view --fn <name>` instead of whole files. Prefer concise text output during interactive agent work; use `--json` only for automation, exact spans, contracts, or machine-readable diagnostics.\n\n## Common Entry Points\n\n```sh\nzero query [graph-or-package]\nzero patch [graph-or-package] --op '<operation>'\nzero check [graph-or-package]\nzero test [graph-or-package]\nzero run [graph-or-package] -- <args>\nzero diff [graph-or-package]\nzero explain <diagnostic-code>\nzero fix --plan [graph-or-package]\n```\n\nIn a Zero repository checkout, prefer `bin/zero` when the task is about that checkout rather than the globally installed compiler.\n",
|
|
NULL
|
|
};
|
|
|
|
static const ZeroEmbeddedSkill zero_embedded_skills[] = {
|
|
{"agent", "Graph-first agent workflow for making focused Zero changes with CLI feedback.", false, zero_embedded_skill_agent_chunks},
|
|
{"builds", "Build, run, target, and profile Zero programs.", false, zero_embedded_skill_builds_chunks},
|
|
{"diagnostics", "Read Zero diagnostics, explanations, and typed fix plans.", false, zero_embedded_skill_diagnostics_chunks},
|
|
{"graph", "Use ProgramGraph commands as the primary agent authoring and inspection surface.", false, zero_embedded_skill_graph_chunks},
|
|
{"language", "Compact zerolang syntax and semantics guide for agents.", false, zero_embedded_skill_language_chunks},
|
|
{"packages", "Create, inspect, and repair Zero packages and manifests.", false, zero_embedded_skill_packages_chunks},
|
|
{"stdlib", "Use Zero standard library modules and target-gated capabilities.", false, zero_embedded_skill_stdlib_chunks},
|
|
{"testing", "Write and run Zero test blocks.", false, zero_embedded_skill_testing_chunks},
|
|
{"zero", "Install Zero and load version-matched workflows with zero skills.", false, zero_embedded_skill_zero_chunks},
|
|
};
|
|
static const size_t zero_embedded_skill_count = sizeof(zero_embedded_skills) / sizeof(zero_embedded_skills[0]);
|
|
|
|
#endif
|