Read the current diff
Compare the session branch with its normal base branch.TypeScript
view.files contains the file changes and diff text. view.stats contains the file, line, and
change totals.
Use getBranchDiff() to filter the response to selected paths.
Read one file
Use the session branch for the latest content, or use a commit SHA for a fixed view.TypeScript
ref. The same SHA can also select a
commit diff.
TypeScript
Refresh after each state
Use either of these refresh signals:- Poll the session branch tip, then reload the diff when the SHA changes.
- Subscribe to
pushwebhooks, validate each delivery, and reload the diff for the same repository and branch.