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
@@ -0,0 +1,89 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://local.codex-chatgpt-control/contracts/v1/schemas/operation-artifact-receipt.schema.json",
4
+ "title": "Transactional browser operation artifact receipt",
5
+ "description": "A redacted receipt for one operation-owned artifact and assistant turn. Output keys are opaque generated names, never caller-supplied paths.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schemaVersion", "operationId", "artifactKey", "assistantTurnId", "sourceIdentityDigest", "kind", "ordinal", "status"],
9
+ "properties": {
10
+ "schemaVersion": { "const": "chatgpt.browser_control.operation_artifact_receipt.v1" },
11
+ "operationId": { "$ref": "#/$defs/uuid" },
12
+ "artifactKey": { "$ref": "#/$defs/opaqueKey" },
13
+ "assistantTurnId": { "$ref": "#/$defs/opaqueId" },
14
+ "sourceIdentityDigest": { "$ref": "#/$defs/digest" },
15
+ "kind": { "enum": ["file", "image", "other"] },
16
+ "ordinal": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
17
+ "outputKey": { "$ref": "#/$defs/outputKey" },
18
+ "mimeType": {
19
+ "type": "string",
20
+ "minLength": 1,
21
+ "maxLength": 127,
22
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9!#$&^_.+/-]{0,126}$"
23
+ },
24
+ "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
25
+ "sha256": { "$ref": "#/$defs/sha256" },
26
+ "status": { "enum": ["available", "transferred", "partial", "blocked"] },
27
+ "blockerCode": { "$ref": "#/$defs/code" }
28
+ },
29
+ "allOf": [
30
+ {
31
+ "if": { "properties": { "status": { "const": "transferred" } }, "required": ["status"] },
32
+ "then": {
33
+ "required": ["outputKey", "bytes", "sha256"],
34
+ "properties": {
35
+ "outputKey": { "$ref": "#/$defs/outputKey" },
36
+ "bytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
37
+ "sha256": { "$ref": "#/$defs/sha256" }
38
+ }
39
+ }
40
+ },
41
+ {
42
+ "if": { "properties": { "status": { "enum": ["partial", "blocked"] } }, "required": ["status"] },
43
+ "then": {
44
+ "required": ["blockerCode"],
45
+ "properties": { "blockerCode": { "$ref": "#/$defs/code" } }
46
+ }
47
+ },
48
+ {
49
+ "if": { "properties": { "status": { "enum": ["available", "transferred"] } }, "required": ["status"] },
50
+ "then": { "not": { "required": ["blockerCode"] } }
51
+ }
52
+ ],
53
+ "$defs": {
54
+ "opaqueId": {
55
+ "type": "string",
56
+ "minLength": 1,
57
+ "maxLength": 512,
58
+ "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]{1,512}$"
59
+ },
60
+ "uuid": {
61
+ "type": "string",
62
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
63
+ },
64
+ "digest": {
65
+ "type": "string",
66
+ "pattern": "^hmac-sha256:[0-9a-f]{64}$"
67
+ },
68
+ "opaqueKey": {
69
+ "type": "string",
70
+ "minLength": 1,
71
+ "maxLength": 128,
72
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
73
+ },
74
+ "outputKey": {
75
+ "type": "string",
76
+ "minLength": 1,
77
+ "maxLength": 128,
78
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$"
79
+ },
80
+ "sha256": {
81
+ "type": "string",
82
+ "pattern": "^[0-9a-f]{64}$"
83
+ },
84
+ "code": {
85
+ "type": "string",
86
+ "pattern": "^[a-z][a-z0-9_]{0,63}$"
87
+ }
88
+ }
89
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://local.codex-chatgpt-control/contracts/v1/schemas/operation-blocker.schema.json",
4
+ "title": "Transactional browser operation blocker",
5
+ "description": "A structured public blocker taxonomy. The message is a transient caller-facing explanation and must be redacted before durable journal persistence.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schemaVersion", "code", "recoverable", "operationId", "requestDigest", "phase", "mutationBoundary", "message"],
9
+ "properties": {
10
+ "schemaVersion": { "const": "chatgpt.browser_control.operation_blocker.v1" },
11
+ "code": {
12
+ "enum": [
13
+ "operation_not_found",
14
+ "operation_request_mismatch",
15
+ "operation_state_corrupt",
16
+ "operation_receipt_expired",
17
+ "operation_quota_exceeded",
18
+ "operation_cancelled",
19
+ "operation_timeout",
20
+ "ambiguous_file_handoff",
21
+ "ambiguous_submit",
22
+ "attachment_manifest_mismatch",
23
+ "input_file_changed",
24
+ "target_binding_mismatch",
25
+ "target_evidence_unavailable",
26
+ "turn_ownership_ambiguous",
27
+ "concurrent_user_turn",
28
+ "configuration_drift",
29
+ "tab_ownership_conflict",
30
+ "provider_concurrency_unsupported",
31
+ "runtime_incompatible",
32
+ "backend_unavailable",
33
+ "browser_bridge_unavailable",
34
+ "login_required",
35
+ "captcha",
36
+ "rate_limited",
37
+ "permission_required",
38
+ "needs_confirmation",
39
+ "selector_drift",
40
+ "send_control_unavailable",
41
+ "capture_ownership_lost",
42
+ "artifact_unavailable",
43
+ "artifact_transfer_partial",
44
+ "output_collision",
45
+ "output_commit_indeterminate",
46
+ "clipboard_restore_failed"
47
+ ]
48
+ },
49
+ "recoverable": { "type": "boolean" },
50
+ "operationId": { "$ref": "#/$defs/uuid" },
51
+ "requestDigest": { "$ref": "#/$defs/digest" },
52
+ "phase": {
53
+ "enum": ["prepared", "handoff_pending", "ready", "send_pending", "submitted", "generating", "capturing", "completed", "uncertain"]
54
+ },
55
+ "mutationBoundary": {
56
+ "enum": ["none", "handoff_may_have_occurred", "send_may_have_occurred", "control_may_have_occurred"]
57
+ },
58
+ "message": { "type": "string", "minLength": 1, "maxLength": 4096 }
59
+ },
60
+ "$defs": {
61
+ "uuid": {
62
+ "type": "string",
63
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
64
+ },
65
+ "digest": {
66
+ "type": "string",
67
+ "pattern": "^hmac-sha256:[0-9a-f]{64}$"
68
+ }
69
+ }
70
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://local.codex-chatgpt-control/contracts/v1/schemas/operation-collect-request.schema.json",
4
+ "title": "Transactional browser operation collect request",
5
+ "description": "A browser-touching collect request. It can observe and capture only the exact operation-owned turn; it cannot compose, attach, or submit.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schemaVersion", "handle"],
9
+ "properties": {
10
+ "schemaVersion": { "const": "chatgpt.browser_control.operation_collect_request.v1" },
11
+ "handle": { "$ref": "#/$defs/handle" },
12
+ "wait": { "type": "boolean" },
13
+ "timeoutMs": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
14
+ "pollIntervalMs": { "type": "integer", "minimum": 0, "maximum": 60000 },
15
+ "responseContent": { "enum": ["include", "metadata"] }
16
+ },
17
+ "$defs": {
18
+ "uuid": {
19
+ "type": "string",
20
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
21
+ },
22
+ "digest": {
23
+ "type": "string",
24
+ "pattern": "^hmac-sha256:[0-9a-f]{64}$"
25
+ },
26
+ "handle": {
27
+ "type": "object",
28
+ "additionalProperties": false,
29
+ "required": ["schemaVersion", "operationId", "requestDigest", "surface", "revision", "phase", "mutationBoundary"],
30
+ "properties": {
31
+ "schemaVersion": { "const": "chatgpt.browser_control.operation_handle.v1" },
32
+ "operationId": { "$ref": "#/$defs/uuid" },
33
+ "requestDigest": { "$ref": "#/$defs/digest" },
34
+ "surface": { "enum": ["chat", "work"] },
35
+ "revision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 },
36
+ "phase": {
37
+ "enum": ["prepared", "handoff_pending", "ready", "send_pending", "submitted", "generating", "capturing", "completed", "uncertain"]
38
+ },
39
+ "mutationBoundary": {
40
+ "enum": ["none", "handoff_may_have_occurred", "send_may_have_occurred", "control_may_have_occurred"]
41
+ },
42
+ "targetBindingDigest": { "$ref": "#/$defs/digest" }
43
+ }
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,74 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://local.codex-chatgpt-control/contracts/v1/schemas/operation-collect-result.schema.json",
4
+ "title": "Transactional browser operation collect result",
5
+ "description": "A strict versioned collect envelope. Durable receipts contain metadata only; optional liveResponse is explicitly ephemeral and non-durable.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schemaVersion", "status", "operationId", "requestDigest", "handle"],
9
+ "properties": {
10
+ "schemaVersion": { "const": "chatgpt.browser_control.operation_collect_result.v1" },
11
+ "status": { "enum": ["completed", "pending", "blocked", "uncertain"] },
12
+ "operationId": { "$ref": "#/$defs/uuid" }, "requestDigest": { "$ref": "#/$defs/digest" }, "handle": { "$ref": "#/$defs/handle" },
13
+ "receipt": { "$ref": "#/$defs/receipt" }, "liveResponse": { "$ref": "#/$defs/liveResponse" }, "blocker": { "$ref": "#/$defs/blocker" }
14
+ },
15
+ "allOf": [
16
+ { "if": { "properties": { "status": { "const": "completed" } }, "required": ["status"] }, "then": { "required": ["receipt"], "properties": { "receipt": { "$ref": "#/$defs/receipt" }, "blocker": false } } },
17
+ { "if": { "properties": { "status": { "const": "pending" } }, "required": ["status"] }, "then": { "properties": { "receipt": false, "blocker": false, "liveResponse": false } } },
18
+ { "if": { "properties": { "status": { "enum": ["blocked", "uncertain"] } }, "required": ["status"] }, "then": { "required": ["blocker"], "properties": { "blocker": { "$ref": "#/$defs/blocker" }, "receipt": false, "liveResponse": false } } }
19
+ ],
20
+ "$defs": {
21
+ "uuid": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
22
+ "digest": { "type": "string", "pattern": "^hmac-sha256:[0-9a-f]{64}$" },
23
+ "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
24
+ "instant": { "type": "string", "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$" },
25
+ "opaqueId": { "type": "string", "minLength": 1, "maxLength": 512, "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]{1,512}$" },
26
+ "phase": { "enum": ["prepared", "handoff_pending", "ready", "send_pending", "submitted", "generating", "capturing", "completed", "uncertain"] },
27
+ "boundary": { "enum": ["none", "handoff_may_have_occurred", "send_may_have_occurred", "control_may_have_occurred"] },
28
+ "handle": {
29
+ "type": "object", "additionalProperties": false,
30
+ "required": ["schemaVersion", "operationId", "requestDigest", "surface", "revision", "phase", "mutationBoundary"],
31
+ "properties": {
32
+ "schemaVersion": { "const": "chatgpt.browser_control.operation_handle.v1" }, "operationId": { "$ref": "#/$defs/uuid" }, "requestDigest": { "$ref": "#/$defs/digest" },
33
+ "surface": { "enum": ["chat", "work"] }, "revision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "phase": { "$ref": "#/$defs/phase" }, "mutationBoundary": { "$ref": "#/$defs/boundary" }, "targetBindingDigest": { "$ref": "#/$defs/digest" }
34
+ }
35
+ },
36
+ "artifact": {
37
+ "type": "object", "additionalProperties": false,
38
+ "required": ["schemaVersion", "operationId", "artifactKey", "assistantTurnId", "sourceIdentityDigest", "kind", "ordinal", "status"],
39
+ "properties": {
40
+ "schemaVersion": { "const": "chatgpt.browser_control.operation_artifact_receipt.v1" }, "operationId": { "$ref": "#/$defs/uuid" }, "artifactKey": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$" }, "assistantTurnId": { "$ref": "#/$defs/opaqueId" }, "sourceIdentityDigest": { "$ref": "#/$defs/digest" }, "kind": { "enum": ["file", "image", "other"] }, "ordinal": { "type": "integer", "minimum": 0, "maximum": 31 }, "outputKey": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$" }, "mimeType": { "type": "string", "minLength": 1, "maxLength": 127, "pattern": "^[A-Za-z0-9][A-Za-z0-9!#$&^_.+/-]{0,126}$" }, "bytes": { "type": "integer", "minimum": 0, "maximum": 8388608 }, "sha256": { "$ref": "#/$defs/sha256" }, "status": { "enum": ["available", "transferred", "partial", "blocked"] }, "blockerCode": { "$ref": "#/$defs/code" }
41
+ },
42
+ "allOf": [
43
+ { "if": { "properties": { "status": { "const": "transferred" } }, "required": ["status"] }, "then": { "required": ["outputKey", "bytes", "sha256"], "properties": { "outputKey": { "type": "string" }, "bytes": { "type": "integer" }, "sha256": { "$ref": "#/$defs/sha256" } } } },
44
+ { "if": { "properties": { "status": { "enum": ["partial", "blocked"] } }, "required": ["status"] }, "then": { "required": ["blockerCode"], "properties": { "blockerCode": { "$ref": "#/$defs/code" } } } },
45
+ { "if": { "properties": { "status": { "enum": ["available", "transferred"] } }, "required": ["status"] }, "then": { "properties": { "blockerCode": false } } }
46
+ ]
47
+ },
48
+ "receipt": {
49
+ "type": "object", "additionalProperties": false,
50
+ "required": ["schemaVersion", "operationId", "requestDigest", "targetBindingDigest", "userTurnId", "userTurnEvidenceDigest", "assistantTurnId", "ownershipEvidenceDigest", "finishReason", "contentAvailable", "artifacts", "completedAt"],
51
+ "properties": {
52
+ "schemaVersion": { "const": "chatgpt.browser_control.operation_receipt.v1" }, "operationId": { "$ref": "#/$defs/uuid" }, "requestDigest": { "$ref": "#/$defs/digest" }, "targetBindingDigest": { "$ref": "#/$defs/digest" }, "userTurnId": { "$ref": "#/$defs/opaqueId" }, "userTurnEvidenceDigest": { "$ref": "#/$defs/digest" }, "assistantTurnId": { "$ref": "#/$defs/opaqueId" }, "ownershipEvidenceDigest": { "$ref": "#/$defs/digest" }, "responseDigest": { "$ref": "#/$defs/digest" }, "responseBytes": { "type": "integer", "minimum": 0, "maximum": 8388608 }, "responseFormat": { "enum": ["markdown", "text"] }, "finishReason": { "type": "string", "minLength": 1, "maxLength": 128, "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$" }, "contentAvailable": { "type": "boolean" }, "artifacts": { "type": "array", "maxItems": 32, "items": { "$ref": "#/$defs/artifact" } }, "completedAt": { "$ref": "#/$defs/instant" }
53
+ },
54
+ "dependentRequired": { "responseDigest": ["responseBytes"], "responseBytes": ["responseDigest"] },
55
+ "allOf": [{ "if": { "properties": { "contentAvailable": { "const": true } }, "required": ["contentAvailable"] }, "then": { "required": ["responseDigest", "responseBytes"], "properties": { "responseDigest": { "$ref": "#/$defs/digest" }, "responseBytes": { "type": "integer", "minimum": 0, "maximum": 8388608 } } } }]
56
+ },
57
+ "liveResponse": {
58
+ "type": "object", "additionalProperties": false,
59
+ "required": ["schemaVersion", "durability", "durable", "content", "bytes", "chars"],
60
+ "properties": {
61
+ "schemaVersion": { "const": "chatgpt.browser_control.operation_live_response.v1" }, "durability": { "const": "ephemeral" }, "durable": { "const": false },
62
+ "content": { "type": "string", "maxLength": 8388608 }, "responseFormat": { "enum": ["markdown", "text"] }, "bytes": { "type": "integer", "minimum": 0, "maximum": 8388608 }, "chars": { "type": "integer", "minimum": 0, "maximum": 8388608 }
63
+ }
64
+ },
65
+ "code": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,63}$" },
66
+ "blocker": {
67
+ "type": "object", "additionalProperties": false,
68
+ "required": ["schemaVersion", "code", "recoverable", "operationId", "requestDigest", "phase", "mutationBoundary", "message"],
69
+ "properties": {
70
+ "schemaVersion": { "const": "chatgpt.browser_control.operation_blocker.v1" }, "code": { "$ref": "#/$defs/code" }, "recoverable": { "type": "boolean" }, "operationId": { "$ref": "#/$defs/uuid" }, "requestDigest": { "$ref": "#/$defs/digest" }, "phase": { "$ref": "#/$defs/phase" }, "mutationBoundary": { "$ref": "#/$defs/boundary" }, "message": { "type": "string", "minLength": 1, "maxLength": 512, "pattern": "^[A-Za-z0-9][A-Za-z0-9 .,:;'()\\-]{0,511}$" }
71
+ }
72
+ }
73
+ }
74
+ }
@@ -0,0 +1,108 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://local.codex-chatgpt-control/contracts/v1/schemas/operation-control-receipt.schema.json",
4
+ "title": "Transactional browser operation control receipt",
5
+ "description": "A redacted receipt for one operation-bound stop or steer action. It never contains the steer text or response content.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schemaVersion",
10
+ "controlActionId",
11
+ "parentOperationId",
12
+ "parentRequestDigest",
13
+ "parentTargetBindingDigest",
14
+ "expectedAssistantTurnId",
15
+ "requestDigest",
16
+ "action",
17
+ "outcome",
18
+ "observedAt"
19
+ ],
20
+ "properties": {
21
+ "schemaVersion": { "const": "chatgpt.browser_control.operation_control_receipt.v1" },
22
+ "controlActionId": { "$ref": "#/$defs/uuid" },
23
+ "parentOperationId": { "$ref": "#/$defs/uuid" },
24
+ "parentRequestDigest": { "$ref": "#/$defs/digest" },
25
+ "parentTargetBindingDigest": { "$ref": "#/$defs/digest" },
26
+ "expectedAssistantTurnId": { "$ref": "#/$defs/opaqueId" },
27
+ "requestDigest": { "$ref": "#/$defs/digest" },
28
+ "action": { "enum": ["stop", "steer"] },
29
+ "outcome": { "enum": ["satisfied", "not_satisfied", "uncertain"] },
30
+ "evidenceDigest": { "$ref": "#/$defs/digest" },
31
+ "blockerCode": { "$ref": "#/$defs/blockerCode" },
32
+ "observedAt": { "$ref": "#/$defs/instant" }
33
+ },
34
+ "allOf": [
35
+ {
36
+ "if": { "properties": { "outcome": { "const": "satisfied" } }, "required": ["outcome"] },
37
+ "then": {
38
+ "required": ["evidenceDigest"],
39
+ "properties": {
40
+ "evidenceDigest": { "$ref": "#/$defs/digest" },
41
+ "blockerCode": false
42
+ }
43
+ }
44
+ },
45
+ {
46
+ "if": { "properties": { "outcome": { "enum": ["not_satisfied", "uncertain"] } }, "required": ["outcome"] },
47
+ "then": { "required": ["blockerCode"] }
48
+ }
49
+ ],
50
+ "$defs": {
51
+ "uuid": {
52
+ "type": "string",
53
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
54
+ },
55
+ "digest": {
56
+ "type": "string",
57
+ "pattern": "^hmac-sha256:[0-9a-f]{64}$"
58
+ },
59
+ "opaqueId": {
60
+ "type": "string",
61
+ "minLength": 1,
62
+ "maxLength": 512,
63
+ "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]{1,512}$"
64
+ },
65
+ "instant": {
66
+ "type": "string",
67
+ "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$"
68
+ },
69
+ "blockerCode": {
70
+ "enum": [
71
+ "operation_not_found",
72
+ "operation_request_mismatch",
73
+ "operation_state_corrupt",
74
+ "operation_receipt_expired",
75
+ "operation_quota_exceeded",
76
+ "operation_cancelled",
77
+ "operation_timeout",
78
+ "ambiguous_file_handoff",
79
+ "ambiguous_submit",
80
+ "attachment_manifest_mismatch",
81
+ "input_file_changed",
82
+ "target_binding_mismatch",
83
+ "target_evidence_unavailable",
84
+ "turn_ownership_ambiguous",
85
+ "concurrent_user_turn",
86
+ "configuration_drift",
87
+ "tab_ownership_conflict",
88
+ "provider_concurrency_unsupported",
89
+ "runtime_incompatible",
90
+ "backend_unavailable",
91
+ "browser_bridge_unavailable",
92
+ "login_required",
93
+ "captcha",
94
+ "rate_limited",
95
+ "permission_required",
96
+ "needs_confirmation",
97
+ "selector_drift",
98
+ "send_control_unavailable",
99
+ "capture_ownership_lost",
100
+ "artifact_unavailable",
101
+ "artifact_transfer_partial",
102
+ "output_collision",
103
+ "output_commit_indeterminate",
104
+ "clipboard_restore_failed"
105
+ ]
106
+ }
107
+ }
108
+ }
@@ -0,0 +1,111 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://local.codex-chatgpt-control/contracts/v1/schemas/operation-control-request.schema.json",
4
+ "title": "Transactional browser operation control request",
5
+ "description": "A request-only, caller-owned stop or steer action bound to an immutable parent handle and expected assistant turn. steerPrompt is transient and must not enter durable state.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schemaVersion",
10
+ "controlActionId",
11
+ "parent",
12
+ "action",
13
+ "expectedAssistantTurnId"
14
+ ],
15
+ "properties": {
16
+ "schemaVersion": { "const": "chatgpt.browser_control.operation_control_request.v1" },
17
+ "controlActionId": { "$ref": "#/$defs/uuid" },
18
+ "parent": { "$ref": "#/$defs/handle" },
19
+ "action": { "enum": ["stop", "steer"] },
20
+ "expectedAssistantTurnId": { "$ref": "#/$defs/opaqueId" },
21
+ "steerPrompt": { "type": "string", "minLength": 1, "maxLength": 8388608 },
22
+ "timeoutMs": { "$ref": "#/$defs/timeoutMs" }
23
+ },
24
+ "allOf": [
25
+ {
26
+ "if": { "properties": { "action": { "const": "steer" } }, "required": ["action"] },
27
+ "then": {
28
+ "required": ["steerPrompt"],
29
+ "properties": { "steerPrompt": { "type": "string", "minLength": 1, "maxLength": 8388608 } }
30
+ }
31
+ },
32
+ {
33
+ "if": { "properties": { "action": { "const": "stop" } }, "required": ["action"] },
34
+ "then": { "properties": { "steerPrompt": false } }
35
+ },
36
+ {
37
+ "properties": {
38
+ "parent": {
39
+ "type": "object",
40
+ "required": ["targetBindingDigest"],
41
+ "properties": {
42
+ "phase": { "const": "generating" },
43
+ "targetBindingDigest": { "$ref": "#/$defs/digest" }
44
+ }
45
+ }
46
+ }
47
+ }
48
+ ],
49
+ "$defs": {
50
+ "uuid": {
51
+ "type": "string",
52
+ "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
53
+ },
54
+ "digest": {
55
+ "type": "string",
56
+ "pattern": "^hmac-sha256:[0-9a-f]{64}$"
57
+ },
58
+ "opaqueId": {
59
+ "type": "string",
60
+ "minLength": 1,
61
+ "maxLength": 512,
62
+ "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]{1,512}$"
63
+ },
64
+ "timeoutMs": {
65
+ "type": "integer",
66
+ "minimum": 0,
67
+ "maximum": 9007199254740991
68
+ },
69
+ "handle": {
70
+ "type": "object",
71
+ "additionalProperties": false,
72
+ "required": [
73
+ "schemaVersion",
74
+ "operationId",
75
+ "requestDigest",
76
+ "surface",
77
+ "revision",
78
+ "phase",
79
+ "mutationBoundary"
80
+ ],
81
+ "properties": {
82
+ "schemaVersion": { "const": "chatgpt.browser_control.operation_handle.v1" },
83
+ "operationId": { "$ref": "#/$defs/uuid" },
84
+ "requestDigest": { "$ref": "#/$defs/digest" },
85
+ "surface": { "enum": ["chat", "work"] },
86
+ "revision": {
87
+ "type": "integer",
88
+ "minimum": 1,
89
+ "maximum": 9007199254740991
90
+ },
91
+ "phase": {
92
+ "enum": [
93
+ "prepared",
94
+ "handoff_pending",
95
+ "ready",
96
+ "send_pending",
97
+ "submitted",
98
+ "generating",
99
+ "capturing",
100
+ "completed",
101
+ "uncertain"
102
+ ]
103
+ },
104
+ "mutationBoundary": {
105
+ "enum": ["none", "handoff_may_have_occurred", "send_may_have_occurred", "control_may_have_occurred"]
106
+ },
107
+ "targetBindingDigest": { "$ref": "#/$defs/digest" }
108
+ }
109
+ }
110
+ }
111
+ }
@@ -0,0 +1,112 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://local.codex-chatgpt-control/contracts/v1/schemas/operation-control-result.schema.json",
4
+ "title": "Transactional browser operation control result",
5
+ "description": "A strict versioned stop or steer envelope. The handle is the freshly reloaded parent handle; steer text is never present.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schemaVersion", "status", "operationId", "requestDigest", "handle", "parentRequestDigest", "parentTargetBindingDigest", "controlActionId", "action", "expectedAssistantTurnId"],
9
+ "properties": {
10
+ "schemaVersion": { "const": "chatgpt.browser_control.operation_control_result.v1" },
11
+ "status": { "enum": ["completed", "blocked", "uncertain"] },
12
+ "operationId": { "$ref": "#/$defs/uuid" },
13
+ "requestDigest": {
14
+ "$ref": "#/$defs/digest",
15
+ "description": "Digest of the child stop or steer request; it is intentionally distinct from the parent handle digest."
16
+ },
17
+ "handle": {
18
+ "$ref": "#/$defs/handle",
19
+ "description": "Freshly reloaded parent operation handle, bound to parentRequestDigest."
20
+ },
21
+ "parentRequestDigest": {
22
+ "$ref": "#/$defs/digest",
23
+ "description": "Immutable parent operation request digest used by the handle and blocker."
24
+ },
25
+ "parentTargetBindingDigest": { "$ref": "#/$defs/digest" }, "controlActionId": { "$ref": "#/$defs/uuid" },
26
+ "action": { "enum": ["stop", "steer"] }, "expectedAssistantTurnId": { "$ref": "#/$defs/opaqueId" },
27
+ "receipt": { "$ref": "#/$defs/receipt" }, "blocker": { "$ref": "#/$defs/blocker" }
28
+ },
29
+ "allOf": [
30
+ {
31
+ "if": { "properties": { "status": { "const": "completed" } }, "required": ["status"] },
32
+ "then": {
33
+ "required": ["receipt"],
34
+ "properties": {
35
+ "receipt": { "allOf": [{ "$ref": "#/$defs/receipt" }, { "type": "object", "required": ["outcome"], "properties": { "outcome": { "const": "satisfied" } } }] },
36
+ "blocker": false
37
+ }
38
+ }
39
+ },
40
+ {
41
+ "if": { "properties": { "status": { "const": "blocked" } }, "required": ["status"] },
42
+ "then": {
43
+ "required": ["blocker"],
44
+ "properties": {
45
+ "blocker": { "$ref": "#/$defs/blocker" },
46
+ "receipt": { "allOf": [{ "$ref": "#/$defs/receipt" }, { "type": "object", "required": ["outcome"], "properties": { "outcome": { "const": "not_satisfied" } } }] }
47
+ }
48
+ }
49
+ },
50
+ {
51
+ "if": { "properties": { "status": { "const": "uncertain" } }, "required": ["status"] },
52
+ "then": {
53
+ "required": ["blocker"],
54
+ "properties": {
55
+ "blocker": { "$ref": "#/$defs/blocker" },
56
+ "receipt": { "allOf": [{ "$ref": "#/$defs/receipt" }, { "type": "object", "required": ["outcome"], "properties": { "outcome": { "const": "uncertain" } } }] }
57
+ }
58
+ }
59
+ }
60
+ ],
61
+ "$defs": {
62
+ "uuid": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
63
+ "digest": { "type": "string", "pattern": "^hmac-sha256:[0-9a-f]{64}$" },
64
+ "opaqueId": { "type": "string", "minLength": 1, "maxLength": 512, "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]{1,512}$" },
65
+ "instant": { "type": "string", "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$" },
66
+ "phase": { "enum": ["prepared", "handoff_pending", "ready", "send_pending", "submitted", "generating", "capturing", "completed", "uncertain"] },
67
+ "boundary": { "enum": ["none", "handoff_may_have_occurred", "send_may_have_occurred", "control_may_have_occurred"] },
68
+ "handle": {
69
+ "type": "object", "additionalProperties": false,
70
+ "required": ["schemaVersion", "operationId", "requestDigest", "surface", "revision", "phase", "mutationBoundary", "targetBindingDigest"],
71
+ "properties": { "schemaVersion": { "const": "chatgpt.browser_control.operation_handle.v1" }, "operationId": { "$ref": "#/$defs/uuid" }, "requestDigest": { "$ref": "#/$defs/digest" }, "surface": { "enum": ["chat", "work"] }, "revision": { "type": "integer", "minimum": 1, "maximum": 9007199254740991 }, "phase": { "$ref": "#/$defs/phase" }, "mutationBoundary": { "$ref": "#/$defs/boundary" }, "targetBindingDigest": { "$ref": "#/$defs/digest" } }
72
+ },
73
+ "receipt": {
74
+ "type": "object", "additionalProperties": false,
75
+ "required": ["schemaVersion", "controlActionId", "parentOperationId", "parentRequestDigest", "parentTargetBindingDigest", "expectedAssistantTurnId", "requestDigest", "action", "outcome", "observedAt"],
76
+ "properties": {
77
+ "schemaVersion": { "const": "chatgpt.browser_control.operation_control_receipt.v1" }, "controlActionId": { "$ref": "#/$defs/uuid" }, "parentOperationId": { "$ref": "#/$defs/uuid" }, "parentRequestDigest": { "$ref": "#/$defs/digest" }, "parentTargetBindingDigest": { "$ref": "#/$defs/digest" }, "expectedAssistantTurnId": { "$ref": "#/$defs/opaqueId" }, "requestDigest": { "$ref": "#/$defs/digest" }, "action": { "enum": ["stop", "steer"] }, "outcome": { "enum": ["satisfied", "not_satisfied", "uncertain"] }, "evidenceDigest": { "$ref": "#/$defs/digest" }, "blockerCode": { "$ref": "#/$defs/code" }, "observedAt": { "$ref": "#/$defs/instant" }
78
+ },
79
+ "allOf": [
80
+ {
81
+ "if": { "properties": { "outcome": { "const": "satisfied" } }, "required": ["outcome"] },
82
+ "then": {
83
+ "required": ["evidenceDigest"],
84
+ "properties": { "evidenceDigest": { "$ref": "#/$defs/digest" }, "blockerCode": false }
85
+ }
86
+ },
87
+ {
88
+ "if": { "properties": { "outcome": { "enum": ["not_satisfied", "uncertain"] } }, "required": ["outcome"] },
89
+ "then": { "required": ["blockerCode"] }
90
+ }
91
+ ]
92
+ },
93
+ "code": { "type": "string", "pattern": "^[a-z][a-z0-9_]{0,63}$" },
94
+ "blocker": {
95
+ "type": "object", "additionalProperties": false,
96
+ "required": ["schemaVersion", "code", "recoverable", "operationId", "requestDigest", "phase", "mutationBoundary", "message"],
97
+ "properties": {
98
+ "schemaVersion": { "const": "chatgpt.browser_control.operation_blocker.v1" },
99
+ "code": { "$ref": "#/$defs/code" },
100
+ "recoverable": { "type": "boolean" },
101
+ "operationId": { "$ref": "#/$defs/uuid" },
102
+ "requestDigest": {
103
+ "$ref": "#/$defs/digest",
104
+ "description": "Parent operation request digest; a control blocker never identifies the child request here."
105
+ },
106
+ "phase": { "$ref": "#/$defs/phase" },
107
+ "mutationBoundary": { "$ref": "#/$defs/boundary" },
108
+ "message": { "type": "string", "minLength": 1, "maxLength": 512, "pattern": "^[A-Za-z0-9][A-Za-z0-9 .,:;'()\\-]{0,511}$" }
109
+ }
110
+ }
111
+ }
112
+ }