codex-chatgpt-control 0.5.1-alpha.2 → 0.5.1-alpha.4

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 (231) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +43 -0
  3. package/contracts/v1/fixtures/backend-capabilities.json +40 -1
  4. package/contracts/v1/fixtures/backend-compatibility.json +21 -0
  5. package/contracts/v1/fixtures/backend-version.json +6 -1
  6. package/contracts/v1/fixtures/download-blocked-by-browser.json +22 -0
  7. package/contracts/v1/fixtures/download-receipt-failed.json +22 -0
  8. package/contracts/v1/fixtures/download-receipt-timeout.json +22 -0
  9. package/contracts/v1/fixtures/journal-rpc-indeterminate.json +32 -0
  10. package/contracts/v1/fixtures/journal-rpc-unsupported-platform.json +32 -0
  11. package/contracts/v1/fixtures/journal-runtime-unavailable.json +32 -0
  12. package/contracts/v1/fixtures/operation-action-prepared-event.json +42 -0
  13. package/contracts/v1/fixtures/operation-action.json +13 -0
  14. package/contracts/v1/fixtures/operation-artifact-receipt.json +14 -0
  15. package/contracts/v1/fixtures/operation-artifact-transfer-intent-event.json +24 -0
  16. package/contracts/v1/fixtures/operation-artifact-transfer-receipt-event.json +26 -0
  17. package/contracts/v1/fixtures/operation-artifact-transfer-state.json +178 -0
  18. package/contracts/v1/fixtures/operation-blocker.json +10 -0
  19. package/contracts/v1/fixtures/operation-collect-request.json +17 -0
  20. package/contracts/v1/fixtures/operation-collect-result.json +42 -0
  21. package/contracts/v1/fixtures/operation-control-receipt.json +13 -0
  22. package/contracts/v1/fixtures/operation-control-request.json +18 -0
  23. package/contracts/v1/fixtures/operation-control-result.json +31 -0
  24. package/contracts/v1/fixtures/operation-event.json +18 -0
  25. package/contracts/v1/fixtures/operation-handle.json +10 -0
  26. package/contracts/v1/fixtures/operation-inspect-request.json +13 -0
  27. package/contracts/v1/fixtures/operation-inspect-result.json +205 -0
  28. package/contracts/v1/fixtures/operation-ownership-baseline-event.json +34 -0
  29. package/contracts/v1/fixtures/operation-receipt.json +32 -0
  30. package/contracts/v1/fixtures/operation-recovery-decision.json +7 -0
  31. package/contracts/v1/fixtures/operation-recovery-observation.json +12 -0
  32. package/contracts/v1/fixtures/operation-request.json +33 -0
  33. package/contracts/v1/fixtures/operation-state.json +144 -0
  34. package/contracts/v1/fixtures/operation-submission-witness-event.json +20 -0
  35. package/contracts/v1/fixtures/operation-submission-witness.json +11 -0
  36. package/contracts/v1/fixtures/operation-submit-result.json +16 -0
  37. package/contracts/v1/fixtures/operation-target-established-event.json +21 -0
  38. package/contracts/v1/manifest.json +185 -1
  39. package/contracts/v1/parity-suite.json +106 -8
  40. package/contracts/v1/schemas/backend-compatibility.schema.json +65 -0
  41. package/contracts/v1/schemas/backend-request.schema.json +8 -2
  42. package/contracts/v1/schemas/capabilities.schema.json +81 -1
  43. package/contracts/v1/schemas/manifest.schema.json +57 -0
  44. package/contracts/v1/schemas/operation-action.schema.json +155 -0
  45. package/contracts/v1/schemas/operation-artifact-receipt.schema.json +89 -0
  46. package/contracts/v1/schemas/operation-blocker.schema.json +70 -0
  47. package/contracts/v1/schemas/operation-collect-request.schema.json +46 -0
  48. package/contracts/v1/schemas/operation-collect-result.schema.json +74 -0
  49. package/contracts/v1/schemas/operation-control-receipt.schema.json +108 -0
  50. package/contracts/v1/schemas/operation-control-request.schema.json +111 -0
  51. package/contracts/v1/schemas/operation-control-result.schema.json +112 -0
  52. package/contracts/v1/schemas/operation-event.schema.json +756 -0
  53. package/contracts/v1/schemas/operation-handle.schema.json +55 -0
  54. package/contracts/v1/schemas/operation-inspect-request.schema.json +42 -0
  55. package/contracts/v1/schemas/operation-inspect-result.schema.json +1662 -0
  56. package/contracts/v1/schemas/operation-receipt.schema.json +153 -0
  57. package/contracts/v1/schemas/operation-recovery.schema.json +314 -0
  58. package/contracts/v1/schemas/operation-request.schema.json +158 -0
  59. package/contracts/v1/schemas/operation-state.schema.json +691 -0
  60. package/contracts/v1/schemas/operation-submission-witness.schema.json +48 -0
  61. package/contracts/v1/schemas/operation-submit-result.schema.json +94 -0
  62. package/contracts/v1/surface-drift-policy.json +50 -0
  63. package/contracts/v1/vectors/operation-request-digest-v1.json +43 -0
  64. package/dist/codex-chatgpt-control-backend.mjs +45882 -9361
  65. package/dist/codex-chatgpt-control-journal.mjs +5547 -0
  66. package/dist/codex-chatgpt-control-live-smoke.bundle.mjs +51677 -0
  67. package/dist/codex-chatgpt-control-release-canary.bundle.mjs +52104 -0
  68. package/dist/codex-chatgpt-control.bundle.mjs +48392 -10260
  69. package/dist/src/backend/client.d.ts +103 -2
  70. package/dist/src/backend/client.js +1436 -97
  71. package/dist/src/backend/compatibility.d.ts +12 -0
  72. package/dist/src/backend/compatibility.js +208 -0
  73. package/dist/src/backend/protocol.d.ts +84 -1
  74. package/dist/src/backend/protocol.js +31 -5
  75. package/dist/src/backend/runtime-identity.d.ts +10 -0
  76. package/dist/src/backend/runtime-identity.js +141 -0
  77. package/dist/src/backend/session.d.ts +10 -2
  78. package/dist/src/backend/session.js +478 -7
  79. package/dist/src/backend/stdio-server.d.ts +4 -1
  80. package/dist/src/backend/stdio-server.js +240 -28
  81. package/dist/src/browser/active-composer-file-input.d.ts +9 -0
  82. package/dist/src/browser/active-composer-file-input.js +33 -0
  83. package/dist/src/browser/attach.d.ts +4 -1
  84. package/dist/src/browser/attach.js +136 -28
  85. package/dist/src/browser/chatgpt-url.d.ts +2 -0
  86. package/dist/src/browser/chatgpt-url.js +9 -0
  87. package/dist/src/browser/downloads.d.ts +17 -1
  88. package/dist/src/browser/downloads.js +150 -28
  89. package/dist/src/browser/page-state.js +6 -0
  90. package/dist/src/client.d.ts +43 -0
  91. package/dist/src/client.js +1279 -59
  92. package/dist/src/commands/artifacts.js +6 -4
  93. package/dist/src/commands/chat-popover.d.ts +37 -0
  94. package/dist/src/commands/chat-popover.js +537 -0
  95. package/dist/src/commands/configuration.d.ts +5 -0
  96. package/dist/src/commands/configuration.js +134 -21
  97. package/dist/src/commands/context.js +10 -3
  98. package/dist/src/commands/doctor.d.ts +1 -1
  99. package/dist/src/commands/doctor.js +27 -4
  100. package/dist/src/commands/experience.d.ts +5 -0
  101. package/dist/src/commands/experience.js +104 -21
  102. package/dist/src/commands/files.js +14 -33
  103. package/dist/src/commands/modes.js +85 -21
  104. package/dist/src/commands/power-discovery.d.ts +130 -0
  105. package/dist/src/commands/power-discovery.js +669 -0
  106. package/dist/src/commands/project-sources.js +325 -31
  107. package/dist/src/commands/sequence.js +59 -32
  108. package/dist/src/commands/session.js +19 -6
  109. package/dist/src/commands/work.js +31 -0
  110. package/dist/src/dom/composer-text.d.ts +6 -0
  111. package/dist/src/dom/composer-text.js +85 -0
  112. package/dist/src/errors.d.ts +9 -0
  113. package/dist/src/errors.js +22 -0
  114. package/dist/src/index.d.ts +6 -0
  115. package/dist/src/index.js +9 -0
  116. package/dist/src/operations/artifact-output.d.ts +69 -0
  117. package/dist/src/operations/artifact-output.js +1748 -0
  118. package/dist/src/operations/artifact-stream.d.ts +19 -0
  119. package/dist/src/operations/artifact-stream.js +35 -0
  120. package/dist/src/operations/artifact-transfer.d.ts +149 -0
  121. package/dist/src/operations/artifact-transfer.js +1312 -0
  122. package/dist/src/operations/browser-adapter.d.ts +167 -0
  123. package/dist/src/operations/browser-adapter.js +2103 -0
  124. package/dist/src/operations/browser-observation.d.ts +110 -0
  125. package/dist/src/operations/browser-observation.js +1256 -0
  126. package/dist/src/operations/browser-target.d.ts +105 -0
  127. package/dist/src/operations/browser-target.js +531 -0
  128. package/dist/src/operations/canonical.d.ts +4 -0
  129. package/dist/src/operations/canonical.js +412 -0
  130. package/dist/src/operations/chatgpt-runtime.d.ts +72 -0
  131. package/dist/src/operations/chatgpt-runtime.js +1232 -0
  132. package/dist/src/operations/client.d.ts +138 -0
  133. package/dist/src/operations/client.js +1145 -0
  134. package/dist/src/operations/collector.d.ts +195 -0
  135. package/dist/src/operations/collector.js +1039 -0
  136. package/dist/src/operations/configuration-routing.d.ts +4 -0
  137. package/dist/src/operations/configuration-routing.js +14 -0
  138. package/dist/src/operations/control.d.ts +372 -0
  139. package/dist/src/operations/control.js +1498 -0
  140. package/dist/src/operations/file-identity.d.ts +33 -0
  141. package/dist/src/operations/file-identity.js +153 -0
  142. package/dist/src/operations/handle.d.ts +19 -0
  143. package/dist/src/operations/handle.js +727 -0
  144. package/dist/src/operations/index.d.ts +25 -0
  145. package/dist/src/operations/index.js +25 -0
  146. package/dist/src/operations/journal-authority.d.ts +12 -0
  147. package/dist/src/operations/journal-authority.js +1 -0
  148. package/dist/src/operations/journal-rpc-client.d.ts +12 -0
  149. package/dist/src/operations/journal-rpc-client.js +225 -0
  150. package/dist/src/operations/journal-rpc-protocol.d.ts +32 -0
  151. package/dist/src/operations/journal-rpc-protocol.js +214 -0
  152. package/dist/src/operations/journal-rpc-server.d.ts +15 -0
  153. package/dist/src/operations/journal-rpc-server.js +272 -0
  154. package/dist/src/operations/journal.d.ts +143 -0
  155. package/dist/src/operations/journal.js +1957 -0
  156. package/dist/src/operations/production-attachments.d.ts +118 -0
  157. package/dist/src/operations/production-attachments.js +1035 -0
  158. package/dist/src/operations/production-chatgpt-artifacts.d.ts +74 -0
  159. package/dist/src/operations/production-chatgpt-artifacts.js +1146 -0
  160. package/dist/src/operations/production-chatgpt-attachments.d.ts +80 -0
  161. package/dist/src/operations/production-chatgpt-attachments.js +1639 -0
  162. package/dist/src/operations/production-configuration.d.ts +42 -0
  163. package/dist/src/operations/production-configuration.js +1544 -0
  164. package/dist/src/operations/production-primitives.d.ts +53 -0
  165. package/dist/src/operations/production-primitives.js +856 -0
  166. package/dist/src/operations/production-work-steer.d.ts +203 -0
  167. package/dist/src/operations/production-work-steer.js +1218 -0
  168. package/dist/src/operations/recovery.d.ts +80 -0
  169. package/dist/src/operations/recovery.js +174 -0
  170. package/dist/src/operations/runtime-adapter.d.ts +126 -0
  171. package/dist/src/operations/runtime-adapter.js +802 -0
  172. package/dist/src/operations/send-once.d.ts +224 -0
  173. package/dist/src/operations/send-once.js +1081 -0
  174. package/dist/src/operations/service.d.ts +286 -0
  175. package/dist/src/operations/service.js +2831 -0
  176. package/dist/src/operations/staging.d.ts +136 -0
  177. package/dist/src/operations/staging.js +630 -0
  178. package/dist/src/operations/state-machine.d.ts +29 -0
  179. package/dist/src/operations/state-machine.js +2047 -0
  180. package/dist/src/operations/submission.d.ts +423 -0
  181. package/dist/src/operations/submission.js +1676 -0
  182. package/dist/src/operations/transactional-chat-power.d.ts +17 -0
  183. package/dist/src/operations/transactional-chat-power.js +212 -0
  184. package/dist/src/operations/turn-ownership.d.ts +202 -0
  185. package/dist/src/operations/turn-ownership.js +700 -0
  186. package/dist/src/operations/types.d.ts +454 -0
  187. package/dist/src/operations/types.js +20 -0
  188. package/dist/src/operations/wire-requests.d.ts +21 -0
  189. package/dist/src/operations/wire-requests.js +396 -0
  190. package/dist/src/operations/wire-results.d.ts +97 -0
  191. package/dist/src/operations/wire-results.js +818 -0
  192. package/dist/src/runner/responses.d.ts +3 -1
  193. package/dist/src/runner/responses.js +19 -1
  194. package/dist/src/runner/result.js +227 -55
  195. package/dist/src/runner/types.d.ts +12 -0
  196. package/dist/src/runtime/command-routing.d.ts +149 -0
  197. package/dist/src/runtime/command-routing.js +431 -0
  198. package/dist/src/runtime/coordinated-browser.d.ts +24 -0
  199. package/dist/src/runtime/coordinated-browser.js +315 -0
  200. package/dist/src/runtime/coordinated-page.d.ts +41 -0
  201. package/dist/src/runtime/coordinated-page.js +651 -0
  202. package/dist/src/runtime/operation-context.d.ts +142 -0
  203. package/dist/src/runtime/operation-context.js +410 -0
  204. package/dist/src/runtime/runtime-session.d.ts +95 -0
  205. package/dist/src/runtime/runtime-session.js +314 -0
  206. package/dist/src/runtime/tab-coordinator.d.ts +200 -0
  207. package/dist/src/runtime/tab-coordinator.js +1200 -0
  208. package/dist/src/runtime/value-boundaries.d.ts +18 -0
  209. package/dist/src/runtime/value-boundaries.js +49 -0
  210. package/dist/src/safety/blockers.js +8 -1
  211. package/dist/src/safety/untrusted-output.js +2 -1
  212. package/dist/src/scripts/backend-server.js +4 -1
  213. package/dist/src/scripts/capture-surface-profile.js +7 -2
  214. package/dist/src/scripts/journal-server.d.ts +2 -0
  215. package/dist/src/scripts/journal-server.js +37 -0
  216. package/dist/src/scripts/live-smoke/harness.js +79 -7
  217. package/dist/src/scripts/live-smoke/scenarios.d.ts +42 -1
  218. package/dist/src/scripts/live-smoke/scenarios.js +147 -30
  219. package/dist/src/scripts/live-smoke/transactional.d.ts +17 -0
  220. package/dist/src/scripts/live-smoke/transactional.js +254 -0
  221. package/dist/src/scripts/live-smoke/types.d.ts +3 -0
  222. package/dist/src/scripts/release-canary-module.js +17 -4
  223. package/dist/src/types.d.ts +38 -1
  224. package/package.json +8 -3
  225. package/references/2026-08-16-transactional-operations.md +459 -0
  226. package/references/2026-09-06-journal-service.md +140 -0
  227. package/references/agents-runner.md +34 -0
  228. package/references/backend-protocol.md +176 -0
  229. package/references/python-parity.md +137 -0
  230. package/references/responses-adapter.md +19 -0
  231. package/references/streaming.md +6 -0
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "schemaVersion": "chatgpt.browser_control.parity_suite.v1",
3
- "contractVersion": "0.1.0",
3
+ "contractVersion": "0.2.0",
4
4
  "surfaces": [
5
5
  {
6
6
  "id": "backend-protocol",
7
7
  "summary": "Backend request, response, event, capability, and protocol-error envelopes.",
8
8
  "fixtures": [
9
9
  "backend-capabilities.json",
10
+ "backend-compatibility.json",
10
11
  "backend-error-event-missing-stream-input.json",
11
12
  "backend-error-missing-run-input.json",
12
13
  "backend-runner-plan-request.json",
@@ -185,6 +186,9 @@
185
186
  "blocker-explanation-profiles.json",
186
187
  "doctor-bridge-upload.json",
187
188
  "doctor-scenario-preflight.json",
189
+ "download-receipt-timeout.json",
190
+ "download-blocked-by-browser.json",
191
+ "download-receipt-failed.json",
188
192
  "existing-tab-diagnostics-blocker.json",
189
193
  "files-preflight-success.json",
190
194
  "project-sources-plan-add.json",
@@ -309,6 +313,66 @@
309
313
  "references/2026-07-16-chat-work-surfaces.md",
310
314
  "../../README.md"
311
315
  ]
316
+ },
317
+ {
318
+ "id": "transactional-operations-contract",
319
+ "summary": "Versioned transactional operation requests, handles, state, action intent, recovery, blockers, terminal ownership, artifact receipts, and strict result envelopes.",
320
+ "fixtures": [
321
+ "operation-action.json",
322
+ "operation-artifact-receipt.json",
323
+ "operation-artifact-transfer-intent-event.json",
324
+ "operation-artifact-transfer-receipt-event.json",
325
+ "operation-artifact-transfer-state.json",
326
+ "operation-blocker.json",
327
+ "operation-collect-request.json",
328
+ "operation-control-receipt.json",
329
+ "operation-control-request.json",
330
+ "operation-collect-result.json",
331
+ "operation-control-result.json",
332
+ "operation-action-prepared-event.json",
333
+ "operation-event.json",
334
+ "operation-ownership-baseline-event.json",
335
+ "operation-handle.json",
336
+ "operation-inspect-request.json",
337
+ "operation-inspect-result.json",
338
+ "operation-receipt.json",
339
+ "operation-recovery-decision.json",
340
+ "operation-recovery-observation.json",
341
+ "operation-request.json",
342
+ "operation-state.json",
343
+ "operation-submission-witness.json",
344
+ "operation-submission-witness-event.json",
345
+ "operation-target-established-event.json",
346
+ "operation-submit-result.json"
347
+ ],
348
+ "sourceFiles": [
349
+ "src/operations/types.ts",
350
+ "src/operations/state-machine.ts",
351
+ "src/operations/artifact-transfer.ts",
352
+ "src/operations/turn-ownership.ts",
353
+ "src/operations/submission.ts",
354
+ "src/operations/journal.ts",
355
+ "src/operations/handle.ts",
356
+ "src/operations/recovery.ts",
357
+ "src/operations/wire-results.ts"
358
+ ],
359
+ "nodeTests": [
360
+ "tests/unit/operations-state-machine.test.ts",
361
+ "tests/unit/operations-artifact-transfer.test.ts",
362
+ "tests/unit/operations-turn-ownership.test.ts",
363
+ "tests/unit/operations-durable-baseline.test.ts",
364
+ "tests/unit/operations-submission.test.ts",
365
+ "tests/unit/operations-handle.test.ts",
366
+ "tests/unit/operations-recovery.test.ts",
367
+ "tests/unit/operations-wire-results.test.ts"
368
+ ],
369
+ "pythonTests": [
370
+ "tests/test_operation_models.py"
371
+ ],
372
+ "docs": [
373
+ "references/2026-08-16-transactional-operations.md",
374
+ "references/backend-protocol.md"
375
+ ]
312
376
  }
313
377
  ],
