@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,1780 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://piagent.io.vn/schemas/piagent-webui/control-command-v1.schema.json",
4
+ "title": "Piagent WebUI control command and receipt v1",
5
+ "oneOf": [
6
+ {
7
+ "$ref": "#/$defs/command"
8
+ },
9
+ {
10
+ "$ref": "#/$defs/receipt"
11
+ }
12
+ ],
13
+ "$defs": {
14
+ "action": {
15
+ "enum": [
16
+ "chat.send",
17
+ "queue.update",
18
+ "queue.delete",
19
+ "queue.dispatch",
20
+ "lifecycle.stop",
21
+ "lifecycle.pause",
22
+ "lifecycle.resume",
23
+ "lifecycle.resume-and-continue",
24
+ "session-options.set-model",
25
+ "session-options.set-thinking",
26
+ "review.mark",
27
+ "source.stage",
28
+ "source.unstage",
29
+ "source.revert",
30
+ "source.open-in-vscode",
31
+ "commit-summary.generate"
32
+ ]
33
+ },
34
+ "capabilityScope": {
35
+ "enum": [
36
+ "control.chat",
37
+ "control.lifecycle",
38
+ "control.resumeAndContinue",
39
+ "control.sessionOptions",
40
+ "reviewActions"
41
+ ]
42
+ },
43
+ "expectedRevisions": {
44
+ "type": "object",
45
+ "additionalProperties": false,
46
+ "required": [
47
+ "runtimeRevision",
48
+ "taskRevision",
49
+ "controlRevision",
50
+ "workspaceRevision",
51
+ "indexRevision",
52
+ "approvalRevision",
53
+ "sessionOptionRevision",
54
+ "queueRevision",
55
+ "workspacePreimage",
56
+ "indexPreimage",
57
+ "patchPreimage"
58
+ ],
59
+ "properties": {
60
+ "runtimeRevision": {
61
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
62
+ },
63
+ "taskRevision": {
64
+ "$ref": "common-v1.schema.json#/$defs/nullableRevisionToken"
65
+ },
66
+ "controlRevision": {
67
+ "$ref": "common-v1.schema.json#/$defs/nullableRevisionToken"
68
+ },
69
+ "workspaceRevision": {
70
+ "$ref": "common-v1.schema.json#/$defs/nullableRevisionToken"
71
+ },
72
+ "indexRevision": {
73
+ "$ref": "common-v1.schema.json#/$defs/nullableRevisionToken"
74
+ },
75
+ "approvalRevision": {
76
+ "$ref": "common-v1.schema.json#/$defs/nullableRevisionToken"
77
+ },
78
+ "sessionOptionRevision": {
79
+ "$ref": "common-v1.schema.json#/$defs/nullableRevisionToken"
80
+ },
81
+ "queueRevision": {
82
+ "$ref": "common-v1.schema.json#/$defs/nullableRevisionToken"
83
+ },
84
+ "workspacePreimage": {
85
+ "anyOf": [
86
+ {
87
+ "$ref": "common-v1.schema.json#/$defs/workingTreeDigest"
88
+ },
89
+ {
90
+ "type": "null"
91
+ }
92
+ ]
93
+ },
94
+ "indexPreimage": {
95
+ "anyOf": [
96
+ {
97
+ "$ref": "common-v1.schema.json#/$defs/digest"
98
+ },
99
+ {
100
+ "type": "null"
101
+ }
102
+ ]
103
+ },
104
+ "patchPreimage": {
105
+ "anyOf": [
106
+ {
107
+ "$ref": "common-v1.schema.json#/$defs/digest"
108
+ },
109
+ {
110
+ "type": "null"
111
+ }
112
+ ]
113
+ }
114
+ }
115
+ },
116
+ "messageContent": {
117
+ "type": "object",
118
+ "additionalProperties": false,
119
+ "required": [
120
+ "messageRequestId",
121
+ "capabilityAction",
122
+ "delivery",
123
+ "text",
124
+ "attachmentRefs",
125
+ "contentDigest"
126
+ ],
127
+ "properties": {
128
+ "messageRequestId": {
129
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
130
+ },
131
+ "capabilityAction": {
132
+ "enum": ["send", "hold", "interruptAndSend"]
133
+ },
134
+ "delivery": {
135
+ "enum": [
136
+ "new-operation",
137
+ "steer",
138
+ "follow-up",
139
+ "hold"
140
+ ]
141
+ },
142
+ "text": {
143
+ "type": "string",
144
+ "minLength": 1,
145
+ "maxLength": 65536,
146
+ "pattern": "^[^\\u0000]*$"
147
+ },
148
+ "attachmentRefs": {
149
+ "type": "array",
150
+ "maxItems": 16,
151
+ "uniqueItems": true,
152
+ "items": {
153
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
154
+ }
155
+ },
156
+ "contentDigest": {
157
+ "$ref": "common-v1.schema.json#/$defs/digest"
158
+ }
159
+ },
160
+ "allOf": [
161
+ {
162
+ "if": {
163
+ "type": "object",
164
+ "properties": { "delivery": { "enum": ["new-operation", "follow-up"] } },
165
+ "required": ["delivery"]
166
+ },
167
+ "then": {
168
+ "type": "object",
169
+ "properties": { "capabilityAction": { "const": "send" } }
170
+ }
171
+ },
172
+ {
173
+ "if": {
174
+ "type": "object",
175
+ "properties": { "delivery": { "const": "hold" } },
176
+ "required": ["delivery"]
177
+ },
178
+ "then": {
179
+ "type": "object",
180
+ "properties": { "capabilityAction": { "const": "hold" } }
181
+ }
182
+ },
183
+ {
184
+ "if": {
185
+ "type": "object",
186
+ "properties": { "delivery": { "const": "steer" } },
187
+ "required": ["delivery"]
188
+ },
189
+ "then": {
190
+ "type": "object",
191
+ "properties": { "capabilityAction": { "const": "interruptAndSend" } }
192
+ }
193
+ }
194
+ ]
195
+ },
196
+ "queueUpdatePayload": {
197
+ "type": "object",
198
+ "additionalProperties": false,
199
+ "required": [
200
+ "queueItemRef",
201
+ "text",
202
+ "attachmentRefs",
203
+ "contentDigest"
204
+ ],
205
+ "properties": {
206
+ "queueItemRef": {
207
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
208
+ },
209
+ "text": {
210
+ "type": "string",
211
+ "minLength": 1,
212
+ "maxLength": 65536,
213
+ "pattern": "^[^\\u0000]*$"
214
+ },
215
+ "attachmentRefs": {
216
+ "type": "array",
217
+ "maxItems": 16,
218
+ "uniqueItems": true,
219
+ "items": {
220
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
221
+ }
222
+ },
223
+ "contentDigest": {
224
+ "$ref": "common-v1.schema.json#/$defs/digest"
225
+ }
226
+ }
227
+ },
228
+ "queueDeletePayload": {
229
+ "type": "object",
230
+ "additionalProperties": false,
231
+ "required": [
232
+ "queueItemRef"
233
+ ],
234
+ "properties": {
235
+ "queueItemRef": {
236
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
237
+ }
238
+ }
239
+ },
240
+ "queueDispatchPayload": {
241
+ "type": "object",
242
+ "additionalProperties": false,
243
+ "required": [
244
+ "queueItemRef",
245
+ "messageRequestId"
246
+ ],
247
+ "properties": {
248
+ "queueItemRef": {
249
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
250
+ },
251
+ "messageRequestId": {
252
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
253
+ }
254
+ }
255
+ },
256
+ "stopPayload": {
257
+ "type": "object",
258
+ "additionalProperties": false,
259
+ "required": [
260
+ "requestedScope"
261
+ ],
262
+ "properties": {
263
+ "requestedScope": {
264
+ "const": "current-agent-operation"
265
+ }
266
+ }
267
+ },
268
+ "pausePayload": {
269
+ "type": "object",
270
+ "additionalProperties": false,
271
+ "required": [
272
+ "safePointPolicy"
273
+ ],
274
+ "properties": {
275
+ "safePointPolicy": {
276
+ "const": "after-current-atomic-unit"
277
+ }
278
+ }
279
+ },
280
+ "emptyPayload": {
281
+ "type": "object",
282
+ "additionalProperties": false,
283
+ "maxProperties": 0
284
+ },
285
+ "modelPayload": {
286
+ "type": "object",
287
+ "additionalProperties": false,
288
+ "required": [
289
+ "modelRef",
290
+ "effectScopeAcknowledged"
291
+ ],
292
+ "properties": {
293
+ "modelRef": {
294
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
295
+ },
296
+ "effectScopeAcknowledged": {
297
+ "enum": [
298
+ "session",
299
+ "session-and-user-default"
300
+ ]
301
+ }
302
+ }
303
+ },
304
+ "thinkingPayload": {
305
+ "type": "object",
306
+ "additionalProperties": false,
307
+ "required": [
308
+ "thinkingLevel",
309
+ "effectScopeAcknowledged"
310
+ ],
311
+ "properties": {
312
+ "thinkingLevel": {
313
+ "enum": [
314
+ "off",
315
+ "minimal",
316
+ "low",
317
+ "medium",
318
+ "high",
319
+ "xhigh",
320
+ "max"
321
+ ]
322
+ },
323
+ "effectScopeAcknowledged": {
324
+ "enum": [
325
+ "session",
326
+ "session-and-user-default"
327
+ ]
328
+ }
329
+ }
330
+ },
331
+ "reviewMarkPayload": {
332
+ "type": "object",
333
+ "additionalProperties": false,
334
+ "required": [
335
+ "view",
336
+ "fileRef",
337
+ "diffRef",
338
+ "reviewState",
339
+ "contentDigest"
340
+ ],
341
+ "properties": {
342
+ "view": {
343
+ "$ref": "source-change-v1.schema.json#/$defs/view"
344
+ },
345
+ "fileRef": {
346
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
347
+ },
348
+ "diffRef": {
349
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
350
+ },
351
+ "reviewState": {
352
+ "enum": [
353
+ "reviewed",
354
+ "unreviewed"
355
+ ]
356
+ },
357
+ "contentDigest": {
358
+ "$ref": "common-v1.schema.json#/$defs/digest"
359
+ }
360
+ }
361
+ },
362
+ "sourceMutationPayload": {
363
+ "type": "object",
364
+ "additionalProperties": false,
365
+ "required": [
366
+ "fileRef",
367
+ "hunkRefs",
368
+ "contentDigest"
369
+ ],
370
+ "properties": {
371
+ "fileRef": {
372
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
373
+ },
374
+ "hunkRefs": {
375
+ "type": "array",
376
+ "maxItems": 128,
377
+ "uniqueItems": true,
378
+ "items": {
379
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
380
+ }
381
+ },
382
+ "contentDigest": {
383
+ "$ref": "common-v1.schema.json#/$defs/digest"
384
+ }
385
+ }
386
+ },
387
+ "revertPayload": {
388
+ "type": "object",
389
+ "additionalProperties": false,
390
+ "required": [
391
+ "fileRef",
392
+ "hunkRefs",
393
+ "previewRef",
394
+ "confirmedPreviewDigest",
395
+ "contentDigest"
396
+ ],
397
+ "properties": {
398
+ "fileRef": {
399
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
400
+ },
401
+ "hunkRefs": {
402
+ "type": "array",
403
+ "maxItems": 1,
404
+ "uniqueItems": true,
405
+ "items": {
406
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
407
+ }
408
+ },
409
+ "previewRef": {
410
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
411
+ },
412
+ "confirmedPreviewDigest": {
413
+ "$ref": "common-v1.schema.json#/$defs/digest"
414
+ },
415
+ "contentDigest": {
416
+ "$ref": "common-v1.schema.json#/$defs/digest"
417
+ }
418
+ }
419
+ },
420
+ "openPayload": {
421
+ "type": "object",
422
+ "additionalProperties": false,
423
+ "required": [
424
+ "fileRef",
425
+ "line",
426
+ "column"
427
+ ],
428
+ "properties": {
429
+ "fileRef": {
430
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
431
+ },
432
+ "line": {
433
+ "type": [
434
+ "integer",
435
+ "null"
436
+ ],
437
+ "minimum": 1,
438
+ "maximum": 100000000
439
+ },
440
+ "column": {
441
+ "type": [
442
+ "integer",
443
+ "null"
444
+ ],
445
+ "minimum": 1,
446
+ "maximum": 1000000
447
+ }
448
+ },
449
+ "allOf": [
450
+ {
451
+ "if": {
452
+ "properties": { "column": { "type": "integer" } },
453
+ "required": ["column"]
454
+ },
455
+ "then": {
456
+ "properties": { "line": { "type": "integer" } }
457
+ }
458
+ }
459
+ ]
460
+ },
461
+ "commitSummaryPayload": {
462
+ "type": "object",
463
+ "additionalProperties": false,
464
+ "required": [
465
+ "mode",
466
+ "modelTurnAcknowledged"
467
+ ],
468
+ "properties": {
469
+ "mode": {
470
+ "enum": [
471
+ "deterministic",
472
+ "model"
473
+ ]
474
+ },
475
+ "modelTurnAcknowledged": {
476
+ "type": "boolean"
477
+ }
478
+ },
479
+ "allOf": [
480
+ {
481
+ "if": {
482
+ "properties": {
483
+ "mode": {
484
+ "const": "model"
485
+ }
486
+ },
487
+ "type": "object"
488
+ },
489
+ "then": {
490
+ "properties": {
491
+ "modelTurnAcknowledged": {
492
+ "const": true
493
+ }
494
+ },
495
+ "type": "object"
496
+ }
497
+ },
498
+ {
499
+ "if": {
500
+ "properties": {
501
+ "mode": {
502
+ "const": "deterministic"
503
+ }
504
+ },
505
+ "type": "object"
506
+ },
507
+ "then": {
508
+ "properties": {
509
+ "modelTurnAcknowledged": {
510
+ "const": false
511
+ }
512
+ },
513
+ "type": "object"
514
+ }
515
+ }
516
+ ]
517
+ },
518
+ "command": {
519
+ "type": "object",
520
+ "additionalProperties": false,
521
+ "required": [
522
+ "schemaVersion",
523
+ "version",
524
+ "messageType",
525
+ "commandId",
526
+ "idempotencyKey",
527
+ "requestedAt",
528
+ "expiresAt",
529
+ "capabilityScope",
530
+ "action",
531
+ "actionDigest",
532
+ "identity",
533
+ "expectedRevisions",
534
+ "payload"
535
+ ],
536
+ "properties": {
537
+ "schemaVersion": {
538
+ "const": 1
539
+ },
540
+ "version": {
541
+ "const": "piagent-webui-control-v1"
542
+ },
543
+ "messageType": {
544
+ "const": "command"
545
+ },
546
+ "commandId": {
547
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
548
+ },
549
+ "idempotencyKey": {
550
+ "type": "string",
551
+ "minLength": 32,
552
+ "maxLength": 128,
553
+ "pattern": "^[A-Za-z0-9._~-]+$"
554
+ },
555
+ "requestedAt": {
556
+ "$ref": "common-v1.schema.json#/$defs/timestamp"
557
+ },
558
+ "expiresAt": {
559
+ "$ref": "common-v1.schema.json#/$defs/timestamp"
560
+ },
561
+ "capabilityScope": {
562
+ "$ref": "#/$defs/capabilityScope"
563
+ },
564
+ "action": {
565
+ "$ref": "#/$defs/action"
566
+ },
567
+ "actionDigest": {
568
+ "$ref": "common-v1.schema.json#/$defs/digest"
569
+ },
570
+ "identity": {
571
+ "$ref": "common-v1.schema.json#/$defs/identity"
572
+ },
573
+ "expectedRevisions": {
574
+ "$ref": "#/$defs/expectedRevisions"
575
+ },
576
+ "payload": {
577
+ "type": "object",
578
+ "maxProperties": 6
579
+ }
580
+ },
581
+ "allOf": [
582
+ {
583
+ "$ref": "#/$defs/commandActionBindings"
584
+ }
585
+ ]
586
+ },
587
+ "commandActionBindings": {
588
+ "allOf": [
589
+ {
590
+ "if": {
591
+ "properties": {
592
+ "action": {
593
+ "const": "chat.send"
594
+ }
595
+ },
596
+ "type": "object"
597
+ },
598
+ "then": {
599
+ "properties": {
600
+ "capabilityScope": {
601
+ "const": "control.chat"
602
+ },
603
+ "payload": {
604
+ "$ref": "#/$defs/messageContent"
605
+ },
606
+ "expectedRevisions": {
607
+ "properties": {
608
+ "queueRevision": {
609
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
610
+ }
611
+ },
612
+ "type": "object"
613
+ }
614
+ },
615
+ "type": "object"
616
+ }
617
+ },
618
+ {
619
+ "if": {
620
+ "properties": {
621
+ "action": {
622
+ "const": "queue.update"
623
+ }
624
+ },
625
+ "type": "object"
626
+ },
627
+ "then": {
628
+ "properties": {
629
+ "capabilityScope": {
630
+ "const": "control.chat"
631
+ },
632
+ "payload": {
633
+ "$ref": "#/$defs/queueUpdatePayload"
634
+ },
635
+ "expectedRevisions": {
636
+ "properties": {
637
+ "queueRevision": {
638
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
639
+ }
640
+ },
641
+ "type": "object"
642
+ }
643
+ },
644
+ "type": "object"
645
+ }
646
+ },
647
+ {
648
+ "if": {
649
+ "properties": {
650
+ "action": {
651
+ "const": "queue.delete"
652
+ }
653
+ },
654
+ "type": "object"
655
+ },
656
+ "then": {
657
+ "properties": {
658
+ "capabilityScope": {
659
+ "const": "control.chat"
660
+ },
661
+ "payload": {
662
+ "$ref": "#/$defs/queueDeletePayload"
663
+ },
664
+ "expectedRevisions": {
665
+ "properties": {
666
+ "queueRevision": {
667
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
668
+ }
669
+ },
670
+ "type": "object"
671
+ }
672
+ },
673
+ "type": "object"
674
+ }
675
+ },
676
+ {
677
+ "if": {
678
+ "properties": {
679
+ "action": {
680
+ "const": "queue.dispatch"
681
+ }
682
+ },
683
+ "type": "object"
684
+ },
685
+ "then": {
686
+ "properties": {
687
+ "capabilityScope": {
688
+ "const": "control.chat"
689
+ },
690
+ "payload": {
691
+ "$ref": "#/$defs/queueDispatchPayload"
692
+ },
693
+ "expectedRevisions": {
694
+ "properties": {
695
+ "queueRevision": {
696
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
697
+ }
698
+ },
699
+ "type": "object"
700
+ }
701
+ },
702
+ "type": "object"
703
+ }
704
+ },
705
+ {
706
+ "if": {
707
+ "properties": {
708
+ "action": {
709
+ "const": "lifecycle.stop"
710
+ }
711
+ },
712
+ "type": "object"
713
+ },
714
+ "then": {
715
+ "properties": {
716
+ "capabilityScope": {
717
+ "const": "control.lifecycle"
718
+ },
719
+ "payload": {
720
+ "$ref": "#/$defs/stopPayload"
721
+ },
722
+ "identity": {
723
+ "properties": {
724
+ "agentOperationId": {
725
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
726
+ }
727
+ },
728
+ "type": "object"
729
+ }
730
+ },
731
+ "type": "object"
732
+ }
733
+ },
734
+ {
735
+ "if": {
736
+ "properties": {
737
+ "action": {
738
+ "const": "lifecycle.pause"
739
+ }
740
+ },
741
+ "type": "object"
742
+ },
743
+ "then": {
744
+ "properties": {
745
+ "capabilityScope": {
746
+ "const": "control.lifecycle"
747
+ },
748
+ "payload": {
749
+ "$ref": "#/$defs/pausePayload"
750
+ },
751
+ "identity": {
752
+ "properties": {
753
+ "taskId": {
754
+ "$ref": "common-v1.schema.json#/$defs/publicId"
755
+ },
756
+ "taskRunId": {
757
+ "$ref": "common-v1.schema.json#/$defs/publicId"
758
+ }
759
+ },
760
+ "type": "object"
761
+ },
762
+ "expectedRevisions": {
763
+ "properties": {
764
+ "taskRevision": {
765
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
766
+ },
767
+ "controlRevision": {
768
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
769
+ }
770
+ },
771
+ "type": "object"
772
+ }
773
+ },
774
+ "type": "object"
775
+ }
776
+ },
777
+ {
778
+ "if": {
779
+ "properties": {
780
+ "action": {
781
+ "const": "lifecycle.resume"
782
+ }
783
+ },
784
+ "type": "object"
785
+ },
786
+ "then": {
787
+ "properties": {
788
+ "capabilityScope": {
789
+ "const": "control.lifecycle"
790
+ },
791
+ "payload": {
792
+ "$ref": "#/$defs/emptyPayload"
793
+ },
794
+ "identity": {
795
+ "properties": {
796
+ "taskId": {
797
+ "$ref": "common-v1.schema.json#/$defs/publicId"
798
+ },
799
+ "taskRunId": {
800
+ "$ref": "common-v1.schema.json#/$defs/publicId"
801
+ }
802
+ },
803
+ "type": "object"
804
+ },
805
+ "expectedRevisions": {
806
+ "properties": {
807
+ "taskRevision": {
808
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
809
+ },
810
+ "controlRevision": {
811
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
812
+ }
813
+ },
814
+ "type": "object"
815
+ }
816
+ },
817
+ "type": "object"
818
+ }
819
+ },
820
+ {
821
+ "if": {
822
+ "properties": {
823
+ "action": {
824
+ "const": "lifecycle.resume-and-continue"
825
+ }
826
+ },
827
+ "type": "object"
828
+ },
829
+ "then": {
830
+ "properties": {
831
+ "capabilityScope": {
832
+ "const": "control.resumeAndContinue"
833
+ },
834
+ "payload": {
835
+ "$ref": "#/$defs/messageContent",
836
+ "properties": {
837
+ "delivery": {
838
+ "const": "new-operation"
839
+ }
840
+ },
841
+ "type": "object"
842
+ },
843
+ "identity": {
844
+ "properties": {
845
+ "taskId": {
846
+ "$ref": "common-v1.schema.json#/$defs/publicId"
847
+ },
848
+ "taskRunId": {
849
+ "$ref": "common-v1.schema.json#/$defs/publicId"
850
+ }
851
+ },
852
+ "type": "object"
853
+ },
854
+ "expectedRevisions": {
855
+ "properties": {
856
+ "taskRevision": {
857
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
858
+ },
859
+ "controlRevision": {
860
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
861
+ },
862
+ "queueRevision": {
863
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
864
+ }
865
+ },
866
+ "type": "object"
867
+ }
868
+ },
869
+ "type": "object"
870
+ }
871
+ },
872
+ {
873
+ "if": {
874
+ "properties": {
875
+ "action": {
876
+ "const": "session-options.set-model"
877
+ }
878
+ },
879
+ "type": "object"
880
+ },
881
+ "then": {
882
+ "properties": {
883
+ "capabilityScope": {
884
+ "const": "control.sessionOptions"
885
+ },
886
+ "payload": {
887
+ "$ref": "#/$defs/modelPayload"
888
+ },
889
+ "expectedRevisions": {
890
+ "properties": {
891
+ "sessionOptionRevision": {
892
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
893
+ }
894
+ },
895
+ "type": "object"
896
+ }
897
+ },
898
+ "type": "object"
899
+ }
900
+ },
901
+ {
902
+ "if": {
903
+ "properties": {
904
+ "action": {
905
+ "const": "session-options.set-thinking"
906
+ }
907
+ },
908
+ "type": "object"
909
+ },
910
+ "then": {
911
+ "properties": {
912
+ "capabilityScope": {
913
+ "const": "control.sessionOptions"
914
+ },
915
+ "payload": {
916
+ "$ref": "#/$defs/thinkingPayload"
917
+ },
918
+ "expectedRevisions": {
919
+ "properties": {
920
+ "sessionOptionRevision": {
921
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
922
+ }
923
+ },
924
+ "type": "object"
925
+ }
926
+ },
927
+ "type": "object"
928
+ }
929
+ },
930
+ {
931
+ "if": {
932
+ "properties": {
933
+ "action": {
934
+ "const": "review.mark"
935
+ }
936
+ },
937
+ "type": "object"
938
+ },
939
+ "then": {
940
+ "properties": {
941
+ "capabilityScope": {
942
+ "const": "reviewActions"
943
+ },
944
+ "payload": {
945
+ "$ref": "#/$defs/reviewMarkPayload"
946
+ },
947
+ "expectedRevisions": {
948
+ "properties": {
949
+ "taskRevision": {
950
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
951
+ },
952
+ "workspaceRevision": {
953
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
954
+ },
955
+ "patchPreimage": {
956
+ "$ref": "common-v1.schema.json#/$defs/digest"
957
+ }
958
+ },
959
+ "type": "object"
960
+ }
961
+ },
962
+ "type": "object"
963
+ }
964
+ },
965
+ {
966
+ "if": {
967
+ "properties": {
968
+ "action": {
969
+ "enum": [
970
+ "source.stage",
971
+ "source.unstage"
972
+ ]
973
+ }
974
+ },
975
+ "type": "object"
976
+ },
977
+ "then": {
978
+ "properties": {
979
+ "capabilityScope": {
980
+ "const": "reviewActions"
981
+ },
982
+ "payload": {
983
+ "$ref": "#/$defs/sourceMutationPayload"
984
+ },
985
+ "expectedRevisions": {
986
+ "properties": {
987
+ "taskRevision": {
988
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
989
+ },
990
+ "workspaceRevision": {
991
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
992
+ },
993
+ "indexRevision": {
994
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
995
+ },
996
+ "workspacePreimage": {
997
+ "$ref": "common-v1.schema.json#/$defs/workingTreeDigest"
998
+ },
999
+ "indexPreimage": {
1000
+ "$ref": "common-v1.schema.json#/$defs/digest"
1001
+ },
1002
+ "patchPreimage": {
1003
+ "$ref": "common-v1.schema.json#/$defs/digest"
1004
+ }
1005
+ },
1006
+ "type": "object"
1007
+ }
1008
+ },
1009
+ "type": "object"
1010
+ }
1011
+ },
1012
+ {
1013
+ "if": {
1014
+ "properties": {
1015
+ "action": {
1016
+ "const": "source.revert"
1017
+ }
1018
+ },
1019
+ "type": "object"
1020
+ },
1021
+ "then": {
1022
+ "properties": {
1023
+ "capabilityScope": {
1024
+ "const": "reviewActions"
1025
+ },
1026
+ "payload": {
1027
+ "$ref": "#/$defs/revertPayload"
1028
+ },
1029
+ "expectedRevisions": {
1030
+ "properties": {
1031
+ "taskRevision": {
1032
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
1033
+ },
1034
+ "workspaceRevision": {
1035
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
1036
+ },
1037
+ "indexRevision": {
1038
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
1039
+ },
1040
+ "workspacePreimage": {
1041
+ "$ref": "common-v1.schema.json#/$defs/workingTreeDigest"
1042
+ },
1043
+ "indexPreimage": {
1044
+ "$ref": "common-v1.schema.json#/$defs/digest"
1045
+ },
1046
+ "patchPreimage": {
1047
+ "$ref": "common-v1.schema.json#/$defs/digest"
1048
+ }
1049
+ },
1050
+ "type": "object"
1051
+ }
1052
+ },
1053
+ "type": "object"
1054
+ }
1055
+ },
1056
+ {
1057
+ "if": {
1058
+ "properties": {
1059
+ "action": {
1060
+ "const": "source.open-in-vscode"
1061
+ }
1062
+ },
1063
+ "type": "object"
1064
+ },
1065
+ "then": {
1066
+ "properties": {
1067
+ "capabilityScope": {
1068
+ "const": "reviewActions"
1069
+ },
1070
+ "payload": {
1071
+ "$ref": "#/$defs/openPayload"
1072
+ },
1073
+ "expectedRevisions": {
1074
+ "properties": {
1075
+ "taskRevision": {
1076
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
1077
+ },
1078
+ "workspaceRevision": {
1079
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
1080
+ }
1081
+ },
1082
+ "type": "object"
1083
+ }
1084
+ },
1085
+ "type": "object"
1086
+ }
1087
+ },
1088
+ {
1089
+ "if": {
1090
+ "properties": {
1091
+ "action": {
1092
+ "const": "commit-summary.generate"
1093
+ }
1094
+ },
1095
+ "type": "object"
1096
+ },
1097
+ "then": {
1098
+ "properties": {
1099
+ "capabilityScope": {
1100
+ "const": "reviewActions"
1101
+ },
1102
+ "payload": {
1103
+ "$ref": "#/$defs/commitSummaryPayload"
1104
+ },
1105
+ "expectedRevisions": {
1106
+ "properties": {
1107
+ "taskRevision": {
1108
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
1109
+ },
1110
+ "indexRevision": {
1111
+ "$ref": "common-v1.schema.json#/$defs/revisionToken"
1112
+ }
1113
+ },
1114
+ "type": "object"
1115
+ }
1116
+ },
1117
+ "type": "object"
1118
+ }
1119
+ },
1120
+ {
1121
+ "if": {
1122
+ "type": "object",
1123
+ "properties": {
1124
+ "action": { "const": "chat.send" },
1125
+ "payload": {
1126
+ "type": "object",
1127
+ "properties": { "delivery": { "const": "steer" } },
1128
+ "required": ["delivery"]
1129
+ }
1130
+ },
1131
+ "required": ["action", "payload"]
1132
+ },
1133
+ "then": {
1134
+ "type": "object",
1135
+ "properties": {
1136
+ "identity": {
1137
+ "type": "object",
1138
+ "properties": {
1139
+ "agentOperationId": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" }
1140
+ }
1141
+ },
1142
+ "expectedRevisions": {
1143
+ "type": "object",
1144
+ "properties": {
1145
+ "controlRevision": { "$ref": "common-v1.schema.json#/$defs/revisionToken" }
1146
+ }
1147
+ }
1148
+ }
1149
+ }
1150
+ },
1151
+ {
1152
+ "if": {
1153
+ "type": "object",
1154
+ "properties": {
1155
+ "action": {
1156
+ "enum": [
1157
+ "lifecycle.pause",
1158
+ "lifecycle.resume",
1159
+ "lifecycle.resume-and-continue",
1160
+ "review.mark",
1161
+ "source.stage",
1162
+ "source.unstage",
1163
+ "source.revert",
1164
+ "source.open-in-vscode",
1165
+ "commit-summary.generate"
1166
+ ]
1167
+ }
1168
+ },
1169
+ "required": ["action"]
1170
+ },
1171
+ "then": {
1172
+ "type": "object",
1173
+ "properties": {
1174
+ "identity": {
1175
+ "type": "object",
1176
+ "properties": {
1177
+ "taskId": { "$ref": "common-v1.schema.json#/$defs/publicId" },
1178
+ "taskRunId": { "$ref": "common-v1.schema.json#/$defs/publicId" }
1179
+ }
1180
+ }
1181
+ }
1182
+ }
1183
+ }
1184
+ ]
1185
+ },
1186
+ "genericRejectedResultCode": {
1187
+ "enum": [
1188
+ "stale-revision",
1189
+ "identity-mismatch",
1190
+ "capability-unavailable",
1191
+ "replay",
1192
+ "idempotency-payload-mismatch",
1193
+ "terminal-task",
1194
+ "expired",
1195
+ "invalid-command",
1196
+ "resync-required"
1197
+ ]
1198
+ },
1199
+ "receiptActionResultBinding": {
1200
+ "anyOf": [
1201
+ {
1202
+ "type": "object",
1203
+ "properties": {
1204
+ "resultCode": {
1205
+ "$ref": "#/$defs/genericRejectedResultCode"
1206
+ }
1207
+ },
1208
+ "required": [
1209
+ "resultCode"
1210
+ ]
1211
+ },
1212
+ {
1213
+ "oneOf": [
1214
+ {
1215
+ "type": "object",
1216
+ "properties": {
1217
+ "action": { "const": "chat.send" },
1218
+ "resultCode": {
1219
+ "enum": [
1220
+ "held",
1221
+ "dispatch-requested",
1222
+ "dispatch-observed",
1223
+ "dispatch-rejected",
1224
+ "dispatch-unknown"
1225
+ ]
1226
+ }
1227
+ },
1228
+ "required": ["action", "resultCode"]
1229
+ },
1230
+ {
1231
+ "type": "object",
1232
+ "properties": {
1233
+ "action": { "const": "queue.update" },
1234
+ "resultCode": { "const": "updated" }
1235
+ },
1236
+ "required": ["action", "resultCode"]
1237
+ },
1238
+ {
1239
+ "type": "object",
1240
+ "properties": {
1241
+ "action": { "const": "queue.delete" },
1242
+ "resultCode": { "const": "deleted" }
1243
+ },
1244
+ "required": ["action", "resultCode"]
1245
+ },
1246
+ {
1247
+ "type": "object",
1248
+ "properties": {
1249
+ "action": { "const": "queue.dispatch" },
1250
+ "resultCode": {
1251
+ "enum": [
1252
+ "dispatch-requested",
1253
+ "dispatch-observed",
1254
+ "dispatch-rejected",
1255
+ "dispatch-unknown"
1256
+ ]
1257
+ }
1258
+ },
1259
+ "required": ["action", "resultCode"]
1260
+ },
1261
+ {
1262
+ "type": "object",
1263
+ "properties": {
1264
+ "action": { "const": "lifecycle.stop" },
1265
+ "resultCode": {
1266
+ "enum": [
1267
+ "already-idle",
1268
+ "stop-requested",
1269
+ "stopped",
1270
+ "unsupported-operation-phase",
1271
+ "settlement-unknown",
1272
+ "emergency-stop",
1273
+ "audit-unavailable"
1274
+ ]
1275
+ }
1276
+ },
1277
+ "required": ["action", "resultCode"]
1278
+ },
1279
+ {
1280
+ "type": "object",
1281
+ "properties": {
1282
+ "action": { "const": "lifecycle.pause" },
1283
+ "resultCode": {
1284
+ "enum": [
1285
+ "pause-requested",
1286
+ "paused",
1287
+ "already-pausing",
1288
+ "already-paused",
1289
+ "pause-unconfirmed"
1290
+ ]
1291
+ }
1292
+ },
1293
+ "required": ["action", "resultCode"]
1294
+ },
1295
+ {
1296
+ "type": "object",
1297
+ "properties": {
1298
+ "action": { "const": "lifecycle.resume" },
1299
+ "resultCode": {
1300
+ "enum": [
1301
+ "resumed",
1302
+ "already-active",
1303
+ "pause-cancelled",
1304
+ "resume-rejected"
1305
+ ]
1306
+ }
1307
+ },
1308
+ "required": ["action", "resultCode"]
1309
+ },
1310
+ {
1311
+ "type": "object",
1312
+ "properties": {
1313
+ "action": { "const": "lifecycle.resume-and-continue" },
1314
+ "resultCode": {
1315
+ "enum": [
1316
+ "dispatch-requested",
1317
+ "dispatch-observed",
1318
+ "dispatch-rejected",
1319
+ "dispatch-unknown",
1320
+ "resumed-not-dispatched"
1321
+ ]
1322
+ }
1323
+ },
1324
+ "required": ["action", "resultCode"]
1325
+ },
1326
+ {
1327
+ "type": "object",
1328
+ "properties": {
1329
+ "action": {
1330
+ "enum": [
1331
+ "session-options.set-model",
1332
+ "session-options.set-thinking"
1333
+ ]
1334
+ },
1335
+ "resultCode": {
1336
+ "enum": [
1337
+ "changed",
1338
+ "unchanged",
1339
+ "effect-unknown"
1340
+ ]
1341
+ }
1342
+ },
1343
+ "required": ["action", "resultCode"]
1344
+ },
1345
+ {
1346
+ "type": "object",
1347
+ "properties": {
1348
+ "action": { "const": "review.mark" },
1349
+ "resultCode": { "enum": ["reviewed", "unreviewed"] }
1350
+ },
1351
+ "required": ["action", "resultCode"]
1352
+ },
1353
+ {
1354
+ "type": "object",
1355
+ "properties": {
1356
+ "action": { "const": "source.stage" },
1357
+ "resultCode": { "enum": ["staged", "effect-unknown"] }
1358
+ },
1359
+ "required": ["action", "resultCode"]
1360
+ },
1361
+ {
1362
+ "type": "object",
1363
+ "properties": {
1364
+ "action": { "const": "source.unstage" },
1365
+ "resultCode": { "enum": ["unstaged", "effect-unknown"] }
1366
+ },
1367
+ "required": ["action", "resultCode"]
1368
+ },
1369
+ {
1370
+ "type": "object",
1371
+ "properties": {
1372
+ "action": { "const": "source.revert" },
1373
+ "resultCode": { "enum": ["reverted", "effect-unknown"] }
1374
+ },
1375
+ "required": ["action", "resultCode"]
1376
+ },
1377
+ {
1378
+ "type": "object",
1379
+ "properties": {
1380
+ "action": { "const": "source.open-in-vscode" },
1381
+ "resultCode": { "enum": ["opened", "effect-unknown"] }
1382
+ },
1383
+ "required": ["action", "resultCode"]
1384
+ },
1385
+ {
1386
+ "type": "object",
1387
+ "properties": {
1388
+ "action": { "const": "commit-summary.generate" },
1389
+ "resultCode": { "const": "summary-generated" }
1390
+ },
1391
+ "required": ["action", "resultCode"]
1392
+ }
1393
+ ]
1394
+ }
1395
+ ]
1396
+ },
1397
+ "receiptPhaseResultBinding": {
1398
+ "oneOf": [
1399
+ {
1400
+ "type": "object",
1401
+ "properties": {
1402
+ "phase": { "const": "requested" },
1403
+ "resultCode": {
1404
+ "enum": [
1405
+ "stop-requested",
1406
+ "pause-requested",
1407
+ "dispatch-requested"
1408
+ ]
1409
+ },
1410
+ "settledAt": { "type": "null" },
1411
+ "settlementEvidenceRef": { "type": "null" },
1412
+ "error": { "type": "null" }
1413
+ },
1414
+ "required": ["phase", "resultCode", "settledAt", "settlementEvidenceRef", "error"]
1415
+ },
1416
+ {
1417
+ "type": "object",
1418
+ "properties": {
1419
+ "phase": { "const": "accepted" },
1420
+ "resultCode": {
1421
+ "enum": [
1422
+ "held",
1423
+ "stop-requested",
1424
+ "pause-requested",
1425
+ "dispatch-requested"
1426
+ ]
1427
+ },
1428
+ "settledAt": { "type": "null" },
1429
+ "settlementEvidenceRef": { "type": "null" },
1430
+ "error": { "type": "null" }
1431
+ },
1432
+ "required": ["phase", "resultCode", "settledAt", "settlementEvidenceRef", "error"]
1433
+ },
1434
+ {
1435
+ "type": "object",
1436
+ "properties": {
1437
+ "phase": { "const": "settled" },
1438
+ "resultCode": {
1439
+ "enum": [
1440
+ "already-idle",
1441
+ "stopped",
1442
+ "emergency-stop",
1443
+ "paused",
1444
+ "already-pausing",
1445
+ "already-paused",
1446
+ "resumed",
1447
+ "already-active",
1448
+ "pause-cancelled",
1449
+ "updated",
1450
+ "deleted",
1451
+ "dispatch-observed",
1452
+ "changed",
1453
+ "unchanged",
1454
+ "reviewed",
1455
+ "unreviewed",
1456
+ "staged",
1457
+ "unstaged",
1458
+ "reverted",
1459
+ "opened",
1460
+ "summary-generated"
1461
+ ]
1462
+ },
1463
+ "settledAt": {
1464
+ "$ref": "common-v1.schema.json#/$defs/timestamp"
1465
+ },
1466
+ "settlementEvidenceRef": {
1467
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
1468
+ },
1469
+ "error": { "type": "null" }
1470
+ },
1471
+ "required": ["phase", "resultCode", "settledAt", "settlementEvidenceRef", "error"]
1472
+ },
1473
+ {
1474
+ "type": "object",
1475
+ "properties": {
1476
+ "phase": { "const": "rejected" },
1477
+ "resultCode": {
1478
+ "anyOf": [
1479
+ { "$ref": "#/$defs/genericRejectedResultCode" },
1480
+ {
1481
+ "enum": [
1482
+ "unsupported-operation-phase",
1483
+ "resume-rejected",
1484
+ "dispatch-rejected"
1485
+ ]
1486
+ }
1487
+ ]
1488
+ },
1489
+ "settledAt": {
1490
+ "$ref": "common-v1.schema.json#/$defs/timestamp"
1491
+ },
1492
+ "settlementEvidenceRef": { "type": "null" },
1493
+ "error": { "$ref": "#/$defs/controlError" }
1494
+ },
1495
+ "required": ["phase", "resultCode", "settledAt", "settlementEvidenceRef", "error"]
1496
+ },
1497
+ {
1498
+ "type": "object",
1499
+ "properties": {
1500
+ "phase": { "const": "uncertain" },
1501
+ "resultCode": {
1502
+ "enum": [
1503
+ "settlement-unknown",
1504
+ "audit-unavailable",
1505
+ "pause-unconfirmed",
1506
+ "dispatch-unknown",
1507
+ "effect-unknown",
1508
+ "resumed-not-dispatched"
1509
+ ]
1510
+ },
1511
+ "settledAt": {
1512
+ "$ref": "common-v1.schema.json#/$defs/timestamp"
1513
+ },
1514
+ "settlementEvidenceRef": { "type": "null" },
1515
+ "error": { "$ref": "#/$defs/controlError" }
1516
+ },
1517
+ "required": ["phase", "resultCode", "settledAt", "settlementEvidenceRef", "error"]
1518
+ }
1519
+ ]
1520
+ },
1521
+ "receipt": {
1522
+ "type": "object",
1523
+ "additionalProperties": false,
1524
+ "required": [
1525
+ "schemaVersion",
1526
+ "version",
1527
+ "messageType",
1528
+ "commandId",
1529
+ "idempotencyKeyDigest",
1530
+ "action",
1531
+ "actionDigest",
1532
+ "identity",
1533
+ "phase",
1534
+ "resultCode",
1535
+ "requestedAt",
1536
+ "settledAt",
1537
+ "observedRevisionsBefore",
1538
+ "observedRevisionsAfter",
1539
+ "deduplicated",
1540
+ "auditRef",
1541
+ "settlementEvidenceRef",
1542
+ "error"
1543
+ ],
1544
+ "properties": {
1545
+ "schemaVersion": {
1546
+ "const": 1
1547
+ },
1548
+ "version": {
1549
+ "const": "piagent-webui-control-v1"
1550
+ },
1551
+ "messageType": {
1552
+ "const": "receipt"
1553
+ },
1554
+ "commandId": {
1555
+ "$ref": "common-v1.schema.json#/$defs/opaqueRef"
1556
+ },
1557
+ "idempotencyKeyDigest": {
1558
+ "$ref": "common-v1.schema.json#/$defs/digest"
1559
+ },
1560
+ "action": {
1561
+ "$ref": "#/$defs/action"
1562
+ },
1563
+ "actionDigest": {
1564
+ "$ref": "common-v1.schema.json#/$defs/digest"
1565
+ },
1566
+ "identity": {
1567
+ "$ref": "common-v1.schema.json#/$defs/identity"
1568
+ },
1569
+ "phase": {
1570
+ "enum": [
1571
+ "rejected",
1572
+ "requested",
1573
+ "accepted",
1574
+ "settled",
1575
+ "uncertain"
1576
+ ]
1577
+ },
1578
+ "resultCode": {
1579
+ "enum": [
1580
+ "already-idle",
1581
+ "stop-requested",
1582
+ "stopped",
1583
+ "unsupported-operation-phase",
1584
+ "settlement-unknown",
1585
+ "emergency-stop",
1586
+ "audit-unavailable",
1587
+ "pause-requested",
1588
+ "paused",
1589
+ "already-pausing",
1590
+ "already-paused",
1591
+ "pause-unconfirmed",
1592
+ "resumed",
1593
+ "already-active",
1594
+ "pause-cancelled",
1595
+ "resume-rejected",
1596
+ "resumed-not-dispatched",
1597
+ "held",
1598
+ "updated",
1599
+ "deleted",
1600
+ "dispatch-requested",
1601
+ "dispatch-observed",
1602
+ "dispatch-rejected",
1603
+ "dispatch-unknown",
1604
+ "changed",
1605
+ "unchanged",
1606
+ "effect-unknown",
1607
+ "reviewed",
1608
+ "unreviewed",
1609
+ "staged",
1610
+ "unstaged",
1611
+ "reverted",
1612
+ "opened",
1613
+ "summary-generated",
1614
+ "stale-revision",
1615
+ "identity-mismatch",
1616
+ "capability-unavailable",
1617
+ "replay",
1618
+ "idempotency-payload-mismatch",
1619
+ "terminal-task",
1620
+ "expired",
1621
+ "invalid-command",
1622
+ "resync-required"
1623
+ ]
1624
+ },
1625
+ "requestedAt": {
1626
+ "$ref": "common-v1.schema.json#/$defs/timestamp"
1627
+ },
1628
+ "settledAt": {
1629
+ "anyOf": [
1630
+ {
1631
+ "$ref": "common-v1.schema.json#/$defs/timestamp"
1632
+ },
1633
+ {
1634
+ "type": "null"
1635
+ }
1636
+ ]
1637
+ },
1638
+ "observedRevisionsBefore": {
1639
+ "$ref": "common-v1.schema.json#/$defs/domainRevision"
1640
+ },
1641
+ "observedRevisionsAfter": {
1642
+ "$ref": "common-v1.schema.json#/$defs/domainRevision"
1643
+ },
1644
+ "deduplicated": {
1645
+ "type": "boolean"
1646
+ },
1647
+ "auditRef": {
1648
+ "$ref": "common-v1.schema.json#/$defs/nullableOpaqueRef"
1649
+ },
1650
+ "settlementEvidenceRef": {
1651
+ "$ref": "common-v1.schema.json#/$defs/nullableOpaqueRef"
1652
+ },
1653
+ "error": {
1654
+ "anyOf": [
1655
+ {
1656
+ "$ref": "#/$defs/controlError"
1657
+ },
1658
+ {
1659
+ "type": "null"
1660
+ }
1661
+ ]
1662
+ }
1663
+ },
1664
+ "allOf": [
1665
+ {
1666
+ "$ref": "#/$defs/receiptActionResultBinding"
1667
+ },
1668
+ {
1669
+ "$ref": "#/$defs/receiptPhaseResultBinding"
1670
+ },
1671
+ {
1672
+ "if": {
1673
+ "type": "object",
1674
+ "properties": {
1675
+ "action": { "const": "lifecycle.stop" }
1676
+ },
1677
+ "required": ["action"]
1678
+ },
1679
+ "then": {
1680
+ "type": "object",
1681
+ "properties": {
1682
+ "identity": {
1683
+ "type": "object",
1684
+ "properties": {
1685
+ "agentOperationId": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" }
1686
+ }
1687
+ }
1688
+ }
1689
+ }
1690
+ },
1691
+ {
1692
+ "if": {
1693
+ "type": "object",
1694
+ "properties": {
1695
+ "action": {
1696
+ "enum": [
1697
+ "lifecycle.pause",
1698
+ "lifecycle.resume",
1699
+ "lifecycle.resume-and-continue",
1700
+ "review.mark",
1701
+ "source.stage",
1702
+ "source.unstage",
1703
+ "source.revert",
1704
+ "source.open-in-vscode",
1705
+ "commit-summary.generate"
1706
+ ]
1707
+ }
1708
+ },
1709
+ "required": ["action"]
1710
+ },
1711
+ "then": {
1712
+ "type": "object",
1713
+ "properties": {
1714
+ "identity": {
1715
+ "type": "object",
1716
+ "properties": {
1717
+ "taskId": { "$ref": "common-v1.schema.json#/$defs/publicId" },
1718
+ "taskRunId": { "$ref": "common-v1.schema.json#/$defs/publicId" }
1719
+ }
1720
+ }
1721
+ }
1722
+ }
1723
+ },
1724
+ {
1725
+ "if": {
1726
+ "type": "object",
1727
+ "properties": { "resultCode": { "const": "dispatch-observed" } },
1728
+ "required": ["resultCode"]
1729
+ },
1730
+ "then": {
1731
+ "type": "object",
1732
+ "properties": {
1733
+ "identity": {
1734
+ "type": "object",
1735
+ "properties": {
1736
+ "agentOperationId": { "$ref": "common-v1.schema.json#/$defs/opaqueRef" }
1737
+ }
1738
+ }
1739
+ }
1740
+ }
1741
+ },
1742
+ {
1743
+ "if": {
1744
+ "type": "object",
1745
+ "properties": {
1746
+ "resultCode": { "const": "replay" }
1747
+ },
1748
+ "required": ["resultCode"]
1749
+ },
1750
+ "then": {
1751
+ "type": "object",
1752
+ "properties": {
1753
+ "deduplicated": { "const": true }
1754
+ }
1755
+ }
1756
+ }
1757
+ ]
1758
+ },
1759
+ "controlError": {
1760
+ "type": "object",
1761
+ "additionalProperties": false,
1762
+ "required": [
1763
+ "code",
1764
+ "message",
1765
+ "retryable"
1766
+ ],
1767
+ "properties": {
1768
+ "code": {
1769
+ "$ref": "common-v1.schema.json#/$defs/reasonCode"
1770
+ },
1771
+ "message": {
1772
+ "$ref": "common-v1.schema.json#/$defs/nonEmptyDisplayText"
1773
+ },
1774
+ "retryable": {
1775
+ "type": "boolean"
1776
+ }
1777
+ }
1778
+ }
1779
+ }
1780
+ }