@piagent/platform 1.3.1 → 1.4.1

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 (329) hide show
  1. package/CHANGELOG.md +132 -0
  2. package/README.md +10 -4
  3. package/README.vi.md +27 -0
  4. package/architecture/layers.json +96 -1
  5. package/docs/README.md +1 -0
  6. package/docs/architecture.md +1 -0
  7. package/docs/authority-manifest.md +1 -0
  8. package/docs/auto-delegation-policy.md +1 -0
  9. package/docs/capability-packs.md +1 -0
  10. package/docs/command-reference-vietnamese.md +5 -4
  11. package/docs/context-engine.md +1 -0
  12. package/docs/context-window-policy.md +1 -0
  13. package/docs/distribution-standard.md +8 -7
  14. package/docs/en/architecture.md +13 -0
  15. package/docs/herdr-workflow.md +1 -0
  16. package/docs/languages.json +20 -4
  17. package/docs/mcp-and-tools.md +125 -9
  18. package/docs/memory-policy.md +1 -0
  19. package/docs/model-options.md +1 -0
  20. package/docs/oauth-providers.md +1 -0
  21. package/docs/operator-manual-vietnamese.md +15 -12
  22. package/docs/package-architecture-notes.md +1 -0
  23. package/docs/project-adapters.md +1 -0
  24. package/docs/project-onboarding.md +1 -0
  25. package/docs/publishing-for-teams.md +37 -0
  26. package/docs/quality-benchmark.md +1 -0
  27. package/docs/quickstart-vietnamese.md +3 -2
  28. package/docs/release-install-policy.md +22 -8
  29. package/docs/runtime-harness-standard.md +2 -1
  30. package/docs/runtime-policy-design.md +1 -0
  31. package/docs/runtime-quality-baseline.md +1 -0
  32. package/docs/security-redaction-benchmark.md +1 -0
  33. package/docs/security-threat-model.md +2 -1
  34. package/docs/subagent-orchestration-capabilities.md +1 -0
  35. package/docs/subagents-and-multiagent.md +1 -0
  36. package/docs/task-implementation-contract.md +12 -4
  37. package/docs/task-lifecycle-vietnamese.md +1 -0
  38. package/docs/team-onboarding.md +3 -2
  39. package/docs/third-party-neutrality.md +26 -0
  40. package/docs/usage-observability.md +71 -0
  41. package/docs/vercel-docs-site.md +1 -0
  42. package/docs/vi/architecture.md +13 -0
  43. package/docs/workflow-recipes.md +1 -0
  44. package/docs-site/architecture.html +5 -1
  45. package/docs-site/benchmark.html +5 -1
  46. package/docs-site/commands.html +5 -1
  47. package/docs-site/content/en/index.html +49 -0
  48. package/docs-site/content/en/runtime.html +13 -0
  49. package/docs-site/content/index.html +49 -0
  50. package/docs-site/content/runtime.html +28 -0
  51. package/docs-site/context-engine.html +5 -1
  52. package/docs-site/en/architecture.html +5 -1
  53. package/docs-site/en/benchmark.html +5 -1
  54. package/docs-site/en/commands.html +5 -1
  55. package/docs-site/en/context-engine.html +5 -1
  56. package/docs-site/en/index.html +54 -1
  57. package/docs-site/en/mcp-approval.html +5 -1
  58. package/docs-site/en/mcp-auth.html +5 -1
  59. package/docs-site/en/mcp-servers.html +5 -1
  60. package/docs-site/en/mcp.html +5 -1
  61. package/docs-site/en/permissions.html +5 -1
  62. package/docs-site/en/profiles.html +5 -1
  63. package/docs-site/en/quickstart.html +5 -1
  64. package/docs-site/en/runtime.html +18 -1
  65. package/docs-site/en/scope.html +5 -1
  66. package/docs-site/en/security.html +5 -1
  67. package/docs-site/en/team.html +5 -1
  68. package/docs-site/en/whats-new.html +5 -1
  69. package/docs-site/en/workflows.html +5 -1
  70. package/docs-site/index.html +54 -1
  71. package/docs-site/mcp-approval.html +5 -1
  72. package/docs-site/mcp-auth.html +5 -1
  73. package/docs-site/mcp-servers.html +5 -1
  74. package/docs-site/mcp.html +5 -1
  75. package/docs-site/permissions.html +5 -1
  76. package/docs-site/profiles.html +5 -1
  77. package/docs-site/quickstart.html +5 -1
  78. package/docs-site/runtime.html +33 -1
  79. package/docs-site/scope.html +5 -1
  80. package/docs-site/security.html +5 -1
  81. package/docs-site/team.html +5 -1
  82. package/docs-site/whats-new.html +5 -1
  83. package/docs-site/workflows.html +5 -1
  84. package/evals/fixtures/mutation-provenance-record.invalid.json +17 -0
  85. package/evals/fixtures/mutation-provenance-record.valid.json +27 -0
  86. package/evals/fixtures/piagent-webui/approval-v1.invalid.json +54 -0
  87. package/evals/fixtures/piagent-webui/approval-v1.valid.json +58 -0
  88. package/evals/fixtures/piagent-webui/attachment-v1.invalid.json +25 -0
  89. package/evals/fixtures/piagent-webui/attachment-v1.valid.json +25 -0
  90. package/evals/fixtures/piagent-webui/capabilities-v1.invalid.json +51 -0
  91. package/evals/fixtures/piagent-webui/capabilities-v1.valid.json +122 -0
  92. package/evals/fixtures/piagent-webui/commit-summary-v1.invalid.json +10 -0
  93. package/evals/fixtures/piagent-webui/commit-summary-v1.valid.json +25 -0
  94. package/evals/fixtures/piagent-webui/control-command-v1.invalid.json +37 -0
  95. package/evals/fixtures/piagent-webui/control-command-v1.valid.json +35 -0
  96. package/evals/fixtures/piagent-webui/diff-v1.invalid.json +13 -0
  97. package/evals/fixtures/piagent-webui/diff-v1.valid.json +141 -0
  98. package/evals/fixtures/piagent-webui/gateway-capabilities-v1.invalid.json +35 -0
  99. package/evals/fixtures/piagent-webui/gateway-capabilities-v1.valid.json +35 -0
  100. package/evals/fixtures/piagent-webui/gateway-protocol-v1.invalid.json +14 -0
  101. package/evals/fixtures/piagent-webui/gateway-protocol-v1.valid.json +14 -0
  102. package/evals/fixtures/piagent-webui/handoff-history-v1.invalid.json +16 -0
  103. package/evals/fixtures/piagent-webui/handoff-history-v1.valid.json +16 -0
  104. package/evals/fixtures/piagent-webui/model-catalog-v1.invalid.json +31 -0
  105. package/evals/fixtures/piagent-webui/model-catalog-v1.valid.json +43 -0
  106. package/evals/fixtures/piagent-webui/queue-v1.invalid.json +29 -0
  107. package/evals/fixtures/piagent-webui/queue-v1.valid.json +44 -0
  108. package/evals/fixtures/piagent-webui/recovery-history-v1.invalid.json +17 -0
  109. package/evals/fixtures/piagent-webui/recovery-history-v1.valid.json +20 -0
  110. package/evals/fixtures/piagent-webui/release-monitor-v1.invalid.json +12 -0
  111. package/evals/fixtures/piagent-webui/release-monitor-v1.valid.json +29 -0
  112. package/evals/fixtures/piagent-webui/review-state-v1.invalid.json +25 -0
  113. package/evals/fixtures/piagent-webui/review-state-v1.valid.json +38 -0
  114. package/evals/fixtures/piagent-webui/runtime-event-v2.invalid.json +49 -0
  115. package/evals/fixtures/piagent-webui/runtime-event-v2.valid.json +49 -0
  116. package/evals/fixtures/piagent-webui/session-catalog-v1.invalid.json +17 -0
  117. package/evals/fixtures/piagent-webui/session-catalog-v1.valid.json +58 -0
  118. package/evals/fixtures/piagent-webui/session-command-v1.invalid.json +19 -0
  119. package/evals/fixtures/piagent-webui/session-command-v1.valid.json +19 -0
  120. package/evals/fixtures/piagent-webui/snapshot-v1.invalid.json +5 -0
  121. package/evals/fixtures/piagent-webui/snapshot-v1.valid.json +191 -0
  122. package/evals/fixtures/piagent-webui/source-change-v1.invalid.json +57 -0
  123. package/evals/fixtures/piagent-webui/source-change-v1.valid.json +98 -0
  124. package/evals/fixtures/piagent-webui/source-mutation-v1.invalid.json +19 -0
  125. package/evals/fixtures/piagent-webui/source-mutation-v1.valid.json +38 -0
  126. package/evals/fixtures/piagent-webui/source-revert-v1.invalid.json +20 -0
  127. package/evals/fixtures/piagent-webui/source-revert-v1.valid.json +62 -0
  128. package/evals/fixtures/piagent-webui/subagent-tree-v1.invalid.json +26 -0
  129. package/evals/fixtures/piagent-webui/subagent-tree-v1.valid.json +39 -0
  130. package/evals/fixtures/piagent-webui/task-index-v1.invalid.json +15 -0
  131. package/evals/fixtures/piagent-webui/task-index-v1.valid.json +15 -0
  132. package/evals/fixtures/piagent-webui/task-timeline-v1.invalid.json +14 -0
  133. package/evals/fixtures/piagent-webui/task-timeline-v1.valid.json +16 -0
  134. package/evals/fixtures/piagent-webui/transcript-v1.invalid.json +35 -0
  135. package/evals/fixtures/piagent-webui/transcript-v1.valid.json +55 -0
  136. package/evals/fixtures/task-baseline-manifest.invalid.json +16 -0
  137. package/evals/fixtures/task-baseline-manifest.valid.json +41 -0
  138. package/evals/fixtures/verifier-file-snapshot.invalid.json +21 -0
  139. package/evals/fixtures/verifier-file-snapshot.valid.json +21 -0
  140. package/package.json +43 -4
  141. package/packages/piagent-core/README.md +3 -2
  142. package/packages/piagent-core/benchmark/benchmark-candidate.d.ts +1 -0
  143. package/packages/piagent-core/benchmark/benchmark-forensics.d.ts +1 -0
  144. package/packages/piagent-core/benchmark/benchmark-ledger.d.ts +4 -0
  145. package/packages/piagent-core/benchmark/benchmark-record-validation.d.ts +1 -0
  146. package/packages/piagent-core/benchmark/benchmark-runtime.d.ts +1 -0
  147. package/packages/piagent-core/capabilities/capability-core.js +2 -2
  148. package/packages/piagent-core/capabilities/capability-verification-cache.js +17 -7
  149. package/packages/piagent-core/capabilities/runtime-integrity.js +190 -0
  150. package/packages/piagent-core/extensions/piagent-guard.ts +80 -272
  151. package/packages/piagent-core/extensions/redaction-core.d.ts +2 -0
  152. package/packages/piagent-core/extensions/runtime-evidence.js +12 -1
  153. package/packages/piagent-core/extensions/shell-reach.ts +250 -0
  154. package/packages/piagent-core/extensions/task-journal.js +30 -1
  155. package/packages/piagent-core/extensions/task-state.js +33 -36
  156. package/packages/piagent-core/mcp/mcp-command-actions.js +1 -1
  157. package/packages/piagent-core/mcp/mcp-server-catalog.js +139 -9
  158. package/packages/piagent-core/package.json +1 -1
  159. package/packages/piagent-core/runtime/hooks/session-start-hook.ts +2 -2
  160. package/packages/piagent-core/runtime/hooks/tool-call-hook.ts +12 -2
  161. package/packages/piagent-core/runtime/hooks/tool-result-hook.ts +20 -19
  162. package/packages/piagent-core/runtime/hooks/tool-result-metadata.ts +13 -0
  163. package/packages/piagent-core/runtime/input/chat-images.ts +2 -2
  164. package/packages/piagent-core/runtime/inspection/activity-event-adapter.ts +94 -0
  165. package/packages/piagent-core/runtime/inspection/approval-broker.ts +318 -0
  166. package/packages/piagent-core/runtime/inspection/commit-summary-projection.ts +59 -0
  167. package/packages/piagent-core/runtime/inspection/context-telemetry-inspection.ts +37 -0
  168. package/packages/piagent-core/runtime/inspection/criteria-links.ts +295 -0
  169. package/packages/piagent-core/runtime/inspection/diff-projection.ts +499 -0
  170. package/packages/piagent-core/runtime/inspection/git-filter-safety.ts +38 -0
  171. package/packages/piagent-core/runtime/inspection/git-numstat-adapter.ts +71 -0
  172. package/packages/piagent-core/runtime/inspection/git-status-adapter.ts +493 -0
  173. package/packages/piagent-core/runtime/inspection/git-tree-adapter.ts +108 -0
  174. package/packages/piagent-core/runtime/inspection/mcp-control.ts +10 -0
  175. package/packages/piagent-core/runtime/inspection/mutation-provenance-contract.ts +131 -0
  176. package/packages/piagent-core/runtime/inspection/mutation-provenance-recorder.ts +48 -0
  177. package/packages/piagent-core/runtime/inspection/mutation-provenance-store.ts +161 -0
  178. package/packages/piagent-core/runtime/inspection/project-runtime-inspection.ts +36 -0
  179. package/packages/piagent-core/runtime/inspection/review-state-contract.ts +108 -0
  180. package/packages/piagent-core/runtime/inspection/review-state-projection.ts +93 -0
  181. package/packages/piagent-core/runtime/inspection/review-state-store.ts +112 -0
  182. package/packages/piagent-core/runtime/inspection/runtime-event-store.ts +262 -0
  183. package/packages/piagent-core/runtime/inspection/same-process-bridge-proof.ts +103 -0
  184. package/packages/piagent-core/runtime/inspection/source-change-projection.ts +471 -0
  185. package/packages/piagent-core/runtime/inspection/source-evidence-contract.ts +139 -0
  186. package/packages/piagent-core/runtime/inspection/source-evidence-store.ts +315 -0
  187. package/packages/piagent-core/runtime/inspection/source-handoff-store.ts +70 -0
  188. package/packages/piagent-core/runtime/inspection/source-inspection-plan.ts +34 -0
  189. package/packages/piagent-core/runtime/inspection/source-mutation-projection.ts +164 -0
  190. package/packages/piagent-core/runtime/inspection/source-mutation-store.ts +168 -0
  191. package/packages/piagent-core/runtime/inspection/source-open-target.ts +38 -0
  192. package/packages/piagent-core/runtime/inspection/source-revert-projection.ts +147 -0
  193. package/packages/piagent-core/runtime/inspection/task-baseline-start-capture.ts +22 -0
  194. package/packages/piagent-core/runtime/inspection/task-compaction-history.ts +160 -0
  195. package/packages/piagent-core/runtime/inspection/task-control-journal.ts +131 -0
  196. package/packages/piagent-core/runtime/inspection/task-handoff-history.ts +95 -0
  197. package/packages/piagent-core/runtime/inspection/task-provenance-projection.ts +60 -0
  198. package/packages/piagent-core/runtime/inspection/task-recovery-timeline.ts +88 -0
  199. package/packages/piagent-core/runtime/inspection/task-run-index.ts +87 -0
  200. package/packages/piagent-core/runtime/inspection/task-source-projection.ts +401 -0
  201. package/packages/piagent-core/runtime/inspection/task-subagent-tree.ts +101 -0
  202. package/packages/piagent-core/runtime/inspection/text-diff.ts +60 -0
  203. package/packages/piagent-core/runtime/inspection/verifier-snapshot-contract.ts +114 -0
  204. package/packages/piagent-core/runtime/inspection/verifier-snapshot-store.ts +189 -0
  205. package/packages/piagent-core/runtime/inspection/webui-snapshot.ts +320 -0
  206. package/packages/piagent-core/runtime/inspection/workspace-file-reader.ts +132 -0
  207. package/packages/piagent-core/runtime/inspection/workspace-source-projection.ts +96 -0
  208. package/packages/piagent-core/runtime/inspection/zero-turn-conformance.ts +175 -0
  209. package/packages/piagent-core/runtime/orchestration/owned-work-budget.ts +93 -6
  210. package/packages/piagent-core/runtime/policy/block-remedy.ts +139 -0
  211. package/packages/piagent-core/runtime/policy/source-index-transaction.ts +173 -0
  212. package/packages/piagent-core/runtime/policy/source-mutation-guard-binding.ts +42 -0
  213. package/packages/piagent-core/runtime/policy/source-mutation-guard.ts +184 -0
  214. package/packages/piagent-core/runtime/policy/source-worktree-transaction.ts +105 -0
  215. package/packages/piagent-core/runtime/product/activity-inspector-footer.ts +5 -3
  216. package/packages/piagent-core/runtime/product/activity-inspector.ts +85 -343
  217. package/packages/piagent-core/runtime/recovery/resume-state.ts +38 -1
  218. package/packages/piagent-core/runtime/registration/activity-inspector-command.ts +68 -14
  219. package/packages/piagent-core/runtime/registration/task-start-tool.ts +22 -27
  220. package/packages/piagent-core/runtime/session/model-authorship-state.ts +31 -3
  221. package/packages/piagent-core/runtime/session/runtime-state.ts +11 -1
  222. package/packages/piagent-core/runtime/session/token-economics.js +34 -0
  223. package/packages/piagent-core/runtime/tools/phase-tool-runtime.ts +2 -1
  224. package/packages/piagent-core/runtime/workflows/task-intake.ts +5 -0
  225. package/packages/piagent-core/security/sensitive-data.js +7 -0
  226. package/packages/piagent-webui/dist/client/assets/index-DwKCWbwd.css +1 -0
  227. package/packages/piagent-webui/dist/client/assets/index-bu7XpD9Q.js +172 -0
  228. package/packages/piagent-webui/dist/client/index.html +16 -0
  229. package/packages/piagent-webui/extension/attachment-store.ts +323 -0
  230. package/packages/piagent-webui/extension/held-message-queue.ts +311 -0
  231. package/packages/piagent-webui/extension/lifecycle-controller.ts +423 -0
  232. package/packages/piagent-webui/extension/lifecycle-event-adapter.ts +23 -0
  233. package/packages/piagent-webui/extension/piagent-webui.ts +470 -0
  234. package/packages/piagent-webui/extension/review-controller.ts +160 -0
  235. package/packages/piagent-webui/extension/same-session-bridge.ts +500 -0
  236. package/packages/piagent-webui/extension/session-options-controller.ts +281 -0
  237. package/packages/piagent-webui/extension/session-stream-adapter.ts +249 -0
  238. package/packages/piagent-webui/extension/source-mutation-controller.ts +215 -0
  239. package/packages/piagent-webui/extension/source-open-controller.ts +136 -0
  240. package/packages/piagent-webui/extension/source-revert-controller.ts +189 -0
  241. package/packages/piagent-webui/extension/terminal-session-adapter.ts +73 -0
  242. package/packages/piagent-webui/extension/vscode-handoff.ts +51 -0
  243. package/packages/piagent-webui/gateway/control-socket.ts +92 -0
  244. package/packages/piagent-webui/gateway/extension-authority.ts +47 -0
  245. package/packages/piagent-webui/gateway/gateway-events.ts +60 -0
  246. package/packages/piagent-webui/gateway/gateway-protocol-service.ts +64 -0
  247. package/packages/piagent-webui/gateway/gateway-service.ts +215 -0
  248. package/packages/piagent-webui/gateway/gateway-session-stream.ts +110 -0
  249. package/packages/piagent-webui/gateway/mcp-auth-broker.ts +158 -0
  250. package/packages/piagent-webui/gateway/native-project-picker.ts +29 -0
  251. package/packages/piagent-webui/gateway/pi-host.ts +41 -0
  252. package/packages/piagent-webui/gateway/profile-state.ts +1 -0
  253. package/packages/piagent-webui/gateway/project-registry.ts +108 -0
  254. package/packages/piagent-webui/gateway/provider-auth-broker.ts +172 -0
  255. package/packages/piagent-webui/gateway/session-catalog.ts +128 -0
  256. package/packages/piagent-webui/gateway/session-command-controller.ts +237 -0
  257. package/packages/piagent-webui/gateway/session-command-store.ts +224 -0
  258. package/packages/piagent-webui/gateway/session-inspection-registry.ts +239 -0
  259. package/packages/piagent-webui/gateway/session-lease-store.ts +1 -0
  260. package/packages/piagent-webui/gateway/session-metadata-store.ts +152 -0
  261. package/packages/piagent-webui/gateway/session-runtime-supervisor.ts +489 -0
  262. package/packages/piagent-webui/ownership/gateway-runtime-context.ts +8 -0
  263. package/packages/piagent-webui/ownership/profile-state.ts +117 -0
  264. package/packages/piagent-webui/ownership/session-lease-store.ts +329 -0
  265. package/packages/piagent-webui/ownership/session-refs.ts +8 -0
  266. package/packages/piagent-webui/package.json +33 -0
  267. package/packages/piagent-webui/server/README.md +4 -0
  268. package/packages/piagent-webui/server/benchmark-release-monitor.ts +230 -0
  269. package/packages/piagent-webui/server/core-inspection-provider.ts +403 -0
  270. package/packages/piagent-webui/server/gateway-websocket.ts +143 -0
  271. package/packages/piagent-webui/server/http-security.ts +27 -0
  272. package/packages/piagent-webui/server/ipc-read-model-client.ts +89 -0
  273. package/packages/piagent-webui/server/loopback-server.ts +368 -0
  274. package/packages/piagent-webui/server/read-model-provider.ts +37 -0
  275. package/packages/piagent-webui/server/read-only-router.ts +105 -0
  276. package/packages/piagent-webui/server/session-auth.ts +88 -0
  277. package/packages/piagent-webui/server/sidecar-main.ts +86 -0
  278. package/packages/piagent-webui/server/sse-hub.ts +76 -0
  279. package/packages/piagent-webui/server/static-bundle.ts +40 -0
  280. package/packages/piagent-webui/server/transcript-projection.ts +125 -0
  281. package/schemas/mutation-provenance-record.schema.json +100 -0
  282. package/schemas/piagent-webui/approval-v1.schema.json +654 -0
  283. package/schemas/piagent-webui/attachment-v1.schema.json +267 -0
  284. package/schemas/piagent-webui/capabilities-v1.schema.json +729 -0
  285. package/schemas/piagent-webui/catalog-v1.json +240 -0
  286. package/schemas/piagent-webui/commit-summary-v1.schema.json +63 -0
  287. package/schemas/piagent-webui/common-v1.schema.json +479 -0
  288. package/schemas/piagent-webui/control-command-v1.schema.json +1780 -0
  289. package/schemas/piagent-webui/diff-v1.schema.json +826 -0
  290. package/schemas/piagent-webui/gateway-capabilities-v1.schema.json +136 -0
  291. package/schemas/piagent-webui/gateway-protocol-v1.schema.json +456 -0
  292. package/schemas/piagent-webui/handoff-history-v1.schema.json +92 -0
  293. package/schemas/piagent-webui/model-catalog-v1.schema.json +95 -0
  294. package/schemas/piagent-webui/queue-v1.schema.json +99 -0
  295. package/schemas/piagent-webui/recovery-history-v1.schema.json +144 -0
  296. package/schemas/piagent-webui/release-monitor-v1.schema.json +173 -0
  297. package/schemas/piagent-webui/review-state-v1.schema.json +206 -0
  298. package/schemas/piagent-webui/runtime-event-v2.schema.json +5206 -0
  299. package/schemas/piagent-webui/session-catalog-v1.schema.json +222 -0
  300. package/schemas/piagent-webui/session-command-v1.schema.json +390 -0
  301. package/schemas/piagent-webui/snapshot-v1.schema.json +2622 -0
  302. package/schemas/piagent-webui/source-change-v1.schema.json +763 -0
  303. package/schemas/piagent-webui/source-mutation-v1.schema.json +96 -0
  304. package/schemas/piagent-webui/source-revert-v1.schema.json +130 -0
  305. package/schemas/piagent-webui/subagent-tree-v1.schema.json +88 -0
  306. package/schemas/piagent-webui/task-index-v1.schema.json +74 -0
  307. package/schemas/piagent-webui/task-timeline-v1.schema.json +49 -0
  308. package/schemas/piagent-webui/transcript-v1.schema.json +243 -0
  309. package/schemas/task-baseline-manifest.schema.json +122 -0
  310. package/schemas/verifier-file-snapshot.schema.json +81 -0
  311. package/scripts/build-docs-site.mjs +21 -1
  312. package/scripts/check-architecture.mjs +1 -0
  313. package/scripts/check-doc-languages.mjs +19 -2
  314. package/scripts/check-third-party-neutrality.mjs +43 -0
  315. package/scripts/explain-command.mjs +240 -0
  316. package/scripts/install-global.sh +105 -4
  317. package/scripts/mcp-manage.mjs +17 -4
  318. package/scripts/pi-session-stats.sh +10 -2
  319. package/scripts/piagent-cli.mjs +30 -3
  320. package/scripts/piagent-dashboard.mjs +261 -0
  321. package/scripts/piagent-webui-launcher.mjs +121 -0
  322. package/scripts/setup.sh +69 -33
  323. package/scripts/traffic-snapshot.mjs +214 -0
  324. package/scripts/typescript-loader.mjs +42 -1
  325. package/scripts/uninstall-global.sh +53 -2
  326. package/scripts/update-global.mjs +33 -1
  327. package/scripts/verify-local.sh +257 -0
  328. package/scripts/verify-release-identity.mjs +4 -1
  329. package/scripts/verify-translation-pairing.mjs +121 -0