314
378
  "backendCommands": {
@@ -333,6 +397,12 @@
333
397
  "pythonTests": ["tests/test_cross_language_conformance.py", "tests/test_backend_client.py"],
334
398
  "docs": ["references/backend-protocol.md", "references/python-parity.md"]
335
399
  },
400
+ "backend.hello": {
401
+ "surface": "backend-protocol",
402
+ "nodeTests": ["tests/unit/backend-dispatch.test.ts", "tests/unit/backend-protocol.test.ts", "tests/unit/backend-client.test.ts"],
403
+ "pythonTests": ["tests/test_cross_language_conformance.py", "tests/test_backend_client.py"],
404
+ "docs": ["references/backend-protocol.md", "references/python-parity.md"]
405
+ },
336
406
  "runner.run": {
337
407
  "surface": "runner-results-streams",
338
408
  "fixtures": ["run-basic-success.json", "runner-budget-blocker.json", "run-browser-bridge-blocker.json"],
@@ -363,7 +433,7 @@
363
433
  },
364
434
  "ask": {
365
435
  "surface": "workflows-primitives-diagnostics",
366
- "fixtures": ["workflow-ask-success.json", "command-descriptors.json"],
436
+ "fixtures": ["workflow-ask-success.json", "journal-runtime-unavailable.json", "journal-rpc-indeterminate.json", "journal-rpc-unsupported-platform.json", "command-descriptors.json"],
367
437
  "nodeTests": ["tests/unit/client.test.ts", "tests/unit/sequence.test.ts", "tests/unit/backend-conformance.test.ts"],
368
438
  "pythonTests": ["tests/test_workflows.py", "tests/test_async_client.py"],
369
439
  "docs": ["references/backend-protocol.md", "references/python-parity.md", "../../README.md"]
@@ -627,6 +697,34 @@
627
697
  "pythonTests": ["tests/test_primitives.py", "tests/test_async_client.py"],
628
698
  "docs": ["references/backend-protocol.md", "references/troubleshooting.md", "references/python-parity.md"]
629
699
  },
