@ixo/topic-protocol 0.8.0 → 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +6 -1
  2. package/dist/schemas/decision-to-pay-template-v2.schema.json +301 -0
  3. package/dist/schemas/payable-obligation-v2.schema.json +319 -0
  4. package/dist/schemas/payment-terms-v2.schema.json +238 -0
  5. package/dist/schemas/topic-contract-body.schema.json +66 -0
  6. package/dist/schemas/topic-contract-state.schema.json +63 -295
  7. package/dist/schemas/topic-recipe.schema.json +19 -0
  8. package/dist/schemas/topic-root.schema.json +17 -1
  9. package/dist/schemas/topic-shape.schema.json +79 -0
  10. package/dist/src/contracts/schemas.d.ts +3417 -1822
  11. package/dist/src/contracts/schemas.js +12 -0
  12. package/dist/src/contracts/schemas.js.map +1 -1
  13. package/dist/src/contracts/topic-contract.d.ts +30 -5
  14. package/dist/src/contracts/topic-contract.js +3 -1
  15. package/dist/src/contracts/topic-contract.js.map +1 -1
  16. package/dist/src/errors.d.ts +1 -1
  17. package/dist/src/errors.js.map +1 -1
  18. package/dist/src/index.d.ts +10 -2
  19. package/dist/src/index.js +9 -1
  20. package/dist/src/index.js.map +1 -1
  21. package/dist/src/projector/types.d.ts +9 -1
  22. package/dist/src/projector/types.js.map +1 -1
  23. package/dist/src/shapes/canonical.d.ts +2 -0
  24. package/dist/src/shapes/canonical.js +20 -0
  25. package/dist/src/shapes/canonical.js.map +1 -0
  26. package/dist/src/shapes/claims.d.ts +12 -0
  27. package/dist/src/shapes/claims.js +20 -0
  28. package/dist/src/shapes/claims.js.map +1 -0
  29. package/dist/src/shapes/now.d.ts +2 -0
  30. package/dist/src/shapes/now.js +42 -0
  31. package/dist/src/shapes/now.js.map +1 -0
  32. package/dist/src/shapes/progress.d.ts +3 -0
  33. package/dist/src/shapes/progress.js +176 -0
  34. package/dist/src/shapes/progress.js.map +1 -0
  35. package/dist/src/shapes/recipes.d.ts +5 -0
  36. package/dist/src/shapes/recipes.js +337 -0
  37. package/dist/src/shapes/recipes.js.map +1 -0
  38. package/dist/src/shapes/resolver.d.ts +14 -0
  39. package/dist/src/shapes/resolver.js +111 -0
  40. package/dist/src/shapes/resolver.js.map +1 -0
  41. package/dist/src/shapes/state.d.ts +53 -0
  42. package/dist/src/shapes/state.js +2 -0
  43. package/dist/src/shapes/state.js.map +1 -0
  44. package/dist/src/shapes/types.d.ts +241 -0
  45. package/dist/src/shapes/types.js +42 -0
  46. package/dist/src/shapes/types.js.map +1 -0
  47. package/package.json +3 -1
  48. package/recipes/README.md +12 -0
  49. package/recipes/agent-delivery.json +607 -0
  50. package/recipes/registry.json +41 -0
  51. package/recipes/research-brief.json +460 -0
  52. package/recipes/verified-work-payment.json +663 -0
  53. package/templates/decision-to-pay/README.md +27 -19
  54. package/templates/decision-to-pay/verified-work-payment.v0.2.template.json +319 -0
