@logicsrc/schemas 0.1.0 → 0.1.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 (38) hide show
  1. package/README.md +8 -1
  2. package/fixtures/openfleet/mixed.json +86 -0
  3. package/fixtures/openprd/conformance.json +14 -3
  4. package/fixtures/openprd/invalid/bad-filename.md +10 -1
  5. package/fixtures/openprd/invalid/bad-id-format.md +10 -1
  6. package/fixtures/openprd/invalid/bad-status.md +10 -1
  7. package/fixtures/openprd/invalid/dates-backwards.md +10 -1
  8. package/fixtures/openprd/invalid/duplicate-requirement.md +10 -1
  9. package/fixtures/openprd/invalid/id-mismatch.md +10 -1
  10. package/fixtures/openprd/invalid/missing-monetization.md +45 -0
  11. package/fixtures/openprd/invalid/missing-section.md +10 -1
  12. package/fixtures/openprd/invalid/missing-title.md +10 -1
  13. package/fixtures/openprd/invalid/no-front-matter.md +9 -0
  14. package/fixtures/openprd/invalid/out-of-order.md +10 -1
  15. package/fixtures/openprd/invalid/superseded-without-replacement.md +10 -1
  16. package/fixtures/openprd/invalid/unknown-key.md +10 -1
  17. package/fixtures/openprd/valid/bold-requirements.md +10 -1
  18. package/fixtures/openprd/valid/full.md +10 -1
  19. package/fixtures/openprd/valid/legacy-0-2.md +41 -0
  20. package/fixtures/openprd/valid/minimal.md +9 -1
  21. package/fixtures/openprd/valid/none-sections.md +9 -1
  22. package/fixtures/openprd/valid/subsections.md +10 -1
  23. package/fixtures/openprd/valid/superseded.md +10 -1
  24. package/fixtures/openwall/announcement.json +16 -0
  25. package/fixtures/openwall/broadcast.json +27 -0
  26. package/fixtures/openwall/direct.json +17 -0
  27. package/fixtures/openwall/receipt-accepted.json +13 -0
  28. package/fixtures/openwall/receipt-retrying.json +14 -0
  29. package/package.json +16 -3
  30. package/schemas/logicsrc-opencreds-audit-event.schema.json +54 -0
  31. package/schemas/logicsrc-opencreds-database.schema.json +94 -0
  32. package/schemas/logicsrc-opencreds-envelope.schema.json +38 -0
  33. package/schemas/logicsrc-opencreds-item.schema.json +240 -0
  34. package/schemas/logicsrc-opencreds-manifest.schema.json +31 -0
  35. package/schemas/logicsrc-opencreds-vault-meta.schema.json +70 -0
  36. package/schemas/logicsrc-openfleet.schema.json +323 -0
  37. package/schemas/logicsrc-openwall-message.schema.json +246 -0
  38. package/schemas/logicsrc-openwall-receipt.schema.json +229 -0
