Development
How the Nuabase source is organized, and how to build, test, and release it.
Repository layout
Section titled “Repository layout”The nuabase/nua-llm repository is a pnpm workspace containing two packages:
nua-client(published asnuabase): The public TypeScript SDK with Zod integration.nua-llm-core(private, bundled intonuabase): The underlying execution engine. It has no build of its own: its package exports point at its TypeScript source, whichnua-clienttype-checks, tests, and bundles directly. Internally:- The client’s engine router resolves the requested model or alias (via the CLI’s alias table for local agents, or the provider alias table for HTTP APIs).
runCastchecks whether the selected engine supports native schema enforcement, formats the prompt accordingly, executes the attempt, parses the output with the caller’s Zod schema, and triggers retries when needed.- Each engine attempt executes a single CLI process or a single HTTP request.
See How It Works for what each of these steps does from the caller’s side.
Running builds and tests
Section titled “Running builds and tests”pnpm installpnpm --filter nuabase build # bundle nuabase, with nua-llm-core inlinedpnpm --filter nua-llm-core test # fast unit tests (mocked providers, no keys needed)mise exec -- pnpm --filter nuabase test # real integration testsnua-llm-coreincludes both mocked unit tests and live integration tests (pnpm test:integration, which automatically skips providers without keys).nuabasetests are full end-to-end integration tests with no stubs. They run once against an HTTP provider (the first key found, unlessSKIP_DIRECT_TESTSis set) and once for each local agent listed inNUA_LOCAL_AGENTS(claude-code,codex,auto).- API keys and
NUA_LOCAL_AGENTSare loaded from an uncommittedmise.tomlat the repo root viamise exec --.
Contributor guidelines
Section titled “Contributor guidelines”- Keep the main entry point edge-compatible: Neither package’s main entry point may import
node:built-in modules. Node built-ins are only permitted insidenuabase/local-agent(enforced by automated tests). - No build step for
nua-llm-core: A change to it is innuabase’s next type check, test run, and bundle without rebuilding anything. - Pinned prompt templates: In-prompt schema instructions are pinned by tests; update them only intentionally.
Releases
Section titled “Releases”Record version bumps with pnpm changeset, apply them with pnpm release:version, and run the release train (which commits, publishes via pnpm release:publish, and pushes). Check pending changesets anytime with pnpm release:status.