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

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 (60) 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 +57 -0
  6. package/dist/schemas/topic-contract-state.schema.json +22 -329
  7. package/dist/schemas/topic-operation.schema.json +2 -2
  8. package/dist/schemas/topic-recipe.schema.json +19 -0
  9. package/dist/schemas/topic-root.schema.json +21 -1
  10. package/dist/schemas/topic-shape.schema.json +80 -0
  11. package/dist/src/contracts/schemas.d.ts +4448 -2534
  12. package/dist/src/contracts/schemas.js +12 -0
  13. package/dist/src/contracts/schemas.js.map +1 -1
  14. package/dist/src/contracts/topic-contract.d.ts +44 -5
  15. package/dist/src/contracts/topic-contract.js +3 -1
  16. package/dist/src/contracts/topic-contract.js.map +1 -1
  17. package/dist/src/errors.d.ts +1 -1
  18. package/dist/src/errors.js.map +1 -1
  19. package/dist/src/index.d.ts +10 -2
  20. package/dist/src/index.js +9 -1
  21. package/dist/src/index.js.map +1 -1
  22. package/dist/src/projector/payload.d.ts +34 -0
  23. package/dist/src/projector/payload.js +93 -2
  24. package/dist/src/projector/payload.js.map +1 -1
  25. package/dist/src/projector/state.js +54 -0
  26. package/dist/src/projector/state.js.map +1 -1
  27. package/dist/src/projector/types.d.ts +52 -2
  28. package/dist/src/projector/types.js.map +1 -1
  29. package/dist/src/shapes/canonical.d.ts +2 -0
  30. package/dist/src/shapes/canonical.js +20 -0
  31. package/dist/src/shapes/canonical.js.map +1 -0
  32. package/dist/src/shapes/claims.d.ts +12 -0
  33. package/dist/src/shapes/claims.js +20 -0
  34. package/dist/src/shapes/claims.js.map +1 -0
  35. package/dist/src/shapes/now.d.ts +2 -0
  36. package/dist/src/shapes/now.js +61 -0
  37. package/dist/src/shapes/now.js.map +1 -0
  38. package/dist/src/shapes/progress.d.ts +3 -0
  39. package/dist/src/shapes/progress.js +490 -0
  40. package/dist/src/shapes/progress.js.map +1 -0
  41. package/dist/src/shapes/recipes.d.ts +5 -0
  42. package/dist/src/shapes/recipes.js +386 -0
  43. package/dist/src/shapes/recipes.js.map +1 -0
  44. package/dist/src/shapes/resolver.d.ts +14 -0
  45. package/dist/src/shapes/resolver.js +121 -0
  46. package/dist/src/shapes/resolver.js.map +1 -0
  47. package/dist/src/shapes/state.d.ts +105 -0
  48. package/dist/src/shapes/state.js +3 -0
  49. package/dist/src/shapes/state.js.map +1 -0
  50. package/dist/src/shapes/types.d.ts +392 -0
  51. package/dist/src/shapes/types.js +44 -0
  52. package/dist/src/shapes/types.js.map +1 -0
  53. package/package.json +3 -1
  54. package/recipes/README.md +12 -0
  55. package/recipes/agent-delivery.json +740 -0
  56. package/recipes/registry.json +41 -0
  57. package/recipes/research-brief.json +578 -0
  58. package/recipes/verified-work-payment.json +801 -0
  59. package/templates/decision-to-pay/README.md +27 -19
  60. package/templates/decision-to-pay/verified-work-payment.v0.2.template.json +319 -0