@@ -0,0 +1,323 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.logicsrc.com/logicsrc-openfleet.schema.json",
4
+ "title": "OpenFleet",
5
+ "description": "A fleet of OpenAgent profiles and/or OpenSwarm swarms with explicit CoinPay rental offers.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "type",
10
+ "version",
11
+ "id",
12
+ "name",
13
+ "owner_did",
14
+ "members"
15
+ ],
16
+ "properties": {
17
+ "type": {
18
+ "const": "logicsrc.openfleet"
19
+ },
20
+ "version": {
21
+ "const": "0.1"
22
+ },
23
+ "id": {
24
+ "$ref": "#/$defs/httpsUrl"
25
+ },
26
+ "name": {
27
+ "type": "string",
28
+ "minLength": 1,
29
+ "maxLength": 120
30
+ },
31
+ "description": {
32
+ "type": "string"
33
+ },
34
+ "owner_did": {
35
+ "$ref": "https://schemas.logicsrc.com/logicsrc-agent.schema.json#/$defs/did"
36
+ },
37
+ "updated_at": {
38
+ "type": "string",
39
+ "format": "date-time"
40
+ },
41
+ "availability": {
42
+ "enum": [
43
+ "available",
44
+ "busy",
45
+ "offline",
46
+ "unknown"
47
+ ]
48
+ },
49
+ "tags": {
50
+ "type": "array",
51
+ "items": {
52
+ "type": "string",
53
+ "minLength": 1
54
+ },
55
+ "uniqueItems": true
56
+ },
57
+ "capabilities": {
58
+ "type": "array",
59
+ "items": {
60
+ "type": "string",
61
+ "minLength": 1
62
+ },
63
+ "uniqueItems": true
64
+ },
65
+ "metadata": {
66
+ "type": "object"
67
+ },
68
+ "members": {
69
+ "type": "array",
70
+ "minItems": 1,
71
+ "items": {
72
+ "$ref": "#/$defs/member"
73
+ }
74
+ },
75
+ "rentals": {
76
+ "type": "array",
77
+ "items": {
78
+ "$ref": "#/$defs/rental"
79
+ }
80
+ }
81
+ },
82
+ "$defs": {
83
+ "httpsUrl": {
84
+ "type": "string",
85
+ "format": "uri",
86
+ "pattern": "^https://"
87
+ },
88
+ "memberReference": {
89
+ "oneOf": [
90
+ {
91
+ "type": "object",
92
+ "additionalProperties": false,
93
+ "required": [
94
+ "kind",
95
+ "id"
96
+ ],
97
+ "properties": {
98
+ "kind": {
99
+ "const": "openagent"
100
+ },
101
+ "id": {
102
+ "$ref": "https://schemas.logicsrc.com/logicsrc-agent.schema.json#/$defs/did"
103
+ }
104
+ }
105
+ },
106
+ {
107
+ "type": "object",
108
+ "additionalProperties": false,
109
+ "required": [
110
+ "kind",
111
+ "id"
112
+ ],
113
+ "properties": {
114
+ "kind": {
115
+ "const": "openswarm"
116
+ },
117
+ "id": {
118
+ "type": "string",
119
+ "pattern": "^ed25519:[0-9a-f]{64}$"
120
+ }
121
+ }
122
+ }
123
+ ]
124
+ },
125
+ "member": {
126
+ "oneOf": [
127
+ {
128
+ "type": "object",
129
+ "additionalProperties": false,
130
+ "required": [
131
+ "kind",
132
+ "id",
133
+ "url"
134
+ ],
135
+ "properties": {
136
+ "kind": {
137
+ "const": "openagent"
138
+ },
139
+ "id": {
140
+ "$ref": "https://schemas.logicsrc.com/logicsrc-agent.schema.json#/$defs/did"
141
+ },
142
+ "url": {
143
+ "$ref": "#/$defs/httpsUrl"
144
+ },
145
+ "name": {
146
+ "type": "string",
147
+ "minLength": 1
148
+ },
149
+ "role": {
150
+ "type": "string",
151
+ "minLength": 1
152
+ },
153
+ "metadata": {
154
+ "type": "object"
155
+ }
156
+ }
157
+ },
158
+ {
159
+ "type": "object",
160
+ "additionalProperties": false,
161
+ "required": [
162
+ "kind",
163
+ "id",
164
+ "url"
165
+ ],
166
+ "properties": {
167
+ "kind": {
168
+ "const": "openswarm"
169
+ },
170
+ "id": {
171
+ "type": "string",
172
+ "pattern": "^ed25519:[0-9a-f]{64}$"
173
+ },
174
+ "url": {
175
+ "$ref": "#/$defs/httpsUrl"
176
+ },
177
+ "name": {
178
+ "type": "string",
179
+ "minLength": 1
180
+ },
181
+ "role": {
182
+ "type": "string",
183
+ "minLength": 1
184
+ },
185
+ "metadata": {
186
+ "type": "object"
187
+ }
188
+ }
189
+ }
190
+ ]
191
+ },
192
+ "scope": {
193
+ "oneOf": [
194
+ {
195
+ "type": "object",
196
+ "additionalProperties": false,
197
+ "required": [
198
+ "kind"
199
+ ],
200
+ "properties": {
201
+ "kind": {
202
+ "const": "fleet"
203
+ }
204
+ }
205
+ },
206
+ {
207
+ "type": "object",
208
+ "additionalProperties": false,
209
+ "required": [
210
+ "kind",
211
+ "members"
212
+ ],
213
+ "properties": {
214
+ "kind": {
215
+ "const": "members"
216
+ },
217
+ "members": {
218
+ "type": "array",
219
+ "minItems": 1,
220
+ "items": {
221
+ "$ref": "#/$defs/memberReference"
222
+ }
223
+ }
224
+ }
225
+ }
226
+ ]
227
+ },
228
+ "rental": {
229
+ "type": "object",
230
+ "additionalProperties": false,
231
+ "required": [
232
+ "id",
233
+ "scope",
234
+ "rate",
235
+ "payment"
236
+ ],
237
+ "properties": {
238
+ "id": {
239
+ "type": "string",
240
+ "minLength": 1
241
+ },
242
+ "name": {
243
+ "type": "string",
244
+ "minLength": 1
245
+ },
246
+ "scope": {
247
+ "$ref": "#/$defs/scope"
248
+ },
249
+ "rate": {
250
+ "type": "object",
251
+ "additionalProperties": false,
252
+ "required": [
253
+ "amount",
254
+ "currency",
255
+ "unit"
256
+ ],
257
+ "properties": {
258
+ "amount": {
259
+ "type": "string",
260
+ "pattern": "^(0|[1-9][0-9]*)\\.[0-9]{6}$",
261
+ "description": "Non-negative USD decimal string with exactly six fractional digits; never a JSON number."
262
+ },
263
+ "currency": {
264
+ "const": "USD"
265
+ },
266
+ "unit": {
267
+ "enum": [
268
+ "hour",
269
+ "day",
270
+ "month",
271
+ "task"
272
+ ]
273
+ }
274
+ }
275
+ },
276
+ "minimum_units": {
277
+ "type": "integer",
278
+ "minimum": 1,
279
+ "maximum": 9007199254740991
280
+ },
281
+ "maximum_units": {
282
+ "type": "integer",
283
+ "minimum": 1,
284
+ "maximum": 9007199254740991
285
+ },
286
+ "valid_from": {
287
+ "type": "string",
288
+ "format": "date-time"
289
+ },
290
+ "valid_until": {
291
+ "type": "string",
292
+ "format": "date-time"
293
+ },
294
+ "terms_url": {
295
+ "$ref": "#/$defs/httpsUrl"
296
+ },
297
+ "payment": {
298
+ "type": "object",
299
+ "additionalProperties": false,
300
+ "required": [
301
+ "provider",
302
+ "payee_did",
303
+ "checkout_url"
304
+ ],
305
+ "properties": {
306
+ "provider": {
307
+ "const": "coinpay"
308
+ },
309
+ "payee_did": {
310
+ "$ref": "https://schemas.logicsrc.com/logicsrc-agent.schema.json#/$defs/did"
311
+ },
312
+ "checkout_url": {
313
+ "$ref": "#/$defs/httpsUrl"
314
+ }
315
+ }
316
+ },
317
+ "metadata": {
318
+ "type": "object"
319
+ }
320
+ }
321
+ }
322
+ }
323
+ }
@@ -0,0 +1,246 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schemas.logicsrc.com/logicsrc-openwall-message.schema.json",
4
+ "title": "OpenWall Message (0.1 draft)",
5
+ "description": "Private sender-side job document. Structural validation does not authorize delivery or enforce the semantic rules in docs/openwall.md.",
6
+ "type": "object",
7
+ "required": [
8
+ "openwall",
9
+ "id",
10
+ "sender",
11
+ "createdAt",
12
+ "expiresAt",
13
+ "visibility",
14
+ "topic",
15
+ "audience",
16
+ "content"
17
+ ],
18
+ "additionalProperties": false,
19
+ "properties": {
20
+ "openwall": {
21
+ "const": "0.1-draft"
22
+ },
23
+ "id": {
24
+ "type": "string",
25
+ "format": "uri",
26
+ "pattern": "^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
27
+ },
28
+ "sender": {
29
+ "$ref": "#/$defs/identity"
30
+ },
31
+ "createdAt": {
32
+ "type": "string",
33
+ "format": "date-time"
34
+ },
35
+ "notBefore": {
36
+ "type": "string",
37
+ "format": "date-time"
38
+ },
39
+ "expiresAt": {
40
+ "type": "string",
41
+ "format": "date-time"
42
+ },
43
+ "visibility": {
44
+ "enum": [
45
+ "private",
46
+ "public"
47
+ ]
48
+ },
49
+ "topic": {
50
+ "type": "string",
51
+ "minLength": 1,
52
+ "maxLength": 128,
53
+ "pattern": "^[a-z0-9][a-z0-9._-]*$"
54
+ },
55
+ "audience": {
56
+ "oneOf": [
57
+ {
58
+ "$ref": "#/$defs/relationships"
59
+ },
60
+ {
61
+ "$ref": "#/$defs/direct"
62
+ },
63
+ {
64
+ "$ref": "#/$defs/public"
65
+ }
66
+ ]
67
+ },
68
+ "content": {
69
+ "type": "object",
70
+ "required": [
71
+ "mediaType",
72
+ "text"
73
+ ],
74
+ "additionalProperties": false,
75
+ "properties": {
76
+ "mediaType": {
77
+ "const": "text/plain"
78
+ },
79
+ "text": {
80
+ "type": "string",
81
+ "minLength": 1,
82
+ "maxLength": 4000
83
+ }
84
+ }
85
+ }
86
+ },
87
+ "allOf": [
88
+ {
89
+ "if": {
90
+ "properties": {
91
+ "visibility": {
92
+ "const": "public"
93
+ }
94
+ }
95
+ },
96
+ "then": {
97
+ "properties": {
98
+ "audience": {
99
+ "$ref": "#/$defs/public"
100
+ }
101
+ }
102
+ },
103
+ "else": {
104
+ "properties": {
105
+ "audience": {
106
+ "oneOf": [
107
+ {
108
+ "$ref": "#/$defs/relationships"
109
+ },
110
+ {
111
+ "$ref": "#/$defs/direct"
112
+ }
113
+ ]
114
+ }
115
+ }
116
+ }
117
+ }
118
+ ],
119
+ "$defs": {
120
+ "identity": {
121
+ "type": "string",
122
+ "format": "uri",
123
+ "pattern": "^(did:|https://)",
124
+ "maxLength": 2048
125
+ },
126
+ "selector": {
127
+ "type": "object",
128
+ "required": [
129
+ "source",
130
+ "actor",
131
+ "groups"
132
+ ],
133
+ "additionalProperties": false,
134
+ "properties": {
135
+ "source": {
136
+ "type": "string",
137
+ "format": "uri",
138
+ "pattern": "^https://",
139
+ "maxLength": 2048
140
+ },
141
+ "actor": {
142
+ "$ref": "#/$defs/identity"
143
+ },
144
+ "groups": {
145
+ "type": "array",
146
+ "minItems": 1,
147
+ "maxItems": 4,
148
+ "uniqueItems": true,
149
+ "items": {
150
+ "enum": [
151
+ "connections",
152
+ "followers",
153
+ "following",
154
+ "users"
155
+ ]
156
+ }
157
+ },
158
+ "scope": {
159
+ "type": "string",
160
+ "format": "uri",
161
+ "pattern": "^https://",
162
+ "maxLength": 2048
163
+ }
164
+ },
165
+ "allOf": [
166
+ {
167
+ "if": {
168
+ "properties": {
169
+ "groups": {
170
+ "contains": {
171
+ "const": "users"
172
+ },
173
+ "type": "array"
174
+ }
175
+ }
176
+ },
177
+ "then": {
178
+ "required": [
179
+ "scope"
180
+ ],
181
+ "properties": {
182
+ "scope": {}
183
+ }
184
+ }
185
+ }
186
+ ]
187
+ },
188
+ "relationships": {
189
+ "type": "object",
190
+ "required": [
191
+ "kind",
192
+ "selectors"
193
+ ],
194
+ "additionalProperties": false,
195
+ "properties": {
196
+ "kind": {
197
+ "const": "relationships"
198
+ },
199
+ "selectors": {
200
+ "type": "array",
201
+ "minItems": 1,
202
+ "maxItems": 32,
203
+ "uniqueItems": true,
204
+ "items": {
205
+ "$ref": "#/$defs/selector"
206
+ }
207
+ },
208
+ "exclude": {
209
+ "type": "array",
210
+ "uniqueItems": true,
211
+ "items": {
212
+ "$ref": "#/$defs/identity"
213
+ }
214
+ }
215
+ }
216
+ },
217
+ "direct": {
218
+ "type": "object",
219
+ "required": [
220
+ "kind",
221
+ "recipient"
222
+ ],
223
+ "additionalProperties": false,
224
+ "properties": {
225
+ "kind": {
226
+ "const": "direct"
227
+ },
228
+ "recipient": {
229
+ "$ref": "#/$defs/identity"
230
+ }
231
+ }
232
+ },
233
+ "public": {
234
+ "type": "object",
235
+ "required": [
236
+ "kind"
237
+ ],
238
+ "additionalProperties": false,
239
+ "properties": {
240
+ "kind": {
241
+ "const": "public"
242
+ }
243
+ }
244
+ }
245
+ }
246
+ }