@@ -0,0 +1,460 @@
1
+ {
2
+ "version": 1,
3
+ "code": "research-brief",
4
+ "id": "https://topic-protocol.ixo.world/recipes/research-brief",
5
+ "recipeVersion": "1.0.0-rc.1",
6
+ "label": "Research brief",
7
+ "description": "Frame a question, do the research, verify the sources, and close the brief explicitly.",
8
+ "baseRecipe": "research",
9
+ "creates": "draft",
10
+ "shape": {
11
+ "version": 1,
12
+ "code": "recipe/research-brief",
13
+ "axes": [
14
+ {
15
+ "code": "contract",
16
+ "phase": "forming",
17
+ "required": true,
18
+ "initialState": "draft",
19
+ "states": [
20
+ {
21
+ "code": "draft"
22
+ },
23
+ {
24
+ "code": "accepted",
25
+ "terminal": true
26
+ }
27
+ ]
28
+ },
29
+ {
30
+ "code": "work",
31
+ "phase": "working",
32
+ "required": true,
33
+ "initialState": "pending",
34
+ "states": [
35
+ {
36
+ "code": "pending"
37
+ },
38
+ {
39
+ "code": "in-progress"
40
+ },
41
+ {
42
+ "code": "submitted",
43
+ "terminal": true
44
+ }
45
+ ]
46
+ },
47
+ {
48
+ "code": "verification",
49
+ "phase": "verifying",
50
+ "required": true,
51
+ "initialState": "pending",
52
+ "states": [
53
+ {
54
+ "code": "pending"
55
+ },
56
+ {
57
+ "code": "verified",
58
+ "terminal": true
59
+ }
60
+ ]
61
+ },
62
+ {
63
+ "code": "topic",
64
+ "phase": "complete",
65
+ "required": true,
66
+ "initialState": "open",
67
+ "states": [
68
+ {
69
+ "code": "open"
70
+ },
71
+ {
72
+ "code": "complete",
73
+ "terminal": true
74
+ }
75
+ ]
76
+ }
77
+ ],
78
+ "transitions": [
79
+ {
80
+ "code": "edit-terms",
81
+ "phase": "forming",
82
+ "predecessor": {
83
+ "axis": "contract",
84
+ "state": "draft"
85
+ },
86
+ "target": {
87
+ "axis": "contract",
88
+ "state": "draft"
89
+ },
90
+ "command": "topic.edit-terms",
91
+ "requiredAbility": "topic/write",
92
+ "assignedTo": {
93
+ "kind": "role",
94
+ "value": "contract-acceptor"
95
+ },
96
+ "gates": [],
97
+ "confirmation": "none",
98
+ "consequence": "shared-state",
99
+ "evidence": {
100
+ "kind": "operation",
101
+ "type": "update-contract"
102
+ },
103
+ "presentation": {
104
+ "reasonCode": "terms-need-input"
105
+ }
106
+ },
107
+ {
108
+ "code": "accept-terms",
109
+ "phase": "forming",
110
+ "predecessor": {
111
+ "axis": "contract",
112
+ "state": "draft"
113
+ },
114
+ "target": {
115
+ "axis": "contract",
116
+ "state": "accepted"
117
+ },
118
+ "command": "topic.accept-terms",
119
+ "requiredAbility": "topic/accept-contract",
120
+ "assignedTo": {
121
+ "kind": "role",
122
+ "value": "contract-acceptor"
123
+ },
124
+ "gates": [],
125
+ "confirmation": "viewer",
126
+ "consequence": "shared-state",
127
+ "evidence": {
128
+ "kind": "operation",
129
+ "type": "accept-contract"
130
+ },
131
+ "presentation": {
132
+ "reasonCode": "terms-await-acceptance"
133
+ }
134
+ },
135
+ {
136
+ "code": "start-work",
137
+ "phase": "working",
138
+ "predecessor": {
139
+ "axis": "work",
140
+ "state": "pending"
141
+ },
142
+ "target": {
143
+ "axis": "work",
144
+ "state": "in-progress"
145
+ },
146
+ "command": "topic.start-work",
147
+ "requiredAbility": "topic/write",
148
+ "assignedTo": {
149
+ "kind": "role",
150
+ "value": "worker"
151
+ },
152
+ "gates": [
153
+ {
154
+ "kind": "axis",
155
+ "axis": "contract",
156
+ "states": [
157
+ "accepted"
158
+ ]
159
+ }
160
+ ],
161
+ "confirmation": "none",
162
+ "consequence": "shared-state",
163
+ "evidence": {
164
+ "kind": "operation",
165
+ "type": "change-progress"
166
+ },
167
+ "presentation": {
168
+ "reasonCode": "start-work"
169
+ }
170
+ },
171
+ {
172
+ "code": "answer-question",
173
+ "phase": "working",
174
+ "predecessor": {
175
+ "axis": "work",
176
+ "state": "in-progress"
177
+ },
178
+ "target": {
179
+ "axis": "work",
180
+ "state": "in-progress"
181
+ },
182
+ "command": "topic.answer-question",
183
+ "requiredAbility": "topic/write",
184
+ "assignedTo": {
185
+ "kind": "role",
186
+ "value": "worker"
187
+ },
188
+ "gates": [
189
+ {
190
+ "kind": "field",
191
+ "path": "/questions/open",
192
+ "predicate": "present"
193
+ }
194
+ ],
195
+ "confirmation": "none",
196
+ "consequence": "shared-state",
197
+ "evidence": {
198
+ "kind": "operation",
199
+ "type": "answer-question"
200
+ },
201
+ "presentation": {
202
+ "reasonCode": "question-awaits-answer"
203
+ }
204
+ },
205
+ {
206
+ "code": "change-due-date",
207
+ "phase": "working",
208
+ "predecessor": {
209
+ "axis": "work",
210
+ "state": "in-progress"
211
+ },
212
+ "target": {
213
+ "axis": "work",
214
+ "state": "in-progress"
215
+ },
216
+ "command": "topic.change-due-date",
217
+ "requiredAbility": "topic/write",
218
+ "assignedTo": {
219
+ "kind": "role",
220
+ "value": "worker"
221
+ },
222
+ "gates": [
223
+ {
224
+ "kind": "field",
225
+ "path": "/outcome/target/value",
226
+ "predicate": "present"
227
+ }
228
+ ],
229
+ "confirmation": "none",
230
+ "consequence": "shared-state",
231
+ "evidence": {
232
+ "kind": "operation",
233
+ "type": "change-due-date"
234
+ },
235
+ "presentation": {
236
+ "reasonCode": "due-date-review"
237
+ }
238
+ },
239
+ {
240
+ "code": "unblock-topic",
241
+ "phase": "working",
242
+ "predecessor": {
243
+ "axis": "topic",
244
+ "state": "open"
245
+ },
246
+ "target": {
247
+ "axis": "topic",
248
+ "state": "open"
249
+ },
250
+ "command": "topic.unblock",
251
+ "requiredAbility": "topic/unblock",
252
+ "assignedTo": {
253
+ "kind": "role",
254
+ "value": "block-resolver"
255
+ },
256
+ "gates": [
257
+ {
258
+ "kind": "condition",
259
+ "states": [
260
+ "blocked"
261
+ ]
262
+ }
263
+ ],
264
+ "confirmation": "none",
265
+ "consequence": "shared-state",
266
+ "evidence": {
267
+ "kind": "operation",
268
+ "type": "unblock-topic"
269
+ },
270
+ "presentation": {
271
+ "reasonCode": "topic-blocked"
272
+ }
273
+ },
274
+ {
275
+ "code": "submit-work",
276
+ "phase": "working",
277
+ "predecessor": {
278
+ "axis": "work",
279
+ "state": "in-progress"
280
+ },
281
+ "target": {
282
+ "axis": "work",
283
+ "state": "submitted"
284
+ },
285
+ "command": "topic.record-outcome",
286
+ "requiredAbility": "topic/record-outcome",
287
+ "assignedTo": {
288
+ "kind": "role",
289
+ "value": "worker"
290
+ },
291
+ "gates": [],
292
+ "confirmation": "none",
293
+ "consequence": "shared-state",
294
+ "evidence": {
295
+ "kind": "record",
296
+ "type": "ixo.topic.work-submission",
297
+ "finality": "accepted"
298
+ },
299
+ "presentation": {
300
+ "reasonCode": "submit-work"
301
+ }
302
+ },
303
+ {
304
+ "code": "complete-topic",
305
+ "phase": "complete",
306
+ "predecessor": {
307
+ "axis": "topic",
308
+ "state": "open"
309
+ },
310
+ "target": {
311
+ "axis": "topic",
312
+ "state": "complete"
313
+ },
314
+ "command": "topic.complete",
315
+ "requiredAbility": "topic/confirm-completion",
316
+ "assignedTo": {
317
+ "kind": "role",
318
+ "value": "completion-authority"
319
+ },
320
+ "gates": [
321
+ {
322
+ "kind": "axis",
323
+ "axis": "work",
324
+ "states": [
325
+ "submitted"
326
+ ]
327
+ }
328
+ ],
329
+ "confirmation": "authority",
330
+ "consequence": "shared-state",
331
+ "evidence": {
332
+ "kind": "operation",
333
+ "type": "complete-topic"
334
+ },
335
+ "completesTopic": true,
336
+ "presentation": {
337
+ "reasonCode": "complete-topic"
338
+ }
339
+ },
340
+ {
341
+ "code": "record-verification",
342
+ "phase": "verifying",
343
+ "predecessor": {
344
+ "axis": "verification",
345
+ "state": "pending"
346
+ },
347
+ "target": {
348
+ "axis": "verification",
349
+ "state": "verified"
350
+ },
351
+ "command": "topic.record-verification",
352
+ "requiredAbility": "claim/evaluate",
353
+ "assignedTo": {
354
+ "kind": "role",
355
+ "value": "evaluator"
356
+ },
357
+ "gates": [
358
+ {
359
+ "kind": "axis",
360
+ "axis": "work",
361
+ "states": [
362
+ "submitted"
363
+ ]
364
+ }
365
+ ],
366
+ "confirmation": "none",
367
+ "consequence": "shared-state",
368
+ "evidence": {
369
+ "kind": "record",
370
+ "type": "ixo.evaluation",
371
+ "finality": "accepted"
372
+ },
373
+ "handoff": {
374
+ "kind": "flow",
375
+ "binding": "evaluation"
376
+ },
377
+ "presentation": {
378
+ "reasonCode": "verification-required"
379
+ }
380
+ }
381
+ ],
382
+ "progressRules": [
383
+ {
384
+ "code": "disputed",
385
+ "condition": "disputed",
386
+ "priority": 700,
387
+ "source": {
388
+ "kind": "record",
389
+ "value": "ixo.topic.dispute"
390
+ }
391
+ },
392
+ {
393
+ "code": "failed",
394
+ "condition": "failed",
395
+ "priority": 650,
396
+ "source": {
397
+ "kind": "receipt",
398
+ "value": "failed"
399
+ }
400
+ },
401
+ {
402
+ "code": "blocked",
403
+ "condition": "blocked",
404
+ "priority": 600,
405
+ "source": {
406
+ "kind": "topic",
407
+ "value": "blocked"
408
+ },
409
+ "requiresTarget": true
410
+ },
411
+ {
412
+ "code": "waiting",
413
+ "condition": "waiting",
414
+ "priority": 500,
415
+ "source": {
416
+ "kind": "topic",
417
+ "value": "waiting"
418
+ },
419
+ "requiresTarget": true
420
+ },
421
+ {
422
+ "code": "needs-input",
423
+ "condition": "needs-input",
424
+ "priority": 400,
425
+ "source": {
426
+ "kind": "record",
427
+ "value": "ixo.topic.question"
428
+ }
429
+ },
430
+ {
431
+ "code": "needs-acceptance",
432
+ "condition": "needs-acceptance",
433
+ "priority": 350,
434
+ "source": {
435
+ "kind": "axis",
436
+ "value": "contract"
437
+ },
438
+ "states": [
439
+ "draft"
440
+ ]
441
+ }
442
+ ],
443
+ "inferredRecordPolicy": {
444
+ "autoAccept": [
445
+ "ixo.topic.fact",
446
+ "ixo.topic.summary",
447
+ "ixo.topic.classification"
448
+ ],
449
+ "neverAutoAccept": [
450
+ "ixo.topic.contract",
451
+ "ixo.topic.outcome",
452
+ "ixo.topic.authority",
453
+ "ixo.topic.action",
454
+ "ixo.claim",
455
+ "ixo.evaluation",
456
+ "ixo.settlement"
457
+ ]
458
+ }
459
+ }
460
+ }