@piagent/platform 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (304) hide show
  1. package/CHANGELOG.md +56 -3
  2. package/README.md +3 -3
  3. package/architecture/layers.json +96 -1
  4. package/docs/README.md +1 -0
  5. package/docs/architecture.md +1 -0
  6. package/docs/authority-manifest.md +1 -0
  7. package/docs/auto-delegation-policy.md +1 -0
  8. package/docs/capability-packs.md +10 -2
  9. package/docs/command-reference-vietnamese.md +5 -4
  10. package/docs/context-engine.md +1 -0
  11. package/docs/context-window-policy.md +1 -0
  12. package/docs/distribution-standard.md +8 -7
  13. package/docs/herdr-workflow.md +1 -0
  14. package/docs/mcp-and-tools.md +14 -9
  15. package/docs/memory-policy.md +1 -0
  16. package/docs/model-options.md +1 -0
  17. package/docs/oauth-providers.md +1 -0
  18. package/docs/operator-manual-vietnamese.md +15 -12
  19. package/docs/package-architecture-notes.md +1 -0
  20. package/docs/project-adapters.md +1 -0
  21. package/docs/project-onboarding.md +1 -0
  22. package/docs/publishing-for-teams.md +1 -0
  23. package/docs/quality-benchmark.md +1 -0
  24. package/docs/quickstart-vietnamese.md +3 -2
  25. package/docs/release-install-policy.md +11 -7
  26. package/docs/runtime-harness-standard.md +1 -0
  27. package/docs/runtime-policy-design.md +1 -0
  28. package/docs/runtime-quality-baseline.md +1 -0
  29. package/docs/security-redaction-benchmark.md +1 -0
  30. package/docs/security-threat-model.md +2 -1
  31. package/docs/subagent-orchestration-capabilities.md +1 -0
  32. package/docs/subagents-and-multiagent.md +1 -0
  33. package/docs/task-implementation-contract.md +1 -0
  34. package/docs/task-lifecycle-vietnamese.md +1 -0
  35. package/docs/team-onboarding.md +3 -2
  36. package/docs/third-party-neutrality.md +26 -0
  37. package/docs/usage-observability.md +1 -0
  38. package/docs/vercel-docs-site.md +1 -0
  39. package/docs/workflow-recipes.md +1 -0
  40. package/docs-site/architecture.html +1 -1
  41. package/docs-site/benchmark.html +1 -1
  42. package/docs-site/commands.html +1 -1
  43. package/docs-site/context-engine.html +1 -1
  44. package/docs-site/en/architecture.html +1 -1
  45. package/docs-site/en/benchmark.html +1 -1
  46. package/docs-site/en/commands.html +1 -1
  47. package/docs-site/en/context-engine.html +1 -1
  48. package/docs-site/en/index.html +1 -1
  49. package/docs-site/en/mcp-approval.html +1 -1
  50. package/docs-site/en/mcp-auth.html +1 -1
  51. package/docs-site/en/mcp-servers.html +1 -1
  52. package/docs-site/en/mcp.html +1 -1
  53. package/docs-site/en/permissions.html +1 -1
  54. package/docs-site/en/profiles.html +1 -1
  55. package/docs-site/en/quickstart.html +1 -1
  56. package/docs-site/en/runtime.html +1 -1
  57. package/docs-site/en/scope.html +1 -1
  58. package/docs-site/en/security.html +1 -1
  59. package/docs-site/en/team.html +1 -1
  60. package/docs-site/en/whats-new.html +1 -1
  61. package/docs-site/en/workflows.html +1 -1
  62. package/docs-site/index.html +1 -1
  63. package/docs-site/mcp-approval.html +1 -1
  64. package/docs-site/mcp-auth.html +1 -1
  65. package/docs-site/mcp-servers.html +1 -1
  66. package/docs-site/mcp.html +1 -1
  67. package/docs-site/permissions.html +1 -1
  68. package/docs-site/profiles.html +1 -1
  69. package/docs-site/quickstart.html +1 -1
  70. package/docs-site/runtime.html +1 -1
  71. package/docs-site/scope.html +1 -1
  72. package/docs-site/security.html +1 -1
  73. package/docs-site/team.html +1 -1
  74. package/docs-site/whats-new.html +1 -1
  75. package/docs-site/workflows.html +1 -1
  76. package/evals/fixtures/mutation-provenance-record.invalid.json +17 -0
  77. package/evals/fixtures/mutation-provenance-record.valid.json +27 -0
  78. package/evals/fixtures/piagent-webui/approval-v1.invalid.json +54 -0
  79. package/evals/fixtures/piagent-webui/approval-v1.valid.json +58 -0
  80. package/evals/fixtures/piagent-webui/attachment-v1.invalid.json +25 -0
  81. package/evals/fixtures/piagent-webui/attachment-v1.valid.json +25 -0
  82. package/evals/fixtures/piagent-webui/capabilities-v1.invalid.json +51 -0
  83. package/evals/fixtures/piagent-webui/capabilities-v1.valid.json +122 -0
  84. package/evals/fixtures/piagent-webui/commit-summary-v1.invalid.json +10 -0
  85. package/evals/fixtures/piagent-webui/commit-summary-v1.valid.json +25 -0
  86. package/evals/fixtures/piagent-webui/control-command-v1.invalid.json +37 -0
  87. package/evals/fixtures/piagent-webui/control-command-v1.valid.json +35 -0
  88. package/evals/fixtures/piagent-webui/diff-v1.invalid.json +13 -0
  89. package/evals/fixtures/piagent-webui/diff-v1.valid.json +141 -0
  90. package/evals/fixtures/piagent-webui/gateway-capabilities-v1.invalid.json +35 -0
  91. package/evals/fixtures/piagent-webui/gateway-capabilities-v1.valid.json +35 -0
  92. package/evals/fixtures/piagent-webui/gateway-protocol-v1.invalid.json +14 -0
  93. package/evals/fixtures/piagent-webui/gateway-protocol-v1.valid.json +14 -0
  94. package/evals/fixtures/piagent-webui/handoff-history-v1.invalid.json +16 -0
  95. package/evals/fixtures/piagent-webui/handoff-history-v1.valid.json +16 -0
  96. package/evals/fixtures/piagent-webui/model-catalog-v1.invalid.json +31 -0
  97. package/evals/fixtures/piagent-webui/model-catalog-v1.valid.json +43 -0
  98. package/evals/fixtures/piagent-webui/queue-v1.invalid.json +29 -0
  99. package/evals/fixtures/piagent-webui/queue-v1.valid.json +44 -0
  100. package/evals/fixtures/piagent-webui/recovery-history-v1.invalid.json +17 -0
  101. package/evals/fixtures/piagent-webui/recovery-history-v1.valid.json +20 -0
  102. package/evals/fixtures/piagent-webui/release-monitor-v1.invalid.json +12 -0
  103. package/evals/fixtures/piagent-webui/release-monitor-v1.valid.json +29 -0
  104. package/evals/fixtures/piagent-webui/review-state-v1.invalid.json +25 -0
  105. package/evals/fixtures/piagent-webui/review-state-v1.valid.json +38 -0
  106. package/evals/fixtures/piagent-webui/runtime-event-v2.invalid.json +49 -0
  107. package/evals/fixtures/piagent-webui/runtime-event-v2.valid.json +49 -0
  108. package/evals/fixtures/piagent-webui/session-catalog-v1.invalid.json +17 -0
  109. package/evals/fixtures/piagent-webui/session-catalog-v1.valid.json +58 -0
  110. package/evals/fixtures/piagent-webui/session-command-v1.invalid.json +19 -0
  111. package/evals/fixtures/piagent-webui/session-command-v1.valid.json +19 -0
  112. package/evals/fixtures/piagent-webui/snapshot-v1.invalid.json +5 -0
  113. package/evals/fixtures/piagent-webui/snapshot-v1.valid.json +191 -0
  114. package/evals/fixtures/piagent-webui/source-change-v1.invalid.json +57 -0
  115. package/evals/fixtures/piagent-webui/source-change-v1.valid.json +98 -0
  116. package/evals/fixtures/piagent-webui/source-mutation-v1.invalid.json +19 -0
  117. package/evals/fixtures/piagent-webui/source-mutation-v1.valid.json +38 -0
  118. package/evals/fixtures/piagent-webui/source-revert-v1.invalid.json +20 -0
  119. package/evals/fixtures/piagent-webui/source-revert-v1.valid.json +62 -0
  120. package/evals/fixtures/piagent-webui/subagent-tree-v1.invalid.json +26 -0
  121. package/evals/fixtures/piagent-webui/subagent-tree-v1.valid.json +39 -0
  122. package/evals/fixtures/piagent-webui/task-index-v1.invalid.json +15 -0
  123. package/evals/fixtures/piagent-webui/task-index-v1.valid.json +15 -0
  124. package/evals/fixtures/piagent-webui/task-timeline-v1.invalid.json +14 -0
  125. package/evals/fixtures/piagent-webui/task-timeline-v1.valid.json +16 -0
  126. package/evals/fixtures/piagent-webui/transcript-v1.invalid.json +35 -0
  127. package/evals/fixtures/piagent-webui/transcript-v1.valid.json +55 -0
  128. package/evals/fixtures/task-baseline-manifest.invalid.json +16 -0
  129. package/evals/fixtures/task-baseline-manifest.valid.json +41 -0
  130. package/evals/fixtures/verifier-file-snapshot.invalid.json +21 -0
  131. package/evals/fixtures/verifier-file-snapshot.valid.json +21 -0
  132. package/package.json +30 -3
  133. package/packages/piagent-core/benchmark/benchmark-candidate.d.ts +1 -0
  134. package/packages/piagent-core/benchmark/benchmark-forensics.d.ts +1 -0
  135. package/packages/piagent-core/benchmark/benchmark-ledger.d.ts +4 -0
  136. package/packages/piagent-core/benchmark/benchmark-record-validation.d.ts +1 -0
  137. package/packages/piagent-core/benchmark/benchmark-runtime.d.ts +1 -0
  138. package/packages/piagent-core/capabilities/capability-core.js +2 -2
  139. package/packages/piagent-core/capabilities/capability-verification-cache.js +280 -0
  140. package/packages/piagent-core/capabilities/runtime-integrity.js +153 -1
  141. package/packages/piagent-core/extensions/document-intake.ts +24 -10
  142. package/packages/piagent-core/extensions/piagent-guard.ts +90 -73
  143. package/packages/piagent-core/extensions/redaction-core.d.ts +2 -0
  144. package/packages/piagent-core/extensions/state-retention.js +77 -44
  145. package/packages/piagent-core/extensions/task-journal.js +30 -1
  146. package/packages/piagent-core/extensions/task-state.js +33 -36
  147. package/packages/piagent-core/mcp/mcp-server-catalog.js +5 -5
  148. package/packages/piagent-core/package.json +1 -1
  149. package/packages/piagent-core/runtime/hooks/session-start-hook.ts +2 -2
  150. package/packages/piagent-core/runtime/hooks/tool-call-hook.ts +5 -2
  151. package/packages/piagent-core/runtime/hooks/tool-result-hook.ts +20 -19
  152. package/packages/piagent-core/runtime/hooks/tool-result-metadata.ts +13 -0
  153. package/packages/piagent-core/runtime/input/chat-images.ts +2 -2
  154. package/packages/piagent-core/runtime/inspection/activity-event-adapter.ts +94 -0
  155. package/packages/piagent-core/runtime/inspection/approval-broker.ts +318 -0
  156. package/packages/piagent-core/runtime/inspection/commit-summary-projection.ts +59 -0
  157. package/packages/piagent-core/runtime/inspection/context-telemetry-inspection.ts +37 -0
  158. package/packages/piagent-core/runtime/inspection/criteria-links.ts +295 -0
  159. package/packages/piagent-core/runtime/inspection/diff-projection.ts +499 -0
  160. package/packages/piagent-core/runtime/inspection/git-filter-safety.ts +38 -0
  161. package/packages/piagent-core/runtime/inspection/git-numstat-adapter.ts +71 -0
  162. package/packages/piagent-core/runtime/inspection/git-status-adapter.ts +493 -0
  163. package/packages/piagent-core/runtime/inspection/git-tree-adapter.ts +108 -0
  164. package/packages/piagent-core/runtime/inspection/mcp-control.ts +10 -0
  165. package/packages/piagent-core/runtime/inspection/mutation-provenance-contract.ts +131 -0
  166. package/packages/piagent-core/runtime/inspection/mutation-provenance-recorder.ts +48 -0
  167. package/packages/piagent-core/runtime/inspection/mutation-provenance-store.ts +161 -0
  168. package/packages/piagent-core/runtime/inspection/project-runtime-inspection.ts +36 -0
  169. package/packages/piagent-core/runtime/inspection/review-state-contract.ts +108 -0
  170. package/packages/piagent-core/runtime/inspection/review-state-projection.ts +93 -0
  171. package/packages/piagent-core/runtime/inspection/review-state-store.ts +112 -0
  172. package/packages/piagent-core/runtime/inspection/runtime-event-store.ts +262 -0
  173. package/packages/piagent-core/runtime/inspection/same-process-bridge-proof.ts +103 -0
  174. package/packages/piagent-core/runtime/inspection/source-change-projection.ts +471 -0
  175. package/packages/piagent-core/runtime/inspection/source-evidence-contract.ts +139 -0
  176. package/packages/piagent-core/runtime/inspection/source-evidence-store.ts +315 -0
  177. package/packages/piagent-core/runtime/inspection/source-handoff-store.ts +70 -0
  178. package/packages/piagent-core/runtime/inspection/source-inspection-plan.ts +34 -0
  179. package/packages/piagent-core/runtime/inspection/source-mutation-projection.ts +164 -0
  180. package/packages/piagent-core/runtime/inspection/source-mutation-store.ts +168 -0
  181. package/packages/piagent-core/runtime/inspection/source-open-target.ts +38 -0
  182. package/packages/piagent-core/runtime/inspection/source-revert-projection.ts +147 -0
  183. package/packages/piagent-core/runtime/inspection/task-baseline-start-capture.ts +22 -0
  184. package/packages/piagent-core/runtime/inspection/task-compaction-history.ts +160 -0
  185. package/packages/piagent-core/runtime/inspection/task-control-journal.ts +131 -0
  186. package/packages/piagent-core/runtime/inspection/task-handoff-history.ts +95 -0
  187. package/packages/piagent-core/runtime/inspection/task-provenance-projection.ts +60 -0
  188. package/packages/piagent-core/runtime/inspection/task-recovery-timeline.ts +88 -0
  189. package/packages/piagent-core/runtime/inspection/task-run-index.ts +87 -0
  190. package/packages/piagent-core/runtime/inspection/task-source-projection.ts +401 -0
  191. package/packages/piagent-core/runtime/inspection/task-subagent-tree.ts +101 -0
  192. package/packages/piagent-core/runtime/inspection/text-diff.ts +60 -0
  193. package/packages/piagent-core/runtime/inspection/verifier-snapshot-contract.ts +114 -0
  194. package/packages/piagent-core/runtime/inspection/verifier-snapshot-store.ts +189 -0
  195. package/packages/piagent-core/runtime/inspection/webui-snapshot.ts +320 -0
  196. package/packages/piagent-core/runtime/inspection/workspace-file-reader.ts +132 -0
  197. package/packages/piagent-core/runtime/inspection/workspace-source-projection.ts +96 -0
  198. package/packages/piagent-core/runtime/inspection/zero-turn-conformance.ts +175 -0
  199. package/packages/piagent-core/runtime/orchestration/owned-work-budget.ts +68 -4
  200. package/packages/piagent-core/runtime/policy/source-index-transaction.ts +173 -0
  201. package/packages/piagent-core/runtime/policy/source-mutation-guard-binding.ts +42 -0
  202. package/packages/piagent-core/runtime/policy/source-mutation-guard.ts +184 -0
  203. package/packages/piagent-core/runtime/policy/source-worktree-transaction.ts +105 -0
  204. package/packages/piagent-core/runtime/product/activity-inspector-footer.ts +5 -3
  205. package/packages/piagent-core/runtime/product/activity-inspector.ts +85 -343
  206. package/packages/piagent-core/runtime/recovery/resume-state.ts +38 -1
  207. package/packages/piagent-core/runtime/registration/activity-inspector-command.ts +68 -14
  208. package/packages/piagent-core/runtime/registration/task-start-tool.ts +13 -14
  209. package/packages/piagent-core/runtime/session/model-authorship-state.ts +31 -3
  210. package/packages/piagent-core/runtime/session/runtime-state.ts +11 -1
  211. package/packages/piagent-webui/dist/client/assets/index-DjMntaK5.js +172 -0
  212. package/packages/piagent-webui/dist/client/assets/index-DwKCWbwd.css +1 -0
  213. package/packages/piagent-webui/dist/client/index.html +16 -0
  214. package/packages/piagent-webui/extension/attachment-store.ts +323 -0
  215. package/packages/piagent-webui/extension/held-message-queue.ts +311 -0
  216. package/packages/piagent-webui/extension/lifecycle-controller.ts +408 -0
  217. package/packages/piagent-webui/extension/lifecycle-event-adapter.ts +23 -0
  218. package/packages/piagent-webui/extension/piagent-webui.ts +470 -0
  219. package/packages/piagent-webui/extension/review-controller.ts +160 -0
  220. package/packages/piagent-webui/extension/same-session-bridge.ts +500 -0
  221. package/packages/piagent-webui/extension/session-options-controller.ts +281 -0
  222. package/packages/piagent-webui/extension/session-stream-adapter.ts +249 -0
  223. package/packages/piagent-webui/extension/source-mutation-controller.ts +215 -0
  224. package/packages/piagent-webui/extension/source-open-controller.ts +136 -0
  225. package/packages/piagent-webui/extension/source-revert-controller.ts +189 -0
  226. package/packages/piagent-webui/extension/terminal-session-adapter.ts +73 -0
  227. package/packages/piagent-webui/extension/vscode-handoff.ts +51 -0
  228. package/packages/piagent-webui/gateway/control-socket.ts +92 -0
  229. package/packages/piagent-webui/gateway/gateway-events.ts +60 -0
  230. package/packages/piagent-webui/gateway/gateway-protocol-service.ts +64 -0
  231. package/packages/piagent-webui/gateway/gateway-service.ts +215 -0
  232. package/packages/piagent-webui/gateway/gateway-session-stream.ts +110 -0
  233. package/packages/piagent-webui/gateway/mcp-auth-broker.ts +158 -0
  234. package/packages/piagent-webui/gateway/native-project-picker.ts +29 -0
  235. package/packages/piagent-webui/gateway/pi-host.ts +41 -0
  236. package/packages/piagent-webui/gateway/profile-state.ts +1 -0
  237. package/packages/piagent-webui/gateway/project-registry.ts +108 -0
  238. package/packages/piagent-webui/gateway/provider-auth-broker.ts +172 -0
  239. package/packages/piagent-webui/gateway/session-catalog.ts +128 -0
  240. package/packages/piagent-webui/gateway/session-command-controller.ts +237 -0
  241. package/packages/piagent-webui/gateway/session-command-store.ts +224 -0
  242. package/packages/piagent-webui/gateway/session-inspection-registry.ts +204 -0
  243. package/packages/piagent-webui/gateway/session-lease-store.ts +1 -0
  244. package/packages/piagent-webui/gateway/session-metadata-store.ts +152 -0
  245. package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +485 -0
  246. package/packages/piagent-webui/ownership/gateway-runtime-context.ts +8 -0
  247. package/packages/piagent-webui/ownership/profile-state.ts +117 -0
  248. package/packages/piagent-webui/ownership/session-lease-store.ts +329 -0
  249. package/packages/piagent-webui/ownership/session-refs.ts +8 -0
  250. package/packages/piagent-webui/package.json +33 -0
  251. package/packages/piagent-webui/server/README.md +4 -0
  252. package/packages/piagent-webui/server/benchmark-release-monitor.ts +230 -0
  253. package/packages/piagent-webui/server/core-inspection-provider.ts +403 -0
  254. package/packages/piagent-webui/server/gateway-websocket.ts +143 -0
  255. package/packages/piagent-webui/server/http-security.ts +27 -0
  256. package/packages/piagent-webui/server/ipc-read-model-client.ts +89 -0
  257. package/packages/piagent-webui/server/loopback-server.ts +368 -0
  258. package/packages/piagent-webui/server/read-model-provider.ts +37 -0
  259. package/packages/piagent-webui/server/read-only-router.ts +105 -0
  260. package/packages/piagent-webui/server/session-auth.ts +88 -0
  261. package/packages/piagent-webui/server/sidecar-main.ts +86 -0
  262. package/packages/piagent-webui/server/sse-hub.ts +76 -0
  263. package/packages/piagent-webui/server/static-bundle.ts +40 -0
  264. package/packages/piagent-webui/server/transcript-projection.ts +110 -0
  265. package/schemas/mutation-provenance-record.schema.json +100 -0
  266. package/schemas/piagent-webui/approval-v1.schema.json +654 -0
  267. package/schemas/piagent-webui/attachment-v1.schema.json +267 -0
  268. package/schemas/piagent-webui/capabilities-v1.schema.json +729 -0
  269. package/schemas/piagent-webui/catalog-v1.json +240 -0
  270. package/schemas/piagent-webui/commit-summary-v1.schema.json +63 -0
  271. package/schemas/piagent-webui/common-v1.schema.json +479 -0
  272. package/schemas/piagent-webui/control-command-v1.schema.json +1780 -0
  273. package/schemas/piagent-webui/diff-v1.schema.json +826 -0
  274. package/schemas/piagent-webui/gateway-capabilities-v1.schema.json +136 -0
  275. package/schemas/piagent-webui/gateway-protocol-v1.schema.json +456 -0
  276. package/schemas/piagent-webui/handoff-history-v1.schema.json +92 -0
  277. package/schemas/piagent-webui/model-catalog-v1.schema.json +95 -0
  278. package/schemas/piagent-webui/queue-v1.schema.json +99 -0
  279. package/schemas/piagent-webui/recovery-history-v1.schema.json +144 -0
  280. package/schemas/piagent-webui/release-monitor-v1.schema.json +173 -0
  281. package/schemas/piagent-webui/review-state-v1.schema.json +206 -0
  282. package/schemas/piagent-webui/runtime-event-v2.schema.json +5206 -0
  283. package/schemas/piagent-webui/session-catalog-v1.schema.json +222 -0
  284. package/schemas/piagent-webui/session-command-v1.schema.json +390 -0
  285. package/schemas/piagent-webui/snapshot-v1.schema.json +2622 -0
  286. package/schemas/piagent-webui/source-change-v1.schema.json +763 -0
  287. package/schemas/piagent-webui/source-mutation-v1.schema.json +96 -0
  288. package/schemas/piagent-webui/source-revert-v1.schema.json +130 -0
  289. package/schemas/piagent-webui/subagent-tree-v1.schema.json +88 -0
  290. package/schemas/piagent-webui/task-index-v1.schema.json +74 -0
  291. package/schemas/piagent-webui/task-timeline-v1.schema.json +49 -0
  292. package/schemas/piagent-webui/transcript-v1.schema.json +243 -0
  293. package/schemas/task-baseline-manifest.schema.json +122 -0
  294. package/schemas/verifier-file-snapshot.schema.json +81 -0
  295. package/scripts/check-architecture.mjs +1 -0
  296. package/scripts/check-doc-languages.mjs +19 -2
  297. package/scripts/check-third-party-neutrality.mjs +43 -0
  298. package/scripts/install-global.sh +1 -1
  299. package/scripts/piagent-cli.mjs +17 -3
  300. package/scripts/piagent-dashboard.mjs +208 -0
  301. package/scripts/piagent-webui-launcher.mjs +121 -0
  302. package/scripts/typescript-loader.mjs +26 -1
  303. package/scripts/verify-local.sh +253 -0
  304. package/scripts/verify-release-identity.mjs +4 -1
