Diffs
Both sides of a changed document as text, for the files a line diff cannot show
What a diff's two sides are when they are not lines of text. A document, spreadsheet, presentation or notebook that changed is rendered to markdown on both sides — the same reading an agent gets instead of the bytes — so the change shows as tracked changes rather than two downloads. The side on disk reuses the shadow the sandbox already keeps; a past version is rendered from its bytes and kept by content hash, so the same version is never rendered twice. A side nothing can read answers with the reason instead. The bytes themselves are not here: that route streams a body and so sits outside this contract.
GET/diff/derivedBoth sides of a document's diff, as text
A document, spreadsheet, presentation or notebook that changed, both versions rendered to markdown the way an agent reads them, so the change can be shown as tracked changes instead of two downloads. The side on disk reuses the shadow the sandbox already keeps; a past version is rendered from its bytes and kept by content hash, so the same version is never rendered twice. A side nothing can read says why.
What you send
| Field | Type | Where |
|---|---|---|
sourcerequired | "working" | "agent" | "commit" | "checkpoint" | query |
repoWhich repository: "root" for the workspace… | string | query |
sideWhich git side the row came… | "staged" | "unstaged" | "conflicted" | query |
pathrequiredThe file, relative to the repo… | string | query |
agentThe conversation whose work is under… | string | query |
shaThe commit, compared against its first… | string | query |
snapshotWhich saved point | string | query |
scopeWhich part of the workspace the… | string | query |
What comes back
| Field | Type |
|---|---|
beforeThe file as it was, rendered… | object |
when present is true | shape |
contentThe side as markdown | string |
deriverWhich reader made this text, with… | string |
notesEvery cap and degradation the conversion… | string[] |
truncatedThe rendering was longer than this… | boolean |
when present is false | shape |
reasonWhy this side has no text:… | string |
afterThe file as it is now,… | object |
when present is true | shape |
contentThe side as markdown | string |
deriverWhich reader made this text, with… | string |
notesEvery cap and degradation the conversion… | string[] |
truncatedThe rendering was longer than this… | boolean |
when present is false | shape |
reasonWhy this side has no text:… | string |
curl "$SANDBOX/diff/derived?source=working&path=src%2Fapp.ts" \
-H "x-intentic-control: $INTENTIC_TOKEN"import { sandbox } from "@intentic/sandbox-client";
const result = await sandbox.diff.derived({
"source": "working",
"path": "src/app.ts"
});