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 - Project
tsconfig.jsonandpackage.jsonat 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 initinit 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/projectThe agent loop
- Check. Send
checka unified diff, or whole-file writes as[{ "path", "content" }]. Nothing touches disk. - Read. Look at
ok,errors,violationsandfallback. Useexplainon anything unclear. - Test. Call
runTestswith{ "scope": "affected" }when Vitest is installed. - Compare.
forkto try another approach.discardthe ones you reject. - Commit. Call
commiton the fork you keep. Runverifyfirst if you want a second opinion.
MCP tools
| Tool | What it does |
|---|---|
check | Apply 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. |
fork | Copy-on-write fork from disk or another fork, so you can try a second patch without disturbing the first. |
discard | Drop a fork and its overlays. |
commit | Write a fork's overlays to disk, atomically per file, and fold them into the warm state. |
runTests | Run Vitest against the fork: affected tests (default), all, or a list of files. |
impact | Who depends on a file or symbol: importers, callers, routes and covering tests. |
routes | The App Router tree: patterns, params, rendering, segment config and client boundaries. |
explain | Why a diagnostic fired and how to fix it. |
audit | Run the framework rules on the whole project: a score and the top violations per rule. |
verify | Recheck the fork's dependents from scratch in a separate tsgo and diff the answers. |
status | Daemon 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 stopOutput 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.
| Variable | Effect |
|---|---|
VETD_TSGO_IDLE_MS | Put tsgo to sleep after this long idle. Default 5 minutes. |
VETD_IDLE_EXIT_MS | Exit the daemon after this long with no clients. Default 10 minutes. |
VETD_CACHE_DIR | Where the content-addressed facts cache lives. Default $XDG_CACHE_HOME/vetd or ~/.cache/vetd. |
VETD_BACKEND | Set to api to force the API backend even when the Go backend is built. |
VETD_TIMEOUT | CLI: give up after this many seconds without an answer. Default 0, wait. |
VETD_DEBUG | CLI: 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.