@ixo/topic-protocol 0.1.1 → 0.3.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.
- package/README.md +11 -2
- package/dist/schemas/topic-capsule.schema.json +2 -1
- package/dist/schemas/topic-file-attachment.schema.json +23 -0
- package/dist/schemas/topic-operation.schema.json +1 -1
- package/dist/schemas/topic-record-message.schema.json +23 -0
- package/dist/schemas/topic-root.schema.json +31 -1
- package/dist/schemas/topic-source-message.schema.json +54 -0
- package/dist/schemas/topic-state.schema.json +22 -1
- package/dist/src/contracts/schemas.d.ts +302 -1
- package/dist/src/contracts/schemas.js +6 -0
- package/dist/src/contracts/schemas.js.map +1 -1
- package/dist/src/contracts/validator.d.ts +1 -0
- package/dist/src/contracts/validator.js +10 -1
- package/dist/src/contracts/validator.js.map +1 -1
- package/dist/src/errors.d.ts +1 -1
- package/dist/src/errors.js.map +1 -1
- package/dist/src/index.d.ts +5 -3
- package/dist/src/index.js +4 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/matrix/cards.d.ts +59 -0
- package/dist/src/matrix/cards.js +86 -0
- package/dist/src/matrix/cards.js.map +1 -0
- package/dist/src/matrix/content.d.ts +2 -1
- package/dist/src/matrix/content.js +11 -0
- package/dist/src/matrix/content.js.map +1 -1
- package/dist/src/matrix/events.js +0 -2
- package/dist/src/matrix/events.js.map +1 -1
- package/dist/src/matrix/runtime.js +12 -4
- package/dist/src/matrix/runtime.js.map +1 -1
- package/dist/src/matrix/types.d.ts +2 -1
- package/dist/src/projector/payload.d.ts +11 -1
- package/dist/src/projector/payload.js +131 -2
- package/dist/src/projector/payload.js.map +1 -1
- package/dist/src/projector/prepare.d.ts +2 -1
- package/dist/src/projector/prepare.js +5 -6
- package/dist/src/projector/prepare.js.map +1 -1
- package/dist/src/projector/project.js +5 -4
- package/dist/src/projector/project.js.map +1 -1
- package/dist/src/projector/state.js +57 -0
- package/dist/src/projector/state.js.map +1 -1
- package/dist/src/projector/types.d.ts +48 -1
- package/dist/src/projector/types.js +18 -0
- package/dist/src/projector/types.js.map +1 -1
- package/dist/src/records/types.d.ts +12 -0
- package/dist/src/records/types.js +12 -0
- package/dist/src/records/types.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,8 @@ identity of a discussion.
|
|
|
9
9
|
|
|
10
10
|
## Status
|
|
11
11
|
|
|
12
|
-
**Version:** 0.
|
|
12
|
+
**Version:** 0.3.0
|
|
13
|
+
|
|
13
14
|
**Maturity:** Draft implementation candidate
|
|
14
15
|
**Execution source of truth:** [Linear Topic Protocol project](https://linear.app/ixo-world/project/topic-protocol-4ea58bc7910d)
|
|
15
16
|
|
|
@@ -38,14 +39,22 @@ key-value adapter at its integration boundary.
|
|
|
38
39
|
|
|
39
40
|
The package includes:
|
|
40
41
|
|
|
41
|
-
- strict Draft 2020-12 validation for all
|
|
42
|
+
- strict Draft 2020-12 validation for all 16 contracts;
|
|
42
43
|
- deterministic Topic projection from a root and authorised operations;
|
|
44
|
+
- singular accepted Overview projection with deterministic conflict handling;
|
|
43
45
|
- relation-free Matrix root and canonical native `m.thread` event builders;
|
|
46
|
+
- validated `ixo.topic.record` and `ixo.topic.source` message-card builders;
|
|
44
47
|
- restart-safe two-event Topic creation with duplicate suppression;
|
|
45
48
|
- append-only Matrix operation parsing and room-upgrade anchor selection;
|
|
46
49
|
- explicit conflict, duplicate-delivery, unauthorised, and unreachable handling;
|
|
47
50
|
- immutable caller inputs and typed protocol errors.
|
|
48
51
|
|
|
52
|
+
Topics retain a singular conversational `kind` while linking any number of
|
|
53
|
+
typed subject contexts. They also project pinned VFS file references without
|
|
54
|
+
copying bytes into Matrix or granting VFS access. A CID, content hash, and
|
|
55
|
+
snapshot metadata are visible to Topic members; the VFS grant remains the
|
|
56
|
+
authority for the file bytes.
|
|
57
|
+
|
|
49
58
|
Install it in a client:
|
|
50
59
|
|
|
51
60
|
```bash
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
"$id": "https://topic-protocol.ixo.world/schemas/topic-capsule.schema.json",
|
|
4
4
|
"title": "Topic Capsule",
|
|
5
5
|
"type": "object",
|
|
6
|
-
"required": ["topicId", "anchor", "stateRevision", "participants", "acceptedMemory", "capabilities", "runtimePolicy"],
|
|
6
|
+
"required": ["topicId", "anchor", "stateRevision", "participants", "attachments", "acceptedMemory", "capabilities", "runtimePolicy"],
|
|
7
7
|
"properties": {
|
|
8
8
|
"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}$" },
|
|
9
9
|
"anchor": { "type": "object", "required": ["roomId", "rootEventId"], "properties": { "roomId": { "type": "string" }, "rootEventId": { "type": "string", "pattern": "^\\$" } } },
|
|
10
10
|
"stateRevision": { "type": "string", "minLength": 1 },
|
|
11
11
|
"participants": { "type": "array", "items": { "type": "object" } },
|
|
12
12
|
"linkedContext": { "type": "array", "items": { "type": "object" } },
|
|
13
|
+
"attachments": { "type": "array", "items": { "$ref": "https://topic-protocol.ixo.world/schemas/topic-file-attachment.schema.json" } },
|
|
13
14
|
"acceptedMemory": { "type": "array", "items": { "type": "object" } },
|
|
14
15
|
"relevantEvents": { "type": "array", "items": { "type": "object" } },
|
|
15
16
|
"capabilities": { "type": "array", "items": { "type": "object" } },
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://topic-protocol.ixo.world/schemas/topic-file-attachment.schema.json",
|
|
4
|
+
"title": "Pinned Topic VFS file reference",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["provider", "resource", "fileId", "version", "cid", "contentHash", "path", "name", "mimeType", "size"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"provider": { "const": "ixo.vfs" },
|
|
9
|
+
"resource": { "type": "string", "pattern": "^ixo:filesystem/.+" },
|
|
10
|
+
"fileId": { "type": "string", "minLength": 1 },
|
|
11
|
+
"version": { "type": "integer", "minimum": 1 },
|
|
12
|
+
"cid": { "type": "string", "minLength": 1 },
|
|
13
|
+
"contentHash": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
|
|
14
|
+
"path": { "type": "string", "pattern": "^/(?!.*(?:^|/)\\.\\.(?:/|$)).+" },
|
|
15
|
+
"name": { "type": "string", "minLength": 1 },
|
|
16
|
+
"mimeType": { "type": "string", "minLength": 1 },
|
|
17
|
+
"size": { "type": "integer", "minimum": 0 },
|
|
18
|
+
"attachedBy": { "type": "string", "minLength": 1 },
|
|
19
|
+
"attachedAt": { "type": "string", "format": "date-time" },
|
|
20
|
+
"operationId": { "type": "string", "minLength": 1 }
|
|
21
|
+
},
|
|
22
|
+
"additionalProperties": false
|
|
23
|
+
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"version": { "const": 1 },
|
|
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", "link-context", "unlink-context", "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", "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" },
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://topic-protocol.ixo.world/schemas/topic-record-message.schema.json",
|
|
4
|
+
"title": "Topic record Matrix message",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["msgtype", "body", "ixo.topic.record", "m.relates_to"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"msgtype": { "const": "ixo.topic.record" },
|
|
9
|
+
"body": { "type": "string", "minLength": 1 },
|
|
10
|
+
"ixo.topic.record": { "$ref": "https://topic-protocol.ixo.world/schemas/topic-record.schema.json" },
|
|
11
|
+
"m.relates_to": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"required": ["rel_type", "event_id", "is_falling_back"],
|
|
14
|
+
"properties": {
|
|
15
|
+
"rel_type": { "const": "m.thread" },
|
|
16
|
+
"event_id": { "type": "string", "pattern": "^\\$" },
|
|
17
|
+
"is_falling_back": { "const": true }
|
|
18
|
+
},
|
|
19
|
+
"additionalProperties": true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"additionalProperties": true
|
|
23
|
+
}
|
|
@@ -12,7 +12,37 @@
|
|
|
12
12
|
"status": { "type": "string", "enum": ["draft", "active", "waiting", "blocked", "resolved", "archived", "redirected"] },
|
|
13
13
|
"createdBy": { "type": "string", "minLength": 1 },
|
|
14
14
|
"createdAt": { "type": "string", "format": "date-time" },
|
|
15
|
-
"context": {
|
|
15
|
+
"context": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"uniqueItems": true,
|
|
18
|
+
"items": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"required": ["type", "id"],
|
|
21
|
+
"properties": {
|
|
22
|
+
"type": { "type": "string", "minLength": 1 },
|
|
23
|
+
"id": { "type": "string", "minLength": 1 }
|
|
24
|
+
},
|
|
25
|
+
"additionalProperties": false
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"overview": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"required": ["summary"],
|
|
31
|
+
"properties": {
|
|
32
|
+
"summary": { "type": "string", "minLength": 1, "maxLength": 280 },
|
|
33
|
+
"nextStep": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"required": ["summary"],
|
|
36
|
+
"properties": {
|
|
37
|
+
"summary": { "type": "string", "minLength": 1, "maxLength": 280 },
|
|
38
|
+
"assignee": { "type": "string", "minLength": 1 },
|
|
39
|
+
"dueAt": { "type": "string", "format": "date-time" }
|
|
40
|
+
},
|
|
41
|
+
"additionalProperties": false
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"additionalProperties": false
|
|
45
|
+
}
|
|
16
46
|
},
|
|
17
47
|
"additionalProperties": true
|
|
18
48
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://topic-protocol.ixo.world/schemas/topic-source-message.schema.json",
|
|
4
|
+
"title": "Topic source Matrix message",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["msgtype", "body", "topicId", "ixo.topic.source", "m.relates_to"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"msgtype": { "const": "ixo.topic.source" },
|
|
9
|
+
"body": { "type": "string", "minLength": 1 },
|
|
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
|
+
"ixo.topic.source": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"required": ["roomId", "eventId", "kind", "occurredAt", "disclosure"],
|
|
14
|
+
"properties": {
|
|
15
|
+
"roomId": { "type": "string", "pattern": "^!" },
|
|
16
|
+
"eventId": { "type": "string", "pattern": "^\\$" },
|
|
17
|
+
"kind": { "type": "string", "enum": ["message", "flow", "decision", "artifact", "notification", "other"] },
|
|
18
|
+
"occurredAt": { "type": "string", "format": "date-time" },
|
|
19
|
+
"disclosure": { "type": "string", "enum": ["reference-only", "summary"] },
|
|
20
|
+
"label": { "type": "string", "minLength": 1, "maxLength": 280 },
|
|
21
|
+
"summary": { "type": "string", "minLength": 1, "maxLength": 560 }
|
|
22
|
+
},
|
|
23
|
+
"allOf": [
|
|
24
|
+
{
|
|
25
|
+
"if": { "properties": { "disclosure": { "const": "summary" } }, "required": ["disclosure"] },
|
|
26
|
+
"then": { "required": ["summary"], "properties": { "summary": {} } }
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"if": { "properties": { "disclosure": { "const": "reference-only" } }, "required": ["disclosure"] },
|
|
30
|
+
"then": {
|
|
31
|
+
"not": {
|
|
32
|
+
"anyOf": [
|
|
33
|
+
{ "required": ["label"], "properties": { "label": {} } },
|
|
34
|
+
{ "required": ["summary"], "properties": { "summary": {} } }
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"additionalProperties": false
|
|
41
|
+
},
|
|
42
|
+
"m.relates_to": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"required": ["rel_type", "event_id", "is_falling_back"],
|
|
45
|
+
"properties": {
|
|
46
|
+
"rel_type": { "const": "m.thread" },
|
|
47
|
+
"event_id": { "type": "string", "pattern": "^\\$" },
|
|
48
|
+
"is_falling_back": { "const": true }
|
|
49
|
+
},
|
|
50
|
+
"additionalProperties": true
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"additionalProperties": true
|
|
54
|
+
}
|
|
@@ -3,15 +3,36 @@
|
|
|
3
3
|
"$id": "https://topic-protocol.ixo.world/schemas/topic-state.schema.json",
|
|
4
4
|
"title": "Projected Topic state",
|
|
5
5
|
"type": "object",
|
|
6
|
-
"required": ["topicId", "revision", "status", "basedOnEvents", "conflicts"],
|
|
6
|
+
"required": ["topicId", "revision", "status", "attachments", "basedOnEvents", "conflicts"],
|
|
7
7
|
"properties": {
|
|
8
8
|
"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}$" },
|
|
9
9
|
"revision": { "type": "string", "minLength": 1 },
|
|
10
10
|
"status": { "type": "string", "enum": ["draft", "active", "waiting", "blocked", "resolved", "archived", "redirected"] },
|
|
11
11
|
"purpose": { "type": "string" },
|
|
12
|
+
"overview": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"required": ["summary", "updatedBy", "updatedAt"],
|
|
15
|
+
"properties": {
|
|
16
|
+
"summary": { "type": "string", "minLength": 1, "maxLength": 280 },
|
|
17
|
+
"nextStep": { "type": "object" },
|
|
18
|
+
"updatedBy": { "type": "string", "minLength": 1 },
|
|
19
|
+
"updatedAt": { "type": "string", "format": "date-time" },
|
|
20
|
+
"operationId": { "type": "string", "minLength": 1 }
|
|
21
|
+
},
|
|
22
|
+
"additionalProperties": true
|
|
23
|
+
},
|
|
12
24
|
"acceptedFacts": { "type": "array", "items": { "type": "object" } },
|
|
13
25
|
"decisions": { "type": "array", "items": { "type": "object" } },
|
|
14
26
|
"unresolvedQuestions": { "type": "array", "items": { "type": "object" } },
|
|
27
|
+
"attachments": {
|
|
28
|
+
"type": "array",
|
|
29
|
+
"items": {
|
|
30
|
+
"allOf": [
|
|
31
|
+
{ "$ref": "https://topic-protocol.ixo.world/schemas/topic-file-attachment.schema.json" },
|
|
32
|
+
{ "type": "object", "required": ["attachedBy", "attachedAt", "operationId"] }
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
15
36
|
"basedOnEvents": { "type": "array", "items": { "type": "string", "pattern": "^\\$" } },
|
|
16
37
|
"conflicts": { "type": "array", "items": { "type": "string" } }
|
|
17
38
|
},
|
|
@@ -197,6 +197,12 @@ export declare const SCHEMA_REGISTRY: Readonly<{
|
|
|
197
197
|
type: string;
|
|
198
198
|
};
|
|
199
199
|
};
|
|
200
|
+
attachments: {
|
|
201
|
+
type: string;
|
|
202
|
+
items: {
|
|
203
|
+
$ref: string;
|
|
204
|
+
};
|
|
205
|
+
};
|
|
200
206
|
acceptedMemory: {
|
|
201
207
|
type: string;
|
|
202
208
|
items: {
|
|
@@ -221,6 +227,67 @@ export declare const SCHEMA_REGISTRY: Readonly<{
|
|
|
221
227
|
};
|
|
222
228
|
additionalProperties: boolean;
|
|
223
229
|
};
|
|
230
|
+
"topic-file-attachment": {
|
|
231
|
+
$schema: string;
|
|
232
|
+
$id: string;
|
|
233
|
+
title: string;
|
|
234
|
+
type: string;
|
|
235
|
+
required: string[];
|
|
236
|
+
properties: {
|
|
237
|
+
provider: {
|
|
238
|
+
const: string;
|
|
239
|
+
};
|
|
240
|
+
resource: {
|
|
241
|
+
type: string;
|
|
242
|
+
pattern: string;
|
|
243
|
+
};
|
|
244
|
+
fileId: {
|
|
245
|
+
type: string;
|
|
246
|
+
minLength: number;
|
|
247
|
+
};
|
|
248
|
+
version: {
|
|
249
|
+
type: string;
|
|
250
|
+
minimum: number;
|
|
251
|
+
};
|
|
252
|
+
cid: {
|
|
253
|
+
type: string;
|
|
254
|
+
minLength: number;
|
|
255
|
+
};
|
|
256
|
+
contentHash: {
|
|
257
|
+
type: string;
|
|
258
|
+
pattern: string;
|
|
259
|
+
};
|
|
260
|
+
path: {
|
|
261
|
+
type: string;
|
|
262
|
+
pattern: string;
|
|
263
|
+
};
|
|
264
|
+
name: {
|
|
265
|
+
type: string;
|
|
266
|
+
minLength: number;
|
|
267
|
+
};
|
|
268
|
+
mimeType: {
|
|
269
|
+
type: string;
|
|
270
|
+
minLength: number;
|
|
271
|
+
};
|
|
272
|
+
size: {
|
|
273
|
+
type: string;
|
|
274
|
+
minimum: number;
|
|
275
|
+
};
|
|
276
|
+
attachedBy: {
|
|
277
|
+
type: string;
|
|
278
|
+
minLength: number;
|
|
279
|
+
};
|
|
280
|
+
attachedAt: {
|
|
281
|
+
type: string;
|
|
282
|
+
format: string;
|
|
283
|
+
};
|
|
284
|
+
operationId: {
|
|
285
|
+
type: string;
|
|
286
|
+
minLength: number;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
additionalProperties: boolean;
|
|
290
|
+
};
|
|
224
291
|
"topic-index-entry": {
|
|
225
292
|
$schema: string;
|
|
226
293
|
$id: string;
|
|
@@ -421,6 +488,43 @@ export declare const SCHEMA_REGISTRY: Readonly<{
|
|
|
421
488
|
};
|
|
422
489
|
additionalProperties: boolean;
|
|
423
490
|
};
|
|
491
|
+
"topic-record-message": {
|
|
492
|
+
$schema: string;
|
|
493
|
+
$id: string;
|
|
494
|
+
title: string;
|
|
495
|
+
type: string;
|
|
496
|
+
required: string[];
|
|
497
|
+
properties: {
|
|
498
|
+
msgtype: {
|
|
499
|
+
const: string;
|
|
500
|
+
};
|
|
501
|
+
body: {
|
|
502
|
+
type: string;
|
|
503
|
+
minLength: number;
|
|
504
|
+
};
|
|
505
|
+
"ixo.topic.record": {
|
|
506
|
+
$ref: string;
|
|
507
|
+
};
|
|
508
|
+
"m.relates_to": {
|
|
509
|
+
type: string;
|
|
510
|
+
required: string[];
|
|
511
|
+
properties: {
|
|
512
|
+
rel_type: {
|
|
513
|
+
const: string;
|
|
514
|
+
};
|
|
515
|
+
event_id: {
|
|
516
|
+
type: string;
|
|
517
|
+
pattern: string;
|
|
518
|
+
};
|
|
519
|
+
is_falling_back: {
|
|
520
|
+
const: boolean;
|
|
521
|
+
};
|
|
522
|
+
};
|
|
523
|
+
additionalProperties: boolean;
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
additionalProperties: boolean;
|
|
527
|
+
};
|
|
424
528
|
"topic-relation": {
|
|
425
529
|
$schema: string;
|
|
426
530
|
$id: string;
|
|
@@ -492,19 +596,55 @@ export declare const SCHEMA_REGISTRY: Readonly<{
|
|
|
492
596
|
};
|
|
493
597
|
context: {
|
|
494
598
|
type: string;
|
|
599
|
+
uniqueItems: boolean;
|
|
495
600
|
items: {
|
|
496
601
|
type: string;
|
|
497
602
|
required: string[];
|
|
498
603
|
properties: {
|
|
499
604
|
type: {
|
|
500
605
|
type: string;
|
|
606
|
+
minLength: number;
|
|
501
607
|
};
|
|
502
608
|
id: {
|
|
503
609
|
type: string;
|
|
610
|
+
minLength: number;
|
|
504
611
|
};
|
|
505
612
|
};
|
|
613
|
+
additionalProperties: boolean;
|
|
506
614
|
};
|
|
507
615
|
};
|
|
616
|
+
overview: {
|
|
617
|
+
type: string;
|
|
618
|
+
required: string[];
|
|
619
|
+
properties: {
|
|
620
|
+
summary: {
|
|
621
|
+
type: string;
|
|
622
|
+
minLength: number;
|
|
623
|
+
maxLength: number;
|
|
624
|
+
};
|
|
625
|
+
nextStep: {
|
|
626
|
+
type: string;
|
|
627
|
+
required: string[];
|
|
628
|
+
properties: {
|
|
629
|
+
summary: {
|
|
630
|
+
type: string;
|
|
631
|
+
minLength: number;
|
|
632
|
+
maxLength: number;
|
|
633
|
+
};
|
|
634
|
+
assignee: {
|
|
635
|
+
type: string;
|
|
636
|
+
minLength: number;
|
|
637
|
+
};
|
|
638
|
+
dueAt: {
|
|
639
|
+
type: string;
|
|
640
|
+
format: string;
|
|
641
|
+
};
|
|
642
|
+
};
|
|
643
|
+
additionalProperties: boolean;
|
|
644
|
+
};
|
|
645
|
+
};
|
|
646
|
+
additionalProperties: boolean;
|
|
647
|
+
};
|
|
508
648
|
};
|
|
509
649
|
additionalProperties: boolean;
|
|
510
650
|
};
|
|
@@ -530,6 +670,33 @@ export declare const SCHEMA_REGISTRY: Readonly<{
|
|
|
530
670
|
purpose: {
|
|
531
671
|
type: string;
|
|
532
672
|
};
|
|
673
|
+
overview: {
|
|
674
|
+
type: string;
|
|
675
|
+
required: string[];
|
|
676
|
+
properties: {
|
|
677
|
+
summary: {
|
|
678
|
+
type: string;
|
|
679
|
+
minLength: number;
|
|
680
|
+
maxLength: number;
|
|
681
|
+
};
|
|
682
|
+
nextStep: {
|
|
683
|
+
type: string;
|
|
684
|
+
};
|
|
685
|
+
updatedBy: {
|
|
686
|
+
type: string;
|
|
687
|
+
minLength: number;
|
|
688
|
+
};
|
|
689
|
+
updatedAt: {
|
|
690
|
+
type: string;
|
|
691
|
+
format: string;
|
|
692
|
+
};
|
|
693
|
+
operationId: {
|
|
694
|
+
type: string;
|
|
695
|
+
minLength: number;
|
|
696
|
+
};
|
|
697
|
+
};
|
|
698
|
+
additionalProperties: boolean;
|
|
699
|
+
};
|
|
533
700
|
acceptedFacts: {
|
|
534
701
|
type: string;
|
|
535
702
|
items: {
|
|
@@ -548,6 +715,20 @@ export declare const SCHEMA_REGISTRY: Readonly<{
|
|
|
548
715
|
type: string;
|
|
549
716
|
};
|
|
550
717
|
};
|
|
718
|
+
attachments: {
|
|
719
|
+
type: string;
|
|
720
|
+
items: {
|
|
721
|
+
allOf: ({
|
|
722
|
+
$ref: string;
|
|
723
|
+
type?: never;
|
|
724
|
+
required?: never;
|
|
725
|
+
} | {
|
|
726
|
+
type: string;
|
|
727
|
+
required: string[];
|
|
728
|
+
$ref?: never;
|
|
729
|
+
})[];
|
|
730
|
+
};
|
|
731
|
+
};
|
|
551
732
|
basedOnEvents: {
|
|
552
733
|
type: string;
|
|
553
734
|
items: {
|
|
@@ -564,6 +745,126 @@ export declare const SCHEMA_REGISTRY: Readonly<{
|
|
|
564
745
|
};
|
|
565
746
|
additionalProperties: boolean;
|
|
566
747
|
};
|
|
748
|
+
"topic-source-message": {
|
|
749
|
+
$schema: string;
|
|
750
|
+
$id: string;
|
|
751
|
+
title: string;
|
|
752
|
+
type: string;
|
|
753
|
+
required: string[];
|
|
754
|
+
properties: {
|
|
755
|
+
msgtype: {
|
|
756
|
+
const: string;
|
|
757
|
+
};
|
|
758
|
+
body: {
|
|
759
|
+
type: string;
|
|
760
|
+
minLength: number;
|
|
761
|
+
};
|
|
762
|
+
topicId: {
|
|
763
|
+
type: string;
|
|
764
|
+
pattern: string;
|
|
765
|
+
};
|
|
766
|
+
"ixo.topic.source": {
|
|
767
|
+
type: string;
|
|
768
|
+
required: string[];
|
|
769
|
+
properties: {
|
|
770
|
+
roomId: {
|
|
771
|
+
type: string;
|
|
772
|
+
pattern: string;
|
|
773
|
+
};
|
|
774
|
+
eventId: {
|
|
775
|
+
type: string;
|
|
776
|
+
pattern: string;
|
|
777
|
+
};
|
|
778
|
+
kind: {
|
|
779
|
+
type: string;
|
|
780
|
+
enum: string[];
|
|
781
|
+
};
|
|
782
|
+
occurredAt: {
|
|
783
|
+
type: string;
|
|
784
|
+
format: string;
|
|
785
|
+
};
|
|
786
|
+
disclosure: {
|
|
787
|
+
type: string;
|
|
788
|
+
enum: string[];
|
|
789
|
+
};
|
|
790
|
+
label: {
|
|
791
|
+
type: string;
|
|
792
|
+
minLength: number;
|
|
793
|
+
maxLength: number;
|
|
794
|
+
};
|
|
795
|
+
summary: {
|
|
796
|
+
type: string;
|
|
797
|
+
minLength: number;
|
|
798
|
+
maxLength: number;
|
|
799
|
+
};
|
|
800
|
+
};
|
|
801
|
+
allOf: ({
|
|
802
|
+
if: {
|
|
803
|
+
properties: {
|
|
804
|
+
disclosure: {
|
|
805
|
+
const: string;
|
|
806
|
+
};
|
|
807
|
+
};
|
|
808
|
+
required: string[];
|
|
809
|
+
};
|
|
810
|
+
then: {
|
|
811
|
+
required: string[];
|
|
812
|
+
properties: {
|
|
813
|
+
summary: {};
|
|
814
|
+
};
|
|
815
|
+
not?: never;
|
|
816
|
+
};
|
|
817
|
+
} | {
|
|
818
|
+
if: {
|
|
819
|
+
properties: {
|
|
820
|
+
disclosure: {
|
|
821
|
+
const: string;
|
|
822
|
+
};
|
|
823
|
+
};
|
|
824
|
+
required: string[];
|
|
825
|
+
};
|
|
826
|
+
then: {
|
|
827
|
+
not: {
|
|
828
|
+
anyOf: ({
|
|
829
|
+
required: string[];
|
|
830
|
+
properties: {
|
|
831
|
+
label: {};
|
|
832
|
+
summary?: never;
|
|
833
|
+
};
|
|
834
|
+
} | {
|
|
835
|
+
required: string[];
|
|
836
|
+
properties: {
|
|
837
|
+
summary: {};
|
|
838
|
+
label?: never;
|
|
839
|
+
};
|
|
840
|
+
})[];
|
|
841
|
+
};
|
|
842
|
+
required?: never;
|
|
843
|
+
properties?: never;
|
|
844
|
+
};
|
|
845
|
+
})[];
|
|
846
|
+
additionalProperties: boolean;
|
|
847
|
+
};
|
|
848
|
+
"m.relates_to": {
|
|
849
|
+
type: string;
|
|
850
|
+
required: string[];
|
|
851
|
+
properties: {
|
|
852
|
+
rel_type: {
|
|
853
|
+
const: string;
|
|
854
|
+
};
|
|
855
|
+
event_id: {
|
|
856
|
+
type: string;
|
|
857
|
+
pattern: string;
|
|
858
|
+
};
|
|
859
|
+
is_falling_back: {
|
|
860
|
+
const: boolean;
|
|
861
|
+
};
|
|
862
|
+
};
|
|
863
|
+
additionalProperties: boolean;
|
|
864
|
+
};
|
|
865
|
+
};
|
|
866
|
+
additionalProperties: boolean;
|
|
867
|
+
};
|
|
567
868
|
}>;
|
|
568
869
|
export type ContractName = keyof typeof SCHEMA_REGISTRY;
|
|
569
|
-
export declare const CONTRACT_NAMES: readonly ("action-receipt" | "agent-run" | "external-session-binding" | "room-policy" | "topic-capsule" | "topic-index-entry" | "topic-message" | "topic-operation" | "topic-preferences" | "topic-record" | "topic-relation" | "topic-root" | "topic-state")[];
|
|
870
|
+
export declare const CONTRACT_NAMES: readonly ("action-receipt" | "agent-run" | "external-session-binding" | "room-policy" | "topic-capsule" | "topic-file-attachment" | "topic-index-entry" | "topic-message" | "topic-operation" | "topic-preferences" | "topic-record" | "topic-record-message" | "topic-relation" | "topic-root" | "topic-state" | "topic-source-message")[];
|
|
@@ -3,28 +3,34 @@ import agentRun from "../../schemas/agent-run.schema.json" with { type: "json" }
|
|
|
3
3
|
import externalSessionBinding from "../../schemas/external-session-binding.schema.json" with { type: "json" };
|
|
4
4
|
import roomPolicy from "../../schemas/room-policy.schema.json" with { type: "json" };
|
|
5
5
|
import topicCapsule from "../../schemas/topic-capsule.schema.json" with { type: "json" };
|
|
6
|
+
import topicFileAttachment from "../../schemas/topic-file-attachment.schema.json" with { type: "json" };
|
|
6
7
|
import topicIndexEntry from "../../schemas/topic-index-entry.schema.json" with { type: "json" };
|
|
7
8
|
import topicMessage from "../../schemas/topic-message.schema.json" with { type: "json" };
|
|
8
9
|
import topicOperation from "../../schemas/topic-operation.schema.json" with { type: "json" };
|
|
9
10
|
import topicPreferences from "../../schemas/topic-preferences.schema.json" with { type: "json" };
|
|
10
11
|
import topicRecord from "../../schemas/topic-record.schema.json" with { type: "json" };
|
|
12
|
+
import topicRecordMessage from "../../schemas/topic-record-message.schema.json" with { type: "json" };
|
|
11
13
|
import topicRelation from "../../schemas/topic-relation.schema.json" with { type: "json" };
|
|
12
14
|
import topicRoot from "../../schemas/topic-root.schema.json" with { type: "json" };
|
|
13
15
|
import topicState from "../../schemas/topic-state.schema.json" with { type: "json" };
|
|
16
|
+
import topicSourceMessage from "../../schemas/topic-source-message.schema.json" with { type: "json" };
|
|
14
17
|
export const SCHEMA_REGISTRY = Object.freeze({
|
|
15
18
|
"action-receipt": actionReceipt,
|
|
16
19
|
"agent-run": agentRun,
|
|
17
20
|
"external-session-binding": externalSessionBinding,
|
|
18
21
|
"room-policy": roomPolicy,
|
|
19
22
|
"topic-capsule": topicCapsule,
|
|
23
|
+
"topic-file-attachment": topicFileAttachment,
|
|
20
24
|
"topic-index-entry": topicIndexEntry,
|
|
21
25
|
"topic-message": topicMessage,
|
|
22
26
|
"topic-operation": topicOperation,
|
|
23
27
|
"topic-preferences": topicPreferences,
|
|
24
28
|
"topic-record": topicRecord,
|
|
29
|
+
"topic-record-message": topicRecordMessage,
|
|
25
30
|
"topic-relation": topicRelation,
|
|
26
31
|
"topic-root": topicRoot,
|
|
27
32
|
"topic-state": topicState,
|
|
33
|
+
"topic-source-message": topicSourceMessage,
|
|
28
34
|
});
|
|
29
35
|
export const CONTRACT_NAMES = Object.freeze(Object.keys(SCHEMA_REGISTRY).sort());
|
|
30
36
|
//# sourceMappingURL=schemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/contracts/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,0CAA0C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC3F,OAAO,QAAQ,MAAM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EAAE,cAAc;IACjC,mBAAmB,EAAE,gBAAgB;IACrC,cAAc,EAAE,WAAW;IAC3B,sBAAsB,EAAE,kBAAkB;IAC1C,gBAAgB,EAAE,aAAa;IAC/B,YAAY,EAAE,SAAS;IACvB,aAAa,EAAE,UAAU;IACzB,sBAAsB,EAAE,kBAAkB;CAC3C,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CACzC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,EAAoB,CACtD,CAAC"}
|
|
@@ -10,5 +10,6 @@ export type ContractValidationResult = {
|
|
|
10
10
|
readonly ok: false;
|
|
11
11
|
readonly errors: readonly ContractValidationError[];
|
|
12
12
|
};
|
|
13
|
+
export declare function isJsonDateTime(value: string): boolean;
|
|
13
14
|
export declare function validateContract(name: ContractName, value: unknown): ContractValidationResult;
|
|
14
15
|
export declare function assertContract(name: ContractName, value: unknown): void;
|