Build and test cycle
npm install # @embabel/runtime-types from git, typescript, vitestnpm run typecheck # tsc --noEmitnpm test # vitest run — mockGateway against your handlersnpm run build # tsc → dist/*.js (CommonJS) + manifest.jsonmockGateway<WorldTools> lets you write hermetic tests in pure Node:
import { mockGateway } from "@embabel/runtime-types";import type { WorldTools } from "../.embabel/gateway";import { getOutline } from "../src/api/docs-editor";
it("extracts headings", async () => { const gateway = mockGateway<WorldTools>({ docs: { documentsGet: vi.fn().mockResolvedValue({ revisionId: "r1", body: { content: [/* … */] } }) }, }); const outline = await getOutline(gateway, { documentId: "abc" }); expect(outline.spans).toHaveLength(2);});No host running, no Docker, no live API.

