Start checking.

vetd checks candidate edits in memory and gives your agent TypeScript errors, framework rules and affected tests.

Requirements

  • Node22.18 or newer
  • TypeScript@typescript/native-preview (TypeScript 7) installed in the project
  • Projecttsconfig.json and package.json at the root
  • OSmacOS or Linux
  • TestsVitest, optional, for affected test runs

Setup

The npm package isn't published yet. Install from a local checkout of the repository:

npm install -D /absolute/path/to/vetd @typescript/native-preview
npx vetd init

init adds a vetd server to .mcp.json and a short usage guide to AGENTS.md. It keeps your other servers and instructions, and it is safe to run again. For clients with their own config format, point them at:

npx --no-install vetd mcp --root /absolute/path/to/project

The agent loop

  1. Check. Send check a unified diff, or whole-file writes as [{ "path", "content" }]. Nothing touches disk.
  2. Read. Look at ok, errors, violations and fallback. Use explain on anything unclear.
  3. Test. Call runTests with { "scope": "affected" } when Vitest is installed.
  4. Compare. fork to try another approach. discard the ones you reject.
  5. Commit. Call commit on the fork you keep. Run verify first if you want a second opinion.

MCP tools

ToolWhat it does
checkApply a patch to a fork in memory and verify it: TypeScript diagnostics for every file the change can reach, Next.js rules, affected routes and tests.
forkCopy-on-write fork from disk or another fork, so you can try a second patch without disturbing the first.
discardDrop a fork and its overlays.
commitWrite a fork's overlays to disk, atomically per file, and fold them into the warm state.
runTestsRun Vitest against the fork: affected tests (default), all, or a list of files.
impactWho depends on a file or symbol: importers, callers, routes and covering tests.
routesThe App Router tree: patterns, params, rendering, segment config and client boundaries.
explainWhy a diagnostic fired and how to fix it.
auditRun the framework rules on the whole project: a score and the top violations per rule.
verifyRecheck the fork's dependents from scratch in a separate tsgo and diff the answers.
statusDaemon state: tsgo mode and memory, forks, and the latest invalidations with reasons.

Full schemas live in src/api.ts.

Reading results

Every check returns ok, new type errors grouped by message in errors, rule violations in violations, affected tests and routes, and ms. Pass detail: "full" for every field, uncapped: typeErrors, ruleViolations, recheck and timingsMs.

Errors that already exist on disk are only counted in preexisting and don't fail ok. With detail: "full", recheck.reasons says why each file was or wasn't revisited. If fallback is set, vetd ran a full check instead. An unsupported or failed check is never a pass.

CLI

git diff | npx vetd check --patch -
npx vetd check --patch change.diff
npx vetd impact src/lib/auth.ts
npx vetd test affected
npx vetd verify --oracle
npx vetd status
npx vetd stop

Output is JSON. check exits 1 when ok is false and 2 for a startup or command error. verify --oracle also runs a slow, stock tsgo --noEmit as an independent check.

Errors go to stderr as one line, then the fix and a link to this page. --timeout SECONDS gives up on a daemon that stops answering; VETD_DEBUG=1 prints the stack trace.

Configuration

Worktrees of the same repository share one daemon. tsgo sleeps when idle and the daemon exits when nobody is connected; the MCP proxy starts it again on demand.

VariableEffect
VETD_TSGO_IDLE_MSPut tsgo to sleep after this long idle. Default 5 minutes.
VETD_IDLE_EXIT_MSExit the daemon after this long with no clients. Default 10 minutes.
VETD_CACHE_DIRWhere the content-addressed facts cache lives. Default $XDG_CACHE_HOME/vetd or ~/.cache/vetd.
VETD_BACKENDSet to api to force the API backend even when the Go backend is built.
VETD_TIMEOUTCLI: give up after this many seconds without an answer. Default 0, wait.
VETD_DEBUGCLI: set to 1 to print stack traces with errors.

Limits

Keep a full TypeScript check and production build in CI. vetd is an early release and its tsgo API may change. The Go backend is experimental. Pages Router support covers routes and links; the component rules target the App Router.