@@ -0,0 +1,826 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://piagent.io.vn/schemas/piagent-webui/diff-v1.schema.json",
4
+ "title": "Piagent WebUI bounded file diff v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schemaVersion",
9
+ "version",
10
+ "generatedAt",
11
+ "identity",
12
+ "view",
13
+ "basis",
14
+ "precondition",
15
+ "observed",
16
+ "file",
17
+ "availability",
18
+ "fallback",
19
+ "hunks",
20
+ "unchangedRegions",
21
+ "truncation",
22
+ "redaction",
23
+ "health",
24
+ "issues"
25
+ ],
26
+ "properties": {
27
+ "schemaVersion": { "const": 1 },
28
+ "version": { "const": "piagent-webui-diff-v1" },
29
+ "generatedAt": { "$ref": "common-v1.schema.json#/$defs/timestamp" },
30
+ "identity": { "$ref": "common-v1.schema.json#/$defs/identity" },
31
+ "view": { "$ref": "source-change-v1.schema.json#/$defs/view" },
32
+ "basis": { "$ref": "source-change-v1.schema.json#/$defs/viewBasis" },
33
+ "precondition": { "$ref": "#/$defs/precondition" },
34
+ "observed": { "$ref": "#/$defs/observedRevision" },
35
+ "file": { "$ref": "source-change-v1.schema.json#/$defs/fileChange" },
36
+ "availability": { "$ref": "#/$defs/availability" },
37
+ "fallback": { "$ref": "#/$defs/fallback" },
38
+ "hunks": {
39
+ "type": "array",
40
+ "maxItems": 128,
41
+ "items": { "$ref": "#/$defs/hunk" }
42
+ },
43
+ "unchangedRegions": {
44
+ "type": "array",
45
+ "maxItems": 129,
46
+ "items": { "$ref": "#/$defs/unchangedRegion" }
47
+ },
48
+ "truncation": { "$ref": "#/$defs/truncation" },
49
+ "redaction": { "$ref": "common-v1.schema.json#/$defs/redaction" },
50
+ "health": { "$ref": "common-v1.schema.json#/$defs/health" },
51
+ "issues": {
52
+ "type": "array",
53
+ "maxItems": 64,
54
+ "items": { "$ref": "common-v1.schema.json#/$defs/issue" }
55
+ }
56
+ },
57
+ "allOf": [
58
+ {
59
+ "if": {
60
+ "type": "object",
61
+ "properties": { "view": { "const": "task" } },
62
+ "required": ["view"]
63
+ },
64
+ "then": {
65
+ "type": "object",
66
+ "properties": {
67
+ "identity": {
68
+ "type": "object",
69
+ "properties": {
70
+ "taskId": { "$ref": "common-v1.schema.json#/$defs/publicId" },
71
+ "taskRunId": { "$ref": "common-v1.schema.json#/$defs/publicId" }
72
+ }
73
+ },
74
+ "basis": { "$ref": "source-change-v1.schema.json#/$defs/taskBasis" }
75
+ }
76
+ }
77
+ },
78
+ {
79
+ "if": {
80
+ "type": "object",
81
+ "properties": { "view": { "const": "working-tree" } },
82
+ "required": ["view"]
83
+ },
84
+ "then": {
85
+ "type": "object",
86
+ "properties": { "basis": { "$ref": "source-change-v1.schema.json#/$defs/workingTreeBasis" } }
87
+ }
88
+ },
89
+ {
90
+ "if": {
91
+ "type": "object",
92
+ "properties": { "view": { "const": "staged" } },
93
+ "required": ["view"]
94
+ },
95
+ "then": {
96
+ "type": "object",
97
+ "properties": {
98
+ "basis": { "$ref": "source-change-v1.schema.json#/$defs/stagedBasis" },
99
+ "file": {
100
+ "type": "object",
101
+ "properties": {
102
+ "status": { "enum": ["A", "M", "D", "R", "C"] }
103
+ }
104
+ }
105
+ }
106
+ }
107
+ },
108
+ {
109
+ "if": {
110
+ "type": "object",
111
+ "properties": {
112
+ "availability": {
113
+ "type": "object",
114
+ "properties": { "state": { "const": "stale" } },
115
+ "required": ["state"]
116
+ }
117
+ },
118
+ "required": ["availability"]
119
+ },
120
+ "then": {
121
+ "type": "object",
122
+ "properties": {
123
+ "availability": {
124
+ "type": "object",
125
+ "properties": {
126
+ "reasonCode": { "const": "stale-retry" },
127
+ "retryable": { "const": true }
128
+ }
129
+ },
130
+ "fallback": {
131
+ "type": "object",
132
+ "properties": { "kind": { "const": "stale" } }
133
+ },
134
+ "hunks": { "type": "array", "maxItems": 0 },
135
+ "unchangedRegions": { "type": "array", "maxItems": 0 },
136
+ "truncation": {
137
+ "type": "object",
138
+ "properties": { "truncated": { "const": false } }
139
+ }
140
+ }
141
+ }
142
+ },
143
+ {
144
+ "if": {
145
+ "type": "object",
146
+ "properties": {
147
+ "availability": {
148
+ "type": "object",
149
+ "properties": { "state": { "const": "unavailable" } },
150
+ "required": ["state"]
151
+ }
152
+ },
153
+ "required": ["availability"]
154
+ },
155
+ "then": {
156
+ "type": "object",
157
+ "properties": {
158
+ "fallback": {
159
+ "type": "object",
160
+ "properties": {
161
+ "kind": { "enum": ["protected", "oversized", "unavailable"] }
162
+ }
163
+ },
164
+ "hunks": { "type": "array", "maxItems": 0 },
165
+ "unchangedRegions": { "type": "array", "maxItems": 0 },
166
+ "truncation": {
167
+ "type": "object",
168
+ "properties": { "truncated": { "const": false } }
169
+ }
170
+ }
171
+ }
172
+ },
173
+ {
174
+ "if": {
175
+ "type": "object",
176
+ "properties": {
177
+ "fallback": {
178
+ "type": "object",
179
+ "properties": { "kind": { "const": "none" } },
180
+ "required": ["kind"]
181
+ }
182
+ },
183
+ "required": ["fallback"]
184
+ },
185
+ "then": {
186
+ "type": "object",
187
+ "properties": {
188
+ "availability": {
189
+ "type": "object",
190
+ "properties": { "state": { "const": "current" } }
191
+ },
192
+ "file": {
193
+ "type": "object",
194
+ "properties": {
195
+ "status": { "enum": ["A", "M", "D", "R", "U"] },
196
+ "content": {
197
+ "type": "object",
198
+ "properties": {
199
+ "kind": { "const": "text" },
200
+ "access": { "const": "available" }
201
+ }
202
+ }
203
+ }
204
+ }
205
+ }
206
+ },
207
+ "else": {
208
+ "type": "object",
209
+ "properties": {
210
+ "hunks": { "type": "array", "maxItems": 0 },
211
+ "unchangedRegions": { "type": "array", "maxItems": 0 }
212
+ }
213
+ }
214
+ },
215
+ {
216
+ "if": {
217
+ "type": "object",
218
+ "properties": {
219
+ "availability": {
220
+ "type": "object",
221
+ "properties": { "state": { "const": "current" } },
222
+ "required": ["state"]
223
+ }
224
+ },
225
+ "required": ["availability"]
226
+ },
227
+ "then": {
228
+ "type": "object",
229
+ "properties": {
230
+ "fallback": {
231
+ "type": "object",
232
+ "properties": {
233
+ "kind": {
234
+ "enum": ["none", "binary", "symlink", "submodule", "conflict"]
235
+ }
236
+ }
237
+ }
238
+ }
239
+ }
240
+ },
241
+ {
242
+ "if": {
243
+ "type": "object",
244
+ "properties": {
245
+ "availability": {
246
+ "type": "object",
247
+ "properties": { "state": { "const": "current" } },
248
+ "required": ["state"]
249
+ },
250
+ "file": {
251
+ "type": "object",
252
+ "properties": {
253
+ "status": { "enum": ["A", "M", "D", "R", "U"] },
254
+ "content": {
255
+ "type": "object",
256
+ "properties": {
257
+ "kind": { "const": "binary" },
258
+ "access": { "const": "available" }
259
+ },
260
+ "required": ["kind", "access"]
261
+ }
262
+ },
263
+ "required": ["status", "content"]
264
+ }
265
+ },
266
+ "required": ["availability", "file"]
267
+ },
268
+ "then": {
269
+ "type": "object",
270
+ "properties": {
271
+ "fallback": { "type": "object", "properties": { "kind": { "const": "binary" } } },
272
+ "hunks": { "type": "array", "maxItems": 0 },
273
+ "unchangedRegions": { "type": "array", "maxItems": 0 }
274
+ }
275
+ }
276
+ },
277
+ {
278
+ "if": {
279
+ "type": "object",
280
+ "properties": {
281
+ "availability": {
282
+ "type": "object",
283
+ "properties": { "state": { "const": "current" } },
284
+ "required": ["state"]
285
+ },
286
+ "file": {
287
+ "type": "object",
288
+ "properties": {
289
+ "status": { "enum": ["A", "M", "D", "R", "U"] },
290
+ "content": {
291
+ "type": "object",
292
+ "properties": {
293
+ "kind": { "const": "symlink" },
294
+ "access": { "const": "available" }
295
+ },
296
+ "required": ["kind", "access"]
297
+ }
298
+ },
299
+ "required": ["status", "content"]
300
+ }
301
+ },
302
+ "required": ["availability", "file"]
303
+ },
304
+ "then": {
305
+ "type": "object",
306
+ "properties": {
307
+ "fallback": { "type": "object", "properties": { "kind": { "const": "symlink" } } },
308
+ "hunks": { "type": "array", "maxItems": 0 },
309
+ "unchangedRegions": { "type": "array", "maxItems": 0 }
310
+ }
311
+ }
312
+ },
313
+ {
314
+ "if": {
315
+ "type": "object",
316
+ "properties": {
317
+ "availability": {
318
+ "type": "object",
319
+ "properties": { "state": { "const": "current" } },
320
+ "required": ["state"]
321
+ },
322
+ "file": {
323
+ "type": "object",
324
+ "properties": {
325
+ "status": { "enum": ["A", "M", "D", "R", "U"] },
326
+ "content": {
327
+ "type": "object",
328
+ "properties": {
329
+ "kind": { "const": "submodule" },
330
+ "access": { "const": "available" }
331
+ },
332
+ "required": ["kind", "access"]
333
+ }
334
+ },
335
+ "required": ["status", "content"]
336
+ }
337
+ },
338
+ "required": ["availability", "file"]
339
+ },
340
+ "then": {
341
+ "type": "object",
342
+ "properties": {
343
+ "fallback": { "type": "object", "properties": { "kind": { "const": "submodule" } } },
344
+ "hunks": { "type": "array", "maxItems": 0 },
345
+ "unchangedRegions": { "type": "array", "maxItems": 0 }
346
+ }
347
+ }
348
+ },
349
+ {
350
+ "if": {
351
+ "type": "object",
352
+ "properties": {
353
+ "availability": {
354
+ "type": "object",
355
+ "properties": {
356
+ "state": { "enum": ["current", "unavailable"] }
357
+ },
358
+ "required": ["state"]
359
+ },
360
+ "file": {
361
+ "type": "object",
362
+ "properties": {
363
+ "content": {
364
+ "type": "object",
365
+ "properties": { "access": { "const": "protected" } },
366
+ "required": ["access"]
367
+ }
368
+ },
369
+ "required": ["content"]
370
+ }
371
+ },
372
+ "required": ["availability", "file"]
373
+ },
374
+ "then": {
375
+ "type": "object",
376
+ "properties": {
377
+ "availability": { "type": "object", "properties": { "state": { "const": "unavailable" } } },
378
+ "fallback": { "type": "object", "properties": { "kind": { "const": "protected" } } },
379
+ "hunks": { "type": "array", "maxItems": 0 },
380
+ "unchangedRegions": { "type": "array", "maxItems": 0 }
381
+ }
382
+ }
383
+ },
384
+ {
385
+ "if": {
386
+ "type": "object",
387
+ "properties": {
388
+ "availability": {
389
+ "type": "object",
390
+ "properties": {
391
+ "state": { "enum": ["current", "unavailable"] }
392
+ },
393
+ "required": ["state"]
394
+ },
395
+ "file": {
396
+ "type": "object",
397
+ "properties": {
398
+ "content": {
399
+ "type": "object",
400
+ "properties": { "access": { "const": "oversized" } },
401
+ "required": ["access"]
402
+ }
403
+ },
404
+ "required": ["content"]
405
+ }
406
+ },
407
+ "required": ["availability", "file"]
408
+ },
409
+ "then": {
410
+ "type": "object",
411
+ "properties": {
412
+ "availability": { "type": "object", "properties": { "state": { "const": "unavailable" } } },
413
+ "fallback": { "type": "object", "properties": { "kind": { "const": "oversized" } } },
414
+ "hunks": { "type": "array", "maxItems": 0 },
415
+ "unchangedRegions": { "type": "array", "maxItems": 0 }
416
+ }
417
+ }
418
+ },
419
+ {
420
+ "if": {
421
+ "type": "object",
422
+ "properties": {
423
+ "availability": {
424
+ "type": "object",
425
+ "properties": {
426
+ "state": { "enum": ["current", "unavailable"] }
427
+ },
428
+ "required": ["state"]
429
+ },
430
+ "file": {
431
+ "type": "object",
432
+ "properties": {
433
+ "content": {
434
+ "type": "object",
435
+ "properties": { "access": { "const": "unavailable" } },
436
+ "required": ["access"]
437
+ }
438
+ },
439
+ "required": ["content"]
440
+ }
441
+ },
442
+ "required": ["availability", "file"]
443
+ },
444
+ "then": {
445
+ "type": "object",
446
+ "properties": {
447
+ "availability": { "type": "object", "properties": { "state": { "const": "unavailable" } } },
448
+ "fallback": { "type": "object", "properties": { "kind": { "const": "unavailable" } } },
449
+ "hunks": { "type": "array", "maxItems": 0 },
450
+ "unchangedRegions": { "type": "array", "maxItems": 0 }
451
+ }
452
+ }
453
+ },
454
+ {
455
+ "if": {
456
+ "type": "object",
457
+ "properties": {
458
+ "availability": {
459
+ "type": "object",
460
+ "properties": { "state": { "const": "current" } },
461
+ "required": ["state"]
462
+ },
463
+ "file": {
464
+ "type": "object",
465
+ "properties": {
466
+ "status": { "const": "C" },
467
+ "content": {
468
+ "type": "object",
469
+ "properties": { "access": { "const": "available" } },
470
+ "required": ["access"]
471
+ }
472
+ },
473
+ "required": ["status", "content"]
474
+ }
475
+ },
476
+ "required": ["availability", "file"]
477
+ },
478
+ "then": {
479
+ "type": "object",
480
+ "properties": {
481
+ "fallback": { "type": "object", "properties": { "kind": { "const": "conflict" } } },
482
+ "hunks": { "type": "array", "maxItems": 0 },
483
+ "unchangedRegions": { "type": "array", "maxItems": 0 }
484
+ }
485
+ }
486
+ },
487
+ {
488
+ "if": {
489
+ "type": "object",
490
+ "properties": {
491
+ "truncation": {
492
+ "type": "object",
493
+ "properties": { "truncated": { "const": true } },
494
+ "required": ["truncated"]
495
+ }
496
+ },
497
+ "required": ["truncation"]
498
+ },
499
+ "then": {
500
+ "type": "object",
501
+ "properties": {
502
+ "availability": { "type": "object", "properties": { "state": { "const": "current" } } },
503
+ "fallback": { "type": "object", "properties": { "kind": { "const": "none" } } },
504
+ "truncation": {
505
+ "type": "object",
506
+ "properties": {
507
+ "reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" },
508
+ "nextCursor": { "$ref": "common-v1.schema.json#/$defs/revisionToken" }
509
+ }
510
+ }
511
+ }
512
+ }
513
+ }
514
+ ],
515
+ "$defs": {
516
+ "precondition": {
517
+ "type": "object",
518
+ "additionalProperties": false,
519
+ "required": [
520
+ "expectedViewRevision",
521
+ "expectedFileRevision",
522
+ "expectedBaseDigest",
523
+ "expectedCurrentDigest"
524
+ ],
525
+ "properties": {
526
+ "expectedViewRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" },
527
+ "expectedFileRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" },
528
+ "expectedBaseDigest": {
529
+ "anyOf": [
530
+ { "$ref": "common-v1.schema.json#/$defs/digest" },
531
+ { "type": "null" }
532
+ ]
533
+ },
534
+ "expectedCurrentDigest": {
535
+ "anyOf": [
536
+ { "$ref": "common-v1.schema.json#/$defs/digest" },
537
+ { "type": "null" }
538
+ ]
539
+ }
540
+ }
541
+ },
542
+ "observedRevision": {
543
+ "type": "object",
544
+ "additionalProperties": false,
545
+ "required": ["viewRevision", "fileRevision", "baseDigest", "currentDigest"],
546
+ "properties": {
547
+ "viewRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" },
548
+ "fileRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" },
549
+ "baseDigest": {
550
+ "anyOf": [
551
+ { "$ref": "common-v1.schema.json#/$defs/digest" },
552
+ { "type": "null" }
553
+ ]
554
+ },
555
+ "currentDigest": {
556
+ "anyOf": [
557
+ { "$ref": "common-v1.schema.json#/$defs/digest" },
558
+ { "type": "null" }
559
+ ]
560
+ }
561
+ }
562
+ },
563
+ "availability": {
564
+ "type": "object",
565
+ "additionalProperties": false,
566
+ "required": ["state", "reasonCode", "message", "retryable"],
567
+ "properties": {
568
+ "state": { "enum": ["current", "stale", "unavailable"] },
569
+ "reasonCode": { "$ref": "common-v1.schema.json#/$defs/nullableReasonCode" },
570
+ "message": { "$ref": "common-v1.schema.json#/$defs/nullableDisplayText" },
571
+ "retryable": { "type": "boolean" }
572
+ },
573
+ "allOf": [
574
+ {
575
+ "if": {
576
+ "type": "object",
577
+ "properties": { "state": { "const": "current" } },
578
+ "required": ["state"]
579
+ },
580
+ "then": {
581
+ "type": "object",
582
+ "properties": {
583
+ "reasonCode": { "type": "null" },
584
+ "retryable": { "const": false }
585
+ }
586
+ },
587
+ "else": {
588
+ "type": "object",
589
+ "properties": {
590
+ "reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" }
591
+ }
592
+ }
593
+ }
594
+ ]
595
+ },
596
+ "fallback": {
597
+ "type": "object",
598
+ "additionalProperties": false,
599
+ "required": ["kind", "reasonCode", "message"],
600
+ "properties": {
601
+ "kind": {
602
+ "enum": [
603
+ "none",
604
+ "binary",
605
+ "symlink",
606
+ "submodule",
607
+ "protected",
608
+ "oversized",
609
+ "conflict",
610
+ "unavailable",
611
+ "stale"
612
+ ]
613
+ },
614
+ "reasonCode": { "$ref": "common-v1.schema.json#/$defs/nullableReasonCode" },
615
+ "message": { "$ref": "common-v1.schema.json#/$defs/nullableDisplayText" }
616
+ },
617
+ "allOf": [
618
+ {
619
+ "if": {
620
+ "type": "object",
621
+ "properties": { "kind": { "const": "none" } },
622
+ "required": ["kind"]
623
+ },
624
+ "then": {
625
+ "type": "object",
626
+ "properties": {
627
+ "reasonCode": { "type": "null" },
628
+ "message": { "type": "null" }
629
+ }
630
+ },
631
+ "else": {
632
+ "type": "object",
633
+ "properties": {
634
+ "reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" }
635
+ }
636
+ }
637
+ }
638
+ ]
639
+ },
640
+ "diffLineText": {
641
+ "type": "string",
642
+ "maxLength": 16384,
643
+ "pattern": "^[^\\u0000-\\u0008\\u000A-\\u001F\\u007F]*$"
644
+ },
645
+ "contextLine": {
646
+ "type": "object",
647
+ "additionalProperties": false,
648
+ "required": ["lineRef", "kind", "marker", "oldLineNumber", "newLineNumber", "text", "redacted"],
649
+ "properties": {
650
+ "lineRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
651
+ "kind": { "const": "context" },
652
+ "marker": { "const": " " },
653
+ "oldLineNumber": { "type": "integer", "minimum": 1, "maximum": 1000000000 },
654
+ "newLineNumber": { "type": "integer", "minimum": 1, "maximum": 1000000000 },
655
+ "text": { "$ref": "#/$defs/diffLineText" },
656
+ "redacted": { "type": "boolean" }
657
+ }
658
+ },
659
+ "addedLine": {
660
+ "type": "object",
661
+ "additionalProperties": false,
662
+ "required": ["lineRef", "kind", "marker", "oldLineNumber", "newLineNumber", "text", "redacted"],
663
+ "properties": {
664
+ "lineRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
665
+ "kind": { "const": "added" },
666
+ "marker": { "const": "+" },
667
+ "oldLineNumber": { "type": "null" },
668
+ "newLineNumber": { "type": "integer", "minimum": 1, "maximum": 1000000000 },
669
+ "text": { "$ref": "#/$defs/diffLineText" },
670
+ "redacted": { "type": "boolean" }
671
+ }
672
+ },
673
+ "deletedLine": {
674
+ "type": "object",
675
+ "additionalProperties": false,
676
+ "required": ["lineRef", "kind", "marker", "oldLineNumber", "newLineNumber", "text", "redacted"],
677
+ "properties": {
678
+ "lineRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
679
+ "kind": { "const": "deleted" },
680
+ "marker": { "const": "-" },
681
+ "oldLineNumber": { "type": "integer", "minimum": 1, "maximum": 1000000000 },
682
+ "newLineNumber": { "type": "null" },
683
+ "text": { "$ref": "#/$defs/diffLineText" },
684
+ "redacted": { "type": "boolean" }
685
+ }
686
+ },
687
+ "noNewlineMarker": {
688
+ "type": "object",
689
+ "additionalProperties": false,
690
+ "required": ["lineRef", "kind", "marker", "oldLineNumber", "newLineNumber", "text", "redacted"],
691
+ "properties": {
692
+ "lineRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
693
+ "kind": { "const": "no-newline-marker" },
694
+ "marker": { "const": "\\" },
695
+ "oldLineNumber": { "type": "null" },
696
+ "newLineNumber": { "type": "null" },
697
+ "text": { "$ref": "#/$defs/diffLineText" },
698
+ "redacted": { "const": false }
699
+ }
700
+ },
701
+ "diffLine": {
702
+ "oneOf": [
703
+ { "$ref": "#/$defs/contextLine" },
704
+ { "$ref": "#/$defs/addedLine" },
705
+ { "$ref": "#/$defs/deletedLine" },
706
+ { "$ref": "#/$defs/noNewlineMarker" }
707
+ ]
708
+ },
709
+ "hunk": {
710
+ "type": "object",
711
+ "additionalProperties": false,
712
+ "required": [
713
+ "hunkRef",
714
+ "oldStart",
715
+ "oldLineCount",
716
+ "newStart",
717
+ "newLineCount",
718
+ "header",
719
+ "lines"
720
+ ],
721
+ "properties": {
722
+ "hunkRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
723
+ "oldStart": { "type": "integer", "minimum": 0, "maximum": 1000000000 },
724
+ "oldLineCount": { "type": "integer", "minimum": 0, "maximum": 1000000 },
725
+ "newStart": { "type": "integer", "minimum": 0, "maximum": 1000000000 },
726
+ "newLineCount": { "type": "integer", "minimum": 0, "maximum": 1000000 },
727
+ "header": { "$ref": "common-v1.schema.json#/$defs/longDisplayText" },
728
+ "lines": {
729
+ "type": "array",
730
+ "maxItems": 512,
731
+ "items": { "$ref": "#/$defs/diffLine" }
732
+ }
733
+ }
734
+ },
735
+ "unchangedRegion": {
736
+ "type": "object",
737
+ "additionalProperties": false,
738
+ "required": [
739
+ "regionRef",
740
+ "oldStart",
741
+ "newStart",
742
+ "lineCount",
743
+ "beforeHunkRef",
744
+ "afterHunkRef",
745
+ "contentState",
746
+ "expansionRef",
747
+ "reasonCode"
748
+ ],
749
+ "properties": {
750
+ "regionRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
751
+ "oldStart": { "type": "integer", "minimum": 1, "maximum": 1000000000 },
752
+ "newStart": { "type": "integer", "minimum": 1, "maximum": 1000000000 },
753
+ "lineCount": { "type": "integer", "minimum": 1, "maximum": 1000000 },
754
+ "beforeHunkRef": { "$ref": "common-v1.schema.json#/$defs/nullableOpaqueRef" },
755
+ "afterHunkRef": { "$ref": "common-v1.schema.json#/$defs/nullableOpaqueRef" },
756
+ "contentState": { "enum": ["available", "unavailable"] },
757
+ "expansionRef": { "$ref": "common-v1.schema.json#/$defs/nullableOpaqueRef" },
758
+ "reasonCode": { "$ref": "common-v1.schema.json#/$defs/nullableReasonCode" }
759
+ },
760
+ "allOf": [
761
+ {
762
+ "if": {
763
+ "type": "object",
764
+ "properties": { "contentState": { "const": "available" } },
765
+ "required": ["contentState"]
766
+ },
767
+ "then": {
768
+ "type": "object",
769
+ "properties": {
770
+ "expansionRef": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
771
+ "reasonCode": { "type": "null" }
772
+ }
773
+ },
774
+ "else": {
775
+ "type": "object",
776
+ "properties": {
777
+ "expansionRef": { "type": "null" },
778
+ "reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" }
779
+ }
780
+ }
781
+ }
782
+ ]
783
+ },
784
+ "truncation": {
785
+ "type": "object",
786
+ "additionalProperties": false,
787
+ "required": ["truncated", "reasonCode", "omittedHunks", "omittedLines", "nextCursor"],
788
+ "properties": {
789
+ "truncated": { "type": "boolean" },
790
+ "reasonCode": { "$ref": "common-v1.schema.json#/$defs/nullableReasonCode" },
791
+ "omittedHunks": { "type": "integer", "minimum": 0, "maximum": 1000000 },
792
+ "omittedLines": { "type": "integer", "minimum": 0, "maximum": 100000000 },
793
+ "nextCursor": { "$ref": "common-v1.schema.json#/$defs/nullableRevisionToken" }
794
+ },
795
+ "allOf": [
796
+ {
797
+ "if": {
798
+ "type": "object",
799
+ "properties": { "truncated": { "const": true } },
800
+ "required": ["truncated"]
801
+ },
802
+ "then": {
803
+ "type": "object",
804
+ "properties": {
805
+ "reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" },
806
+ "nextCursor": { "$ref": "common-v1.schema.json#/$defs/revisionToken" }
807
+ },
808
+ "anyOf": [
809
+ { "type": "object", "properties": { "omittedHunks": { "type": "integer", "minimum": 1 } } },
810
+ { "type": "object", "properties": { "omittedLines": { "type": "integer", "minimum": 1 } } }
811
+ ]
812
+ },
813
+ "else": {
814
+ "type": "object",
815
+ "properties": {
816
+ "reasonCode": { "type": "null" },
817
+ "omittedHunks": { "const": 0 },
818
+ "omittedLines": { "const": 0 },
819
+ "nextCursor": { "type": "null" }
820
+ }
821
+ }
822
+ }
823
+ ]
824
+ }
825
+ }
826
+ }