Diff two commits or two package versions
code_diffCompares two exact identities of the same public GitHub repository (base and head refs, both resolved to commit shas) or npm package (base and head versions, both tarballs checked against the registry's sha512). Without path: the added, removed and changed files, decided by git blob id. With path: a unified diff of that file (Myers; minimal:false marks a large change answered as one replace hunk); identical blobs answer no hunks, a file that is not UTF-8 text answers binary:true with both blob ids and no hunks ("Binary files differ"), and a change region of more than 100000 lines is refused (diff_too_large). Pages with offset/limit (at most 1000 items and about 1 MB per page; truncated:true when the byte bound ended a page). A hunk larger than a page is split at line boundaries into consecutive hunks that apply in order; a single line larger than a page is refused (response_too_large) with both blob ids. Every answer, an error included, carries a pauhu-library-receipt/2 in structuredContent.receipt and as a trailing "receipt: {...}" text line; library_verify checks a receipt.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | Base ref (repo) or version (package) | |
| head | Yes | Head ref (repo) or version (package) | |
| path | No | One file: answer its unified diff | |
| repo | No | GitHub repository as owner/name, e.g. nodejs/node. Give this or package. | |
| limit | No | Files (summary) or hunks (path) per page (default 200, at most 1000) | |
| offset | No | ||
| package | No | npm package name, e.g. source-map-js or @scope/name. Give this or repo. |