@tomflow/chatloop-tools 0.9.64 → 0.9.70

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 (175) hide show
  1. package/node_modules/@tomflow/chatloop-context/README.md +296 -0
  2. package/node_modules/@tomflow/chatloop-context/bin/cli.mjs +48 -0
  3. package/node_modules/@tomflow/chatloop-context/capabilities/approval.mjs +151 -0
  4. package/node_modules/@tomflow/chatloop-context/capabilities/context.mjs +376 -0
  5. package/node_modules/@tomflow/chatloop-context/capabilities/document.mjs +290 -0
  6. package/node_modules/@tomflow/chatloop-context/capabilities/evidence.mjs +134 -0
  7. package/node_modules/@tomflow/chatloop-context/capabilities/presentation.mjs +82 -0
  8. package/node_modules/@tomflow/chatloop-context/capabilities/project.mjs +349 -0
  9. package/node_modules/@tomflow/chatloop-context/capabilities/sdk.mjs +72 -0
  10. package/node_modules/@tomflow/chatloop-context/capabilities/start.mjs +73 -0
  11. package/node_modules/@tomflow/chatloop-context/capabilities/task.mjs +507 -0
  12. package/node_modules/@tomflow/chatloop-context/capabilities.generated.mjs +11 -0
  13. package/node_modules/@tomflow/chatloop-context/docs/interfaces.md +261 -0
  14. package/node_modules/@tomflow/chatloop-context/docs/operator-and-migration.md +277 -0
  15. package/node_modules/@tomflow/chatloop-context/index.mjs +238 -0
  16. package/node_modules/@tomflow/chatloop-context/lib/api-log.mjs +86 -0
  17. package/node_modules/@tomflow/chatloop-context/lib/approval-policy.mjs +77 -0
  18. package/node_modules/@tomflow/chatloop-context/lib/capability-catalog.generated.json +2036 -0
  19. package/node_modules/@tomflow/chatloop-context/lib/capability-router.mjs +69 -0
  20. package/node_modules/@tomflow/chatloop-context/lib/cli-commands.mjs +338 -0
  21. package/node_modules/@tomflow/chatloop-context/lib/context-cli.mjs +298 -0
  22. package/node_modules/@tomflow/chatloop-context/lib/context-migration.mjs +286 -0
  23. package/node_modules/@tomflow/chatloop-context/lib/core/context.mjs +117 -0
  24. package/node_modules/@tomflow/chatloop-context/lib/core/evidence.mjs +51 -0
  25. package/node_modules/@tomflow/chatloop-context/lib/core/health.mjs +134 -0
  26. package/node_modules/@tomflow/chatloop-context/lib/core/migration.mjs +262 -0
  27. package/node_modules/@tomflow/chatloop-context/lib/core/project.mjs +246 -0
  28. package/node_modules/@tomflow/chatloop-context/lib/core/review.mjs +180 -0
  29. package/node_modules/@tomflow/chatloop-context/lib/core/run-cancel.mjs +68 -0
  30. package/node_modules/@tomflow/chatloop-context/lib/core/run-recovery.mjs +112 -0
  31. package/node_modules/@tomflow/chatloop-context/lib/core/run.mjs +367 -0
  32. package/node_modules/@tomflow/chatloop-context/lib/core/store.mjs +398 -0
  33. package/node_modules/@tomflow/chatloop-context/lib/core/task.mjs +264 -0
  34. package/node_modules/@tomflow/chatloop-context/lib/line-review.mjs +13 -0
  35. package/node_modules/@tomflow/chatloop-context/lib/methods.mjs +111 -0
  36. package/node_modules/@tomflow/chatloop-context/lib/operations.mjs +107 -0
  37. package/node_modules/@tomflow/chatloop-context/lib/orphan-operator.mjs +118 -0
  38. package/node_modules/@tomflow/chatloop-context/lib/process-inventory.mjs +20 -0
  39. package/node_modules/@tomflow/chatloop-context/lib/project-branch.mjs +316 -0
  40. package/node_modules/@tomflow/chatloop-context/lib/project-diagnostic.mjs +153 -0
  41. package/node_modules/@tomflow/chatloop-context/lib/project-guards.mjs +19 -0
  42. package/node_modules/@tomflow/chatloop-context/lib/project-store.mjs +117 -0
  43. package/node_modules/@tomflow/chatloop-context/lib/trusted-run.mjs +142 -0
  44. package/node_modules/@tomflow/chatloop-context/lib/workspace-operator.mjs +169 -0
  45. package/node_modules/@tomflow/chatloop-context/package.json +38 -0
  46. package/node_modules/@tomflow/chatloop-context/scripts/build-capabilities.mjs +114 -0
  47. package/node_modules/@tomflow/chatloop-extension/README.md +190 -0
  48. package/node_modules/@tomflow/chatloop-extension/actions.generated.mjs +13 -0
  49. package/node_modules/@tomflow/chatloop-extension/bin/cli.mjs +168 -0
  50. package/node_modules/@tomflow/chatloop-extension/bin/native-host.mjs +246 -0
  51. package/node_modules/@tomflow/chatloop-extension/capabilities/chat_dom.mjs +1 -0
  52. package/node_modules/@tomflow/chatloop-extension/capabilities/chat_screenshot.mjs +1 -0
  53. package/node_modules/@tomflow/chatloop-extension/capabilities/chat_text.mjs +1 -0
  54. package/node_modules/@tomflow/chatloop-extension/capabilities/clean.mjs +1 -0
  55. package/node_modules/@tomflow/chatloop-extension/capabilities/continue.mjs +1 -0
  56. package/node_modules/@tomflow/chatloop-extension/capabilities/entry_test.mjs +1 -0
  57. package/node_modules/@tomflow/chatloop-extension/capabilities/handoff.mjs +1 -0
  58. package/node_modules/@tomflow/chatloop-extension/capabilities/reload.mjs +1 -0
  59. package/node_modules/@tomflow/chatloop-extension/capabilities/session.mjs +1 -0
  60. package/node_modules/@tomflow/chatloop-extension/capabilities/start.mjs +1 -0
  61. package/node_modules/@tomflow/chatloop-extension/capabilities/status.mjs +1 -0
  62. package/node_modules/@tomflow/chatloop-extension/extension/actions/clean.js +123 -0
  63. package/node_modules/@tomflow/chatloop-extension/extension/actions/common.js +183 -0
  64. package/node_modules/@tomflow/chatloop-extension/extension/actions/continue.js +390 -0
  65. package/node_modules/@tomflow/chatloop-extension/extension/actions/dom.js +2 -0
  66. package/node_modules/@tomflow/chatloop-extension/extension/actions/entry_test.js +241 -0
  67. package/node_modules/@tomflow/chatloop-extension/extension/actions/handoff-scoped.js +143 -0
  68. package/node_modules/@tomflow/chatloop-extension/extension/actions/handoff.js +399 -0
  69. package/node_modules/@tomflow/chatloop-extension/extension/actions/index.js +2 -0
  70. package/node_modules/@tomflow/chatloop-extension/extension/actions/model-intent.js +60 -0
  71. package/node_modules/@tomflow/chatloop-extension/extension/actions/read-mode.js +9 -0
  72. package/node_modules/@tomflow/chatloop-extension/extension/actions/reload.js +20 -0
  73. package/node_modules/@tomflow/chatloop-extension/extension/actions/screenshot.js +77 -0
  74. package/node_modules/@tomflow/chatloop-extension/extension/actions/session.js +95 -0
  75. package/node_modules/@tomflow/chatloop-extension/extension/actions/start.js +329 -0
  76. package/node_modules/@tomflow/chatloop-extension/extension/actions/status.js +38 -0
  77. package/node_modules/@tomflow/chatloop-extension/extension/actions/text.js +2 -0
  78. package/node_modules/@tomflow/chatloop-extension/extension/background.js +33 -0
  79. package/node_modules/@tomflow/chatloop-extension/extension/clean.html +5 -0
  80. package/node_modules/@tomflow/chatloop-extension/extension/content.js +40 -0
  81. package/node_modules/@tomflow/chatloop-extension/extension/continue.html +9 -0
  82. package/node_modules/@tomflow/chatloop-extension/extension/dom.html +17 -0
  83. package/node_modules/@tomflow/chatloop-extension/extension/entry_test.html +6 -0
  84. package/node_modules/@tomflow/chatloop-extension/extension/handoff.html +9 -0
  85. package/node_modules/@tomflow/chatloop-extension/extension/loop/action-catalog.generated.js +2 -0
  86. package/node_modules/@tomflow/chatloop-extension/extension/loop/api-aspect.generated.js +275 -0
  87. package/node_modules/@tomflow/chatloop-extension/extension/loop/api-observation-queue.generated.js +84 -0
  88. package/node_modules/@tomflow/chatloop-extension/extension/loop/core.js +107 -0
  89. package/node_modules/@tomflow/chatloop-extension/extension/loop/index.js +36 -0
  90. package/node_modules/@tomflow/chatloop-extension/extension/loop/observer-approval.js +299 -0
  91. package/node_modules/@tomflow/chatloop-extension/extension/loop/observer-inspect.js +144 -0
  92. package/node_modules/@tomflow/chatloop-extension/extension/loop/observer-poll.js +172 -0
  93. package/node_modules/@tomflow/chatloop-extension/extension/loop/observer-recovery.js +109 -0
  94. package/node_modules/@tomflow/chatloop-extension/extension/loop/observer.js +211 -0
  95. package/node_modules/@tomflow/chatloop-extension/extension/loop/resource-maintenance.js +159 -0
  96. package/node_modules/@tomflow/chatloop-extension/extension/loop/resources.js +399 -0
  97. package/node_modules/@tomflow/chatloop-extension/extension/manifest.json +43 -0
  98. package/node_modules/@tomflow/chatloop-extension/extension/popup.html +25 -0
  99. package/node_modules/@tomflow/chatloop-extension/extension/popup.js +99 -0
  100. package/node_modules/@tomflow/chatloop-extension/extension/reload.html +17 -0
  101. package/node_modules/@tomflow/chatloop-extension/extension/screenshot.html +17 -0
  102. package/node_modules/@tomflow/chatloop-extension/extension/session.html +7 -0
  103. package/node_modules/@tomflow/chatloop-extension/extension/start.html +6 -0
  104. package/node_modules/@tomflow/chatloop-extension/extension/status.html +6 -0
  105. package/node_modules/@tomflow/chatloop-extension/extension/text.html +17 -0
  106. package/node_modules/@tomflow/chatloop-extension/extension/worker/action-result.js +136 -0
  107. package/node_modules/@tomflow/chatloop-extension/extension/worker/action-take.js +218 -0
  108. package/node_modules/@tomflow/chatloop-extension/extension/worker/admission.js +127 -0
  109. package/node_modules/@tomflow/chatloop-extension/extension/worker/adopt-prepare.js +296 -0
  110. package/node_modules/@tomflow/chatloop-extension/extension/worker/adopt-recovery.js +186 -0
  111. package/node_modules/@tomflow/chatloop-extension/extension/worker/adopt-result.js +126 -0
  112. package/node_modules/@tomflow/chatloop-extension/extension/worker/bootstrap.js +287 -0
  113. package/node_modules/@tomflow/chatloop-extension/extension/worker/manual.js +163 -0
  114. package/node_modules/@tomflow/chatloop-extension/extension/worker/readiness.js +345 -0
  115. package/node_modules/@tomflow/chatloop-extension/extension/worker/router.js +209 -0
  116. package/node_modules/@tomflow/chatloop-extension/extension/worker/scheduler.js +385 -0
  117. package/node_modules/@tomflow/chatloop-extension/extension/worker/session-control.js +75 -0
  118. package/node_modules/@tomflow/chatloop-extension/extension/worker/task-action-v2.js +278 -0
  119. package/node_modules/@tomflow/chatloop-extension/extension/worker/task-cancel-recovery-v2.js +52 -0
  120. package/node_modules/@tomflow/chatloop-extension/extension/worker/task-cancel-v2.js +93 -0
  121. package/node_modules/@tomflow/chatloop-extension/extension/worker/task-continue-recovery-v2.js +78 -0
  122. package/node_modules/@tomflow/chatloop-extension/extension/worker/task-handoff-recovery-v2.js +148 -0
  123. package/node_modules/@tomflow/chatloop-extension/extension/worker/task-handoff-v2.js +325 -0
  124. package/node_modules/@tomflow/chatloop-extension/extension/worker/task-hold-recovery-v2.js +109 -0
  125. package/node_modules/@tomflow/chatloop-extension/extension/worker/task-intent-dispatch-v2.js +220 -0
  126. package/node_modules/@tomflow/chatloop-extension/extension/worker/task-intent-v2.js +106 -0
  127. package/node_modules/@tomflow/chatloop-extension/extension/worker/task-owner-resolver.js +110 -0
  128. package/node_modules/@tomflow/chatloop-extension/extension/worker/task-recover-v2.js +209 -0
  129. package/node_modules/@tomflow/chatloop-extension/extension/worker/task-routes-v2.js +357 -0
  130. package/node_modules/@tomflow/chatloop-extension/extension/worker/task-run-store.js +400 -0
  131. package/node_modules/@tomflow/chatloop-extension/extension/worker/task-scheduler.js +78 -0
  132. package/node_modules/@tomflow/chatloop-extension/extension/worker/task-start-v2.js +361 -0
  133. package/node_modules/@tomflow/chatloop-extension/extension/worker/task-terminal-v2.js +235 -0
  134. package/node_modules/@tomflow/chatloop-extension/extension/worker/turn-failure.js +197 -0
  135. package/node_modules/@tomflow/chatloop-extension/extension/worker/turn-finished.js +205 -0
  136. package/node_modules/@tomflow/chatloop-extension/index.mjs +78 -0
  137. package/node_modules/@tomflow/chatloop-extension/lib/action-routing.mjs +19 -0
  138. package/node_modules/@tomflow/chatloop-extension/lib/api-observation-queue.mjs +82 -0
  139. package/node_modules/@tomflow/chatloop-extension/lib/bridge.mjs +378 -0
  140. package/node_modules/@tomflow/chatloop-extension/lib/browser-launch.mjs +89 -0
  141. package/node_modules/@tomflow/chatloop-extension/lib/context-binding.mjs +45 -0
  142. package/node_modules/@tomflow/chatloop-extension/lib/context-ipc.mjs +122 -0
  143. package/node_modules/@tomflow/chatloop-extension/lib/owner-evidence.mjs +75 -0
  144. package/node_modules/@tomflow/chatloop-extension/lib/owner-kernel-lock.mjs +106 -0
  145. package/node_modules/@tomflow/chatloop-extension/lib/owner-ledger.mjs +316 -0
  146. package/node_modules/@tomflow/chatloop-extension/lib/owner-locked-write.mjs +30 -0
  147. package/node_modules/@tomflow/chatloop-extension/lib/scoped-cancel-v2.mjs +190 -0
  148. package/node_modules/@tomflow/chatloop-extension/lib/scoped-continue-v2.mjs +214 -0
  149. package/node_modules/@tomflow/chatloop-extension/lib/scoped-handoff-v2.mjs +338 -0
  150. package/node_modules/@tomflow/chatloop-extension/lib/scoped-native-control.mjs +398 -0
  151. package/node_modules/@tomflow/chatloop-extension/lib/scoped-recovery-v2.mjs +234 -0
  152. package/node_modules/@tomflow/chatloop-extension/lib/scoped-retire-v2.mjs +70 -0
  153. package/node_modules/@tomflow/chatloop-extension/lib/scoped-terminal-v2.mjs +143 -0
  154. package/node_modules/@tomflow/chatloop-extension/lib/session-file.mjs +228 -0
  155. package/node_modules/@tomflow/chatloop-extension/package.json +36 -0
  156. package/node_modules/@tomflow/chatloop-extension/scripts/build-actions.mjs +138 -0
  157. package/node_modules/@tomflow/chatloop-trace/README.md +118 -0
  158. package/node_modules/@tomflow/chatloop-trace/events/context.api.mjs +23 -0
  159. package/node_modules/@tomflow/chatloop-trace/events/typed.api.call.mjs +22 -0
  160. package/node_modules/@tomflow/chatloop-trace/events.generated.mjs +4 -0
  161. package/node_modules/@tomflow/chatloop-trace/index.mjs +59 -0
  162. package/node_modules/@tomflow/chatloop-trace/lib/api-aspect.mjs +273 -0
  163. package/node_modules/@tomflow/chatloop-trace/lib/trace-reader.mjs +308 -0
  164. package/node_modules/@tomflow/chatloop-trace/lib/trace-retention.mjs +140 -0
  165. package/node_modules/@tomflow/chatloop-trace/lib/trace.mjs +236 -0
  166. package/node_modules/@tomflow/chatloop-trace/package.json +28 -0
  167. package/node_modules/@tomflow/chatloop-trace/scripts/build-events.mjs +68 -0
  168. package/node_modules/ps-list/index.d.ts +76 -0
  169. package/node_modules/ps-list/index.js +366 -0
  170. package/node_modules/ps-list/license +9 -0
  171. package/node_modules/ps-list/package.json +44 -0
  172. package/node_modules/ps-list/readme.md +56 -0
  173. package/node_modules/ps-list/vendor/fastlist-0.3.0-x64.exe +0 -0
  174. package/node_modules/ps-list/vendor/fastlist-0.3.0-x86.exe +0 -0
  175. package/package.json +12 -4
