Skip to content

Reference

Authoritative descriptions of the tooling surface. These pages describe what the tools accept and emit; for the language semantics they enforce, see the language specification. For compiler implementation details see internals/.

CLI

The mty binary dispatches to per-command sub-pages:

  • mty — top-level binary overview, global flags, exit codes.
  • mty new — scaffold a new project (templates: web-game, cli, agent).
  • mty check — lex / parse / lower / typeck / borrowck / effectck / taintck.
  • mty run — JIT via Cranelift (interpreter fallback on unsupported shapes); -- <argv> passthrough.
  • mty build — native object + linker, or --target wasm32-{wasi,web}.
  • mty serve — dev server: build + HTTP + WebSocket reload on file change.
  • mty fmt — canonical formatter (idempotent under fuzz).
  • mty dump — inspect intermediate artefacts (CST, AST, HIR, SIR).
  • mty explain — Cause / Example / Fix / Spec for any MTxxxx diagnostic.
  • mty doc — markdown / HTML docs from /// comments.
  • mty lsp — LSP 3.17 server over stdio.
  • mty pkg — package manager (resolve / fetch / publish / verify).
  • mty inspect — runtime introspection; --cost reads the std.observe SQLite store.
  • mty replay — replay traces; --byte-identical strict mode; --diff divergence reporter.
  • mty reload — hot-swap an agent's wasm without losing its state.
  • mty find — capability-tagged search across the stdlib catalog (v0.33).
  • mty fix — bulk-apply fix envelopes from mty check --format json (v0.35).
  • mty agent — spawn / list / kill / send-message to running agents from the CLI.
  • mty hooks — install / uninstall / status of the project's pre-push git hook (v0.34).
  • mty doc --check — Strategy B drift gate: compares per-module docstubs to the curated stdlib catalog (v0.35).

mty test --eval runs *.eval.mty suites against a provider panel under byte-identical replay — covered under internals/std-eval.md.

Manifest + registry

  • Manifest format — the mighty.toml schema (workspace, deps, wit, cluster, profiles).
  • Registry — the GitHub-Releases-backed package registry contract.

Stdlib

Stable surface area of the standard library:

Core

  • std.fs — file-system reads + writes (capability-gated).
  • std.http — HTTP client (capability-gated, P2-direct).
  • std.json — JSON serialise + parse.
  • std.test — built-in test runner.
  • std.time — wall-clock + monotonic + sleep.
  • std.tls — TLS sockets (rustls-backed).

LLM-agent stack (v0.26–v0.30)

  • std.llm — typed Anthropic / OpenAI / Gemini / Bedrock providers with streaming, tool use, structured outputs, TokenBudget short-circuit.
  • std.mcp — MCP server (stdio + http) + client; auto-exposes @tool-annotated fns.
  • std.memoryVectorStore, Episodic, Working; deterministic snapshots fold into replay.
  • std.swarm — multi-provider consensus under a shared dollar budget; Majority / Plurality / Unanimous / WeightedVote / FirstAgreed.

Macros + attributes

  • @tool decorator — generates JSON schema descriptor + invoker + register companions for every provider; cap: clause enforced by the runtime.

Other surfaces

Internals + spec