700
+ "operations.submit": {
701
+ "surface": "transactional-operations-contract",
702
+ "fixtures": ["operation-request.json", "operation-submit-result.json"],
703
+ "nodeTests": ["tests/unit/backend-client.test.ts", "tests/unit/backend-dispatch.test.ts", "tests/unit/operations-wire-results.test.ts"],
704
+ "pythonTests": ["tests/test_operations_client.py", "tests/test_backend_client.py"],
705
+ "docs": ["references/backend-protocol.md", "references/python-parity.md", "references/2026-08-16-transactional-operations.md"]
706
+ },
707
+ "operations.collect": {
708
+ "surface": "transactional-operations-contract",
709
+ "fixtures": ["operation-collect-request.json", "operation-collect-result.json"],
710
+ "nodeTests": ["tests/unit/backend-client.test.ts", "tests/unit/backend-dispatch.test.ts", "tests/unit/operations-wire-requests.test.ts", "tests/unit/operations-wire-results.test.ts"],
711
+ "pythonTests": ["tests/test_operations_client.py", "tests/test_operation_models.py", "tests/test_backend_client.py"],
712
+ "docs": ["references/backend-protocol.md", "references/python-parity.md", "references/2026-08-16-transactional-operations.md"]
713
+ },
714
+ "operations.inspect": {
715
+ "surface": "transactional-operations-contract",
716
+ "fixtures": ["operation-inspect-request.json", "operation-inspect-result.json"],
717
+ "nodeTests": ["tests/unit/backend-client.test.ts", "tests/unit/backend-dispatch.test.ts", "tests/unit/operations-wire-results.test.ts"],
718
+ "pythonTests": ["tests/test_operations_client.py", "tests/test_backend_client.py"],
719
+ "docs": ["references/backend-protocol.md", "references/python-parity.md", "references/2026-08-16-transactional-operations.md"]
720
+ },
721
+ "operations.control": {
722
+ "surface": "transactional-operations-contract",
723
+ "fixtures": ["operation-control-request.json", "operation-control-result.json"],
724
+ "nodeTests": ["tests/unit/backend-client.test.ts", "tests/unit/backend-dispatch.test.ts", "tests/unit/operations-wire-results.test.ts"],
725
+ "pythonTests": ["tests/test_operations_client.py", "tests/test_backend_client.py"],
726
+ "docs": ["references/backend-protocol.md", "references/python-parity.md", "references/2026-08-16-transactional-operations.md"]
727
+ },
630
728
  "messages.waitAndRead": {
631
729
  "surface": "workflows-primitives-diagnostics",
632
730
  "fixtures": ["command-descriptors.json", "workflow-ask-success.json"],
@@ -650,9 +748,9 @@
650
748
  },
