@joe-broadhead/opencode-mem 0.9.14 → 0.11.3

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 (143) hide show
  1. package/CHANGELOG.md +1856 -0
  2. package/README.md +15 -7
  3. package/SECURITY.md +3 -1
  4. package/docs/agent-instructions.md +1 -1
  5. package/docs/agent-protocol.md +7 -7
  6. package/docs/permissions.md +16 -0
  7. package/package.json +8921 -1070
  8. package/shared/page-paths.js +44 -0
  9. package/skills/mem.pages/SKILL.md +3 -1
  10. package/skills/mem.usage/SKILL.md +15 -15
  11. package/src/action-grant-keys.js +159 -0
  12. package/src/action-grant.js +439 -0
  13. package/src/actions.js +1690 -0
  14. package/src/backend/records.js +25 -2
  15. package/src/backend/v3.js +76 -22
  16. package/src/call-shapes.js +17 -16
  17. package/src/collector-lock.js +533 -62
  18. package/src/collector-service.js +153 -26
  19. package/src/collector.js +623 -30
  20. package/src/config.js +88 -7
  21. package/src/connect.js +106 -8
  22. package/src/credentials.js +123 -25
  23. package/src/events.js +174 -3
  24. package/src/forget-turn.js +141 -0
  25. package/src/host-refusal.js +78 -0
  26. package/src/index.js +209 -22
  27. package/src/jobs/host.js +557 -0
  28. package/src/ops/codes.js +110 -0
  29. package/src/ops/copy-lineage.js +42 -0
  30. package/src/ops/index.js +28 -0
  31. package/src/ops/space-ops.js +1936 -0
  32. package/src/outlinks.js +103 -0
  33. package/src/p2-reservation.js +151 -0
  34. package/src/permissions.js +30 -0
  35. package/src/plugins/descriptor.js +62 -0
  36. package/src/plugins/discovery.js +318 -0
  37. package/src/plugins/grants.js +178 -0
  38. package/src/plugins/locate.js +319 -0
  39. package/src/plugins/manifest.js +1162 -0
  40. package/src/plugins/source-contract/index.js +34 -0
  41. package/src/plugins/source-contract/policy.js +102 -0
  42. package/src/plugins/source-contract/vendor/PROVENANCE.json +17 -0
  43. package/src/plugins/source-contract/vendor/RELEASE-SHA256SUMS +3 -0
  44. package/src/plugins/source-contract/vendor/RELEASE.json +17 -0
  45. package/src/plugins/source-contract/vendor/SHA256SUMS +41 -0
  46. package/src/plugins/source-contract/vendor/THIRD-PARTY-NOTICES.md +35 -0
  47. package/src/plugins/source-contract/vendor/broker-client.js +93 -0
  48. package/src/plugins/source-contract/vendor/chunks/chunk-3M5PAKSS.js +84 -0
  49. package/src/plugins/source-contract/vendor/chunks/chunk-4ERCA4TK.js +185 -0
  50. package/src/plugins/source-contract/vendor/chunks/chunk-6HDIB2SA.js +183 -0
  51. package/src/plugins/source-contract/vendor/chunks/chunk-ELPJD3ND.js +10 -0
  52. package/src/plugins/source-contract/vendor/chunks/chunk-HLVAKAYG.js +10 -0
  53. package/src/plugins/source-contract/vendor/chunks/chunk-I2RXJJJM.js +81 -0
  54. package/src/plugins/source-contract/vendor/chunks/chunk-KWEWSZ4V.js +505 -0
  55. package/src/plugins/source-contract/vendor/chunks/chunk-KYWBTAF4.js +182 -0
  56. package/src/plugins/source-contract/vendor/chunks/chunk-Q3RQA5J2.js +249 -0
  57. package/src/plugins/source-contract/vendor/chunks/chunk-RRUAIQ4I.js +156 -0
  58. package/src/plugins/source-contract/vendor/chunks/chunk-RYNKNCPP.js +165 -0
  59. package/src/plugins/source-contract/vendor/chunks/chunk-W5SHR7DQ.js +9477 -0
  60. package/src/plugins/source-contract/vendor/chunks/chunk-ZUKF7P6U.js +653 -0
  61. package/src/plugins/source-contract/vendor/cursor.js +26 -0
  62. package/src/plugins/source-contract/vendor/descriptor.js +34 -0
  63. package/src/plugins/source-contract/vendor/events.js +257 -0
  64. package/src/plugins/source-contract/vendor/index.js +10 -0
  65. package/src/plugins/source-contract/vendor/params.js +22 -0
  66. package/src/plugins/source-contract/vendor/permission.js +28 -0
  67. package/src/plugins/source-contract/vendor/pick.js +22 -0
  68. package/src/plugins/source-contract/vendor/read.js +29 -0
  69. package/src/plugins/source-contract/vendor/registry.js +23 -0
  70. package/src/plugins/source-contract/vendor/schema.js +17 -0
  71. package/src/plugins/source-contract/vendor/schemas/output.agenda.json +96 -0
  72. package/src/plugins/source-contract/vendor/schemas/output.countdown.json +28 -0
  73. package/src/plugins/source-contract/vendor/schemas/output.image.json +28 -0
  74. package/src/plugins/source-contract/vendor/schemas/output.inbox.json +84 -0
  75. package/src/plugins/source-contract/vendor/schemas/output.links.json +46 -0
  76. package/src/plugins/source-contract/vendor/schemas/output.list.json +57 -0
  77. package/src/plugins/source-contract/vendor/schemas/output.metric.json +61 -0
  78. package/src/plugins/source-contract/vendor/schemas/output.note.json +14 -0
  79. package/src/plugins/source-contract/vendor/schemas/output.progress.json +50 -0
  80. package/src/plugins/source-contract/vendor/schemas/output.record.json +38 -0
  81. package/src/plugins/source-contract/vendor/schemas/output.table.json +61 -0
  82. package/src/plugins/source-contract/vendor/schemas/output.thread.json +62 -0
  83. package/src/plugins/source-contract/vendor/schemas/sources.json +819 -0
  84. package/src/plugins/source-contract/vendor/schemas.js +19 -0
  85. package/src/plugins/source-contract/vendor/tools-rpc.js +42 -0
  86. package/src/plugins/verify.js +56 -0
  87. package/src/protocol.js +11 -6
  88. package/src/recall.js +92 -5
  89. package/src/records.js +61 -2
  90. package/src/requests.js +216 -0
  91. package/src/runtime.js +89 -7
  92. package/src/setup-time.js +68 -0
  93. package/src/skills.js +230 -8
  94. package/src/source-ids.js +25 -0
  95. package/src/sources/declaration.js +365 -0
  96. package/src/sources/reads.js +772 -0
  97. package/src/sources/rpc.js +151 -0
  98. package/src/sources.js +389 -92
  99. package/src/spaces.js +283 -11
  100. package/src/spool.js +61 -4
  101. package/src/stated.js +10 -5
  102. package/src/storable.js +139 -0
  103. package/src/tools/commitments.js +74 -23
  104. package/src/tools/held-write.js +46 -19
  105. package/src/tools/index.js +28 -0
  106. package/src/tools/ingest.js +38 -2
  107. package/src/tools/memory.js +56 -25
  108. package/src/tools/page.js +212 -95
  109. package/src/tools/recall.js +218 -4
  110. package/src/tools/share.js +42 -3
  111. package/src/tools/shared.js +84 -6
  112. package/src/tools/space-lifecycle.js +278 -0
  113. package/src/tools/spaces.js +381 -30
  114. package/src/tools/status.js +9 -2
  115. package/src/tools/wiki.js +231 -116
  116. package/src/util.js +110 -6
  117. package/src/vendor/source-contract/README.md +24 -0
  118. package/src/vendor/source-contract/THIRD-PARTY-NOTICES.md +35 -0
  119. package/src/vendor/source-contract/VENDOR.json +81 -0
  120. package/src/vendor/source-contract/chunks/chunk-3M5PAKSS.js +84 -0
  121. package/src/vendor/source-contract/chunks/chunk-6HDIB2SA.js +183 -0
  122. package/src/vendor/source-contract/chunks/chunk-HLVAKAYG.js +10 -0
  123. package/src/vendor/source-contract/chunks/chunk-I2RXJJJM.js +81 -0
  124. package/src/vendor/source-contract/chunks/chunk-KWEWSZ4V.js +505 -0
  125. package/src/vendor/source-contract/chunks/chunk-W5SHR7DQ.js +9477 -0
  126. package/src/vendor/source-contract/chunks/chunk-ZUKF7P6U.js +653 -0
  127. package/src/vendor/source-contract/cursor.js +26 -0
  128. package/src/vendor/source-contract/events.js +257 -0
  129. package/src/vendor/source-contract/registry.js +23 -0
  130. package/src/vendor/source-contract/tools-rpc.js +42 -0
  131. package/src/views/access-reads.js +256 -0
  132. package/src/views/communities.js +77 -0
  133. package/src/views/contracts.js +1082 -23
  134. package/src/views/inbox-bytes.js +103 -0
  135. package/src/views/profile.js +31 -0
  136. package/src/views/receipt.js +26 -1
  137. package/src/views/records-reads.js +520 -41
  138. package/src/views/rpc.js +153 -25
  139. package/src/views/shape.js +8 -5
  140. package/src/views/write-state.js +89 -0
  141. package/src/wiki-ingest.js +215 -0
  142. package/src/wiki-state.js +228 -0
  143. package/views/pages.html +2 -2