@@ -0,0 +1,729 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://piagent.io.vn/schemas/piagent-webui/capabilities-v1.schema.json",
4
+ "title": "Piagent WebUI capability handshake v1",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": [
8
+ "schemaVersion",
9
+ "version",
10
+ "generatedAt",
11
+ "protocolMin",
12
+ "protocolMax",
13
+ "supportedSnapshotVersions",
14
+ "supportedEventVersions",
15
+ "mode",
16
+ "compatibility",
17
+ "identity",
18
+ "runtimeBuild",
19
+ "serverBuild",
20
+ "capabilities",
21
+ "replay",
22
+ "limits"
23
+ ],
24
+ "properties": {
25
+ "schemaVersion": { "const": 1 },
26
+ "version": { "const": "piagent-webui-capabilities-v1" },
27
+ "generatedAt": { "$ref": "common-v1.schema.json#/$defs/timestamp" },
28
+ "protocolMin": { "const": 1 },
29
+ "protocolMax": { "const": 1 },
30
+ "supportedSnapshotVersions": {
31
+ "type": "array",
32
+ "minItems": 1,
33
+ "maxItems": 16,
34
+ "uniqueItems": true,
35
+ "items": { "type": "integer", "minimum": 1, "maximum": 65535 }
36
+ },
37
+ "supportedEventVersions": {
38
+ "type": "array",
39
+ "minItems": 1,
40
+ "maxItems": 16,
41
+ "uniqueItems": true,
42
+ "items": { "type": "integer", "minimum": 1, "maximum": 65535 }
43
+ },
44
+ "mode": { "enum": ["unavailable", "inspect-only", "control-enabled"] },
45
+ "compatibility": { "$ref": "#/$defs/compatibility" },
46
+ "identity": { "$ref": "common-v1.schema.json#/$defs/identity" },
47
+ "runtimeBuild": { "$ref": "#/$defs/buildIdentity" },
48
+ "serverBuild": { "$ref": "#/$defs/buildIdentity" },
49
+ "capabilities": {
50
+ "type": "object",
51
+ "additionalProperties": false,
52
+ "required": [
53
+ "inspect",
54
+ "control.chat",
55
+ "control.lifecycle",
56
+ "control.resumeAndContinue",
57
+ "control.sessionOptions",
58
+ "attachments",
59
+ "approve",
60
+ "reviewActions"
61
+ ],
62
+ "properties": {
63
+ "inspect": { "$ref": "#/$defs/inspectCapability" },
64
+ "control.chat": { "$ref": "#/$defs/chatCapability" },
65
+ "control.lifecycle": { "$ref": "#/$defs/lifecycleCapability" },
66
+ "control.resumeAndContinue": { "$ref": "#/$defs/resumeAndContinueCapability" },
67
+ "control.sessionOptions": { "$ref": "#/$defs/sessionOptionsCapability" },
68
+ "attachments": { "$ref": "#/$defs/attachmentsCapability" },
69
+ "approve": { "$ref": "#/$defs/approveCapability" },
70
+ "reviewActions": { "$ref": "#/$defs/reviewActionsCapability" }
71
+ }
72
+ },
73
+ "replay": { "$ref": "#/$defs/replay" },
74
+ "limits": { "$ref": "#/$defs/resourceLimits" }
75
+ },
76
+ "allOf": [
77
+ {
78
+ "if": { "properties": { "mode": { "const": "unavailable" } } },
79
+ "then": {
80
+ "properties": {
81
+ "capabilities": {
82
+ "type": "object",
83
+ "properties": {
84
+ "inspect": { "$ref": "#/$defs/unavailableCapability" },
85
+ "control.chat": { "$ref": "#/$defs/unavailableCapability" },
86
+ "control.lifecycle": { "$ref": "#/$defs/unavailableCapability" },
87
+ "control.resumeAndContinue": { "$ref": "#/$defs/unavailableCapability" },
88
+ "control.sessionOptions": { "$ref": "#/$defs/unavailableCapability" },
89
+ "attachments": { "$ref": "#/$defs/unavailableCapability" },
90
+ "approve": { "$ref": "#/$defs/unavailableCapability" },
91
+ "reviewActions": { "$ref": "#/$defs/unavailableCapability" }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ },
97
+ {
98
+ "if": { "properties": { "mode": { "const": "inspect-only" } } },
99
+ "then": {
100
+ "properties": {
101
+ "capabilities": {
102
+ "type": "object",
103
+ "properties": {
104
+ "inspect": { "$ref": "#/$defs/availableInspectCapability" },
105
+ "control.chat": { "$ref": "#/$defs/unavailableCapability" },
106
+ "control.lifecycle": { "$ref": "#/$defs/unavailableCapability" },
107
+ "control.resumeAndContinue": { "$ref": "#/$defs/unavailableCapability" },
108
+ "control.sessionOptions": { "$ref": "#/$defs/unavailableCapability" },
109
+ "attachments": { "$ref": "#/$defs/unavailableCapability" },
110
+ "approve": { "$ref": "#/$defs/unavailableCapability" },
111
+ "reviewActions": { "$ref": "#/$defs/unavailableCapability" }
112
+ }
113
+ }
114
+ }
115
+ }
116
+ },
117
+ {
118
+ "if": { "properties": { "mode": { "const": "control-enabled" } } },
119
+ "then": {
120
+ "properties": {
121
+ "capabilities": {
122
+ "type": "object",
123
+ "properties": {
124
+ "inspect": { "$ref": "#/$defs/availableInspectCapability" }
125
+ },
126
+ "anyOf": [
127
+ {
128
+ "type": "object",
129
+ "properties": {
130
+ "control.chat": {
131
+ "type": "object",
132
+ "properties": { "status": { "const": "available" } }
133
+ }
134
+ }
135
+ },
136
+ {
137
+ "type": "object",
138
+ "properties": {
139
+ "control.lifecycle": {
140
+ "type": "object",
141
+ "properties": { "status": { "const": "available" } }
142
+ }
143
+ }
144
+ },
145
+ {
146
+ "type": "object",
147
+ "properties": {
148
+ "control.resumeAndContinue": {
149
+ "type": "object",
150
+ "properties": { "status": { "const": "available" } }
151
+ }
152
+ }
153
+ },
154
+ {
155
+ "type": "object",
156
+ "properties": {
157
+ "control.sessionOptions": {
158
+ "type": "object",
159
+ "properties": { "status": { "const": "available" } }
160
+ }
161
+ }
162
+ },
163
+ {
164
+ "type": "object",
165
+ "properties": {
166
+ "attachments": {
167
+ "type": "object",
168
+ "properties": { "status": { "const": "available" } }
169
+ }
170
+ }
171
+ },
172
+ {
173
+ "type": "object",
174
+ "properties": {
175
+ "approve": {
176
+ "type": "object",
177
+ "properties": { "status": { "const": "available" } }
178
+ }
179
+ }
180
+ },
181
+ {
182
+ "type": "object",
183
+ "properties": {
184
+ "reviewActions": {
185
+ "type": "object",
186
+ "properties": { "status": { "const": "available" } }
187
+ }
188
+ }
189
+ }
190
+ ]
191
+ }
192
+ }
193
+ }
194
+ },
195
+ {
196
+ "if": {
197
+ "type": "object",
198
+ "required": ["capabilities"],
199
+ "properties": {
200
+ "capabilities": {
201
+ "type": "object",
202
+ "required": ["control.resumeAndContinue"],
203
+ "properties": {
204
+ "control.resumeAndContinue": {
205
+ "type": "object",
206
+ "required": ["status"],
207
+ "properties": {
208
+ "status": { "const": "available" }
209
+ }
210
+ }
211
+ }
212
+ }
213
+ }
214
+ },
215
+ "then": {
216
+ "properties": {
217
+ "capabilities": {
218
+ "type": "object",
219
+ "properties": {
220
+ "control.chat": {
221
+ "type": "object",
222
+ "properties": {
223
+ "status": { "const": "available" }
224
+ }
225
+ },
226
+ "control.lifecycle": {
227
+ "type": "object",
228
+ "properties": {
229
+ "status": { "const": "available" },
230
+ "actions": {
231
+ "type": "object",
232
+ "properties": {
233
+ "resume": {
234
+ "type": "object",
235
+ "properties": {
236
+ "available": { "const": true }
237
+ }
238
+ }
239
+ }
240
+ }
241
+ }
242
+ }
243
+ }
244
+ }
245
+ }
246
+ }
247
+ },
248
+ {
249
+ "if": {
250
+ "type": "object",
251
+ "required": ["compatibility"],
252
+ "properties": {
253
+ "compatibility": {
254
+ "type": "object",
255
+ "required": ["state"],
256
+ "properties": {
257
+ "state": { "enum": ["incompatible", "resync-required"] }
258
+ }
259
+ }
260
+ }
261
+ },
262
+ "then": {
263
+ "properties": {
264
+ "mode": { "enum": ["unavailable", "inspect-only"] },
265
+ "capabilities": {
266
+ "type": "object",
267
+ "properties": {
268
+ "control.chat": { "$ref": "#/$defs/unavailableCapability" },
269
+ "control.lifecycle": { "$ref": "#/$defs/unavailableCapability" },
270
+ "control.resumeAndContinue": { "$ref": "#/$defs/unavailableCapability" },
271
+ "control.sessionOptions": { "$ref": "#/$defs/unavailableCapability" },
272
+ "attachments": { "$ref": "#/$defs/unavailableCapability" },
273
+ "approve": { "$ref": "#/$defs/unavailableCapability" },
274
+ "reviewActions": { "$ref": "#/$defs/unavailableCapability" }
275
+ }
276
+ }
277
+ }
278
+ }
279
+ }
280
+ ],
281
+ "$defs": {
282
+ "unavailableCapability": {
283
+ "type": "object",
284
+ "additionalProperties": false,
285
+ "required": ["status", "version", "reason"],
286
+ "properties": {
287
+ "status": { "const": "unavailable" },
288
+ "version": { "type": "null" },
289
+ "reason": { "$ref": "common-v1.schema.json#/$defs/stateReason" }
290
+ }
291
+ },
292
+ "availableCapabilityBase": {
293
+ "type": "object",
294
+ "required": ["status", "version", "reason"],
295
+ "properties": {
296
+ "status": { "const": "available" },
297
+ "version": { "const": 1 },
298
+ "reason": { "type": "null" }
299
+ }
300
+ },
301
+ "availableInspectCapability": {
302
+ "allOf": [
303
+ { "$ref": "#/$defs/availableCapabilityBase" },
304
+ {
305
+ "type": "object",
306
+ "additionalProperties": false,
307
+ "required": ["status", "version", "reason", "sourceViews"],
308
+ "properties": {
309
+ "status": { "const": "available" },
310
+ "version": { "const": 1 },
311
+ "reason": { "type": "null" },
312
+ "sourceViews": {
313
+ "type": "array",
314
+ "minItems": 1,
315
+ "maxItems": 3,
316
+ "uniqueItems": true,
317
+ "items": { "enum": ["task", "working-tree", "staged"] }
318
+ }
319
+ }
320
+ }
321
+ ]
322
+ },
323
+ "inspectCapability": {
324
+ "oneOf": [
325
+ { "$ref": "#/$defs/availableInspectCapability" },
326
+ { "$ref": "#/$defs/unavailableCapability" }
327
+ ]
328
+ },
329
+ "actionAvailability": {
330
+ "oneOf": [
331
+ {
332
+ "type": "object",
333
+ "additionalProperties": false,
334
+ "required": ["available", "reasonCode"],
335
+ "properties": {
336
+ "available": { "const": true },
337
+ "reasonCode": { "type": "null" }
338
+ }
339
+ },
340
+ {
341
+ "type": "object",
342
+ "additionalProperties": false,
343
+ "required": ["available", "reasonCode"],
344
+ "properties": {
345
+ "available": { "const": false },
346
+ "reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" }
347
+ }
348
+ }
349
+ ]
350
+ },
351
+ "availableChatCapability": {
352
+ "type": "object",
353
+ "additionalProperties": false,
354
+ "required": ["status", "version", "reason", "queuePersistence", "actions"],
355
+ "properties": {
356
+ "status": { "const": "available" },
357
+ "version": { "const": 1 },
358
+ "reason": { "type": "null" },
359
+ "queuePersistence": { "enum": ["runtime-lifetime", "runtime-restart-revalidation"] },
360
+ "actions": {
361
+ "type": "object",
362
+ "additionalProperties": false,
363
+ "required": ["send", "hold", "editHeld", "deleteHeld", "dispatchHeld", "interruptAndSend"],
364
+ "properties": {
365
+ "send": { "$ref": "#/$defs/actionAvailability" },
366
+ "hold": { "$ref": "#/$defs/actionAvailability" },
367
+ "editHeld": { "$ref": "#/$defs/actionAvailability" },
368
+ "deleteHeld": { "$ref": "#/$defs/actionAvailability" },
369
+ "dispatchHeld": { "$ref": "#/$defs/actionAvailability" },
370
+ "interruptAndSend": { "$ref": "#/$defs/actionAvailability" }
371
+ }
372
+ }
373
+ }
374
+ },
375
+ "chatCapability": {
376
+ "oneOf": [
377
+ { "$ref": "#/$defs/availableChatCapability" },
378
+ { "$ref": "#/$defs/unavailableCapability" }
379
+ ]
380
+ },
381
+ "operationPhase": {
382
+ "$ref": "common-v1.schema.json#/$defs/operationPhase"
383
+ },
384
+ "phaseStopSupport": {
385
+ "oneOf": [
386
+ {
387
+ "type": "object",
388
+ "additionalProperties": false,
389
+ "required": ["stop", "reasonCode"],
390
+ "properties": {
391
+ "stop": { "const": "supported" },
392
+ "reasonCode": { "type": "null" }
393
+ }
394
+ },
395
+ {
396
+ "type": "object",
397
+ "additionalProperties": false,
398
+ "required": ["stop", "reasonCode"],
399
+ "properties": {
400
+ "stop": { "enum": ["unsupported", "unknown"] },
401
+ "reasonCode": { "$ref": "common-v1.schema.json#/$defs/reasonCode" }
402
+ }
403
+ }
404
+ ]
405
+ },
406
+ "availableLifecycleCapability": {
407
+ "type": "object",
408
+ "additionalProperties": false,
409
+ "required": ["status", "version", "reason", "currentPhase", "actions", "stopPhaseSupport"],
410
+ "properties": {
411
+ "status": { "const": "available" },
412
+ "version": { "const": 1 },
413
+ "reason": { "type": "null" },
414
+ "currentPhase": { "$ref": "#/$defs/operationPhase" },
415
+ "actions": {
416
+ "type": "object",
417
+ "additionalProperties": false,
418
+ "required": ["pause", "resume"],
419
+ "properties": {
420
+ "pause": { "$ref": "#/$defs/actionAvailability" },
421
+ "resume": { "$ref": "#/$defs/actionAvailability" }
422
+ }
423
+ },
424
+ "stopPhaseSupport": {
425
+ "type": "object",
426
+ "additionalProperties": false,
427
+ "required": [
428
+ "idle",
429
+ "input-preflight",
430
+ "model",
431
+ "tool-preflight",
432
+ "waiting-approval",
433
+ "tool",
434
+ "retry",
435
+ "compaction",
436
+ "branch-summary",
437
+ "direct-bash",
438
+ "settling",
439
+ "other",
440
+ "unknown"
441
+ ],
442
+ "properties": {
443
+ "idle": { "$ref": "#/$defs/phaseStopSupport" },
444
+ "input-preflight": { "$ref": "#/$defs/phaseStopSupport" },
445
+ "model": { "$ref": "#/$defs/phaseStopSupport" },
446
+ "tool-preflight": { "$ref": "#/$defs/phaseStopSupport" },
447
+ "waiting-approval": { "$ref": "#/$defs/phaseStopSupport" },
448
+ "tool": { "$ref": "#/$defs/phaseStopSupport" },
449
+ "retry": { "$ref": "#/$defs/phaseStopSupport" },
450
+ "compaction": { "$ref": "#/$defs/phaseStopSupport" },
451
+ "branch-summary": { "$ref": "#/$defs/phaseStopSupport" },
452
+ "direct-bash": { "$ref": "#/$defs/phaseStopSupport" },
453
+ "settling": { "$ref": "#/$defs/phaseStopSupport" },
454
+ "other": { "$ref": "#/$defs/phaseStopSupport" },
455
+ "unknown": { "$ref": "#/$defs/phaseStopSupport" }
456
+ }
457
+ }
458
+ }
459
+ },
460
+ "lifecycleCapability": {
461
+ "oneOf": [
462
+ { "$ref": "#/$defs/availableLifecycleCapability" },
463
+ { "$ref": "#/$defs/unavailableCapability" }
464
+ ]
465
+ },
466
+ "availableResumeAndContinueCapability": {
467
+ "type": "object",
468
+ "additionalProperties": false,
469
+ "required": ["status", "version", "reason", "delivery", "requires"],
470
+ "properties": {
471
+ "status": { "const": "available" },
472
+ "version": { "const": 1 },
473
+ "reason": { "type": "null" },
474
+ "delivery": { "const": "new-operation" },
475
+ "requires": {
476
+ "type": "array",
477
+ "minItems": 2,
478
+ "maxItems": 2,
479
+ "uniqueItems": true,
480
+ "prefixItems": [
481
+ { "const": "control.lifecycle" },
482
+ { "const": "control.chat" }
483
+ ],
484
+ "items": false
485
+ }
486
+ }
487
+ },
488
+ "resumeAndContinueCapability": {
489
+ "oneOf": [
490
+ { "$ref": "#/$defs/availableResumeAndContinueCapability" },
491
+ { "$ref": "#/$defs/unavailableCapability" }
492
+ ]
493
+ },
494
+ "availableSessionOptionsCapability": {
495
+ "type": "object",
496
+ "additionalProperties": false,
497
+ "required": ["status", "version", "reason", "effectScope", "allowedLifecyclePoints", "actions"],
498
+ "properties": {
499
+ "status": { "const": "available" },
500
+ "version": { "const": 1 },
501
+ "reason": { "type": "null" },
502
+ "effectScope": { "enum": ["session", "session-and-user-default"] },
503
+ "allowedLifecyclePoints": {
504
+ "type": "array",
505
+ "minItems": 1,
506
+ "maxItems": 2,
507
+ "uniqueItems": true,
508
+ "items": { "enum": ["idle", "pre-fresh-task"] }
509
+ },
510
+ "actions": {
511
+ "type": "object",
512
+ "additionalProperties": false,
513
+ "required": ["setModel", "setThinking"],
514
+ "properties": {
515
+ "setModel": { "$ref": "#/$defs/actionAvailability" },
516
+ "setThinking": { "$ref": "#/$defs/actionAvailability" }
517
+ }
518
+ }
519
+ }
520
+ },
521
+ "sessionOptionsCapability": {
522
+ "oneOf": [
523
+ { "$ref": "#/$defs/availableSessionOptionsCapability" },
524
+ { "$ref": "#/$defs/unavailableCapability" }
525
+ ]
526
+ },
527
+ "availableAttachmentsCapability": {
528
+ "type": "object",
529
+ "additionalProperties": false,
530
+ "required": ["status", "version", "reason", "kinds", "mimeTypes"],
531
+ "properties": {
532
+ "status": { "const": "available" },
533
+ "version": { "const": 1 },
534
+ "reason": { "type": "null" },
535
+ "kinds": {
536
+ "type": "array",
537
+ "minItems": 1,
538
+ "maxItems": 2,
539
+ "uniqueItems": true,
540
+ "items": { "enum": ["file", "image"] }
541
+ },
542
+ "mimeTypes": {
543
+ "type": "array",
544
+ "minItems": 1,
545
+ "maxItems": 64,
546
+ "uniqueItems": true,
547
+ "items": {
548
+ "type": "string",
549
+ "minLength": 3,
550
+ "maxLength": 127,
551
+ "pattern": "^[a-z0-9!#$&^_.+-]+/[a-z0-9!#$&^_.+*-]+$"
552
+ }
553
+ }
554
+ }
555
+ },
556
+ "attachmentsCapability": {
557
+ "oneOf": [
558
+ { "$ref": "#/$defs/availableAttachmentsCapability" },
559
+ { "$ref": "#/$defs/unavailableCapability" }
560
+ ]
561
+ },
562
+ "availableApproveCapability": {
563
+ "type": "object",
564
+ "additionalProperties": false,
565
+ "required": ["status", "version", "reason", "decisions", "arbitration"],
566
+ "properties": {
567
+ "status": { "const": "available" },
568
+ "version": { "const": 1 },
569
+ "reason": { "type": "null" },
570
+ "decisions": {
571
+ "type": "array",
572
+ "minItems": 2,
573
+ "maxItems": 2,
574
+ "uniqueItems": true,
575
+ "items": { "enum": ["allow", "deny"] }
576
+ },
577
+ "arbitration": { "const": "first-valid-cas" }
578
+ }
579
+ },
580
+ "approveCapability": {
581
+ "oneOf": [
582
+ { "$ref": "#/$defs/availableApproveCapability" },
583
+ { "$ref": "#/$defs/unavailableCapability" }
584
+ ]
585
+ },
586
+ "availableReviewActionsCapability": {
587
+ "type": "object",
588
+ "additionalProperties": false,
589
+ "required": ["status", "version", "reason", "actions"],
590
+ "properties": {
591
+ "status": { "const": "available" },
592
+ "version": { "const": 1 },
593
+ "reason": { "type": "null" },
594
+ "actions": {
595
+ "type": "object",
596
+ "additionalProperties": false,
597
+ "required": [
598
+ "reviewMark",
599
+ "stage",
600
+ "unstage",
601
+ "revert",
602
+ "openInVsCode",
603
+ "generateCommitSummaryDeterministic",
604
+ "generateCommitSummaryModel"
605
+ ],
606
+ "properties": {
607
+ "reviewMark": { "$ref": "#/$defs/actionAvailability" },
608
+ "stage": { "$ref": "#/$defs/actionAvailability" },
609
+ "unstage": { "$ref": "#/$defs/actionAvailability" },
610
+ "revert": { "$ref": "#/$defs/actionAvailability" },
611
+ "openInVsCode": { "$ref": "#/$defs/actionAvailability" },
612
+ "generateCommitSummaryDeterministic": { "$ref": "#/$defs/actionAvailability" },
613
+ "generateCommitSummaryModel": { "$ref": "#/$defs/actionAvailability" }
614
+ }
615
+ }
616
+ }
617
+ },
618
+ "reviewActionsCapability": {
619
+ "oneOf": [
620
+ { "$ref": "#/$defs/availableReviewActionsCapability" },
621
+ { "$ref": "#/$defs/unavailableCapability" }
622
+ ]
623
+ },
624
+ "compatibility": {
625
+ "type": "object",
626
+ "additionalProperties": false,
627
+ "required": ["state", "reason"],
628
+ "properties": {
629
+ "state": { "enum": ["compatible", "degraded", "incompatible", "resync-required"] },
630
+ "reason": {
631
+ "anyOf": [
632
+ { "$ref": "common-v1.schema.json#/$defs/stateReason" },
633
+ { "type": "null" }
634
+ ]
635
+ }
636
+ },
637
+ "allOf": [
638
+ {
639
+ "if": { "properties": { "state": { "const": "compatible" } } },
640
+ "then": { "properties": { "reason": { "type": "null" } } },
641
+ "else": { "properties": { "reason": { "$ref": "common-v1.schema.json#/$defs/stateReason" } } }
642
+ }
643
+ ]
644
+ },
645
+ "availableBuildIdentity": {
646
+ "type": "object",
647
+ "additionalProperties": false,
648
+ "required": ["state", "buildId", "version", "reason"],
649
+ "properties": {
650
+ "state": { "const": "available" },
651
+ "buildId": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" },
652
+ "version": {
653
+ "type": "string",
654
+ "minLength": 1,
655
+ "maxLength": 160,
656
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._+~-]{0,159}$"
657
+ },
658
+ "reason": { "type": "null" }
659
+ }
660
+ },
661
+ "unavailableBuildIdentity": {
662
+ "type": "object",
663
+ "additionalProperties": false,
664
+ "required": ["state", "buildId", "version", "reason"],
665
+ "properties": {
666
+ "state": { "const": "unavailable" },
667
+ "buildId": { "type": "null" },
668
+ "version": { "type": "null" },
669
+ "reason": { "$ref": "common-v1.schema.json#/$defs/stateReason" }
670
+ }
671
+ },
672
+ "buildIdentity": {
673
+ "oneOf": [
674
+ { "$ref": "#/$defs/availableBuildIdentity" },
675
+ { "$ref": "#/$defs/unavailableBuildIdentity" }
676
+ ]
677
+ },
678
+ "replay": {
679
+ "type": "object",
680
+ "additionalProperties": false,
681
+ "required": ["eventRetentionCount", "eventRetentionSeconds", "resyncSupported"],
682
+ "properties": {
683
+ "eventRetentionCount": { "type": "integer", "minimum": 0, "maximum": 1000000 },
684
+ "eventRetentionSeconds": { "type": "integer", "minimum": 0, "maximum": 2592000 },
685
+ "resyncSupported": { "const": true }
686
+ }
687
+ },
688
+ "resourceLimits": {
689
+ "type": "object",
690
+ "additionalProperties": false,
691
+ "required": [
692
+ "maxRequestBodyBytes",
693
+ "maxEventPayloadBytes",
694
+ "maxReplayEvents",
695
+ "maxDiffBytes",
696
+ "maxDiffLines",
697
+ "maxDiffHunks",
698
+ "maxLogPreviewBytes",
699
+ "maxLogPreviewLines",
700
+ "maxAttachmentCount",
701
+ "maxAttachmentFileBytes",
702
+ "maxAttachmentTotalBytes",
703
+ "maxQueueItems",
704
+ "maxMessageBytes",
705
+ "maxSseClients",
706
+ "maxGitProcesses",
707
+ "requestTimeoutMs"
708
+ ],
709
+ "properties": {
710
+ "maxRequestBodyBytes": { "type": "integer", "minimum": 1024, "maximum": 104857600 },
711
+ "maxEventPayloadBytes": { "type": "integer", "minimum": 256, "maximum": 10485760 },
712
+ "maxReplayEvents": { "type": "integer", "minimum": 0, "maximum": 100000 },
713
+ "maxDiffBytes": { "type": "integer", "minimum": 1024, "maximum": 52428800 },
714
+ "maxDiffLines": { "type": "integer", "minimum": 1, "maximum": 200000 },
715
+ "maxDiffHunks": { "type": "integer", "minimum": 1, "maximum": 10000 },
716
+ "maxLogPreviewBytes": { "type": "integer", "minimum": 256, "maximum": 1048576 },
717
+ "maxLogPreviewLines": { "type": "integer", "minimum": 1, "maximum": 10000 },
718
+ "maxAttachmentCount": { "type": "integer", "minimum": 0, "maximum": 64 },
719
+ "maxAttachmentFileBytes": { "type": "integer", "minimum": 0, "maximum": 104857600 },
720
+ "maxAttachmentTotalBytes": { "type": "integer", "minimum": 0, "maximum": 536870912 },
721
+ "maxQueueItems": { "type": "integer", "minimum": 0, "maximum": 1000 },
722
+ "maxMessageBytes": { "type": "integer", "minimum": 1, "maximum": 1048576 },
723
+ "maxSseClients": { "type": "integer", "minimum": 1, "maximum": 64 },
724
+ "maxGitProcesses": { "type": "integer", "minimum": 1, "maximum": 32 },
725
+ "requestTimeoutMs": { "type": "integer", "minimum": 100, "maximum": 300000 }
726
+ }
727
+ }
728
+ }
729
+ }