651
749
  "artifacts.downloadLatest": {
652
750
  "surface": "workflows-primitives-diagnostics",
653
- "fixtures": ["command-descriptors.json"],
654
- "nodeTests": ["tests/unit/artifacts.test.ts", "tests/unit/files.test.ts"],
655
- "pythonTests": ["tests/test_primitives.py", "tests/test_async_client.py"],
751
+ "fixtures": ["command-descriptors.json", "download-receipt-timeout.json", "download-blocked-by-browser.json", "download-receipt-failed.json"],
752
+ "nodeTests": ["tests/unit/artifacts.test.ts", "tests/unit/files.test.ts", "tests/unit/browser-downloads.test.ts"],
753
+ "pythonTests": ["tests/test_primitives.py", "tests/test_async_client.py", "tests/test_parity_snapshots.py"],
656
754
  "docs": ["references/backend-protocol.md", "references/python-parity.md"]
657
755
  },
658
756
  "files.preflight": {
@@ -671,9 +769,9 @@
671
769
  },
672
770
  "files.downloadLatest": {
673
771
  "surface": "workflows-primitives-diagnostics",
674
- "fixtures": ["command-descriptors.json"],
675
- "nodeTests": ["tests/unit/files.test.ts", "tests/unit/client.test.ts"],
676
- "pythonTests": ["tests/test_primitives.py"],
772
+ "fixtures": ["command-descriptors.json", "download-receipt-timeout.json", "download-blocked-by-browser.json", "download-receipt-failed.json"],
773
+ "nodeTests": ["tests/unit/files.test.ts", "tests/unit/client.test.ts", "tests/unit/browser-downloads.test.ts"],
774
+ "pythonTests": ["tests/test_primitives.py", "tests/test_parity_snapshots.py"],
677
775
  "docs": ["references/backend-protocol.md", "references/troubleshooting.md", "references/python-parity.md"]
678
776
  },