@@ -0,0 +1,819 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "contractVersion": {
6
+ "type": "number",
7
+ "const": 1
8
+ },
9
+ "rpc": {
10
+ "description": "The plugin's tools-RPC id (#4, #8), which a consumer calls instead of mapping the package.",
11
+ "type": "string",
12
+ "maxLength": 200
13
+ },
14
+ "probe": {
15
+ "description": "The plugin's one probe tool, and the permission action it asserts (#4, #8).",
16
+ "type": "object",
17
+ "properties": {
18
+ "action": {
19
+ "type": "string",
20
+ "maxLength": 80,
21
+ "pattern": "^(?:[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*|[a-z][a-z0-9]*_[a-z][a-z0-9_]*)$"
22
+ }
23
+ },
24
+ "required": [
25
+ "action"
26
+ ],
27
+ "additionalProperties": false
28
+ },
29
+ "items": {
30
+ "minItems": 1,
31
+ "type": "array",
32
+ "items": {
33
+ "oneOf": [
34
+ {
35
+ "type": "object",
36
+ "properties": {
37
+ "id": {
38
+ "type": "string",
39
+ "maxLength": 64,
40
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)+$"
41
+ },
42
+ "tool": {
43
+ "type": "string",
44
+ "maxLength": 64,
45
+ "pattern": "^[a-z][a-z0-9_]{0,63}$"
46
+ },
47
+ "input": {
48
+ "description": "The input the tool needs to reach this source. It carries no account and no secret.",
49
+ "type": "object",
50
+ "properties": {},
51
+ "additionalProperties": {}
52
+ },
53
+ "accounts": {
54
+ "type": "object",
55
+ "properties": {
56
+ "named": {
57
+ "type": "boolean",
58
+ "description": "True when the source reads more than one account, so a read names one."
59
+ }
60
+ },
61
+ "required": [
62
+ "named"
63
+ ],
64
+ "additionalProperties": false,
65
+ "description": "Which signed-in accounts a source reads."
66
+ },
67
+ "scope": {
68
+ "type": "object",
69
+ "properties": {
70
+ "keys": {
71
+ "type": "array",
72
+ "items": {
73
+ "type": "string",
74
+ "maxLength": 32,
75
+ "pattern": "^[a-z][a-z0-9_]{0,31}$"
76
+ },
77
+ "description": "The scope keys a person confirms: labels, channels, repositories. Empty when there is nothing to choose."
78
+ },
79
+ "describe": {
80
+ "type": "string",
81
+ "maxLength": 200,
82
+ "description": "The sentence shown at consent, such as Which labels."
83
+ },
84
+ "suggest": {
85
+ "description": "The read-only tool that lists the values a person may pick, and the operations it asserts. It runs only at bind, in the probe session; its results are shown and never stored, so its operations never enter a running grant.",
86
+ "type": "object",
87
+ "properties": {
88
+ "tool": {
89
+ "type": "string",
90
+ "maxLength": 64,
91
+ "pattern": "^[a-z][a-z0-9_]{0,63}$"
92
+ },
93
+ "operations": {
94
+ "minItems": 1,
95
+ "type": "array",
96
+ "items": {
97
+ "type": "string",
98
+ "maxLength": 200,
99
+ "pattern": "^[A-Za-z][A-Za-z0-9._-]{0,199}$"
100
+ }
101
+ }
102
+ },
103
+ "required": [
104
+ "tool",
105
+ "operations"
106
+ ],
107
+ "additionalProperties": false
108
+ }
109
+ },
110
+ "required": [
111
+ "keys",
112
+ "describe"
113
+ ],
114
+ "additionalProperties": false,
115
+ "description": "What a person confirms at consent, and the sentence that asks them."
116
+ },
117
+ "private": {
118
+ "description": "True when everything this source reads is personal: shown at consent.",
119
+ "type": "boolean"
120
+ },
121
+ "cost": {
122
+ "oneOf": [
123
+ {
124
+ "type": "object",
125
+ "properties": {
126
+ "class": {
127
+ "type": "string",
128
+ "const": "free"
129
+ },
130
+ "units": {
131
+ "not": {}
132
+ },
133
+ "probe": {
134
+ "not": {}
135
+ }
136
+ },
137
+ "required": [
138
+ "class"
139
+ ],
140
+ "additionalProperties": false
141
+ },
142
+ {
143
+ "type": "object",
144
+ "properties": {
145
+ "class": {
146
+ "type": "string",
147
+ "const": "metered"
148
+ },
149
+ "units": {
150
+ "minItems": 1,
151
+ "type": "array",
152
+ "items": {
153
+ "type": "object",
154
+ "properties": {
155
+ "per": {
156
+ "type": "string",
157
+ "maxLength": 32,
158
+ "pattern": "^[a-z][a-z0-9-]{0,31}$"
159
+ },
160
+ "usd": {
161
+ "type": "number",
162
+ "minimum": 0
163
+ }
164
+ },
165
+ "required": [
166
+ "per",
167
+ "usd"
168
+ ],
169
+ "additionalProperties": false,
170
+ "description": "One price unit, in US dollars, from the plugin's own price table."
171
+ }
172
+ },
173
+ "probe": {
174
+ "type": "object",
175
+ "properties": {
176
+ "per": {
177
+ "type": "string",
178
+ "maxLength": 32,
179
+ "pattern": "^[a-z][a-z0-9-]{0,31}$"
180
+ },
181
+ "usd": {
182
+ "type": "number",
183
+ "minimum": 0
184
+ }
185
+ },
186
+ "required": [
187
+ "per",
188
+ "usd"
189
+ ],
190
+ "additionalProperties": false,
191
+ "description": "One price unit, in US dollars, from the plugin's own price table."
192
+ }
193
+ },
194
+ "required": [
195
+ "class",
196
+ "units"
197
+ ],
198
+ "additionalProperties": false
199
+ },
200
+ {
201
+ "type": "object",
202
+ "properties": {
203
+ "class": {
204
+ "type": "string",
205
+ "const": "billed"
206
+ },
207
+ "units": {
208
+ "minItems": 1,
209
+ "type": "array",
210
+ "items": {
211
+ "type": "object",
212
+ "properties": {
213
+ "per": {
214
+ "type": "string",
215
+ "maxLength": 32,
216
+ "pattern": "^[a-z][a-z0-9-]{0,31}$"
217
+ },
218
+ "usd": {
219
+ "type": "number",
220
+ "minimum": 0
221
+ }
222
+ },
223
+ "required": [
224
+ "per",
225
+ "usd"
226
+ ],
227
+ "additionalProperties": false,
228
+ "description": "One price unit, in US dollars, from the plugin's own price table."
229
+ }
230
+ },
231
+ "probe": {
232
+ "type": "object",
233
+ "properties": {
234
+ "per": {
235
+ "type": "string",
236
+ "maxLength": 32,
237
+ "pattern": "^[a-z][a-z0-9-]{0,31}$"
238
+ },
239
+ "usd": {
240
+ "type": "number",
241
+ "minimum": 0
242
+ }
243
+ },
244
+ "required": [
245
+ "per",
246
+ "usd"
247
+ ],
248
+ "additionalProperties": false,
249
+ "description": "One price unit, in US dollars, from the plugin's own price table."
250
+ }
251
+ },
252
+ "required": [
253
+ "class",
254
+ "units",
255
+ "probe"
256
+ ],
257
+ "additionalProperties": false
258
+ }
259
+ ],
260
+ "description": "What one read costs, including a probe call, which reads no content."
261
+ },
262
+ "cadence": {
263
+ "type": "object",
264
+ "properties": {
265
+ "providerMinMinutes": {
266
+ "type": "integer",
267
+ "minimum": 1,
268
+ "maximum": 10080
269
+ }
270
+ },
271
+ "additionalProperties": false,
272
+ "description": "A provider's own floor between reads. Only where the provider imposes one."
273
+ },
274
+ "maxBytes": {
275
+ "default": 65536,
276
+ "description": "The most bytes one result may take: default 65536 (64 KB), at most 1048576 (1 MB).",
277
+ "type": "integer",
278
+ "minimum": 1,
279
+ "maximum": 1048576
280
+ },
281
+ "retentionDays": {
282
+ "description": "How many days an events consumer keeps what it read.",
283
+ "type": "integer",
284
+ "minimum": 1,
285
+ "maximum": 9007199254740991
286
+ },
287
+ "urlHosts": {
288
+ "type": "array",
289
+ "items": {
290
+ "type": "string",
291
+ "maxLength": 253,
292
+ "pattern": "^(?:\\*\\.)?[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+$"
293
+ },
294
+ "description": "The hosts an event's url may point at, for display. A consumer renders a url only when its host matches."
295
+ },
296
+ "kind": {
297
+ "type": "string",
298
+ "const": "events"
299
+ },
300
+ "reads": {
301
+ "type": "string",
302
+ "maxLength": 64,
303
+ "description": "The thing it reads: a core kind, or x-<namespace>/<name>, whose namespace is the source's."
304
+ },
305
+ "details": {
306
+ "type": "array",
307
+ "items": {
308
+ "type": "object",
309
+ "properties": {
310
+ "id": {
311
+ "type": "string",
312
+ "maxLength": 64,
313
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)+$"
314
+ },
315
+ "tool": {
316
+ "type": "string",
317
+ "maxLength": 64,
318
+ "pattern": "^[a-z][a-z0-9_]{0,63}$"
319
+ },
320
+ "from": {
321
+ "minItems": 1,
322
+ "type": "array",
323
+ "items": {
324
+ "type": "string",
325
+ "enum": [
326
+ "external_id",
327
+ "kind",
328
+ "occurred_at",
329
+ "url",
330
+ "thread",
331
+ "actors",
332
+ "labels",
333
+ "hash"
334
+ ]
335
+ },
336
+ "description": "The event fields the detail's input comes from. Identifiers only: an event's title and text are never an input."
337
+ }
338
+ },
339
+ "required": [
340
+ "id",
341
+ "tool",
342
+ "from"
343
+ ],
344
+ "additionalProperties": false,
345
+ "description": "One read of an event's detail: the tool, and the event fields its input comes from."
346
+ }
347
+ },
348
+ "permission": {
349
+ "type": "object",
350
+ "properties": {
351
+ "events": {
352
+ "type": "string",
353
+ "maxLength": 80,
354
+ "pattern": "^(?:[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*|[a-z][a-z0-9]*_[a-z][a-z0-9_]*)$"
355
+ },
356
+ "tool": {
357
+ "not": {}
358
+ },
359
+ "identity": {
360
+ "description": "The identity operations probe asserts for this source (#4, #8); each is among permission.operations, and no content read asserts it.",
361
+ "minItems": 1,
362
+ "type": "array",
363
+ "items": {
364
+ "type": "string",
365
+ "maxLength": 200,
366
+ "pattern": "^[A-Za-z][A-Za-z0-9._-]{0,199}$"
367
+ }
368
+ },
369
+ "operations": {
370
+ "description": "Every operation the source's reads assert, and nothing else. Absent when `rules` states them.",
371
+ "minItems": 1,
372
+ "type": "array",
373
+ "items": {
374
+ "type": "string",
375
+ "maxLength": 200,
376
+ "pattern": "^[A-Za-z][A-Za-z0-9._-]{0,199}$"
377
+ }
378
+ },
379
+ "rules": {
380
+ "description": "The grants verbatim, for a provider whose resources are not <account>:<operation> (GitHub's github_api on GET /user).",
381
+ "minItems": 1,
382
+ "type": "array",
383
+ "items": {
384
+ "type": "object",
385
+ "properties": {
386
+ "action": {
387
+ "type": "string",
388
+ "maxLength": 80,
389
+ "pattern": "^(?:[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*|[a-z][a-z0-9]*_[a-z][a-z0-9_]*)$"
390
+ },
391
+ "resource": {
392
+ "type": "string",
393
+ "maxLength": 200,
394
+ "description": "The resource the action is asserted on, such as GET /user."
395
+ }
396
+ },
397
+ "required": [
398
+ "action",
399
+ "resource"
400
+ ],
401
+ "additionalProperties": false
402
+ }
403
+ }
404
+ },
405
+ "required": [
406
+ "events"
407
+ ],
408
+ "additionalProperties": false,
409
+ "description": "The events_list action, and the provider operations the source asserts."
410
+ },
411
+ "output": {
412
+ "not": {}
413
+ },
414
+ "maxAgeSec": {
415
+ "not": {}
416
+ },
417
+ "params": {
418
+ "not": {}
419
+ }
420
+ },
421
+ "required": [
422
+ "id",
423
+ "tool",
424
+ "cost",
425
+ "kind",
426
+ "reads",
427
+ "permission"
428
+ ],
429
+ "additionalProperties": false,
430
+ "description": "An events source: append-only, ordered, read with a cursor."
431
+ },
432
+ {
433
+ "type": "object",
434
+ "properties": {
435
+ "id": {
436
+ "type": "string",
437
+ "maxLength": 64,
438
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)+$"
439
+ },
440
+ "tool": {
441
+ "type": "string",
442
+ "maxLength": 64,
443
+ "pattern": "^[a-z][a-z0-9_]{0,63}$"
444
+ },
445
+ "input": {
446
+ "description": "The input the tool needs to reach this source. It carries no account and no secret.",
447
+ "type": "object",
448
+ "properties": {},
449
+ "additionalProperties": {}
450
+ },
451
+ "accounts": {
452
+ "type": "object",
453
+ "properties": {
454
+ "named": {
455
+ "type": "boolean",
456
+ "description": "True when the source reads more than one account, so a read names one."
457
+ }
458
+ },
459
+ "required": [
460
+ "named"
461
+ ],
462
+ "additionalProperties": false,
463
+ "description": "Which signed-in accounts a source reads."
464
+ },
465
+ "scope": {
466
+ "type": "object",
467
+ "properties": {
468
+ "keys": {
469
+ "type": "array",
470
+ "items": {
471
+ "type": "string",
472
+ "maxLength": 32,
473
+ "pattern": "^[a-z][a-z0-9_]{0,31}$"
474
+ },
475
+ "description": "The scope keys a person confirms: labels, channels, repositories. Empty when there is nothing to choose."
476
+ },
477
+ "describe": {
478
+ "type": "string",
479
+ "maxLength": 200,
480
+ "description": "The sentence shown at consent, such as Which labels."
481
+ },
482
+ "suggest": {
483
+ "description": "The read-only tool that lists the values a person may pick, and the operations it asserts. It runs only at bind, in the probe session; its results are shown and never stored, so its operations never enter a running grant.",
484
+ "type": "object",
485
+ "properties": {
486
+ "tool": {
487
+ "type": "string",
488
+ "maxLength": 64,
489
+ "pattern": "^[a-z][a-z0-9_]{0,63}$"
490
+ },
491
+ "operations": {
492
+ "minItems": 1,
493
+ "type": "array",
494
+ "items": {
495
+ "type": "string",
496
+ "maxLength": 200,
497
+ "pattern": "^[A-Za-z][A-Za-z0-9._-]{0,199}$"
498
+ }
499
+ }
500
+ },
501
+ "required": [
502
+ "tool",
503
+ "operations"
504
+ ],
505
+ "additionalProperties": false
506
+ }
507
+ },
508
+ "required": [
509
+ "keys",
510
+ "describe"
511
+ ],
512
+ "additionalProperties": false,
513
+ "description": "What a person confirms at consent, and the sentence that asks them."
514
+ },
515
+ "private": {
516
+ "description": "True when everything this source reads is personal: shown at consent.",
517
+ "type": "boolean"
518
+ },
519
+ "cost": {
520
+ "oneOf": [
521
+ {
522
+ "type": "object",
523
+ "properties": {
524
+ "class": {
525
+ "type": "string",
526
+ "const": "free"
527
+ },
528
+ "units": {
529
+ "not": {}
530
+ },
531
+ "probe": {
532
+ "not": {}
533
+ }
534
+ },
535
+ "required": [
536
+ "class"
537
+ ],
538
+ "additionalProperties": false
539
+ },
540
+ {
541
+ "type": "object",
542
+ "properties": {
543
+ "class": {
544
+ "type": "string",
545
+ "const": "metered"
546
+ },
547
+ "units": {
548
+ "minItems": 1,
549
+ "type": "array",
550
+ "items": {
551
+ "type": "object",
552
+ "properties": {
553
+ "per": {
554
+ "type": "string",
555
+ "maxLength": 32,
556
+ "pattern": "^[a-z][a-z0-9-]{0,31}$"
557
+ },
558
+ "usd": {
559
+ "type": "number",
560
+ "minimum": 0
561
+ }
562
+ },
563
+ "required": [
564
+ "per",
565
+ "usd"
566
+ ],
567
+ "additionalProperties": false,
568
+ "description": "One price unit, in US dollars, from the plugin's own price table."
569
+ }
570
+ },
571
+ "probe": {
572
+ "type": "object",
573
+ "properties": {
574
+ "per": {
575
+ "type": "string",
576
+ "maxLength": 32,
577
+ "pattern": "^[a-z][a-z0-9-]{0,31}$"
578
+ },
579
+ "usd": {
580
+ "type": "number",
581
+ "minimum": 0
582
+ }
583
+ },
584
+ "required": [
585
+ "per",
586
+ "usd"
587
+ ],
588
+ "additionalProperties": false,
589
+ "description": "One price unit, in US dollars, from the plugin's own price table."
590
+ }
591
+ },
592
+ "required": [
593
+ "class",
594
+ "units"
595
+ ],
596
+ "additionalProperties": false
597
+ },
598
+ {
599
+ "type": "object",
600
+ "properties": {
601
+ "class": {
602
+ "type": "string",
603
+ "const": "billed"
604
+ },
605
+ "units": {
606
+ "minItems": 1,
607
+ "type": "array",
608
+ "items": {
609
+ "type": "object",
610
+ "properties": {
611
+ "per": {
612
+ "type": "string",
613
+ "maxLength": 32,
614
+ "pattern": "^[a-z][a-z0-9-]{0,31}$"
615
+ },
616
+ "usd": {
617
+ "type": "number",
618
+ "minimum": 0
619
+ }
620
+ },
621
+ "required": [
622
+ "per",
623
+ "usd"
624
+ ],
625
+ "additionalProperties": false,
626
+ "description": "One price unit, in US dollars, from the plugin's own price table."
627
+ }
628
+ },
629
+ "probe": {
630
+ "type": "object",
631
+ "properties": {
632
+ "per": {
633
+ "type": "string",
634
+ "maxLength": 32,
635
+ "pattern": "^[a-z][a-z0-9-]{0,31}$"
636
+ },
637
+ "usd": {
638
+ "type": "number",
639
+ "minimum": 0
640
+ }
641
+ },
642
+ "required": [
643
+ "per",
644
+ "usd"
645
+ ],
646
+ "additionalProperties": false,
647
+ "description": "One price unit, in US dollars, from the plugin's own price table."
648
+ }
649
+ },
650
+ "required": [
651
+ "class",
652
+ "units",
653
+ "probe"
654
+ ],
655
+ "additionalProperties": false
656
+ }
657
+ ],
658
+ "description": "What one read costs, including a probe call, which reads no content."
659
+ },
660
+ "cadence": {
661
+ "type": "object",
662
+ "properties": {
663
+ "providerMinMinutes": {
664
+ "type": "integer",
665
+ "minimum": 1,
666
+ "maximum": 10080
667
+ }
668
+ },
669
+ "additionalProperties": false,
670
+ "description": "A provider's own floor between reads. Only where the provider imposes one."
671
+ },
672
+ "maxBytes": {
673
+ "default": 65536,
674
+ "description": "The most bytes one result may take: default 65536 (64 KB), at most 1048576 (1 MB).",
675
+ "type": "integer",
676
+ "minimum": 1,
677
+ "maximum": 1048576
678
+ },
679
+ "retentionDays": {
680
+ "description": "How many days an events consumer keeps what it read.",
681
+ "type": "integer",
682
+ "minimum": 1,
683
+ "maximum": 9007199254740991
684
+ },
685
+ "urlHosts": {
686
+ "type": "array",
687
+ "items": {
688
+ "type": "string",
689
+ "maxLength": 253,
690
+ "pattern": "^(?:\\*\\.)?[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+$"
691
+ },
692
+ "description": "The hosts an event's url may point at, for display. A consumer renders a url only when its host matches."
693
+ },
694
+ "kind": {
695
+ "type": "string",
696
+ "const": "snapshot"
697
+ },
698
+ "output": {
699
+ "type": "string",
700
+ "maxLength": 64,
701
+ "description": "A registry name, or x-<namespace>/<name>; an x- output carries its schema inline."
702
+ },
703
+ "outputSchema": {
704
+ "description": "An x- output's schema, inline: JSON Schema draft 2020-12. Required for x-, absent for a registry name.",
705
+ "anyOf": [
706
+ {
707
+ "type": "boolean"
708
+ },
709
+ {
710
+ "type": "object",
711
+ "properties": {},
712
+ "additionalProperties": {}
713
+ }
714
+ ]
715
+ },
716
+ "params": {
717
+ "description": "The parameters a consumer may pass, resolved by the library at read time.",
718
+ "type": "object",
719
+ "properties": {},
720
+ "additionalProperties": {}
721
+ },
722
+ "permission": {
723
+ "type": "object",
724
+ "properties": {
725
+ "tool": {
726
+ "type": "string",
727
+ "maxLength": 80,
728
+ "pattern": "^(?:[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*|[a-z][a-z0-9]*_[a-z][a-z0-9_]*)$"
729
+ },
730
+ "events": {
731
+ "not": {}
732
+ },
733
+ "identity": {
734
+ "description": "The identity operations probe asserts for this source (#4, #8); each is among permission.operations, and no content read asserts it.",
735
+ "minItems": 1,
736
+ "type": "array",
737
+ "items": {
738
+ "type": "string",
739
+ "maxLength": 200,
740
+ "pattern": "^[A-Za-z][A-Za-z0-9._-]{0,199}$"
741
+ }
742
+ },
743
+ "operations": {
744
+ "description": "Every operation the source's reads assert, and nothing else. Absent when `rules` states them.",
745
+ "minItems": 1,
746
+ "type": "array",
747
+ "items": {
748
+ "type": "string",
749
+ "maxLength": 200,
750
+ "pattern": "^[A-Za-z][A-Za-z0-9._-]{0,199}$"
751
+ }
752
+ },
753
+ "rules": {
754
+ "description": "The grants verbatim, for a provider whose resources are not <account>:<operation> (GitHub's github_api on GET /user).",
755
+ "minItems": 1,
756
+ "type": "array",
757
+ "items": {
758
+ "type": "object",
759
+ "properties": {
760
+ "action": {
761
+ "type": "string",
762
+ "maxLength": 80,
763
+ "pattern": "^(?:[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*|[a-z][a-z0-9]*_[a-z][a-z0-9_]*)$"
764
+ },
765
+ "resource": {
766
+ "type": "string",
767
+ "maxLength": 200,
768
+ "description": "The resource the action is asserted on, such as GET /user."
769
+ }
770
+ },
771
+ "required": [
772
+ "action",
773
+ "resource"
774
+ ],
775
+ "additionalProperties": false
776
+ }
777
+ }
778
+ },
779
+ "required": [
780
+ "tool"
781
+ ],
782
+ "additionalProperties": false,
783
+ "description": "The read tool's action, and the provider operations the source asserts."
784
+ },
785
+ "maxAgeSec": {
786
+ "description": "How long a result may be reused before it is read again.",
787
+ "type": "integer",
788
+ "minimum": 1,
789
+ "maximum": 9007199254740991
790
+ },
791
+ "reads": {
792
+ "not": {}
793
+ },
794
+ "details": {
795
+ "not": {}
796
+ }
797
+ },
798
+ "required": [
799
+ "id",
800
+ "tool",
801
+ "cost",
802
+ "kind",
803
+ "output",
804
+ "permission"
805
+ ],
806
+ "additionalProperties": false,
807
+ "description": "A snapshot source: the latest state, read on demand."
808
+ }
809
+ ]
810
+ },
811
+ "description": "The plugin's sources. A source id is unique across the declaration."
812
+ }
813
+ },
814
+ "required": [
815
+ "contractVersion",
816
+ "items"
817
+ ],
818
+ "additionalProperties": false
819
+ }