@@ -0,0 +1,376 @@
1
+ // One self-contained Context capability contract. Registered at build time.
2
+ export const capability={
3
+ "id": "context",
4
+ "version": 1,
5
+ "purpose": "Business progress, durable receipts, UNKNOWN effects and checkpoints",
6
+ "startWith": "context.request.status",
7
+ "methods": [
8
+ {
9
+ "id": "context.history",
10
+ "group": "context",
11
+ "mode": "read",
12
+ "description": "Read versioned history and receipts for a task.",
13
+ "inputSchema": {
14
+ "type": "object",
15
+ "required": [
16
+ "operation",
17
+ "projectId",
18
+ "taskId"
19
+ ],
20
+ "additionalProperties": false,
21
+ "properties": {
22
+ "operation": {
23
+ "const": "context.history"
24
+ },
25
+ "projectId": {
26
+ "type": "string",
27
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
28
+ },
29
+ "taskId": {
30
+ "type": "string",
31
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
32
+ }
33
+ }
34
+ },
35
+ "order": 8,
36
+ "route": {
37
+ "kind": "core",
38
+ "method": "history",
39
+ "params": [
40
+ "projectId",
41
+ "taskId"
42
+ ]
43
+ }
44
+ },
45
+ {
46
+ "id": "context.resume",
47
+ "group": "context",
48
+ "mode": "read",
49
+ "description": "Read one verified checkpoint snapshot; does not grant Browser Owner.",
50
+ "inputSchema": {
51
+ "type": "object",
52
+ "required": [
53
+ "operation",
54
+ "projectId",
55
+ "taskId",
56
+ "checkpointId"
57
+ ],
58
+ "additionalProperties": false,
59
+ "properties": {
60
+ "operation": {
61
+ "const": "context.resume"
62
+ },
63
+ "projectId": {
64
+ "type": "string",
65
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
66
+ },
67
+ "taskId": {
68
+ "type": "string",
69
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
70
+ },
71
+ "checkpointId": {
72
+ "type": "string",
73
+ "minLength": 8,
74
+ "maxLength": 64
75
+ },
76
+ "maxBytes": {
77
+ "type": "integer",
78
+ "minimum": 16384,
79
+ "maximum": 262144
80
+ }
81
+ }
82
+ },
83
+ "order": 9,
84
+ "route": {
85
+ "kind": "core",
86
+ "method": "resume",
87
+ "params": [
88
+ "projectId",
89
+ "taskId",
90
+ "checkpointId",
91
+ "maxBytes"
92
+ ]
93
+ }
94
+ },
95
+ {
96
+ "id": "context.request.status",
97
+ "group": "context",
98
+ "mode": "read",
99
+ "description": "Check an unknown write using its original durable writeRequestId.",
100
+ "inputSchema": {
101
+ "type": "object",
102
+ "required": [
103
+ "operation",
104
+ "projectId",
105
+ "storeEpoch",
106
+ "writeRequestId"
107
+ ],
108
+ "additionalProperties": false,
109
+ "properties": {
110
+ "operation": {
111
+ "const": "context.request.status"
112
+ },
113
+ "projectId": {
114
+ "type": "string",
115
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
116
+ },
117
+ "storeEpoch": {
118
+ "type": "string",
119
+ "minLength": 10,
120
+ "maxLength": 64
121
+ },
122
+ "writeRequestId": {
123
+ "type": "string",
124
+ "minLength": 8,
125
+ "maxLength": 128
126
+ }
127
+ }
128
+ },
129
+ "order": 10,
130
+ "route": {
131
+ "kind": "core",
132
+ "method": "requestStatus",
133
+ "params": [
134
+ "$args"
135
+ ]
136
+ }
137
+ },
138
+ {
139
+ "id": "context.patch",
140
+ "group": "context",
141
+ "mode": "write",
142
+ "description": "Write active-run progress under the current holder and revisions.",
143
+ "inputSchema": {
144
+ "type": "object",
145
+ "required": [
146
+ "operation",
147
+ "projectId",
148
+ "taskId",
149
+ "expectedTaskRevision",
150
+ "expectedBindingRevision",
151
+ "runRef",
152
+ "runCredential",
153
+ "patch",
154
+ "expectedStoreEpoch",
155
+ "writeRequestId"
156
+ ],
157
+ "additionalProperties": false,
158
+ "properties": {
159
+ "operation": {
160
+ "const": "context.patch"
161
+ },
162
+ "projectId": {
163
+ "type": "string",
164
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
165
+ },
166
+ "taskId": {
167
+ "type": "string",
168
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
169
+ },
170
+ "expectedTaskRevision": {
171
+ "type": "integer",
172
+ "minimum": 1
173
+ },
174
+ "expectedBindingRevision": {
175
+ "type": "integer",
176
+ "minimum": 0
177
+ },
178
+ "runRef": {
179
+ "type": "string",
180
+ "minLength": 8,
181
+ "maxLength": 256
182
+ },
183
+ "runCredential": {
184
+ "type": "string",
185
+ "pattern": "^[0-9a-f]{64}$"
186
+ },
187
+ "patch": {
188
+ "type": "object"
189
+ },
190
+ "expectedStoreEpoch": {
191
+ "type": "string",
192
+ "minLength": 10,
193
+ "maxLength": 64
194
+ },
195
+ "writeRequestId": {
196
+ "type": "string",
197
+ "minLength": 8,
198
+ "maxLength": 128
199
+ }
200
+ }
201
+ },
202
+ "order": 31,
203
+ "route": {
204
+ "kind": "core",
205
+ "method": "patch",
206
+ "params": [
207
+ "$args"
208
+ ]
209
+ }
210
+ },
211
+ {
212
+ "id": "context.unknown.resolve",
213
+ "group": "context",
214
+ "mode": "write",
215
+ "description": "Resolve a known unknown side effect only with matching evidence.",
216
+ "inputSchema": {
217
+ "type": "object",
218
+ "required": [
219
+ "operation",
220
+ "projectId",
221
+ "taskId",
222
+ "expectedTaskRevision",
223
+ "expectedBindingRevision",
224
+ "runRef",
225
+ "runCredential",
226
+ "effectRef",
227
+ "resolutionEvidenceRef",
228
+ "expectedStoreEpoch",
229
+ "writeRequestId"
230
+ ],
231
+ "additionalProperties": false,
232
+ "properties": {
233
+ "operation": {
234
+ "const": "context.unknown.resolve"
235
+ },
236
+ "projectId": {
237
+ "type": "string",
238
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
239
+ },
240
+ "taskId": {
241
+ "type": "string",
242
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
243
+ },
244
+ "expectedTaskRevision": {
245
+ "type": "integer",
246
+ "minimum": 1
247
+ },
248
+ "expectedBindingRevision": {
249
+ "type": "integer",
250
+ "minimum": 0
251
+ },
252
+ "runRef": {
253
+ "type": "string",
254
+ "minLength": 8,
255
+ "maxLength": 256
256
+ },
257
+ "runCredential": {
258
+ "type": "string",
259
+ "pattern": "^[0-9a-f]{64}$"
260
+ },
261
+ "effectRef": {
262
+ "type": "string",
263
+ "minLength": 1,
264
+ "maxLength": 256
265
+ },
266
+ "resolutionEvidenceRef": {
267
+ "type": "string",
268
+ "minLength": 8,
269
+ "maxLength": 4096
270
+ },
271
+ "expectedStoreEpoch": {
272
+ "type": "string",
273
+ "minLength": 10,
274
+ "maxLength": 64
275
+ },
276
+ "writeRequestId": {
277
+ "type": "string",
278
+ "minLength": 8,
279
+ "maxLength": 128
280
+ }
281
+ }
282
+ },
283
+ "order": 32,
284
+ "route": {
285
+ "kind": "core",
286
+ "method": "resolveUnknownEffect",
287
+ "params": [
288
+ "$args"
289
+ ]
290
+ }
291
+ },
292
+ {
293
+ "id": "context.checkpoint",
294
+ "group": "context",
295
+ "mode": "write",
296
+ "description": "Create a durable business checkpoint, not Browser Owner permission.",
297
+ "inputSchema": {
298
+ "type": "object",
299
+ "required": [
300
+ "operation",
301
+ "projectId",
302
+ "taskId",
303
+ "expectedTaskRevision",
304
+ "expectedBindingRevision",
305
+ "runRef",
306
+ "runCredential",
307
+ "expectedStoreEpoch",
308
+ "writeRequestId"
309
+ ],
310
+ "additionalProperties": false,
311
+ "properties": {
312
+ "operation": {
313
+ "const": "context.checkpoint"
314
+ },
315
+ "projectId": {
316
+ "type": "string",
317
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
318
+ },
319
+ "taskId": {
320
+ "type": "string",
321
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
322
+ },
323
+ "expectedTaskRevision": {
324
+ "type": "integer",
325
+ "minimum": 1
326
+ },
327
+ "expectedBindingRevision": {
328
+ "type": "integer",
329
+ "minimum": 0
330
+ },
331
+ "runRef": {
332
+ "type": "string",
333
+ "minLength": 8,
334
+ "maxLength": 256
335
+ },
336
+ "runCredential": {
337
+ "type": "string",
338
+ "pattern": "^[0-9a-f]{64}$"
339
+ },
340
+ "expectedStoreEpoch": {
341
+ "type": "string",
342
+ "minLength": 10,
343
+ "maxLength": 64
344
+ },
345
+ "writeRequestId": {
346
+ "type": "string",
347
+ "minLength": 8,
348
+ "maxLength": 128
349
+ },
350
+ "evidenceRefs": {
351
+ "type": "array",
352
+ "maxItems": 200,
353
+ "items": {
354
+ "type": "object"
355
+ }
356
+ },
357
+ "unknownEffects": {
358
+ "type": "array",
359
+ "maxItems": 200,
360
+ "items": {
361
+ "type": "object"
362
+ }
363
+ }
364
+ }
365
+ },
366
+ "order": 33,
367
+ "route": {
368
+ "kind": "core",
369
+ "method": "checkpoint",
370
+ "params": [
371
+ "$args"
372
+ ]
373
+ }
374
+ }
375
+ ]
376
+ };
@@ -0,0 +1,290 @@
1
+ // One self-contained Context capability contract. Registered at build time.
2
+ export const capability={
3
+ "id": "document",
4
+ "version": 1,
5
+ "purpose": "Immutable R/P drafts, issue preparation and exact version reads",
6
+ "startWith": "document.list",
7
+ "methods": [
8
+ {
9
+ "id": "document.get",
10
+ "group": "document",
11
+ "mode": "read",
12
+ "description": "Read an immutable R/P document at a precise version.",
13
+ "inputSchema": {
14
+ "type": "object",
15
+ "required": [
16
+ "operation",
17
+ "projectId",
18
+ "taskId",
19
+ "documentId",
20
+ "version"
21
+ ],
22
+ "additionalProperties": false,
23
+ "properties": {
24
+ "operation": {
25
+ "const": "document.get"
26
+ },
27
+ "projectId": {
28
+ "type": "string",
29
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
30
+ },
31
+ "taskId": {
32
+ "type": "string",
33
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
34
+ },
35
+ "documentId": {
36
+ "type": "string",
37
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
38
+ },
39
+ "version": {
40
+ "type": "integer",
41
+ "minimum": 1
42
+ }
43
+ }
44
+ },
45
+ "order": 5,
46
+ "route": {
47
+ "kind": "core",
48
+ "method": "documentGet",
49
+ "params": [
50
+ "projectId",
51
+ "taskId",
52
+ "documentId",
53
+ "version"
54
+ ]
55
+ }
56
+ },
57
+ {
58
+ "id": "document.list",
59
+ "group": "document",
60
+ "mode": "read",
61
+ "description": "List versioned R/P documents of a task.",
62
+ "inputSchema": {
63
+ "type": "object",
64
+ "required": [
65
+ "operation",
66
+ "projectId",
67
+ "taskId"
68
+ ],
69
+ "additionalProperties": false,
70
+ "properties": {
71
+ "operation": {
72
+ "const": "document.list"
73
+ },
74
+ "projectId": {
75
+ "type": "string",
76
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
77
+ },
78
+ "taskId": {
79
+ "type": "string",
80
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
81
+ }
82
+ }
83
+ },
84
+ "order": 6,
85
+ "route": {
86
+ "kind": "core",
87
+ "method": "documentList",
88
+ "params": [
89
+ "projectId",
90
+ "taskId"
91
+ ]
92
+ }
93
+ },
94
+ {
95
+ "id": "document.createDraft",
96
+ "group": "document",
97
+ "mode": "write",
98
+ "description": "Create immutable R/P draft version linked to a task.",
99
+ "inputSchema": {
100
+ "type": "object",
101
+ "required": [
102
+ "operation",
103
+ "projectId",
104
+ "taskId",
105
+ "documentId",
106
+ "version",
107
+ "kind",
108
+ "body",
109
+ "expectedTaskRevision",
110
+ "expectedStoreEpoch",
111
+ "writeRequestId"
112
+ ],
113
+ "additionalProperties": false,
114
+ "properties": {
115
+ "operation": {
116
+ "const": "document.createDraft"
117
+ },
118
+ "projectId": {
119
+ "type": "string",
120
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
121
+ },
122
+ "taskId": {
123
+ "type": "string",
124
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
125
+ },
126
+ "documentId": {
127
+ "type": "string",
128
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
129
+ },
130
+ "version": {
131
+ "type": "integer",
132
+ "minimum": 1
133
+ },
134
+ "kind": {
135
+ "enum": [
136
+ "R",
137
+ "P",
138
+ "INSTRUCTIONS",
139
+ "HISTORY",
140
+ "LEGACY_EVIDENCE",
141
+ "REFERENCE"
142
+ ]
143
+ },
144
+ "body": {
145
+ "type": "string",
146
+ "minLength": 1,
147
+ "maxLength": 4194304
148
+ },
149
+ "expectedTaskRevision": {
150
+ "type": "integer",
151
+ "minimum": 1
152
+ },
153
+ "expectedStoreEpoch": {
154
+ "type": "string",
155
+ "minLength": 10,
156
+ "maxLength": 64
157
+ },
158
+ "writeRequestId": {
159
+ "type": "string",
160
+ "minLength": 8,
161
+ "maxLength": 128
162
+ },
163
+ "literalRevision": {
164
+ "type": "object",
165
+ "additionalProperties": false,
166
+ "required": ["baseVersion", "baseContentHash", "replacements"],
167
+ "properties": {
168
+ "baseVersion": {"type": "integer", "minimum": 1},
169
+ "baseContentHash": {"type": "string", "pattern": "^[a-f0-9]{64}$"},
170
+ "replacements": {
171
+ "type": "array",
172
+ "minItems": 1,
173
+ "maxItems": 32,
174
+ "items": {
175
+ "type": "object",
176
+ "additionalProperties": false,
177
+ "required": ["from", "to", "expectedCount"],
178
+ "properties": {
179
+ "from": {"type": "string", "minLength": 1},
180
+ "to": {"type": "string"},
181
+ "expectedCount": {"type": "integer", "minimum": 1, "maximum": 100}
182
+ }
183
+ }
184
+ }
185
+ }
186
+ },
187
+ "requirementRef": {
188
+ "type": "object",
189
+ "additionalProperties": false,
190
+ "required": [
191
+ "documentId",
192
+ "version",
193
+ "contentHash"
194
+ ],
195
+ "properties": {
196
+ "documentId": {
197
+ "type": "string",
198
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
199
+ },
200
+ "version": {
201
+ "type": "integer",
202
+ "minimum": 1
203
+ },
204
+ "contentHash": {
205
+ "type": "string",
206
+ "pattern": "^[a-f0-9]{64}$"
207
+ }
208
+ }
209
+ }
210
+ }
211
+ },
212
+ "order": 24,
213
+ "route": {
214
+ "kind": "core",
215
+ "method": "documentCreate",
216
+ "params": [
217
+ "$args"
218
+ ]
219
+ }
220
+ },
221
+ {
222
+ "id": "document.prepareIssue",
223
+ "group": "document",
224
+ "mode": "write",
225
+ "description": "Record intent to present a precise R/P version.",
226
+ "inputSchema": {
227
+ "type": "object",
228
+ "required": [
229
+ "operation",
230
+ "projectId",
231
+ "taskId",
232
+ "documentId",
233
+ "version",
234
+ "contentHash",
235
+ "expectedTaskRevision",
236
+ "expectedStoreEpoch",
237
+ "writeRequestId"
238
+ ],
239
+ "additionalProperties": false,
240
+ "properties": {
241
+ "operation": {
242
+ "const": "document.prepareIssue"
243
+ },
244
+ "projectId": {
245
+ "type": "string",
246
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
247
+ },
248
+ "taskId": {
249
+ "type": "string",
250
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
251
+ },
252
+ "documentId": {
253
+ "type": "string",
254
+ "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,127}$"
255
+ },
256
+ "version": {
257
+ "type": "integer",
258
+ "minimum": 1
259
+ },
260
+ "contentHash": {
261
+ "type": "string",
262
+ "pattern": "^[a-f0-9]{64}$"
263
+ },
264
+ "expectedTaskRevision": {
265
+ "type": "integer",
266
+ "minimum": 1
267
+ },
268
+ "expectedStoreEpoch": {
269
+ "type": "string",
270
+ "minLength": 10,
271
+ "maxLength": 64
272
+ },
273
+ "writeRequestId": {
274
+ "type": "string",
275
+ "minLength": 8,
276
+ "maxLength": 128
277
+ }
278
+ }
279
+ },
280
+ "order": 26,
281
+ "route": {
282
+ "kind": "core",
283
+ "method": "prepareIssue",
284
+ "params": [
285
+ "$args"
286
+ ]
287
+ }
288
+ }
289
+ ]
290
+ };