679
777
  "projects.sources.list": {
@@ -0,0 +1,65 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://local.codex-chatgpt-control/contracts/v1/schemas/backend-compatibility.schema.json",
4
+ "title": "Negotiated backend compatibility report",
5
+ "description": "A bounded, redacted report retained by the lifecycle-owned backend transport.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schemaVersion", "status", "mode", "warnings"],
9
+ "properties": {
10
+ "schemaVersion": {
11
+ "const": "chatgpt.browser_control.backend_compatibility.v1"
12
+ },
13
+ "status": {
14
+ "enum": ["compatible", "warning", "unknown", "blocked"]
15
+ },
16
+ "mode": {
17
+ "enum": ["multiplexed", "single-flight", "legacy", "unknown"]
18
+ },
19
+ "protocolVersion": { "$ref": "#/$defs/text" },
20
+ "backendSessionId": { "$ref": "#/$defs/text" },
21
+ "packageName": { "$ref": "#/$defs/text" },
22
+ "packageVersion": { "$ref": "#/$defs/text" },
23
+ "runtime": { "$ref": "#/$defs/text" },
24
+ "runtimeVersion": { "$ref": "#/$defs/text" },
25
+ "buildDigest": { "$ref": "#/$defs/text" },
26
+ "warnings": {
27
+ "type": "array",
28
+ "maxItems": 16,
29
+ "items": { "$ref": "#/$defs/warning" }
30
+ }
31
+ },
32
+ "$defs": {
33
+ "text": {
34
+ "type": "string",
35
+ "minLength": 1,
36
+ "maxLength": 512,
37
+ "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]{1,512}$"
38
+ },
39
+ "warning": {
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "required": ["code", "message"],
43
+ "properties": {
44
+ "code": {
45
+ "enum": [
46
+ "package_name_mismatch",
47
+ "package_version_mismatch",
48
+ "runtime_mismatch",
49
+ "runtime_version_mismatch",
50
+ "build_digest_mismatch",
51
+ "provenance_unknown",
52
+ "legacy_backend",
53
+ "negotiation_rejected"
54
+ ]
55
+ },
56
+ "field": {
57
+ "enum": ["packageName", "packageVersion", "runtime", "runtimeVersion", "buildDigest"]
58
+ },
59
+ "expected": { "$ref": "#/$defs/text" },
60
+ "received": { "$ref": "#/$defs/text" },
61
+ "message": { "$ref": "#/$defs/text" }
62
+ }
63
+ }
64
+ }
65
+ }
@@ -6,12 +6,13 @@
6
6
  "additionalProperties": false,
