@ixo/topic-protocol 0.4.0 → 0.6.0

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 (38) hide show
  1. package/README.md +5 -3
  2. package/dist/profiles/job-card/profile.json +29 -0
  3. package/dist/schemas/job-card.schema.json +46 -0
  4. package/dist/schemas/topic-contract-state.schema.json +318 -0
  5. package/dist/schemas/topic-file-attachment.schema.json +1 -1
  6. package/dist/schemas/topic-index-entry.schema.json +1 -1
  7. package/dist/schemas/topic-kind-profile.schema.json +82 -0
  8. package/dist/schemas/topic-operation.schema.json +14 -3
  9. package/dist/schemas/topic-preferences.schema.json +47 -2
  10. package/dist/schemas/topic-root.schema.json +9 -3
  11. package/dist/src/contracts/schemas.d.ts +1101 -24
  12. package/dist/src/contracts/schemas.js +6 -0
  13. package/dist/src/contracts/schemas.js.map +1 -1
  14. package/dist/src/contracts/topic-contract.d.ts +152 -0
  15. package/dist/src/contracts/topic-contract.js +104 -0
  16. package/dist/src/contracts/topic-contract.js.map +1 -0
  17. package/dist/src/contracts/topic-kind-profile.d.ts +81 -0
  18. package/dist/src/contracts/topic-kind-profile.js +76 -0
  19. package/dist/src/contracts/topic-kind-profile.js.map +1 -0
  20. package/dist/src/index.d.ts +4 -2
  21. package/dist/src/index.js +3 -1
  22. package/dist/src/index.js.map +1 -1
  23. package/dist/src/indexing/types.d.ts +2 -1
  24. package/dist/src/indexing/types.js.map +1 -1
  25. package/dist/src/matrix/anchors.d.ts +3 -0
  26. package/dist/src/matrix/anchors.js +14 -0
  27. package/dist/src/matrix/anchors.js.map +1 -1
  28. package/dist/src/projector/payload.d.ts +19 -1
  29. package/dist/src/projector/payload.js +74 -0
  30. package/dist/src/projector/payload.js.map +1 -1
  31. package/dist/src/projector/state.js +47 -0
  32. package/dist/src/projector/state.js.map +1 -1
  33. package/dist/src/projector/types.d.ts +49 -6
  34. package/dist/src/projector/types.js +3 -0
  35. package/dist/src/projector/types.js.map +1 -1
  36. package/package.json +4 -2
  37. package/profiles/job-card/README.md +11 -0
  38. package/profiles/job-card/profile.json +29 -0
package/README.md CHANGED
@@ -9,7 +9,7 @@ identity of a discussion.
9
9
 
10
10
  ## Status
11
11
 
12
- **Version:** 0.4.0
12
+ **Version:** 0.6.0
13
13
 
14
14
  **Maturity:** Draft implementation candidate