@@ -0,0 +1,105 @@
1
+ import type { TopicContractBodyV3, TopicContractBodyV4 } from "../contracts/topic-contract.js";
2
+ import type { TopicFlowBindingV1 } from "../action-runtime/types.js";
3
+ import type { TopicAnchor, TopicContractHeads, TopicRootV3, TopicRootV4 } from "../projector/types.js";
4
+ import type { ResolvedTopicClaimBindingV1, TopicClaimBindingV1, TopicProgressProjectionV1, TopicProgressProjectionV2, TopicShapeSourceRefV1 } from "./types.js";
5
+ export declare const TOPIC_STATE_PROFILE_V3 = "qi.topic-contract-state/v3";
6
+ export declare const TOPIC_STATE_PROFILE_V4 = "qi.topic-contract-state/v4";
7
+ export interface TopicContractReferenceV3 {
8
+ readonly revision: string;
9
+ readonly bodyHash: string;
10
+ readonly bodyRef: Readonly<Record<string, unknown>>;
11
+ readonly body?: TopicContractBodyV3;
12
+ }
13
+ export interface TopicContractReferenceV4 {
14
+ readonly revision: string;
15
+ readonly bodyHash: `sha256:${string}`;
16
+ readonly bodyRef: Readonly<Record<string, unknown>>;
17
+ readonly body?: TopicContractBodyV4;
18
+ }
19
+ export interface TopicContractConfirmationV1 {
20
+ readonly operationId: string;
21
+ readonly contractRevision: string;
22
+ readonly bodyHash: `sha256:${string}`;
23
+ readonly policyDigest: `sha256:${string}`;
24
+ readonly actor: string;
25
+ readonly confirmedAt: string;
26
+ readonly requiredAbility: string;
27
+ readonly authorityProofRef: string;
28
+ readonly withdrawnAt?: string;
29
+ }
30
+ export interface TopicContractAssentV1 extends Omit<TopicContractConfirmationV1, "confirmedAt"> {
31
+ readonly assentedAt: string;
32
+ }
33
+ export interface TopicContractHeadsV4 {
34
+ readonly proposed?: TopicContractReferenceV4 & {
35
+ readonly confirmations?: readonly TopicContractConfirmationV1[];
36
+ readonly assents?: readonly TopicContractAssentV1[];
37
+ };
38
+ readonly effective?: TopicContractReferenceV4 & {
39
+ readonly effectiveAt: string;
40
+ readonly confirmations: readonly TopicContractConfirmationV1[];
41
+ readonly assents?: readonly TopicContractAssentV1[];
42
+ };
43
+ readonly superseded?: readonly (TopicContractReferenceV4 & {
44
+ readonly supersededAt: string;
45
+ })[];
46
+ }
47
+ export interface TopicStateBindingsV3 {
48
+ readonly flows?: readonly TopicFlowBindingV1[];
49
+ readonly context?: readonly {
50
+ readonly type: "ixo.resource" | "ixo.flow" | "matrix.conversation" | "ixo.entity" | "ixo.service";
51
+ readonly id: string;
52
+ readonly label?: string;
53
+ }[];
54
+ readonly udidReferences?: readonly {
55
+ readonly id: string;
56
+ readonly role: "evaluation" | "decision" | "effect" | "settlement";
57
+ readonly digest?: `sha256:${string}`;
58
+ }[];
59
+ }
60
+ interface TopicContractStateCommonV1 {
61
+ readonly schema: "https://topic-protocol.ixo.world/schemas/topic-contract-state.schema.json";
62
+ readonly topicId: string;
63
+ readonly anchor: TopicAnchor;
64
+ readonly shape: {
65
+ readonly digest: `sha256:${string}`;
66
+ readonly sources: readonly TopicShapeSourceRefV1[];
67
+ };
68
+ readonly policy: Readonly<Record<string, unknown>>;
69
+ readonly bindings: TopicStateBindingsV3;
70
+ readonly provenance: Readonly<Record<string, unknown>>;
71
+ readonly extensions?: Readonly<Record<string, unknown>>;
72
+ }
73
+ interface TopicStateProjectionCommonV1 {
74
+ readonly revision: string;
75
+ readonly contractRevision: string;
76
+ readonly title: string;
77
+ readonly attachmentCount: number;
78
+ readonly operationCount: number;
79
+ readonly claimBinding?: TopicClaimBindingV1;
80
+ readonly claimResolution?: ResolvedTopicClaimBindingV1;
81
+ }
82
+ export interface TopicContractStateV3 extends TopicContractStateCommonV1 {
83
+ readonly version: 3;
84
+ readonly profile: typeof TOPIC_STATE_PROFILE_V3;
85
+ readonly manifest: TopicRootV3;
86
+ readonly contracts: TopicContractHeads;
87
+ readonly progress: TopicProgressProjectionV1;
88
+ readonly projection: TopicStateProjectionCommonV1 & {
89
+ readonly status: TopicRootV3["status"];
90
+ readonly kindRef: TopicContractBodyV3["kindRef"];
91
+ };
92
+ }
93
+ export interface TopicContractStateV4 extends TopicContractStateCommonV1 {
94
+ readonly version: 4;
95
+ readonly profile: typeof TOPIC_STATE_PROFILE_V4;
96
+ readonly manifest: TopicRootV4;
97
+ readonly contracts: TopicContractHeadsV4;
98
+ readonly progress: TopicProgressProjectionV2;
99
+ readonly projection: TopicStateProjectionCommonV1 & {
100
+ readonly status: TopicRootV4["status"];
101
+ readonly setupStatus: "draft" | "awaiting-confirmation" | "scheduled" | "confirmed" | "review-due" | "expired" | "disputed";
102
+ readonly kindRef: TopicContractBodyV4["kindRef"];
103
+ };
104
+ }
105
+ export {};
@@ -0,0 +1,3 @@
1
+ export const TOPIC_STATE_PROFILE_V3 = "qi.topic-contract-state/v3";
2
+ export const TOPIC_STATE_PROFILE_V4 = "qi.topic-contract-state/v4";
3
+ //# sourceMappingURL=state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/shapes/state.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AACnE,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC"}
@@ -0,0 +1,392 @@
1
+ export declare const SHAPE_PHASES: readonly ["forming", "working", "verifying", "deciding", "effecting", "settling", "complete", "dormant"];
2
+ export declare const SHAPE_CONDITIONS: readonly ["on-track", "needs-input", "needs-confirmation", "review-due", "expired", "waiting", "blocked", "failed", "disputed", "degraded"];
3
+ export declare const SHAPE_ATTENTION_STATES: readonly ["none", "viewer-action-required", "viewer-review-required", "viewer-confirmation-required"];
4
+ export declare const BASE_RECIPE_CODES: readonly ["project", "flow", "proposal", "evaluation", "claims", "research", "discussion", "incident"];
5
+ export declare const TOPIC_RECIPE_CODES: readonly ["research-brief", "agent-delivery", "verified-work-payment"];
6
+ export type ShapePhaseV1 = (typeof SHAPE_PHASES)[number];
7
+ export type ShapeConditionV1 = (typeof SHAPE_CONDITIONS)[number];
8
+ export type ShapeAttentionV1 = (typeof SHAPE_ATTENTION_STATES)[number];
9
+ export type BaseRecipeCodeV1 = (typeof BASE_RECIPE_CODES)[number];
10
+ export type TopicRecipeCodeV1 = (typeof TOPIC_RECIPE_CODES)[number];
11
+ export type ShapeConsequenceClassV1 = "none" | "shared-state" | "external-effect" | "settlement";
12
+ export type ShapeConfirmationPolicyV1 = "none" | "viewer" | "authority";
13
+ export type ShapeEvidenceRequirementV1 = {
14
+ readonly kind: "operation" | "record" | "receipt";
15
+ readonly type: string;
16
+ readonly finality?: "observed" | "accepted" | "verified" | "final";
17
+ };
18
+ export type TopicSubjectRefV1 = {
19
+ readonly kind: "actor";
20
+ readonly id: string;
21
+ } | {
22
+ readonly kind: "role";
23
+ readonly id: string;
24
+ };
25
+ export interface TopicConfirmationPolicyV1 {
26
+ readonly mode: "any" | "all" | "threshold";
27
+ readonly subjects: readonly TopicSubjectRefV1[];
28
+ readonly threshold?: number;
29
+ }
30
+ export interface TopicAssentPolicyV1 {
31
+ readonly mode: "any" | "all" | "threshold";
32
+ readonly signatories: readonly TopicSubjectRefV1[];
33
+ readonly threshold?: number;
34
+ }
35
+ export interface TopicDisputePolicyV1 {
36
+ readonly resolvers?: readonly TopicSubjectRefV1[];
37
+ readonly process?: {
38
+ readonly kind: "flow" | "resource";
39
+ readonly id: string;
40
+ readonly label?: string;
41
+ };
42
+ }
43
+ export interface TopicActivationPolicyV1 {
44
+ /** Drafts may leave any activation detail unresolved; effectiveness may not. */
45
+ readonly editors?: readonly TopicSubjectRefV1[];
46
+ readonly confirmation?: TopicConfirmationPolicyV1;
47
+ readonly lifecycle?: {
48
+ readonly effectiveAt?: string;
49
+ readonly reviewAt?: string;
50
+ readonly expiresAt?: string;
51
+ readonly onExpiry: "pause-consequential";
52
+ };
53
+ readonly dispute?: TopicDisputePolicyV1;
54
+ }
55
+ export interface ShapeRequirementPresentationV1 {
56
+ readonly code: string;
57
+ readonly labelKey: string;
58
+ readonly promptKey: string;
59
+ readonly purposeKey: string;
60
+ readonly priority: number;
61
+ readonly focusPath?: string;
62
+ readonly assignedTo?: {
63
+ readonly kind: "actor" | "role";
64
+ readonly value: string;
65
+ };
66
+ }
67
+ export type ShapeGateV1 = ({
68
+ readonly kind: "field";
69
+ readonly path: string;
70
+ readonly predicate: "present" | "accepted";
71
+ } | {
72
+ readonly kind: "field-any";
73
+ readonly paths: readonly string[];
74
+ readonly predicate: "present" | "accepted";
75
+ } | {
76
+ readonly kind: "record";
77
+ readonly type: string;
78
+ readonly status?: string;
79
+ } | {
80
+ readonly kind: "receipt";
81
+ readonly type: string;
82
+ readonly status?: string;
83
+ } | {
84
+ readonly kind: "axis";
85
+ readonly axis: string;
86
+ readonly states: readonly string[];
87
+ } | {
88
+ readonly kind: "binding";
89
+ readonly type: "flow" | "claim" | "resource";
90
+ } | {
91
+ readonly kind: "condition";
92
+ readonly states: readonly ("waiting" | "blocked" | "failed" | "disputed")[];
93
+ }) & {
94
+ readonly requirement?: ShapeRequirementPresentationV1;
95
+ };
96
+ export interface ShapeStateDefinitionV1 {
97
+ readonly code: string;
98
+ readonly labelKey?: string;
99
+ readonly terminal?: boolean;
100
+ readonly condition?: ShapeConditionV1;
101
+ }
102
+ export interface ShapeStateAxisV1 {
103
+ readonly code: string;
104
+ readonly phase: ShapePhaseV1;
105
+ readonly required: boolean;
106
+ readonly initialState: string;
107
+ readonly states: readonly ShapeStateDefinitionV1[];
108
+ }
109
+ export interface ShapeTransitionV1 {
110
+ readonly code: string;
111
+ readonly phase: ShapePhaseV1;
112
+ readonly predecessor: {
113
+ readonly axis: string;
114
+ readonly state: string;
115
+ };
116
+ readonly target: {
117
+ readonly axis: string;
118
+ readonly state: string;
119
+ };
120
+ readonly command: string;
121
+ readonly requiredAbility: string;
122
+ readonly assignedTo: {
123
+ readonly kind: "actor" | "role";
124
+ readonly value: string;
125
+ };
126
+ readonly gates: readonly ShapeGateV1[];
127
+ readonly confirmation: ShapeConfirmationPolicyV1;
128
+ readonly consequence: ShapeConsequenceClassV1;
129
+ readonly evidence: ShapeEvidenceRequirementV1;
130
+ readonly completesTopic?: boolean;
131
+ readonly handoff?: {
132
+ readonly kind: "flow" | "resource";
133
+ readonly binding: string;
134
+ };
135
+ readonly presentation?: {
136
+ readonly reasonCode: string;
137
+ readonly actionLabelKey?: string;
138
+ readonly bodyKey?: string;
139
+ readonly purposeKey?: string;
140
+ readonly unlocksKey?: string;
141
+ readonly priority?: number;
142
+ readonly focusPath?: string;
143
+ };
144
+ }
145
+ export interface ShapeProgressRuleV1 {
146
+ readonly code: string;
147
+ readonly condition: Exclude<ShapeConditionV1, "on-track" | "degraded">;
148
+ readonly priority: number;
149
+ readonly source: {
150
+ readonly kind: "axis" | "record" | "receipt" | "topic";
151
+ readonly value: string;
152
+ };
153
+ readonly states?: readonly string[];
154
+ readonly requiresTarget?: boolean;
155
+ }
156
+ export interface TopicShapeV1 {
157
+ readonly version: 1;
158
+ readonly code: string;
159
+ readonly axes: readonly ShapeStateAxisV1[];
160
+ readonly transitions: readonly ShapeTransitionV1[];
161
+ readonly progressRules: readonly ShapeProgressRuleV1[];
162
+ readonly inferredRecordPolicy: {
163
+ readonly autoAccept: readonly string[];
164
+ readonly neverAutoAccept: readonly string[];
165
+ };
166
+ }
167
+ export type TopicShapeOverlayV1 = Omit<TopicShapeV1, "axes" | "transitions" | "progressRules"> & {
168
+ readonly axes?: readonly ShapeStateAxisV1[];
169
+ readonly transitions?: readonly ShapeTransitionV1[];
170
+ readonly progressRules?: readonly ShapeProgressRuleV1[];
171
+ };
172
+ export interface TopicShapeSourceRefV1 {
173
+ readonly kind: "base-recipe" | "topic-recipe" | "kind" | "topic";
174
+ readonly id: string;
175
+ readonly version: string;
176
+ readonly digest: `sha256:${string}`;
177
+ }
178
+ export interface TopicRecipeRefV1 {
179
+ readonly id: string;
180
+ readonly version: string;
181
+ readonly digest: `sha256:${string}`;
182
+ }
183
+ export interface TopicRecipeV1 {
184
+ readonly version: 1;
185
+ readonly code: TopicRecipeCodeV1;
186
+ readonly id: string;
187
+ readonly recipeVersion: string;
188
+ readonly label: string;
189
+ readonly description: string;
190
+ readonly baseRecipe: BaseRecipeCodeV1;
191
+ readonly creates: "draft";
192
+ readonly shape: TopicShapeV1;
193
+ }
194
+ export interface EffectiveTopicShapeV1 {
195
+ readonly version: 1;
196
+ readonly shape: TopicShapeV1;
197
+ readonly sources: readonly TopicShapeSourceRefV1[];
198
+ readonly digest: `sha256:${string}`;
199
+ }
200
+ export interface TopicClaimBindingV1 {
201
+ readonly entityDid: string;
202
+ readonly collectionId: string;
203
+ }
204
+ export interface ResolvedTopicClaimBindingV1 extends TopicClaimBindingV1 {
205
+ readonly protocolDid: string;
206
+ readonly rubric: {
207
+ readonly id: string;
208
+ readonly digest?: `sha256:${string}`;
209
+ };
210
+ }
211
+ export interface TopicProgressSourceV1 {
212
+ readonly kind: "operation" | "record" | "receipt";
213
+ readonly type: string;
214
+ readonly id: string;
215
+ readonly status?: string;
216
+ readonly finality?: "observed" | "accepted" | "verified" | "final";
217
+ }
218
+ export interface TopicProgressSourceV2 extends TopicProgressSourceV1 {
219
+ readonly actor?: string;
220
+ readonly contractRevision?: string;
221
+ readonly bodyHash?: `sha256:${string}`;
222
+ readonly policyDigest?: `sha256:${string}`;
223
+ readonly authorityProofRef?: string;
224
+ }
225
+ export interface TopicEvaluationTimeV1 {
226
+ readonly at: string;
227
+ readonly source: "matrix" | "server" | "system" | "client";
228
+ readonly trusted: boolean;
229
+ readonly freshUntil?: string;
230
+ }
231
+ export interface TopicDisputeV1 {
232
+ readonly id: string;
233
+ readonly status: "open" | "resolved";
234
+ readonly reasonCode: string;
235
+ readonly raisedBy: string;
236
+ readonly affectedRevision: string;
237
+ readonly resolver: TopicSubjectRefV1;
238
+ readonly process?: TopicDisputePolicyV1["process"];
239
+ readonly resolutionRef?: string;
240
+ }
241
+ export interface TopicProgressBlockV1 {
242
+ readonly condition: "waiting" | "blocked" | "failed" | "disputed";
243
+ readonly sourceId: string;
244
+ readonly target: {
245
+ readonly kind: "actor" | "flow" | "resource" | "external";
246
+ readonly id: string;
247
+ };
248
+ readonly reasonCode: string;
249
+ }
250
+ export interface TopicProgressInputV1 {
251
+ readonly topicId: string;
252
+ readonly topicRevision: string;
253
+ readonly contractRevision: string;
254
+ readonly status: "draft" | "active" | "resolved" | "archived" | "redirected";
255
+ readonly shape?: EffectiveTopicShapeV1;
256
+ readonly historyCompatible: boolean;
257
+ readonly axisStates: Readonly<Record<string, string>>;
258
+ readonly sources: readonly TopicProgressSourceV1[];
259
+ readonly presentFields?: readonly string[];
260
+ readonly acceptedFields?: readonly string[];
261
+ readonly bindings?: readonly ("flow" | "claim" | "resource")[];
262
+ readonly actorAssignments?: Readonly<Record<string, readonly string[]>>;
263
+ readonly block?: TopicProgressBlockV1;
264
+ }
265
+ export interface TopicStateTagV1 {
266
+ readonly code: string;
267
+ readonly source: {
268
+ readonly axis: string;
269
+ readonly state: string;
270
+ } | {
271
+ readonly progressRule: string;
272
+ };
273
+ readonly priority: number;
274
+ readonly tone: "neutral" | "info" | "attention" | "warning" | "critical" | "positive";
275
+ readonly provenance: readonly string[];
276
+ }
277
+ export interface TopicTransitionCandidateV1 {
278
+ readonly transition: ShapeTransitionV1;
279
+ readonly assignedActor?: string;
280
+ readonly assignedActors?: readonly string[];
281
+ readonly gateStatus: readonly {
282
+ readonly gate: ShapeGateV1;
283
+ readonly satisfied: boolean;
284
+ }[];
285
+ }
286
+ export type TopicObligationKindV1 = "safety" | "input" | "confirmation" | "assent" | "transition" | "wait" | "review" | "expiry" | "dispute";
287
+ export type TopicObligationStatusV1 = "open" | "ready" | "waiting" | "blocked" | "unavailable";
288
+ export interface TopicObligationV1 {
289
+ readonly id: string;
290
+ readonly code: string;
291
+ readonly kind: TopicObligationKindV1;
292
+ readonly phase: ShapePhaseV1;
293
+ readonly status: TopicObligationStatusV1;
294
+ readonly priority: number;
295
+ readonly blocking: boolean;
296
+ readonly responsibility?: {
297
+ readonly kind: "actor" | "role";
298
+ readonly value: string;
299
+ };
300
+ readonly assignedActors: readonly string[];
301
+ readonly requiredAbility?: string;
302
+ readonly consequence: ShapeConsequenceClassV1;
303
+ readonly focusPath?: string;
304
+ readonly transitionCode?: string;
305
+ readonly command?: string;
306
+ readonly handoff?: ShapeTransitionV1["handoff"];
307
+ readonly presentation: {
308
+ readonly labelKey: string;
309
+ readonly promptKey: string;
310
+ readonly purposeKey: string;
311
+ readonly unlocksKey?: string;
312
+ };
313
+ readonly provenance: readonly string[];
314
+ }
315
+ export type TopicProgressInputV2 = Omit<TopicProgressInputV1, "sources" | "shape"> & {
316
+ readonly shape?: EffectiveTopicShapeV1;
317
+ readonly sources: readonly TopicProgressSourceV2[];
318
+ readonly contractBodyHash: `sha256:${string}`;
319
+ readonly policyDigest: `sha256:${string}`;
320
+ readonly activationPolicy?: TopicActivationPolicyV1;
321
+ readonly assentPolicy?: TopicAssentPolicyV1;
322
+ readonly evaluationTime?: TopicEvaluationTimeV1;
323
+ readonly dispute?: TopicDisputeV1;
324
+ };
325
+ interface TopicProgressProjectionCommonV1 {
326
+ readonly topicId: string;
327
+ readonly topicRevision: string;
328
+ readonly contractRevision: string;
329
+ readonly shapeDigest: `sha256:${string}`;
330
+ readonly phase: ShapePhaseV1;
331
+ readonly condition: ShapeConditionV1;
332
+ readonly reasonCode: string;
333
+ readonly axisStates: Readonly<Record<string, string>>;
334
+ readonly stateTags: readonly TopicStateTagV1[];
335
+ readonly candidates: readonly TopicTransitionCandidateV1[];
336
+ readonly provenance: readonly string[];
337
+ readonly block?: TopicProgressBlockV1;
338
+ }
339
+ export interface TopicProgressProjectionV1 extends TopicProgressProjectionCommonV1 {
340
+ readonly version: 1;
341
+ }
342
+ export interface TopicProgressProjectionV2 extends TopicProgressProjectionCommonV1 {
343
+ readonly version: 2;
344
+ readonly obligations: readonly TopicObligationV1[];
345
+ readonly primaryObligationId?: string;
346
+ readonly evaluatedAt?: TopicEvaluationTimeV1;
347
+ readonly dispute?: TopicDisputeV1;
348
+ }
349
+ export interface TopicViewerAuthorityV1 {
350
+ readonly viewerId: string;
351
+ readonly matrixWrite: boolean;
352
+ readonly verifiedAbilities: readonly string[];
353
+ readonly roleAssignments: Readonly<Record<string, readonly string[]>>;
354
+ }
355
+ export interface TopicNowProjectionV1 {
356
+ readonly version: 1;
357
+ readonly phase: ShapePhaseV1;
358
+ readonly condition: ShapeConditionV1;
359
+ readonly attention: ShapeAttentionV1;
360
+ readonly reasonCode: string;
361
+ readonly stateTags: readonly TopicStateTagV1[];
362
+ readonly transitions: readonly ShapeTransitionV1[];
363
+ readonly cacheKey: {
364
+ readonly topicRevision: string;
365
+ readonly contractRevision: string;
366
+ readonly shapeDigest: `sha256:${string}`;
367
+ };
368
+ readonly blockedOn?: TopicProgressBlockV1["target"];
369
+ }
370
+ export type TopicObligationActionabilityV1 = "mine" | "theirs" | "unassigned" | "unauthorized" | "unavailable";
371
+ export interface TopicNowObligationV1 extends TopicObligationV1 {
372
+ readonly actionability: TopicObligationActionabilityV1;
373
+ }
374
+ export interface TopicNowProjectionV2 {
375
+ readonly version: 2;
376
+ readonly phase: ShapePhaseV1;
377
+ readonly condition: ShapeConditionV1;
378
+ readonly attention: ShapeAttentionV1;
379
+ readonly reasonCode: string;
380
+ readonly stateTags: readonly TopicStateTagV1[];
381
+ readonly transitions: readonly ShapeTransitionV1[];
382
+ readonly obligations: readonly TopicNowObligationV1[];
383
+ readonly primaryObligation?: TopicNowObligationV1;
384
+ readonly remainingCount: number;
385
+ readonly cacheKey: {
386
+ readonly topicRevision: string;
387
+ readonly contractRevision: string;
388
+ readonly shapeDigest: `sha256:${string}`;
389
+ };
390
+ readonly blockedOn?: TopicProgressBlockV1["target"];
391
+ }
392
+ export {};
@@ -0,0 +1,44 @@
1
+ export const SHAPE_PHASES = [
2
+ "forming",
3
+ "working",
4
+ "verifying",
5
+ "deciding",
6
+ "effecting",
7
+ "settling",
8
+ "complete",
9
+ "dormant",
10
+ ];
11
+ export const SHAPE_CONDITIONS = [
12
+ "on-track",
13
+ "needs-input",
14
+ "needs-confirmation",
15
+ "review-due",
16
+ "expired",
17
+ "waiting",
18
+ "blocked",
19
+ "failed",
20
+ "disputed",
21
+ "degraded",
22
+ ];
23
+ export const SHAPE_ATTENTION_STATES = [
24
+ "none",
25
+ "viewer-action-required",
26
+ "viewer-review-required",
27
+ "viewer-confirmation-required",
28
+ ];
29
+ export const BASE_RECIPE_CODES = [
30
+ "project",
31
+ "flow",
32
+ "proposal",
33
+ "evaluation",
34
+ "claims",
35
+ "research",
36
+ "discussion",
37
+ "incident",
38
+ ];
39
+ export const TOPIC_RECIPE_CODES = [
40
+ "research-brief",
41
+ "agent-delivery",
42
+ "verified-work-payment",
43
+ ];
44
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/shapes/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS;IACT,SAAS;IACT,WAAW;IACX,UAAU;IACV,WAAW;IACX,UAAU;IACV,UAAU;IACV,SAAS;CACD,CAAC;AAEX,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,UAAU;IACV,aAAa;IACb,oBAAoB;IACpB,YAAY;IACZ,SAAS;IACT,SAAS;IACT,SAAS;IACT,QAAQ;IACR,UAAU;IACV,UAAU;CACF,CAAC;AAEX,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,MAAM;IACN,wBAAwB;IACxB,wBAAwB;IACxB,8BAA8B;CACtB,CAAC;AAEX,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,SAAS;IACT,MAAM;IACN,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,UAAU;CACF,CAAC;AAEX,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,gBAAgB;IAChB,gBAAgB;IAChB,uBAAuB;CACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixo/topic-protocol",
3
- "version": "0.8.0",
3
+ "version": "1.0.0-rc.2",
4
4
  "description": "Reference contracts and deterministic projection for IXO Topics",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -18,6 +18,7 @@
18
18
  "files": [
19
19
  "dist",
20
20
  "profiles",
21
+ "recipes",
21
22
  "templates",
22
23
  "README.md"
23
24
  ],
@@ -28,6 +29,7 @@
28
29
  },
29
30
  "./schemas/*": "./dist/schemas/*",
30
31
  "./profiles/*": "./profiles/*",
32
+ "./recipes/*": "./recipes/*",
31
33
  "./templates/*": "./templates/*"
32
34
  },
33
35
  "scripts": {
@@ -0,0 +1,12 @@
1
+ # Topic Recipe registry
2
+
3
+ These digest-addressed Topic Recipes are Marketplace-ready release-candidate
4
+ artifacts. Every recipe creates a user-reviewable Draft; none grants authority
5
+ or executes its Flow bindings.
6
+
7
+ - `research-brief.json`
8
+ - `agent-delivery.json`
9
+ - `verified-work-payment.json`
10
+
11
+ `registry.json` publishes the corresponding immutable references. Consumers
12
+ must verify the recipe digest before resolving the Effective Topic Shape.