7
7
  "properties": {
8
8
  "schemaVersion": { "const": "chatgpt.browser_control.backend_request.v1" },
9
- "requestId": { "type": "string", "minLength": 1 },
9
+ "requestId": { "type": "string", "minLength": 1, "maxLength": 4096 },
10
10
  "command": {
11
11
  "enum": [
12
12
  "backend.version",
13
13
  "backend.health",
14
14
  "backend.capabilities",
15
+ "backend.hello",
15
16
  "runner.run",
16
17
  "runner.plan",
17
18
  "runner.stream",
@@ -53,6 +54,7 @@
53
54
  "messages.wait",
54
55
  "messages.readLatest",
55
56
  "messages.status",
57
+ "messages.stop",
56
58
  "messages.waitAndRead",
57
59
  "artifacts.listLatest",
58
60
  "artifacts.wait",
@@ -66,7 +68,11 @@
66
68
  "modes.set",
67
69
  "modes.get",
68
70
  "tools.select",
69
- "response.copy"
71
+ "response.copy",
72
+ "operations.submit",
73
+ "operations.collect",
74
+ "operations.inspect",
75
+ "operations.control"
70
76
  ]
71
77
  },
72
78
  "payload": {
@@ -2,10 +2,37 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://local.codex-chatgpt-control/contracts/v1/capabilities.schema.json",
4
4
  "type": "object",
5
- "required": ["protocolVersion", "commands", "transports", "streaming"],
5
+ "required": [
6
+ "protocolVersion",
7
+ "backendSessionId",
8
+ "packageName",
9
+ "packageVersion",
10
+ "runtime",
11
+ "runtimeVersion",
12
+ "buildDigest",
13
+ "supportedProtocolVersions",
14
+ "commands",
15
+ "transports",
16
+ "streaming",
17
+ "requestIds",
18
+ "multiplexing",
19
+ "cancellation",
20
+ "tabs"
21
+ ],
6
22
  "additionalProperties": false,
7
23
  "properties": {
8
24
  "protocolVersion": { "const": "chatgpt.browser_control.backend_request.v1" },
25
+ "backendSessionId": { "type": "string", "minLength": 1, "maxLength": 512 },
26
+ "packageName": { "type": "string", "minLength": 1, "maxLength": 512 },
27
+ "packageVersion": { "type": "string", "minLength": 1, "maxLength": 512 },
28
+ "runtime": { "const": "node" },
29
+ "runtimeVersion": { "type": "string", "minLength": 1, "maxLength": 512 },
30
+ "buildDigest": { "type": "string", "minLength": 1, "maxLength": 512 },
31
+ "supportedProtocolVersions": {
32
+ "type": "array",
33
+ "minItems": 1,
34
+ "items": { "type": "string", "minLength": 1 }
35
+ },
9
36
  "commands": {
10
37
  "type": "array",
11
38
  "minItems": 1,
@@ -28,6 +55,59 @@
28
55
  },
29
56
  "tokenDeltas": { "const": false }
30
57
  }
58
+ },
59
+ "requestIds": {
60
+ "type": "object",
61
+ "additionalProperties": false,
62
+ "required": ["required", "scope"],
63
+ "properties": {
64
+ "required": { "type": "boolean" },
65
+ "scope": { "enum": ["connection", "process", "none"] }
66
+ }
67
+ },
68
+ "multiplexing": {
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "required": ["unary", "streams"],
72
+ "properties": {
73
+ "unary": { "type": "boolean" },
74
+ "streams": { "type": "boolean" }
75
+ }
76
+ },
77
+ "cancellation": {
78
+ "type": "object",
79
+ "additionalProperties": false,
80
+ "required": ["supported", "requests", "streams"],
81
+ "properties": {
82
+ "supported": { "type": "boolean" },
83
+ "requests": { "type": "boolean" },
84
+ "streams": { "type": "boolean" }
85
+ }
86
+ },
87
+ "tabs": {
88
+ "type": "object",
89
+ "additionalProperties": false,
90
+ "required": [
91
+ "stableProviderIdentity",
92
+ "stableBrowserIdentity",
93
+ "stableTabIdentity",
94
+ "coordinationScope",
95
+ "authoritativeClaim",
96
+ "fencing",
97
+ "concurrentTabs"
98
+ ],
99
+ "properties": {
100
+ "stableProviderIdentity": { "type": "boolean" },
101
+ "stableBrowserIdentity": { "type": "boolean" },
102
+ "stableTabIdentity": { "type": "boolean" },
103
+ "coordinationScope": { "enum": ["none", "process", "provider"] },
104
+ "authoritativeClaim": { "type": "boolean" },
105
+ "fencing": { "type": "boolean" },
106
+ "concurrentTabs": { "type": "boolean" },
107
+ "stableIdentity": { "type": "boolean" },
108
+ "coordination": { "type": "boolean" },
109
+ "concurrent": { "type": "boolean" }
110
+ }
31
111
  }
32
112
  }
