v0.1.0 — Initial release
Initial release of @code-first-agents/tool — the TypeScript implementation of the Code-First Agents pattern. It provides the Tool base class for building deterministic CLI tools that LLM agents can discover, validate, and invoke with zero guesswork.
Features
Toolbase class — register subcommands (.subcommand()) with Zod input/output schemas, then dispatch from the CLI via.run(argv)— which always exits 0 — or call.invoke(name, args)for in-process use, which returns the result envelope without exiting.- Typed output levels (L1/L2/L3) —
l1Output(raw data fields),l2Output(requires aclassificationenum), andl3Output(adds a requiredinstructionsstring) helpers, each baking the{ ok, message }envelope for the output spectrum. - Self-describing introspection — auto-registered
schema(JSON Schema for every subcommand) andhelpbuiltins; neither is user-overridable. - Always-exit-0 semantics — every path, including errors, exits 0 and reports status via an
ok: falseJSON envelope (unknown_subcommand,input_validation_error,schema_violation,non_object_return,unexpected_error); handlers throwToolErrorfor domain-specific codes. - Zod v4 schema validation — input/output validated on every call;
.strict()input schemas reject unknown flags. Requires thezod@^4peer dependency; developed and tested on Bun >= 1.2.