Purpose
vdiff is used to solve the problem of coding agents using outdated API knowledge when writing code. LLMs learn the API surface of a package during training, but the package itself continues to evolve. When a coding agent writes code against zod or express, it writes the version from its memory, which is often not the version installed in the project's lockfile, and the result is confidently calling functions that have long since been renamed or removed.
Existing version query tools can only tell the agent what the current version is, and documentation tools can only tell it how today's documentation says to write things; neither can answer the question the agent really cares about during editing: "What changed between the version I know and the version installed here?" vdiff is precisely what answers this question.
Main capabilities
- Given a package name and two versions, return a structured, machine-readable list of breaking changes.
- Change types include: removed exports (export_removed), changed function signatures (signature_changed), removed members (member_removed), etc.
- Each change entry includes the signatures before and after the change as well as a brief migration note.
- The diff is computed based on the package's own type declarations, not the changelog, so the output reflects the real export surface.
- Every response carries a confidence score: 0.9 when using the package's bundled type declarations, and 0.8 when using community-maintained @types/* declarations.
- Results are cached in Postgres by (package, from, to), and each version pair is computed only once.
How to use
The service's online address is https://vdiff-api.onrender.com , and the most convenient way to consume it is through the MCP server vdiff-mcp, or you can call the REST API directly. For API endpoint reference, see docs/api.md.
The workflow consists of four steps:
- Resolve: Fetch package metadata, versions, and dist-tags from the npm registry.
- Extract: Download the tarball for each of the two versions, keep only the .d.ts files, and use the TypeScript compiler API to build a public export table (functions, classes, members, normalized call signatures). Prefer the declarations bundled with the package; if the package does not provide them, fall back to the DefinitelyTyped @types/* package with a matching version (by major.minor).
- Compare: Diff the two export tables into typed change entries, each containing the before and after signatures and a migration note.
- Cache and meter: Store the results in Postgres, and record the cache hit status and user agent for each request.
The service also includes protective measures: rate limiting by IP, a cap on concurrent diff computations, size limits on tarballs and extracted declarations, and fetch timeouts.
Applicable scenarios
- A coding agent, while editing code, needs to understand the API differences between the currently installed version and the version it remembers from training.
- A developer or tool needs to obtain a machine-readable list of breaking changes for an npm package.
- Scenarios that require before-and-after signature comparisons and migration notes for migration.
Limitations
- The diff is type-level: runtime behavior changes that do not touch types are invisible.
- The confidence score is 0.9 when using the package's bundled types, and 0.8 when using community-maintained @types/* declarations.
- The service has rate limiting by IP, a cap on concurrent computations (exceeding it returns 503 with retry-after), a tarball download limit of 50 MB, a per-version extracted declaration limit of 15 MB (exceeding it returns 422), a packument fetch timeout of 10 seconds, and a tarball fetch timeout of 30 seconds. Tarballs are fetched only over HTTPS from registry.npmjs.org.
- The code is cloud-agnostic: a plain container plus DATABASE_URL is enough to run it; it is currently deployed on Render and uses Neon Postgres.
Running it yourself
Configurable via environment variables. The containerized run method (applies the schema at startup and then serves) as well as all configuration options are handled through environment variables.
License
The API and diff engine use the Functional Source License, v1.1, MIT Future License (FSL-1.1-MIT): free to use, read, and modify, but may not be used to provide a competing service; each release automatically converts to MIT two years after publication. The MCP server wrapper under the mcp/ directory uses the MIT license.