33
113
  }
@@ -21,7 +21,26 @@
21
21
  "backendRequest",
22
22
  "backendResponse",
23
23
  "backendEvent",
24
+ "backendCompatibility",
24
25
  "capabilities",
26
+ "operationAction",
27
+ "operationArtifactReceipt",
28
+ "operationBlocker",
29
+ "operationCollectRequest",
30
+ "operationControlReceipt",
31
+ "operationControlRequest",
32
+ "operationEvent",
33
+ "operationHandle",
34
+ "operationInspectRequest",
35
+ "operationReceipt",
36
+ "operationRecovery",
37
+ "operationRequest",
38
+ "operationState",
39
+ "operationSubmissionWitness",
40
+ "operationSubmitResult",
41
+ "operationCollectResult",
42
+ "operationInspectResult",
43
+ "operationControlResult",
25
44
  "surfaceProfile"
26
45
  ],
27
46
  "additionalProperties": false,
@@ -36,7 +55,26 @@
36
55
  "backendRequest": { "type": "string", "minLength": 1 },
37
56
  "backendResponse": { "type": "string", "minLength": 1 },
38
57
  "backendEvent": { "type": "string", "minLength": 1 },
58
+ "backendCompatibility": { "type": "string", "minLength": 1 },
39
59
  "capabilities": { "type": "string", "minLength": 1 },
60
+ "operationAction": { "type": "string", "minLength": 1 },
61
+ "operationArtifactReceipt": { "type": "string", "minLength": 1 },
62
+ "operationBlocker": { "type": "string", "minLength": 1 },
63
+ "operationCollectRequest": { "type": "string", "minLength": 1 },
64
+ "operationControlReceipt": { "type": "string", "minLength": 1 },
65
+ "operationControlRequest": { "type": "string", "minLength": 1 },
66
+ "operationEvent": { "type": "string", "minLength": 1 },
67
+ "operationHandle": { "type": "string", "minLength": 1 },
68
+ "operationInspectRequest": { "type": "string", "minLength": 1 },
69
+ "operationReceipt": { "type": "string", "minLength": 1 },
70
+ "operationRecovery": { "type": "string", "minLength": 1 },
71
+ "operationRequest": { "type": "string", "minLength": 1 },
72
+ "operationState": { "type": "string", "minLength": 1 },
73
+ "operationSubmissionWitness": { "type": "string", "minLength": 1 },
74
+ "operationSubmitResult": { "type": "string", "minLength": 1 },
75
+ "operationCollectResult": { "type": "string", "minLength": 1 },
76
+ "operationInspectResult": { "type": "string", "minLength": 1 },
77
+ "operationControlResult": { "type": "string", "minLength": 1 },
40
78
  "surfaceProfile": { "type": "string", "minLength": 1 }
41
79
  }
42
80
  },
@@ -60,7 +98,26 @@
60
98
  "backendRequest",
61
99
  "backendResponse",
62
100
  "backendEvent",
101
+ "backendCompatibility",
63
102
  "capabilities",
103
+ "operationAction",
104
+ "operationArtifactReceipt",
105
+ "operationBlocker",
106
+ "operationCollectRequest",
107
+ "operationControlReceipt",
108
+ "operationControlRequest",
109
+ "operationEvent",
110
+ "operationHandle",
111
+ "operationInspectRequest",
112
+ "operationReceipt",
113
+ "operationRecovery",
114
+ "operationRequest",
115
+ "operationState",
116
+ "operationSubmissionWitness",
117
+ "operationSubmitResult",
118
+ "operationCollectResult",
119
+ "operationInspectResult",
120
+ "operationControlResult",
64
121
  "surfaceProfile"
65
122
  ]
66
123
  },