15
15
  **Execution source of truth:** [Linear Topic Protocol project](https://linear.app/ixo-world/project/topic-protocol-4ea58bc7910d)
@@ -22,12 +22,13 @@ and external action execution require their dedicated conformance evidence.
22
22
  ## Read this first
23
23
 
24
24
  - [Architecture decisions](docs/adr/README.md)
25
+ - [Why Topics matter](docs/topics-feature-guide.md) — a non-technical feature guide
26
+ - [Extending Topic Kinds](docs/extending-topic-kinds.md) — third-party custom Kind and Kind Profile guide
25
27
  - [Protocol chapters](docs/protocol/README.md)
26
28
  - [Machine-readable contracts](contracts/README.md)
27
29
  - [Reference implementation](docs/reference-implementation.md)
28
30
  - [ixo-portal integration plan](docs/implementation/ixo-portal.md)
29
31
  - [Conformance and release gates](docs/conformance.md)
30
- - [Source recovery and provenance](docs/source-recovery.md)
31
32
  - [Linear issue map](docs/tracking/linear-source-of-truth.md)
32
33
 
33
34
  ## npm runtime
@@ -39,7 +40,8 @@ key-value adapter at its integration boundary.
39
40
 
40
41
  The package includes:
41
42
 
42
- - strict Draft 2020-12 validation for all 17 contracts;
43
+ - strict Draft 2020-12 validation for all 20 contracts, including Kind Profiles and Job Cards;
44
+ - pinned, declarative Kind Profiles with safe standard-Kind fallback;
43
45
  - deterministic Topic-index reconciliation, structured search, and personal ranking;
44
46
  - deterministic Topic projection from a root and authorised operations;
45
47
  - singular accepted Overview projection with deterministic conflict handling;
@@ -0,0 +1,29 @@
1
+ {
2
+ "version": 1,
3
+ "id": "https://topic-protocol.ixo.world/profiles/job-card",
4
+ "profileVersion": "1.0.0",
5
+ "label": "Job",
6
+ "description": "A portable digital job card coordinated through a Task-based Topic.",
7
+ "kind": {
8
+ "customId": "org.ixo.job-card",
9
+ "baseKind": "task",
10
+ "recipe": "project"
11
+ },
12
+ "resource": {
13
+ "type": "org.ixo.job-card",
14
+ "version": 1,
15
+ "schema": "https://topic-protocol.ixo.world/schemas/job-card.schema.json"
16
+ },
17
+ "acceptance": {
18
+ "requiredResourcePaths": ["/jobNumber", "/phase"]
19
+ },
20
+ "projection": {
21
+ "key": "org.ixo.topic-kind/job-card/v1",
22
+ "roomVisibleFields": ["/jobNumber", "/phase", "/priority", "/scheduled/start"]
23
+ },
24
+ "presentation": {
25
+ "fallbackLabel": "Job",
26
+ "primaryFields": ["/jobNumber", "/phase", "/priority", "/scheduled/start", "/site", "/asset"]
27
+ },
28
+ "capabilities": ["topic/write", "topic/change-status", "topic/confirm-completion"]
29
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://topic-protocol.ixo.world/schemas/job-card.schema.json",
4
+ "title": "IXO Job Card resource v1",
5
+ "type": "object",
6
+ "required": ["version", "type", "id"],
7
+ "properties": {
8
+ "version": { "const": 1 },
9
+ "type": { "const": "org.ixo.job-card" },
10
+ "id": { "type": "string", "pattern": "^urn:ixo:job:[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
11
+ "jobNumber": { "type": "string", "minLength": 1, "maxLength": 80 },
12
+ "phase": { "type": "string", "enum": ["requested", "scheduled", "dispatched", "in_progress", "ready_for_review", "completed", "cancelled"] },
13
+ "priority": { "type": "string", "enum": ["low", "normal", "high", "urgent"] },
14
+ "instructions": { "type": "string", "minLength": 1, "maxLength": 10000 },
15
+ "scheduled": {
16
+ "type": "object",
17
+ "properties": {
18
+ "start": { "$ref": "https://topic-protocol.ixo.world/schemas/topic-contract-state.schema.json#/$defs/temporalTarget" },
19
+ "end": { "$ref": "https://topic-protocol.ixo.world/schemas/topic-contract-state.schema.json#/$defs/temporalTarget" }
20
+ },
21
+ "additionalProperties": false
22
+ },
23
+ "site": { "$ref": "#/$defs/resourceTarget" },
24
+ "asset": { "$ref": "#/$defs/resourceTarget" },
25
+ "requestedBy": { "type": "string", "minLength": 1, "maxLength": 256 },
26
+ "assignedTo": {
27
+ "type": "array",
28
+ "uniqueItems": true,
29
+ "maxItems": 100,
30
+ "items": { "type": "string", "minLength": 1, "maxLength": 256 }
31
+ },
32
+ "extensions": { "type": "object" }
33
+ },
34
+ "additionalProperties": false,
35
+ "$defs": {
36
+ "resourceTarget": {
37
+ "type": "object",
38
+ "required": ["label"],
39
+ "properties": {
40
+ "label": { "type": "string", "minLength": 1, "maxLength": 280 },
41
+ "id": { "type": "string", "minLength": 1, "maxLength": 512 }
42
+ },
43
+ "additionalProperties": false
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,318 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://topic-protocol.ixo.world/schemas/topic-contract-state.schema.json",
4
+ "title": "Qi Topic Contract state profile v2",
5
+ "type": "object",
6
+ "required": ["version", "profile", "schema", "topicId", "anchor", "manifest", "contracts", "projection", "policy", "bindings", "provenance"],
7
+ "properties": {
8
+ "version": { "const": 2 },
9
+ "profile": { "const": "qi.topic-contract-state/v2" },
10
+ "schema": { "const": "https://topic-protocol.ixo.world/schemas/topic-contract-state.schema.json" },
11
+ "topicId": { "$ref": "#/$defs/topicId" },
12
+ "anchor": { "$ref": "#/$defs/anchor" },
13
+ "manifest": { "$ref": "#/$defs/manifest" },
14
+ "contracts": { "$ref": "#/$defs/contractHeads" },
15
+ "projection": { "$ref": "#/$defs/projection" },
16
+ "policy": { "type": "object" },
17
+ "bindings": { "$ref": "#/$defs/bindings" },
18
+ "provenance": { "$ref": "#/$defs/provenance" },
19
+ "extensions": { "type": "object" }
20
+ },
21
+ "additionalProperties": false,
22
+ "$defs": {
23
+ "topicId": { "type": "string", "pattern": "^ixo:topic:[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
24
+ "entryId": { "type": "string", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
25
+ "eventId": { "type": "string", "pattern": "^\\$" },
26
+ "roomId": { "type": "string", "pattern": "^!" },
27
+ "hash": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
28
+ "persistedKind": { "type": "string", "enum": ["task", "agent_task", "proposal", "evaluation", "claims", "question", "discussion", "incident"] },
29
+ "kindRef": {
30
+ "oneOf": [
31
+ {
32
+ "type": "object",
33
+ "required": ["source", "kind"],
34
+ "properties": { "source": { "const": "standard" }, "kind": { "$ref": "#/$defs/persistedKind" } },
35
+ "additionalProperties": false
36
+ },
37
+ {
38
+ "type": "object",
39
+ "required": ["source", "customId", "label", "baseKind"],
40
+ "properties": {
41
+ "source": { "const": "custom" },
42
+ "customId": { "type": "string", "minLength": 1, "maxLength": 128 },
43
+ "label": { "type": "string", "minLength": 1, "maxLength": 80 },
44
+ "baseKind": { "$ref": "#/$defs/persistedKind" }
45
+ },
46
+ "additionalProperties": false
47
+ }
48
+ ]
49
+ },
50
+ "kindProfileRef": {
51
+ "type": "object",
52
+ "required": ["id", "version", "schema", "digest"],
53
+ "properties": {
54
+ "id": { "type": "string", "format": "uri" },
55
+ "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
56
+ "schema": { "type": "string", "format": "uri" },
57
+ "digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" }
58
+ },
59
+ "additionalProperties": false
60
+ },
61
+ "kindResource": {
62
+ "type": "object",
63
+ "required": ["profile", "type", "id", "version", "value"],
64
+ "properties": {
65
+ "profile": { "$ref": "#/$defs/kindProfileRef" },
66
+ "type": { "type": "string", "minLength": 1, "maxLength": 128 },
67
+ "id": { "type": "string", "minLength": 1, "maxLength": 512 },
68
+ "version": { "type": "integer", "minimum": 1 },
69
+ "value": { "type": "object" }
70
+ },
71
+ "additionalProperties": false
72
+ },
73
+ "anchor": {
74
+ "oneOf": [
75
+ {
76
+ "type": "object",
77
+ "required": ["mode", "roomId", "rootEventId", "manifestSource"],
78
+ "properties": {
79
+ "mode": { "const": "native" },
80
+ "roomId": { "$ref": "#/$defs/roomId" },
81
+ "rootEventId": { "$ref": "#/$defs/eventId" },
82
+ "manifestSource": { "const": "root-event" }
83
+ },
84
+ "additionalProperties": false
85
+ },
86
+ {
87
+ "type": "object",
88
+ "required": ["mode", "roomId", "rootEventId", "manifestSource"],
89
+ "properties": {
90
+ "mode": { "const": "adopted" },
91
+ "roomId": { "$ref": "#/$defs/roomId" },
92
+ "rootEventId": { "$ref": "#/$defs/eventId" },
93
+ "manifestSource": { "const": "state-event" }
94
+ },
95
+ "additionalProperties": false
96
+ }
97
+ ]
98
+ },
99
+ "manifest": {
100
+ "type": "object",
101
+ "required": ["version", "id", "title", "kind", "status", "createdBy", "createdAt"],
102
+ "properties": {
103
+ "version": { "const": 2 },
104
+ "id": { "$ref": "#/$defs/topicId" },
105
+ "title": { "type": "string", "minLength": 1, "maxLength": 280 },
106
+ "kind": { "$ref": "#/$defs/persistedKind" },
107
+ "status": { "type": "string", "enum": ["draft", "active", "waiting", "blocked", "resolved", "archived", "redirected"] },
108
+ "createdBy": { "type": "string", "minLength": 1 },
109
+ "createdAt": { "type": "string", "format": "date-time" }
110
+ },
111
+ "additionalProperties": true
112
+ },
113
+ "provenance": {
114
+ "type": "object",
115
+ "required": ["basis", "acceptance", "sourceEventIds"],
116
+ "properties": {
117
+ "basis": { "type": "string", "enum": ["explicit", "contextual", "inferred", "suggested", "retrieved"] },
118
+ "acceptance": { "type": "string", "enum": ["proposed", "accepted", "rejected", "superseded"] },
119
+ "sourceEventIds": { "type": "array", "uniqueItems": true, "items": { "$ref": "#/$defs/eventId" } },
120
+ "createdBy": { "type": "string", "minLength": 1 },
121
+ "createdAt": { "type": "string", "format": "date-time" }
122
+ },
123
+ "additionalProperties": false
124
+ },
125
+ "statement": {
126
+ "type": "object",
127
+ "required": ["id", "text", "provenance"],
128
+ "properties": {
129
+ "id": { "$ref": "#/$defs/entryId" },
130
+ "text": { "type": "string", "minLength": 1, "maxLength": 4000 },
131
+ "provenance": { "$ref": "#/$defs/provenance" }
132
+ },
133
+ "additionalProperties": false
134
+ },
135
+ "temporalTarget": {
136
+ "oneOf": [
137
+ {
138
+ "type": "object",
139
+ "required": ["precision", "value", "timezone"],
140
+ "properties": {
141
+ "precision": { "const": "date" },
142
+ "value": { "type": "string", "format": "date" },
143
+ "timezone": { "type": "string", "minLength": 1, "maxLength": 128 }
144
+ },
145
+ "additionalProperties": false
146
+ },
147
+ {
148
+ "type": "object",
149
+ "required": ["precision", "value", "timezone"],
150
+ "properties": {
151
+ "precision": { "const": "datetime" },
152
+ "value": { "type": "string", "format": "date-time" },
153
+ "timezone": { "type": "string", "minLength": 1, "maxLength": 128 }
154
+ },
155
+ "additionalProperties": false
156
+ }
157
+ ]
158
+ },
159
+ "criterion": {
160
+ "type": "object",
161
+ "required": ["id", "description", "status"],
162
+ "properties": {
163
+ "id": { "$ref": "#/$defs/entryId" },
164
+ "description": { "type": "string", "minLength": 1, "maxLength": 2000 },
165
+ "status": { "type": "string", "enum": ["pending", "met", "not_met", "waived"] },
166
+ "verification": { "type": "object" }
167
+ },
168
+ "additionalProperties": false
169
+ },
170
+ "outcome": {
171
+ "type": "object",
172
+ "properties": {
173
+ "statement": { "$ref": "#/$defs/statement" },
174
+ "status": { "type": "string", "enum": ["proposed", "accepted", "achieved", "abandoned"] },
175
+ "target": { "$ref": "#/$defs/temporalTarget" },
176
+ "successCriteria": { "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/criterion" } },
177
+ "outcomeRecordId": { "type": "string", "minLength": 1 },
178
+ "abandonedReason": { "type": "string", "minLength": 1, "maxLength": 2000 }
179
+ },
180
+ "additionalProperties": false
181
+ },
182
+ "risk": {
183
+ "type": "object",
184
+ "required": ["id", "description", "status"],
185
+ "properties": {
186
+ "id": { "$ref": "#/$defs/entryId" },
187
+ "description": { "type": "string", "minLength": 1, "maxLength": 2000 },
188
+ "impact": { "type": "string", "enum": ["low", "medium", "high", "critical"] },
189
+ "status": { "type": "string", "enum": ["open", "mitigated", "accepted", "closed"] },
190
+ "owner": { "type": "string", "minLength": 1 },
191
+ "mitigation": { "type": "string", "minLength": 1, "maxLength": 2000 }
192
+ },
193
+ "additionalProperties": false
194
+ },
195
+ "appearance": {
196
+ "type": "object",
197
+ "properties": {
198
+ "glyph": {
199
+ "oneOf": [
200
+ { "type": "object", "required": ["type", "value"], "properties": { "type": { "const": "emoji" }, "value": { "type": "string", "minLength": 1, "maxLength": 16 } }, "additionalProperties": false },
201
+ { "type": "object", "required": ["type", "name"], "properties": { "type": { "const": "icon" }, "name": { "type": "string", "enum": ["task", "agent", "proposal", "evaluation", "claims", "question", "discussion", "incident"] } }, "additionalProperties": false }
202
+ ]
203
+ }
204
+ },
205
+ "additionalProperties": false
206
+ },
207
+ "contractBody": {
208
+ "type": "object",
209
+ "required": ["version", "revision", "status", "kindRef", "authoredBy", "authoredAt", "workingMode", "recipe"],
210
+ "properties": {
211
+ "version": { "const": 2 },
212
+ "revision": { "type": "string", "minLength": 1 },
213
+ "status": { "type": "string", "enum": ["draft", "accepted", "superseded"] },
214
+ "kindRef": { "$ref": "#/$defs/kindRef" },
215
+ "kindProfile": { "$ref": "#/$defs/kindProfileRef" },
216
+ "kindResource": { "$ref": "#/$defs/kindResource" },
217
+ "authoredBy": { "type": "string", "minLength": 1 },
218
+ "authoredAt": { "type": "string", "format": "date-time" },
219
+ "workingMode": { "type": "string", "enum": ["solo", "team", "client"] },
220
+ "recipe": { "type": "string", "enum": ["project", "flow", "proposal", "evaluation", "claims", "research", "discussion", "incident"] },
221
+ "locale": { "type": "string", "minLength": 2, "maxLength": 32 },
222
+ "timezone": { "type": "string", "minLength": 1, "maxLength": 128 },
223
+ "temporalMode": { "type": "string", "enum": ["finite", "ongoing"] },
224
+ "tags": { "type": "array", "uniqueItems": true, "maxItems": 20, "items": { "type": "string", "minLength": 1, "maxLength": 80 } },
225
+ "appearance": { "$ref": "#/$defs/appearance" },
226
+ "intent": { "$ref": "#/$defs/statement" },
227
+ "outcome": { "$ref": "#/$defs/outcome" },
228
+ "completion": { "type": "object" },
229
+ "ownerId": { "type": "string", "minLength": 1 },
230
+ "scope": { "type": "object" },
231
+ "constraints": { "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/statement" } },
232
+ "assumptions": { "type": "array", "maxItems": 50, "items": { "type": "object" } },
233
+ "questions": { "type": "array", "maxItems": 50, "items": { "type": "object" } },
234
+ "risks": { "type": "array", "maxItems": 50, "items": { "$ref": "#/$defs/risk" } },
235
+ "participants": { "type": "array", "maxItems": 100, "items": { "type": "object" } },
236
+ "roles": { "type": "array", "maxItems": 50, "items": { "type": "object" } },
237
+ "agents": { "type": "array", "maxItems": 20, "items": { "type": "object" } },
238
+ "decision": { "type": "object" },
239
+ "plan": { "type": "object" },
240
+ "attachments": { "type": "array", "maxItems": 100, "items": { "type": "object" } }
241
+ },
242
+ "additionalProperties": true
243
+ },
244
+ "contractRef": {
245
+ "type": "object",
246
+ "required": ["revision", "bodyHash", "bodyRef"],
247
+ "properties": {
248
+ "revision": { "type": "string", "minLength": 1 },
249
+ "bodyHash": { "$ref": "#/$defs/hash" },
250
+ "bodyRef": { "type": "object" },
251
+ "body": { "$ref": "#/$defs/contractBody" }
252
+ },
253
+ "additionalProperties": true
254
+ },
255
+ "effectiveContractRef": {
256
+ "allOf": [
257
+ { "$ref": "#/$defs/contractRef" },
258
+ {
259
+ "type": "object",
260
+ "required": ["acceptedBy", "acceptedAt"],
261
+ "properties": {
262
+ "acceptedBy": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "minLength": 1 } },
263
+ "acceptedAt": { "type": "string", "format": "date-time" }
264
+ }
265
+ }
266
+ ]
267
+ },
268
+ "contractHeads": {
269
+ "type": "object",
270
+ "properties": { "proposed": { "$ref": "#/$defs/contractRef" }, "effective": { "$ref": "#/$defs/effectiveContractRef" } },
271
+ "additionalProperties": false
272
+ },
273
+ "projection": {
274
+ "type": "object",
275
+ "required": ["revision", "title", "status", "kindRef", "attachmentCount", "operationCount"],
276
+ "properties": {
277
+ "revision": { "type": "string", "minLength": 1 },
278
+ "title": { "type": "string", "minLength": 1, "maxLength": 280 },
279
+ "status": { "type": "string", "enum": ["draft", "active", "waiting", "blocked", "resolved", "archived", "redirected"] },
280
+ "kindRef": { "$ref": "#/$defs/kindRef" },
281
+ "kindProfile": { "$ref": "#/$defs/kindProfileRef" },
282
+ "appearance": { "$ref": "#/$defs/appearance" },
283
+ "attachmentCount": { "type": "integer", "minimum": 0 },
284
+ "operationCount": { "type": "integer", "minimum": 0 }
285
+ },
286
+ "additionalProperties": true
287
+ },
288
+ "recurrence": {
289
+ "oneOf": [
290
+ { "type": "object", "required": ["frequency", "time", "timezone"], "properties": { "frequency": { "const": "daily" }, "time": { "type": "string", "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$" }, "timezone": { "type": "string", "minLength": 1 } }, "additionalProperties": false },
291
+ { "type": "object", "required": ["frequency", "days", "time", "timezone"], "properties": { "frequency": { "const": "weekly" }, "days": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "enum": ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"] } }, "time": { "type": "string", "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$" }, "timezone": { "type": "string", "minLength": 1 } }, "additionalProperties": false }
292
+ ]
293
+ },
294
+ "automation": {
295
+ "type": "object",
296
+ "required": ["provider", "scheduleId", "actionId", "recurrence", "status"],
297
+ "properties": {
298
+ "provider": { "const": "temporal" },
299
+ "scheduleId": { "type": "string", "minLength": 1 },
300
+ "actionId": { "type": "string", "minLength": 1 },
301
+ "recurrence": { "$ref": "#/$defs/recurrence" },
302
+ "status": { "type": "string", "enum": ["pending", "active", "paused", "failed"] },
303
+ "nextRunAt": { "type": "string", "format": "date-time" }
304
+ },
305
+ "additionalProperties": false
306
+ },
307
+ "bindings": {
308
+ "type": "object",
309
+ "properties": {
310
+ "governanceProposal": { "type": "object" },
311
+ "claims": { "type": "object" },
312
+ "automations": { "type": "array", "maxItems": 20, "items": { "$ref": "#/$defs/automation" } },
313
+ "context": { "type": "array", "maxItems": 100, "items": { "type": "object" } }
314
+ },
315
+ "additionalProperties": false
316
+ }
317
+ }
318
+ }
@@ -6,7 +6,7 @@
6
6
  "required": ["provider", "resource", "fileId", "version", "cid", "contentHash", "path", "name", "mimeType", "size"],
7
7
  "properties": {
8
8
  "provider": { "const": "ixo.vfs" },
9
- "resource": { "type": "string", "pattern": "^ixo:filesystem/.+" },
9
+ "resource": { "type": "string", "pattern": "^ixo:filesystem(?:/.+)?$" },
10
10
  "fileId": { "type": "string", "minLength": 1 },
11
11
  "version": { "type": "integer", "minimum": 1 },
12
12
  "cid": { "type": "string", "minLength": 1 },
@@ -11,7 +11,7 @@
11
11
  "title": { "type": "string", "minLength": 1, "maxLength": 280 },
12
12
  "currentState": { "type": "string", "minLength": 1, "maxLength": 280 },
13
13
  "status": { "type": "string" },
14
- "kind": { "type": "string", "enum": ["discussion", "question", "decision", "proposal", "task", "incident", "flow"] },
14
+ "kind": { "type": "string", "enum": ["discussion", "question", "decision", "proposal", "task", "incident", "flow", "agent_task", "evaluation", "claims"] },
15
15
  "domain": {
16
16
  "type": "object",
17
17
  "required": ["id"],
@@ -0,0 +1,82 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://topic-protocol.ixo.world/schemas/topic-kind-profile.schema.json",
4
+ "title": "Topic Kind Profile v1",
5
+ "type": "object",
6
+ "required": ["version", "id", "profileVersion", "label", "kind", "resource", "acceptance", "projection", "presentation"],
7
+ "properties": {
8
+ "version": { "const": 1 },
9
+ "id": { "type": "string", "format": "uri" },
10
+ "profileVersion": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" },
11
+ "label": { "type": "string", "minLength": 1, "maxLength": 80 },
12
+ "description": { "type": "string", "minLength": 1, "maxLength": 1000 },
13
+ "kind": {
14
+ "type": "object",
15
+ "required": ["customId", "baseKind", "recipe"],
16
+ "properties": {
17
+ "customId": { "type": "string", "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)+$", "maxLength": 128 },
18
+ "baseKind": { "type": "string", "enum": ["task", "agent_task", "proposal", "evaluation", "claims", "question", "discussion", "incident"] },
19
+ "recipe": { "type": "string", "enum": ["project", "flow", "proposal", "evaluation", "claims", "research", "discussion", "incident"] }
20
+ },
21
+ "additionalProperties": false
22
+ },
23
+ "resource": {
24
+ "type": "object",
25
+ "required": ["type", "version", "schema"],
26
+ "properties": {
27
+ "type": { "type": "string", "pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)+$", "maxLength": 128 },
28
+ "version": { "type": "integer", "minimum": 1 },
29
+ "schema": { "type": "string", "format": "uri" }
30
+ },
31
+ "additionalProperties": false
32
+ },
33
+ "acceptance": {
34
+ "type": "object",
35
+ "required": ["requiredResourcePaths"],
36
+ "properties": {
37
+ "requiredResourcePaths": {
38
+ "type": "array",
39
+ "uniqueItems": true,
40
+ "maxItems": 50,
41
+ "items": { "type": "string", "pattern": "^/" }
42
+ }
43
+ },
44
+ "additionalProperties": false
45
+ },
46
+ "projection": {
47
+ "type": "object",
48
+ "required": ["key", "roomVisibleFields"],
49
+ "properties": {
50
+ "key": { "type": "string", "pattern": "^[a-z0-9]+(?:[._/-][a-z0-9]+)+$", "maxLength": 160 },
51
+ "roomVisibleFields": {
52
+ "type": "array",
53
+ "uniqueItems": true,
54
+ "maxItems": 20,
55
+ "items": { "type": "string", "pattern": "^/" }
56
+ }
57
+ },
58
+ "additionalProperties": false
59
+ },
60
+ "presentation": {
61
+ "type": "object",
62
+ "required": ["fallbackLabel", "primaryFields"],
63
+ "properties": {
64
+ "fallbackLabel": { "type": "string", "minLength": 1, "maxLength": 80 },
65
+ "primaryFields": {
66
+ "type": "array",
67
+ "uniqueItems": true,
68
+ "maxItems": 20,
69
+ "items": { "type": "string", "pattern": "^/" }
70
+ }
71
+ },
72
+ "additionalProperties": false
73
+ },
74
+ "capabilities": {
75
+ "type": "array",
76
+ "uniqueItems": true,
77
+ "maxItems": 20,
78
+ "items": { "type": "string", "minLength": 1, "maxLength": 128 }
79
+ }
80
+ },
81
+ "additionalProperties": false
82
+ }
@@ -5,15 +5,26 @@
5
5
  "type": "object",
6
6
  "required": ["version", "operationId", "topicId", "type", "previousRevision", "actor", "createdAt", "payload"],
7
7
  "properties": {
8
- "version": { "const": 1 },
8
+ "version": { "enum": [1, 2] },
9
9
  "operationId": { "type": "string", "minLength": 1 },
10
10
  "topicId": { "type": "string", "pattern": "^ixo:topic:[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
11
- "type": { "type": "string", "enum": ["rename", "change-status", "update-overview", "link-context", "unlink-context", "attach-files", "detach-files", "record-decision", "redirect", "branch", "merge", "resolve-conflict"] },
11
+ "type": { "type": "string", "enum": ["rename", "change-status", "update-overview", "link-context", "unlink-context", "attach-files", "detach-files", "record-decision", "propose-contract", "update-contract", "accept-contract", "supersede-contract", "bind-automation", "update-automation", "pause-automation", "remove-automation", "redirect", "branch", "merge", "resolve-conflict"] },
12
12
  "previousRevision": { "type": "string", "minLength": 1 },
13
13
  "actor": { "type": "string", "minLength": 1 },
14
14
  "createdAt": { "type": "string", "format": "date-time" },
15
15
  "payload": { "type": "object" },
16
16
  "capability": { "type": "string" }
17
17
  },
18
- "additionalProperties": true
18
+ "additionalProperties": true,
19
+ "allOf": [
20
+ {
21
+ "if": {
22
+ "properties": {
23
+ "type": { "enum": ["propose-contract", "update-contract", "accept-contract", "supersede-contract", "bind-automation", "update-automation", "pause-automation", "remove-automation"] }
24
+ },
25
+ "required": ["type"]
26
+ },
27
+ "then": { "properties": { "version": { "const": 2 } } }
28
+ }
29
+ ]
19
30
  }
@@ -5,8 +5,53 @@
5
5
  "type": "object",
6
6
  "required": ["version", "topics", "autoFollow"],
7
7
  "properties": {
8
- "version": { "const": 1 },
9
- "topics": { "type": "object", "additionalProperties": { "type": "object", "required": ["notificationMode", "pinned"], "properties": { "notificationMode": { "type": "string", "enum": ["follow", "default", "mute"] }, "pinned": { "type": "boolean" }, "markedUnreadFrom": { "type": ["string", "null"] } } } },
8
+ "version": { "enum": [1, 2] },
9
+ "topics": {
10
+ "type": "object",
11
+ "additionalProperties": {
12
+ "type": "object",
13
+ "required": ["notificationMode", "pinned"],
14
+ "properties": {
15
+ "notificationMode": { "type": "string", "enum": ["follow", "default", "mute"] },
16
+ "pinned": { "type": "boolean" },
17
+ "markedUnreadFrom": { "type": ["string", "null"] },
18
+ "companion": {
19
+ "type": "object",
20
+ "required": ["oracleDid", "sessionId"],
21
+ "properties": {
22
+ "oracleDid": { "type": "string", "minLength": 1 },
23
+ "sessionId": { "type": "string", "minLength": 1 },
24
+ "lastContextRevision": { "type": "string", "minLength": 1 }
25
+ },
26
+ "additionalProperties": false
27
+ },
28
+ "reminder": {
29
+ "oneOf": [
30
+ {
31
+ "type": "object",
32
+ "required": ["mode", "at", "timezone"],
33
+ "properties": {
34
+ "mode": { "const": "at" },
35
+ "at": { "type": "string", "format": "date-time" },
36
+ "timezone": { "type": "string", "minLength": 1 }
37
+ },
38
+ "additionalProperties": false
39
+ },
40
+ {
41
+ "type": "object",
42
+ "required": ["mode", "minutes"],
43
+ "properties": {
44
+ "mode": { "const": "before_due" },
45
+ "minutes": { "type": "integer", "minimum": 0 }
46
+ },
47
+ "additionalProperties": false
48
+ }
49
+ ]
50
+ }
51
+ },
52
+ "additionalProperties": false
53
+ }
54
+ },
10
55
  "autoFollow": { "type": "string", "enum": ["none", "started", "started_or_participated"] }
11
56
  },
12
57
  "additionalProperties": false