@@ -0,0 +1,155 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://local.codex-chatgpt-control/contracts/v1/schemas/operation-action.schema.json",
4
+ "title": "Transactional browser operation action record",
5
+ "description": "A redacted, append-only action intent and postcondition record. It contains no user prompt, response, file content, or filesystem path.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "actionId",
10
+ "kind",
11
+ "repeatPolicy",
12
+ "requestDigest",
13
+ "intentRevision",
14
+ "intentAt"
15
+ ],
16
+ "properties": {
17
+ "actionId": { "$ref": "#/$defs/uuid" },
18
+ "kind": { "$ref": "#/$defs/actionKind" },
19
+ "repeatPolicy": { "$ref": "#/$defs/repeatPolicy" },
20
+ "requestDigest": { "$ref": "#/$defs/digest" },
21
+ "parentActionId": { "$ref": "#/$defs/uuid" },
22
+ "targetDigest": { "$ref": "#/$defs/digest" },
23
+ "intentRevision": { "$ref": "#/$defs/revision" },
24
+ "intentAt": { "$ref": "#/$defs/instant" },
25
+ "outcome": { "enum": ["satisfied", "not_satisfied", "uncertain"] },
26
+ "receiptRevision": { "$ref": "#/$defs/revision" },
27
+ "receiptAt": { "$ref": "#/$defs/instant" },
28
+ "evidenceDigest": { "$ref": "#/$defs/digest" },
29
+ "blockerCode": { "$ref": "#/$defs/code" }
30
+ },
31
+ "allOf": [
32
+ {
33
+ "if": { "required": ["outcome"], "properties": { "outcome": { "enum": ["satisfied", "not_satisfied", "uncertain"] } } },
34
+ "then": {
35
+ "required": ["receiptRevision", "receiptAt"],
36
+ "properties": {
37
+ "receiptRevision": { "$ref": "#/$defs/revision" },
38
+ "receiptAt": { "$ref": "#/$defs/instant" }
39
+ }
40
+ }
41
+ },
42
+ {
43
+ "if": { "required": ["receiptRevision"], "properties": { "receiptRevision": { "$ref": "#/$defs/revision" } } },
44
+ "then": {
45
+ "required": ["outcome", "receiptAt"],
46
+ "properties": {
47
+ "outcome": { "enum": ["satisfied", "not_satisfied", "uncertain"] },
48
+ "receiptAt": { "$ref": "#/$defs/instant" }
49
+ }
50
+ }
51
+ },
52
+ {
53
+ "if": { "required": ["receiptAt"] },
54
+ "then": {
55
+ "required": ["outcome", "receiptRevision"],
56
+ "properties": {
57
+ "outcome": { "enum": ["satisfied", "not_satisfied", "uncertain"] },
58
+ "receiptRevision": { "$ref": "#/$defs/revision" }
59
+ }
60
+ }
61
+ },
62
+ {
63
+ "if": { "required": ["evidenceDigest"], "properties": { "evidenceDigest": { "$ref": "#/$defs/digest" } } },
64
+ "then": {
65
+ "required": ["outcome"],
66
+ "properties": { "outcome": { "enum": ["satisfied", "not_satisfied", "uncertain"] } }
67
+ }
68
+ },
69
+ {
70
+ "if": { "required": ["blockerCode"], "properties": { "blockerCode": { "$ref": "#/$defs/code" } } },
71
+ "then": {
72
+ "required": ["outcome"],
73
+ "properties": { "outcome": { "enum": ["not_satisfied", "uncertain"] } }
74
+ }
75
+ },
76
+ {
77
+ "if": { "properties": { "outcome": { "const": "satisfied" } }, "required": ["outcome"] },
78
+ "then": {
79
+ "required": ["evidenceDigest"],
80
+ "properties": { "evidenceDigest": { "$ref": "#/$defs/digest" } }
81
+ }
82
+ },
83
+ {
84
+ "if": { "properties": { "kind": { "not": { "const": "status_read" } } }, "required": ["kind"] },
85
+ "then": {
86
+ "required": ["targetDigest"],
87
+ "properties": { "targetDigest": { "$ref": "#/$defs/digest" } }
88
+ }
89
+ },
90
+ {
91
+ "if": { "properties": { "kind": { "enum": ["status_read", "power_discovery"] } }, "required": ["kind"] },
92
+ "then": { "properties": { "repeatPolicy": { "const": "read_only" } } }
93
+ },
94
+ {
95
+ "if": { "properties": { "kind": { "enum": ["configuration_set", "tool_set", "composer_set", "power_select"] } }, "required": ["kind"] },
96
+ "then": { "properties": { "repeatPolicy": { "const": "reconcile_set_to_value" } } }
97
+ },
98
+ {
99
+ "if": { "properties": { "kind": { "enum": ["file_handoff", "send", "work_steer", "stop"] } }, "required": ["kind"] },
100
+ "then": { "properties": { "repeatPolicy": { "const": "observe_only_after_intent" } } }
101
+ },
102
+ {
103
+ "if": { "properties": { "kind": { "enum": ["download", "local_output_commit", "clipboard_capture_restore"] } }, "required": ["kind"] },
104
+ "then": { "properties": { "repeatPolicy": { "const": "reconcile_local_effect" } } }
105
+ }
106
+ ],
107
+ "$defs": {
108
+ "uuid": {
109
+ "type": "string",
110
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
111
+ },
112
+ "digest": {
113
+ "type": "string",
114
+ "pattern": "^hmac-sha256:[0-9a-f]{64}$"
115
+ },
116
+ "instant": {
117
+ "type": "string",
118
+ "pattern": "^(?!\\d{4}-02-(?:30|31)T)(?!\\d{4}-(?:04|06|09|11)-31T)\\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\\d|3[01])T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{3}Z$"
119
+ },
120
+ "revision": {
121
+ "type": "integer",
122
+ "minimum": 1,
123
+ "maximum": 9007199254740991
124
+ },
125
+ "code": {
126
+ "type": "string",
127
+ "pattern": "^[a-z][a-z0-9_]{0,63}$"
128
+ },
129
+ "actionKind": {
130
+ "enum": [
131
+ "status_read",
132
+ "configuration_set",
133
+ "tool_set",
134
+ "composer_set",
135
+ "power_discovery",
136
+ "power_select",
137
+ "file_handoff",
138
+ "send",
139
+ "work_steer",
140
+ "stop",
141
+ "download",
142
+ "local_output_commit",
143
+ "clipboard_capture_restore"
144
+ ]
145
+ },
146
+ "repeatPolicy": {
147
+ "enum": [
148
+ "read_only",
149
+ "reconcile_set_to_value",
150
+ "reconcile_local_effect",
151
+ "observe_only_after_intent"
152
+ ]
153
+ }
154
+ }
155
+ }