@joe-broadhead/opencode-mem 0.12.1 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/package.json +1 -1
  3. package/src/collector.js +11 -1
  4. package/src/plugins/source-contract/index.js +2 -2
  5. package/src/plugins/source-contract/policy.js +3 -7
  6. package/src/plugins/source-contract/vendor/PROVENANCE.json +8 -8
  7. package/src/plugins/source-contract/vendor/RELEASE-SHA256SUMS +3 -3
  8. package/src/plugins/source-contract/vendor/RELEASE.json +9 -9
  9. package/src/plugins/source-contract/vendor/SHA256SUMS +28 -28
  10. package/src/plugins/source-contract/vendor/broker-client.js +14 -14
  11. package/src/plugins/source-contract/vendor/chunks/{chunk-Q3RQA5J2.js → chunk-77MJETEE.js} +9 -9
  12. package/src/plugins/source-contract/vendor/chunks/{chunk-6HDIB2SA.js → chunk-BOUWB5UP.js} +2 -2
  13. package/src/plugins/source-contract/vendor/chunks/{chunk-KYWBTAF4.js → chunk-EHIOPXPL.js} +9 -8
  14. package/src/plugins/source-contract/vendor/chunks/{chunk-RYNKNCPP.js → chunk-F4K2Y64D.js} +1 -1
  15. package/src/plugins/source-contract/vendor/chunks/{chunk-RRUAIQ4I.js → chunk-HVBOAYBO.js} +43 -9
  16. package/src/plugins/source-contract/vendor/chunks/{chunk-ELPJD3ND.js → chunk-IL565TRX.js} +1 -1
  17. package/src/plugins/source-contract/vendor/chunks/{chunk-W5SHR7DQ.js → chunk-JUWIMDGF.js} +2 -2
  18. package/src/{vendor/source-contract/chunks/chunk-I2RXJJJM.js → plugins/source-contract/vendor/chunks/chunk-NUEROZNU.js} +1 -1
  19. package/src/plugins/source-contract/vendor/chunks/{chunk-3M5PAKSS.js → chunk-OZMX7VR7.js} +22 -2
  20. package/src/plugins/source-contract/vendor/chunks/{chunk-HLVAKAYG.js → chunk-T4QM7B3S.js} +1 -1
  21. package/src/plugins/source-contract/vendor/chunks/{chunk-KWEWSZ4V.js → chunk-X6XP7YK2.js} +24 -4
  22. package/src/plugins/source-contract/vendor/chunks/{chunk-4ERCA4TK.js → chunk-XVA6H6OO.js} +2 -2
  23. package/src/plugins/source-contract/vendor/chunks/{chunk-ZUKF7P6U.js → chunk-YH323FAZ.js} +51 -10
  24. package/src/plugins/source-contract/vendor/cursor.js +3 -3
  25. package/src/plugins/source-contract/vendor/descriptor.js +11 -11
  26. package/src/plugins/source-contract/vendor/events.js +9 -5
  27. package/src/plugins/source-contract/vendor/index.js +3 -3
  28. package/src/plugins/source-contract/vendor/params.js +3 -3
  29. package/src/plugins/source-contract/vendor/permission.js +9 -3
  30. package/src/plugins/source-contract/vendor/pick.js +5 -5
  31. package/src/plugins/source-contract/vendor/read.js +14 -14
  32. package/src/plugins/source-contract/vendor/registry.js +4 -4
  33. package/src/plugins/source-contract/vendor/schema.js +8 -8
  34. package/src/plugins/source-contract/vendor/schemas/sources.json +158 -4
  35. package/src/plugins/source-contract/vendor/schemas.js +9 -9
  36. package/src/plugins/source-contract/vendor/tools-rpc.js +4 -4
  37. package/src/vendor/source-contract/README.md +6 -5
  38. package/src/vendor/source-contract/VENDOR.json +46 -46
  39. package/src/vendor/source-contract/chunks/{chunk-6HDIB2SA.js → chunk-BOUWB5UP.js} +2 -2
  40. package/src/vendor/source-contract/chunks/{chunk-W5SHR7DQ.js → chunk-JUWIMDGF.js} +2 -2
  41. package/src/{plugins/source-contract/vendor/chunks/chunk-I2RXJJJM.js → vendor/source-contract/chunks/chunk-NUEROZNU.js} +1 -1
  42. package/src/vendor/source-contract/chunks/{chunk-3M5PAKSS.js → chunk-OZMX7VR7.js} +22 -2
  43. package/src/vendor/source-contract/chunks/{chunk-HLVAKAYG.js → chunk-T4QM7B3S.js} +1 -1
  44. package/src/vendor/source-contract/chunks/{chunk-KWEWSZ4V.js → chunk-X6XP7YK2.js} +24 -4
  45. package/src/vendor/source-contract/chunks/{chunk-ZUKF7P6U.js → chunk-YH323FAZ.js} +51 -10
  46. package/src/vendor/source-contract/cursor.js +3 -3
  47. package/src/vendor/source-contract/events.js +9 -5
  48. package/src/vendor/source-contract/registry.js +4 -4
  49. package/src/vendor/source-contract/tools-rpc.js +4 -4
@@ -56,6 +56,12 @@
56
56
  "named": {
57
57
  "type": "boolean",
58
58
  "description": "True when the source reads more than one account, so a read names one."
59
+ },
60
+ "server": {
61
+ "description": "For a plugin with one MCP server per account (#30, item 9): the server a named account's MCP tools live on, with {account} for the account, such as plaud-{account}. A bare operation is then <server>_<operation> for an account other than default; the default account keeps the namespace.",
62
+ "type": "string",
63
+ "maxLength": 64,
64
+ "pattern": "^[a-z][a-z0-9_-]*\\{account\\}[a-z0-9_-]*$"
59
65
  }
60
66
  },
61
67
  "required": [
@@ -160,6 +166,17 @@
160
166
  "usd": {
161
167
  "type": "number",
162
168
  "minimum": 0
169
+ },
170
+ "conditions": {
171
+ "description": "The short sentence shown at consent when this price applies, such as X app owners only.",
172
+ "type": "string",
173
+ "minLength": 1,
174
+ "maxLength": 200
175
+ },
176
+ "min": {
177
+ "description": "The lowest rate that may apply, in US dollars: at most usd.",
178
+ "type": "number",
179
+ "minimum": 0
163
180
  }
164
181
  },
165
182
  "required": [
@@ -181,6 +198,17 @@
181
198
  "usd": {
182
199
  "type": "number",
183
200
  "minimum": 0
201
+ },
202
+ "conditions": {
203
+ "description": "The short sentence shown at consent when this price applies, such as X app owners only.",
204
+ "type": "string",
205
+ "minLength": 1,
206
+ "maxLength": 200
207
+ },
208
+ "min": {
209
+ "description": "The lowest rate that may apply, in US dollars: at most usd.",
210
+ "type": "number",
211
+ "minimum": 0
184
212
  }
185
213
  },
186
214
  "required": [
@@ -218,6 +246,17 @@
218
246
  "usd": {
219
247
  "type": "number",
220
248
  "minimum": 0
249
+ },
250
+ "conditions": {
251
+ "description": "The short sentence shown at consent when this price applies, such as X app owners only.",
252
+ "type": "string",
253
+ "minLength": 1,
254
+ "maxLength": 200
255
+ },
256
+ "min": {
257
+ "description": "The lowest rate that may apply, in US dollars: at most usd.",
258
+ "type": "number",
259
+ "minimum": 0
221
260
  }
222
261
  },
223
262
  "required": [
@@ -239,6 +278,17 @@
239
278
  "usd": {
240
279
  "type": "number",
241
280
  "minimum": 0
281
+ },
282
+ "conditions": {
283
+ "description": "The short sentence shown at consent when this price applies, such as X app owners only.",
284
+ "type": "string",
285
+ "minLength": 1,
286
+ "maxLength": 200
287
+ },
288
+ "min": {
289
+ "description": "The lowest rate that may apply, in US dollars: at most usd.",
290
+ "type": "number",
291
+ "minimum": 0
242
292
  }
243
293
  },
244
294
  "required": [
@@ -357,8 +407,7 @@
357
407
  "not": {}
358
408
  },
359
409
  "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,
410
+ "description": "The identity operations probe asserts for this source (#4, #8); each is among permission.operations, and no content read asserts it. Empty when the probe asserts only sources.probe.action; absent when the source does not declare it, so a consumer uses its fallback.",
362
411
  "type": "array",
363
412
  "items": {
364
413
  "type": "string",
@@ -366,6 +415,10 @@
366
415
  "pattern": "^[A-Za-z][A-Za-z0-9._-]{0,199}$"
367
416
  }
368
417
  },
418
+ "readsIdentity": {
419
+ "description": "True when the source's content reads assert an identity operation (#30, item 4); every identity operation is still declared.",
420
+ "type": "boolean"
421
+ },
369
422
  "operations": {
370
423
  "description": "Every operation the source's reads assert, and nothing else. Absent when `rules` states them.",
371
424
  "minItems": 1,
@@ -400,6 +453,30 @@
400
453
  ],
401
454
  "additionalProperties": false
402
455
  }
456
+ },
457
+ "identityRules": {
458
+ "description": "For a rules source: the grants probe asserts for this source, verbatim, each among permission.rules (#30, item 10). Empty when the probe asserts only sources.probe.action; absent when undeclared. A rules source's equivalent of identity.",
459
+ "type": "array",
460
+ "items": {
461
+ "type": "object",
462
+ "properties": {
463
+ "action": {
464
+ "type": "string",
465
+ "maxLength": 80,
466
+ "pattern": "^(?:[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*|[a-z][a-z0-9]*_[a-z][a-z0-9_]*)$"
467
+ },
468
+ "resource": {
469
+ "type": "string",
470
+ "maxLength": 200,
471
+ "description": "The resource the action is asserted on, such as GET /user."
472
+ }
473
+ },
474
+ "required": [
475
+ "action",
476
+ "resource"
477
+ ],
478
+ "additionalProperties": false
479
+ }
403
480
  }
404
481
  },
405
482
  "required": [
@@ -454,6 +531,12 @@
454
531
  "named": {
455
532
  "type": "boolean",
456
533
  "description": "True when the source reads more than one account, so a read names one."
534
+ },
535
+ "server": {
536
+ "description": "For a plugin with one MCP server per account (#30, item 9): the server a named account's MCP tools live on, with {account} for the account, such as plaud-{account}. A bare operation is then <server>_<operation> for an account other than default; the default account keeps the namespace.",
537
+ "type": "string",
538
+ "maxLength": 64,
539
+ "pattern": "^[a-z][a-z0-9_-]*\\{account\\}[a-z0-9_-]*$"
457
540
  }
458
541
  },
459
542
  "required": [
@@ -558,6 +641,17 @@
558
641
  "usd": {
559
642
  "type": "number",
560
643
  "minimum": 0
644
+ },
645
+ "conditions": {
646
+ "description": "The short sentence shown at consent when this price applies, such as X app owners only.",
647
+ "type": "string",
648
+ "minLength": 1,
649
+ "maxLength": 200
650
+ },
651
+ "min": {
652
+ "description": "The lowest rate that may apply, in US dollars: at most usd.",
653
+ "type": "number",
654
+ "minimum": 0
561
655
  }
562
656
  },
563
657
  "required": [
@@ -579,6 +673,17 @@
579
673
  "usd": {
580
674
  "type": "number",
581
675
  "minimum": 0
676
+ },
677
+ "conditions": {
678
+ "description": "The short sentence shown at consent when this price applies, such as X app owners only.",
679
+ "type": "string",
680
+ "minLength": 1,
681
+ "maxLength": 200
682
+ },
683
+ "min": {
684
+ "description": "The lowest rate that may apply, in US dollars: at most usd.",
685
+ "type": "number",
686
+ "minimum": 0
582
687
  }
583
688
  },
584
689
  "required": [
@@ -616,6 +721,17 @@
616
721
  "usd": {
617
722
  "type": "number",
618
723
  "minimum": 0
724
+ },
725
+ "conditions": {
726
+ "description": "The short sentence shown at consent when this price applies, such as X app owners only.",
727
+ "type": "string",
728
+ "minLength": 1,
729
+ "maxLength": 200
730
+ },
731
+ "min": {
732
+ "description": "The lowest rate that may apply, in US dollars: at most usd.",
733
+ "type": "number",
734
+ "minimum": 0
619
735
  }
620
736
  },
621
737
  "required": [
@@ -637,6 +753,17 @@
637
753
  "usd": {
638
754
  "type": "number",
639
755
  "minimum": 0
756
+ },
757
+ "conditions": {
758
+ "description": "The short sentence shown at consent when this price applies, such as X app owners only.",
759
+ "type": "string",
760
+ "minLength": 1,
761
+ "maxLength": 200
762
+ },
763
+ "min": {
764
+ "description": "The lowest rate that may apply, in US dollars: at most usd.",
765
+ "type": "number",
766
+ "minimum": 0
640
767
  }
641
768
  },
642
769
  "required": [
@@ -731,8 +858,7 @@
731
858
  "not": {}
732
859
  },
733
860
  "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,
861
+ "description": "The identity operations probe asserts for this source (#4, #8); each is among permission.operations, and no content read asserts it. Empty when the probe asserts only sources.probe.action; absent when the source does not declare it, so a consumer uses its fallback.",
736
862
  "type": "array",
737
863
  "items": {
738
864
  "type": "string",
@@ -740,6 +866,10 @@
740
866
  "pattern": "^[A-Za-z][A-Za-z0-9._-]{0,199}$"
741
867
  }
742
868
  },
869
+ "readsIdentity": {
870
+ "description": "True when the source's content reads assert an identity operation (#30, item 4); every identity operation is still declared.",
871
+ "type": "boolean"
872
+ },
743
873
  "operations": {
744
874
  "description": "Every operation the source's reads assert, and nothing else. Absent when `rules` states them.",
745
875
  "minItems": 1,
@@ -774,6 +904,30 @@
774
904
  ],
775
905
  "additionalProperties": false
776
906
  }
907
+ },
908
+ "identityRules": {
909
+ "description": "For a rules source: the grants probe asserts for this source, verbatim, each among permission.rules (#30, item 10). Empty when the probe asserts only sources.probe.action; absent when undeclared. A rules source's equivalent of identity.",
910
+ "type": "array",
911
+ "items": {
912
+ "type": "object",
913
+ "properties": {
914
+ "action": {
915
+ "type": "string",
916
+ "maxLength": 80,
917
+ "pattern": "^(?:[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*|[a-z][a-z0-9]*_[a-z][a-z0-9_]*)$"
918
+ },
919
+ "resource": {
920
+ "type": "string",
921
+ "maxLength": 200,
922
+ "description": "The resource the action is asserted on, such as GET /user."
923
+ }
924
+ },
925
+ "required": [
926
+ "action",
927
+ "resource"
928
+ ],
929
+ "additionalProperties": false
930
+ }
777
931
  }
778
932
  },
779
933
  "required": [
@@ -1,16 +1,16 @@
1
- // @we-the-rebel-alliance/source-contract 0.1.0. Built by scripts/build.mjs; do not edit.
1
+ // @we-the-rebel-alliance/source-contract 0.2.0. Built by scripts/build.mjs; do not edit.
2
2
  import {
3
3
  SOURCES_SCHEMA
4
- } from "./chunks/chunk-RRUAIQ4I.js";
5
- import "./chunks/chunk-KWEWSZ4V.js";
6
- import "./chunks/chunk-ZUKF7P6U.js";
7
- import "./chunks/chunk-I2RXJJJM.js";
8
- import "./chunks/chunk-3M5PAKSS.js";
4
+ } from "./chunks/chunk-HVBOAYBO.js";
5
+ import "./chunks/chunk-X6XP7YK2.js";
6
+ import "./chunks/chunk-YH323FAZ.js";
7
+ import "./chunks/chunk-NUEROZNU.js";
8
+ import "./chunks/chunk-OZMX7VR7.js";
9
9
  import {
10
10
  OUTPUTS
11
- } from "./chunks/chunk-6HDIB2SA.js";
12
- import "./chunks/chunk-W5SHR7DQ.js";
13
- import "./chunks/chunk-HLVAKAYG.js";
11
+ } from "./chunks/chunk-BOUWB5UP.js";
12
+ import "./chunks/chunk-JUWIMDGF.js";
13
+ import "./chunks/chunk-T4QM7B3S.js";
14
14
 
15
15
  // src/schemas.ts
16
16
  var SCHEMAS = [SOURCES_SCHEMA, ...Object.values(OUTPUTS)];
@@ -1,4 +1,4 @@
1
- // @we-the-rebel-alliance/source-contract 0.1.0. Built by scripts/build.mjs; do not edit.
1
+ // @we-the-rebel-alliance/source-contract 0.2.0. Built by scripts/build.mjs; do not edit.
2
2
  import {
3
3
  CLASSES,
4
4
  LOCATION_HEADER,
@@ -16,11 +16,11 @@ import {
16
16
  toolsRpcId,
17
17
  toolsRpcIdProblems,
18
18
  upstreamText
19
- } from "./chunks/chunk-KWEWSZ4V.js";
19
+ } from "./chunks/chunk-X6XP7YK2.js";
20
20
  import {
21
21
  evaluate
22
- } from "./chunks/chunk-3M5PAKSS.js";
23
- import "./chunks/chunk-HLVAKAYG.js";
22
+ } from "./chunks/chunk-OZMX7VR7.js";
23
+ import "./chunks/chunk-T4QM7B3S.js";
24
24
  export {
25
25
  CLASSES,
26
26
  LOCATION_HEADER,
@@ -1,10 +1,11 @@
1
1
  # Vendored `@we-the-rebel-alliance/source-contract`
2
2
 
3
- **The locked v0.1.0 release.** This is the package's `dist/` at
4
- `381e6c91` — `main` after PR #21, #24 and #25 merged (schema: rpc, probe and identity, one
5
- kind rule, the events page, and verbatim grants), `package.json` version
6
- `0.1.0`. The `v0.1.0` tag is not created yet; whichever commit it names must be
7
- this one, and `VENDOR.json` names the commit and the SHA-256 of every file here.
3
+ **The locked v0.2.0 release.** This is the package's `dist/` at
4
+ `88bdc1e3` — `v0.1.0` plus #29–#41 (the keys a page and a declaration may now
5
+ carry, the probe's scheme-qualified owner, and the checks a rules source and the
6
+ kit now make), `package.json` version `0.2.0`. The `v0.2.0` tag is annotated
7
+ (`6c2eaac8`), and `VENDOR.json` names the commit and the SHA-256 of every file
8
+ here.
8
9
 
9
10
  - **Runtime:** `tools-rpc.js`, `events.js`, `cursor.js` and `registry.js` are what
10
11
  Memory's sources carry the protocol with, so the copy ships inside the plugin (the
@@ -1,59 +1,67 @@
1
1
  {
2
- "commit": "8ace21db949557740c6dd8fd837c6efc50c367b7",
2
+ "commit": "88bdc1e32af83098e06e6fb234ae267d91a4320e",
3
+ "package": "@we-the-rebel-alliance/source-contract",
4
+ "repository": "https://github.com/we-the-rebel-alliance/source-contract",
5
+ "tag": "v0.2.0",
6
+ "tagObject": "6c2eaac8d3cc83886b4916e96f79fe1fd7d6199a",
7
+ "release": "https://github.com/we-the-rebel-alliance/source-contract/releases/tag/v0.2.0",
8
+ "vendoredAt": "2026-11-17",
9
+ "version": "0.2.0",
10
+ "why": "v0.2.0's tagged release (tag v0.2.0 on 88bdc1e), copied from the release tarball's dist/ after verifying it against the release's SHA256SUMS. tools-rpc, events, cursor and registry are what the sources' protocol uses at runtime; the kit and the schema are read by Memory's tests.",
3
11
  "files": {
4
12
  "THIRD-PARTY-NOTICES.md": "1a00d3f937d6c65cd6987bbd0f0da1591d6f423bd7751aedfdc8cdd152bfa04e",
5
13
  "broker-client.d.ts": "cf65170b6e960ae4b3501f91913fb4ddbf95d600239ef6bdeac12f872c8b9801",
6
- "broker-client.js": "0b79307d2d1f33db24d3dd53184a3166627b51dffbdbb81f7cb4cf7a5ecafadd",
7
- "chunks/chunk-3M5PAKSS.js": "d5a610aab777cff819b2d4fb4ebc9b4903f14345a1ebe5f52842f41119290f13",
8
- "chunks/chunk-4ERCA4TK.js": "b91fefade14e3988d5817431a0a72476f5f03c8ce40e5c0448034e0572f8975b",
9
- "chunks/chunk-6HDIB2SA.js": "a4f9d76b5e98c2994cdd9e2dc9d6ad4f796977fa7a7720519f498cb8996ed047",
10
- "chunks/chunk-ELPJD3ND.js": "d8e1a5c27078e5ce1cfe2ef7e3f6381fffe242e625fa6370251b6fbfc03105ff",
11
- "chunks/chunk-HLVAKAYG.js": "d0c7a4785744974cc4cf01af0f21495fc13b5ecea729aa8d162f800f16a56d6f",
12
- "chunks/chunk-I2RXJJJM.js": "6f9f2b56ea30e3aa7629f823cc19b9438b5178f7448e2c292d2b07d28b0bc8e8",
13
- "chunks/chunk-KWEWSZ4V.js": "9789db2ecce07e4ef24e46afe7f0b6669b45e7fe544c9aa302048dcfb20f6c34",
14
- "chunks/chunk-KYWBTAF4.js": "b2efb36e7e70f930f23d2375f79a825a14ba682b86986ad038588747797743c7",
15
- "chunks/chunk-Q3RQA5J2.js": "a4887f98e83f3ecea7ddfd1da9a5518f4c44ac0032f91aa1bdaf057a5bdfa630",
16
- "chunks/chunk-RRUAIQ4I.js": "1e431825a38c3b8ec14d94b312f9b255b019c151277fc5ae304deafbf43a0729",
17
- "chunks/chunk-RYNKNCPP.js": "c384c7af7ae1fc1d58999221adc1a4830001fb467b86cdb7678016eea174daaa",
18
- "chunks/chunk-W5SHR7DQ.js": "2b17357118874b1052601e8062dc2aa24c182d5a55c2642400cba7572577d151",
19
- "chunks/chunk-ZUKF7P6U.js": "6971bb13eb9a9ea9a3708d7e99b76292d4f82170c58cdafbd2443e1d47a34153",
14
+ "broker-client.js": "32b2940e7c9bbe6b9cbdd777f5eb0dfd8ae6177ec3c76360992a39d0161460ff",
15
+ "chunks/chunk-77MJETEE.js": "92f2543c72ad90e59357ffd904c6ab92eba6e062b7acb7dbb54c3ed08bb92620",
16
+ "chunks/chunk-BOUWB5UP.js": "c1576a886f7d67c8bb5afeb40f9282893e276012861a21f5952fc6a2b17051a4",
17
+ "chunks/chunk-EHIOPXPL.js": "cf4c37cdf92c51a182e5c91f540fcd41dc798a8e90c6c4a9911a0dac4ac54a6c",
18
+ "chunks/chunk-F4K2Y64D.js": "3f460580a07cf2011b3971d00af8306598cd73b59d43844b7610b38917c93bb5",
19
+ "chunks/chunk-HVBOAYBO.js": "8d4d5b011223794170623f008e3d62a1e397af5bf74ee5ced268399d776177da",
20
+ "chunks/chunk-IL565TRX.js": "ce20e775c75c7f13ff4c0608510819a57e134b885f33934933fd4a29b79df1e0",
21
+ "chunks/chunk-JUWIMDGF.js": "58a2f8598a2120c567ae89f9c2302083164d5271d5de2dcbf9949fb53eecc471",
22
+ "chunks/chunk-NUEROZNU.js": "a9b21faf6e418d1f484749908123fab5db2843f4eac68978edd01f28e651330e",
23
+ "chunks/chunk-OZMX7VR7.js": "02119d5b15c6dc03306a1f5fcfd0ede841a252a94137a47ad18c438d7fe46782",
24
+ "chunks/chunk-T4QM7B3S.js": "847c456d855db47ca014344b0a7d38af2050675d3bd3e22cdfa02254985417d2",
25
+ "chunks/chunk-X6XP7YK2.js": "1edd6b1242779f4d604ed9010dfc35a05fd112eab1186b218e06c2d45096ede7",
26
+ "chunks/chunk-XVA6H6OO.js": "a73cbef67fd6b6d9b40e77d88038ca74e1398990614732d0b3b714a76fc94071",
27
+ "chunks/chunk-YH323FAZ.js": "7fc90ad68ef25be1633cc86a0f59f08cab04f27fed562eac43ac5532772acc5d",
20
28
  "conformance.d.ts": "e7bff576b2085cde07b9fc82244b1b41475175f28c6fd5d26eac383306ecb01e",
21
- "conformance.js": "d939fa44dbe5536e0e6bfaf1560b9b1abd2380cb0849fa9361a1b224da986ca3",
29
+ "conformance.js": "f64e742976a4c3a9442305eb735532716c86bb049de0a7ef90dcf53518c5c88d",
22
30
  "cursor.d.ts": "b6bd52b4f5267fba84fc6ac4c46f06aeddc8f77d216980929aaed8577f8caa32",
23
- "cursor.js": "28482ff668ec5680fe7c3e38ae7ee87c36da99ee447dbb851d055cdc49b0bea1",
24
- "descriptor.d.ts": "3ff8eec5623bf716fb290e7c3ab1f5e77b6026706126fa58e7ac775e1c946c01",
25
- "descriptor.js": "684cf95c0ddfb7d1b4e13c10fe5307a96971771e8e2ca71ab9a992d5deb6ebd2",
31
+ "cursor.js": "fd1cfd69b0d5765ccdcd0b451d51f7a422c5c87f89465f73da24e938339665e1",
32
+ "descriptor.d.ts": "da9eeaf84362a3954e53ad695d86ef37c0721f6ef61667054a81b5a5c968345d",
33
+ "descriptor.js": "1c182a6594c02af158b2104c967e76eb09acb3342157326ac71204ffa6fe2e77",
26
34
  "events.d.ts": "cee2042a1a8216ceabd1ea22a997f6fb1754516ce4d3fa241ab135904e5d33db",
27
- "events.js": "ce67038a5d442dd57d554a59eda98adcf726e3d7f5210c544c4e4f78200dd852",
35
+ "events.js": "40829989df80afa24b5c4313b66dc9dfd22dcd6296ae23da3b7d747329d4f65a",
28
36
  "index.d.ts": "04416e21fe8ff873f320ddc2e55b4c061760fc5c3a908d9636119135dc4272d2",
29
- "index.js": "52208818a550d9317dc263906f9a001bf0b4b56fb3d19319c43fe8fe68a7cc28",
37
+ "index.js": "7b690aa81cb7967ace45c9fb6fe319540387b06ad7366e69170955abb24f1ecc",
30
38
  "internal/checked.d.ts": "b139039477b76f14aa42683729f059607218a059180e638620c98c70ac4a8d09",
31
39
  "internal/conformance/details.d.ts": "abc4d34f01b11ac668510030a10646d306919f176de72d245454a8fbe1c8061c",
32
- "internal/conformance/kit.d.ts": "bc18e66225a3a9ec3ac3cc86e109bc82047434898c16e13a78e0db0c99e0fd8d",
40
+ "internal/conformance/kit.d.ts": "69d4c478ee0cd94046d38c4ab0d3e39e7bb762c884f00f0d4967dfc3528732a2",
33
41
  "internal/conformance/page.d.ts": "839e4b9768d60d5d0b89da9f40a1b33a91c5497059a3167f1123493962604773",
34
- "internal/conformance/permission.d.ts": "4056582ed572e8d6e34902244a90fd9c5596c3b9c0dd519f7e8f215f6a58fe2f",
42
+ "internal/conformance/permission.d.ts": "e7b64e4de90c2a44982c73451bd5a04779433b2a9c45afc9c7910a2fa609d34c",
35
43
  "internal/conformance/probe.d.ts": "76fca0d07bb8de25931c0520a4a928b0957e852679d410f044a1fe1e8e305c6a",
36
44
  "internal/conformance/rules.d.ts": "b5566a7b8c68d67ad017114bb49b18d77b1720f6352aa2f5d2517e55a95802ca",
37
45
  "internal/conformance/suggest.d.ts": "fc75a1f0a495afe4d2289aa597fcb3d862b9d9326060f897b085a4772744674a",
38
46
  "internal/events-conformance.d.ts": "4ba72ddf14447b064f5e9e775b57bf182c8d504fd9076a1b8cd55a0a1d329c95",
39
- "internal/events.d.ts": "cdc142750d5a355794f7f2b33cff2a94a104c5d7546333c7d065639e9305a410",
47
+ "internal/events.d.ts": "d6e7539333d6253550e26b87243bbeeefa8bdb4aec23bb173ab782bf279018fe",
40
48
  "internal/failure.d.ts": "8a97c06868c3004afce0c17ad3f34a456be7e263e4f6437c2ec5f463f988275b",
41
- "internal/schema/types.d.ts": "75bf6d6ff5d708e386ebb9e505fdc6cd834f68f54353fc077e7685ea5a2bc8e3",
49
+ "internal/schema/types.d.ts": "e03754e83dd8f79f0fa23e2bf3d77622f1e3060474c8a0f11416af2e71176e1b",
42
50
  "internal/secrets.d.ts": "8e294e3b5c0c84eedd90bc60af8476e2bbcfc5f9f775963f07a9ec180a5e3b13",
43
51
  "params.d.ts": "454d5aa201c4f80be08502de442e835fa2619a923440f7b25969def6436676d3",
44
- "params.js": "e5168b149699c793eccf1ad4c0f8a07df777aec675f093754ec3194d62c44ca7",
45
- "permission.d.ts": "6c14da085dff17b9a4448eb298919578e2bd3c67169fbfbcbb17b941da9db73d",
46
- "permission.js": "2ca7ea60b48cab16d5e14fc3f447469ad736f506a9c9a29f22ccef83e292da12",
52
+ "params.js": "624ff0a0afbb2359491f5e808365232a0c49852acb3f95de64cbf0f126f54aa4",
53
+ "permission.d.ts": "70c5a80e43971e8b81920ae053e0c7de36ecbfb09414cf91080e75ece09bdd96",
54
+ "permission.js": "0d1cedeec5d097753dcb50a40de7e0e0fccd102f96a3688785dfa2550cccd778",
47
55
  "pick.d.ts": "e41f48be4cbde48049ad1a34dbd844b532a0b0d37f6490b4de60e24252591d8a",
48
- "pick.js": "572ab1bd6534215d59f99b774ff1d2dfff399dc94439e45b7ed048ab9ea6bdf1",
49
- "read.d.ts": "5ec18bf920b1b18897232e728a89f0e5a2ea2b130d24ac16475f046a6161d15c",
50
- "read.js": "5890bea19273e20a2c4726f855c66c2470e68c0deb732309b7122b81f02d6081",
56
+ "pick.js": "66fb3d6b18732cca8ce5d8470b3b2dc9310cc5a29c98f7d76c5c8bbdccadad27",
57
+ "read.d.ts": "1cdc2123f9094c8aaaffd10dfbd7c89f58269b774f9e6e3cf4ab875a2f5bab08",
58
+ "read.js": "f5f4cb67818fa346f45199356a0ab7ff6e1eb2c859a7cdfc0a65141b41a072f8",
51
59
  "registry.d.ts": "d28922618fa5e6b6601ff5c1cf250545a86fe9cc342712115bd57716d0637760",
52
- "registry.js": "52ac92e7c0bb4c651e42d9a7ae6e7ae029a2c8677dfa240426271bbe4721164f",
60
+ "registry.js": "89b6e892ed4f36774e5e455220305d29f9a0bcd8ca3ad38fab0855d1458f4b91",
53
61
  "schema.d.ts": "e7322f2604e2dac1cca02fc8d2201de5e369cecf817accea3b28c2760a7a44e3",
54
- "schema.js": "826b66a5c8e44c029795b2db9aaf8bc63092be99b75a6a866705312ed238b11b",
62
+ "schema.js": "4ad50a25cd4cb4561d983b94d169e4a453d76be35b013d73b79f48e9a1e26b4c",
55
63
  "schemas.d.ts": "5893b16f86f605ac68d37496e0a79c825fa412acb804977e28c3e44f2c90ede9",
56
- "schemas.js": "98fb19d5d3974668d31e949bdbb238b682326b22b8bca6a2b4c5c1105ca3c53f",
64
+ "schemas.js": "49c63338b4bcd3de82f1702d4a79c16f9ecd57bdee8d72cd7650b4dee7836c62",
57
65
  "schemas/output.agenda.json": "afdcaa972b3294394883025d8c531ff51d4117cb8f5d2240b5f55319cf646b10",
58
66
  "schemas/output.countdown.json": "2bb069201056c91056b3590417918970e3b79950df39f45f1537cc59eb3b9933",
59
67
  "schemas/output.image.json": "b162cf16515ffb3eb324c4cc62d9898e6c894ba882d91af60025b60cf33129f9",
@@ -66,16 +74,8 @@
66
74
  "schemas/output.record.json": "30fbb81a6f8df5d0601e428f2503eb726eca603cc350805852dc7c909a9b59a1",
67
75
  "schemas/output.table.json": "3d9695004dbf803576efcca0ff5bcef94af2d9475131db2fc694f974bc217dae",
68
76
  "schemas/output.thread.json": "ffaaaa5107a2a6b7b36230e2e458383591b687af77c1be2e1876194bdeb40f90",
69
- "schemas/sources.json": "160d6c9fff25809ae4eaa4d3d2275b7048b57e5606bf277e6924d6064dd1ca95",
70
- "tools-rpc.d.ts": "bd050c3ba4deadf286dc54206ee228af3e32dd6b7463dbd08f3f211653bed772",
71
- "tools-rpc.js": "bdac6baf1f7fa35fa800aa59269aaee22e770a76247b81f324b2d263a75447a1"
72
- },
73
- "package": "@we-the-rebel-alliance/source-contract",
74
- "repository": "https://github.com/we-the-rebel-alliance/source-contract",
75
- "tag": "v0.1.0",
76
- "tagObject": "1bf9466b3d3745900bad4abb1c83f922956887de",
77
- "release": "https://github.com/we-the-rebel-alliance/source-contract/releases/tag/v0.1.0",
78
- "vendoredAt": "2026-11-14",
79
- "version": "0.1.0",
80
- "why": "v0.1.0's tagged release (tag v0.1.0 on 8ace21db), copied from the release tarball's dist/ after verifying it against the release's SHA256SUMS. tools-rpc, events, cursor and registry are what the sources' protocol uses at runtime; the kit and the schema are read by Memory's tests."
77
+ "schemas/sources.json": "b94a3e678154aafd9fa206d46fb1dfa93e6cdbd2f6eb27ef7391f99c95dce9d2",
78
+ "tools-rpc.d.ts": "f54924d710ff8f75fc9607bec13db2b74ae74753ff6d640dbfdd809d9aa13bbd",
79
+ "tools-rpc.js": "2a27cbb7910bab01fe52f128141202a7ca26cc45fa2b6ae55dc28377e92e1fd1"
80
+ }
81
81
  }
@@ -1,4 +1,4 @@
1
- // @we-the-rebel-alliance/source-contract 0.1.0. Built by scripts/build.mjs; do not edit.
1
+ // @we-the-rebel-alliance/source-contract 0.2.0. Built by scripts/build.mjs; do not edit.
2
2
  import {
3
3
  _enum,
4
4
  _null,
@@ -13,7 +13,7 @@ import {
13
13
  string,
14
14
  union,
15
15
  validator
16
- } from "./chunk-W5SHR7DQ.js";
16
+ } from "./chunk-JUWIMDGF.js";
17
17
 
18
18
  // src/registry.ts
19
19
  var text = (max) => string().max(max);
@@ -1,7 +1,7 @@
1
- // @we-the-rebel-alliance/source-contract 0.1.0. Built by scripts/build.mjs; do not edit.
1
+ // @we-the-rebel-alliance/source-contract 0.2.0. Built by scripts/build.mjs; do not edit.
2
2
  import {
3
3
  __export
4
- } from "./chunk-HLVAKAYG.js";
4
+ } from "./chunk-T4QM7B3S.js";
5
5
 
6
6
  // node_modules/zod/v4/classic/schemas.js
7
7
  var schemas_exports2 = {};
@@ -1,4 +1,4 @@
1
- // @we-the-rebel-alliance/source-contract 0.1.0. Built by scripts/build.mjs; do not edit.
1
+ // @we-the-rebel-alliance/source-contract 0.2.0. Built by scripts/build.mjs; do not edit.
2
2
 
3
3
  // src/cursor.ts
4
4
  import { createHash } from "node:crypto";
@@ -1,4 +1,4 @@
1
- // @we-the-rebel-alliance/source-contract 0.1.0. Built by scripts/build.mjs; do not edit.
1
+ // @we-the-rebel-alliance/source-contract 0.2.0. Built by scripts/build.mjs; do not edit.
2
2
 
3
3
  // src/permission.ts
4
4
  var DENY_ALL = { action: "*", resource: "*", effect: "deny" };
@@ -16,7 +16,18 @@ function namespaceOf(source) {
16
16
  }
17
17
  function operationRule(source, operation, account) {
18
18
  const namespace = namespaceOf(source);
19
- return operation.includes(".") ? allow(`${namespace}.read`, `${account}:${operation}`) : allow(`${namespace}_${operation}`, "*");
19
+ return operation.includes(".") ? allow(`${namespace}.read`, `${account}:${operation}`) : allow(`${serverOf(source, account)}_${operation}`, "*");
20
+ }
21
+ var DEFAULT_ACCOUNT = "default";
22
+ var SERVER_ACCOUNT_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;
23
+ function serverOf(source, account) {
24
+ const template = source.accounts?.server;
25
+ if (template === void 0 || account === DEFAULT_ACCOUNT) return namespaceOf(source);
26
+ return template.replace("{account}", account);
27
+ }
28
+ function serverAccountProblem(source, account) {
29
+ if (source.accounts?.server === void 0 || account === DEFAULT_ACCOUNT || SERVER_ACCOUNT_PATTERN.test(account)) return void 0;
30
+ return `the account must be letters, digits, _ or - (at most 64), since it names the MCP server ${source.accounts.server}`;
20
31
  }
21
32
  function fenced(rules) {
22
33
  const loose = rules.find((rule) => WILDCARD.test(rule.action) || rule.resource !== "*" && WILDCARD.test(rule.resource));
@@ -43,6 +54,8 @@ function sessionRules(source, grant) {
43
54
  if (declared !== void 0) return fenced([allow(method, "*"), ...declared.map((rule) => allow(rule.action, rule.resource))]);
44
55
  const operations = source.permission.operations ?? [];
45
56
  if (operations.length === 0) return { ok: false, problems: [`${source.id} declares neither operations nor rules`] };
57
+ const server = serverAccountProblem(source, grant.account);
58
+ if (server) return { ok: false, problems: [server] };
46
59
  return fenced([allow(method, "*"), ...operations.map((operation) => operationRule(source, operation, grant.account))]);
47
60
  }
48
61
  function detailRules(source, detailId, grant) {
@@ -54,6 +67,10 @@ function probeRules(source, account, identityOperations, probeAction) {
54
67
  if (problem) return { ok: false, problems: [problem] };
55
68
  const method = probeAction ?? methodAction(source);
56
69
  if (method === void 0) return { ok: false, problems: [`${source.id} names no action for its method`] };
70
+ const server = serverAccountProblem(source, account);
71
+ if (server) return { ok: false, problems: [server] };
72
+ const verbatim = source.permission.identityRules;
73
+ if (verbatim !== void 0) return fenced([allow(method, "*"), ...verbatim.map((rule) => allow(rule.action, rule.resource))]);
57
74
  return fenced([allow(method, "*"), ...identityOperations.map((operation) => operationRule(source, operation, account))]);
58
75
  }
59
76
  function evaluate(rules, action, resource = "*") {
@@ -75,6 +92,9 @@ export {
75
92
  accountProblem,
76
93
  namespaceOf,
77
94
  operationRule,
95
+ DEFAULT_ACCOUNT,
96
+ SERVER_ACCOUNT_PATTERN,
97
+ serverOf,
78
98
  methodAction,
79
99
  sessionRules,
80
100
  detailRules,
@@ -1,4 +1,4 @@
1
- // @we-the-rebel-alliance/source-contract 0.1.0. Built by scripts/build.mjs; do not edit.
1
+ // @we-the-rebel-alliance/source-contract 0.2.0. Built by scripts/build.mjs; do not edit.
2
2
  var __defProp = Object.defineProperty;
3
3
  var __export = (target, all) => {
4
4
  for (var name in all)
@@ -1,8 +1,8 @@
1
- // @we-the-rebel-alliance/source-contract 0.1.0. Built by scripts/build.mjs; do not edit.
1
+ // @we-the-rebel-alliance/source-contract 0.2.0. Built by scripts/build.mjs; do not edit.
2
2
  import {
3
3
  ACCOUNT_PATTERN,
4
4
  evaluate
5
- } from "./chunk-3M5PAKSS.js";
5
+ } from "./chunk-OZMX7VR7.js";
6
6
 
7
7
  // src/tools-rpc.ts
8
8
  import { randomUUID } from "node:crypto";
@@ -191,6 +191,12 @@ async function registerToolsRpc(ctx, options) {
191
191
  if (!CLASSES.includes(method.class)) throw new Error(`registerToolsRpc: ${method.name} has the class "${String(method.class)}"; use one of ${CLASSES.join(", ")}`);
192
192
  if (method.kind === "plugin" && (typeof method.run !== "function" || method.action === "")) throw new Error(`registerToolsRpc: the plugin method ${method.name} needs a run function and an action`);
193
193
  if (method.kind === "plugin" && method.resource !== void 0 && typeof method.resource !== "function") throw new Error(`registerToolsRpc: the plugin method ${method.name}'s resource must be a function of its input`);
194
+ if (method.kind === "plugin" && method.resourceKind !== void 0 && method.resourceKind !== "read" && method.resourceKind !== "any") {
195
+ throw new Error(`registerToolsRpc: the plugin method ${method.name}'s resourceKind must be "read" or "any"`);
196
+ }
197
+ if (method.kind === "plugin" && method.resourceKind !== void 0 && method.resource === void 0) {
198
+ throw new Error(`registerToolsRpc: the plugin method ${method.name} sets resourceKind but has no resource resolver`);
199
+ }
194
200
  if (method.kind === "mcp" && "resource" in method) throw new Error(`registerToolsRpc: the MCP method ${method.name} cannot have a resource resolver; only a plugin method can`);
195
201
  }
196
202
  const fail = (code, what) => {
@@ -212,14 +218,16 @@ async function registerToolsRpc(ctx, options) {
212
218
  let resource;
213
219
  try {
214
220
  resource = method.resource(envelope2.input);
215
- } catch {
221
+ } catch (error) {
222
+ const coded = codedRefusal(error);
223
+ if (coded) throw new ScriptError(coded);
216
224
  resource = null;
217
225
  }
218
226
  const unresolved = (what) => new ScriptError({ code: "RESOURCE_UNRESOLVED", what, next: NEXT_STEPS.RESOURCE_UNRESOLVED ?? RESOURCE_NEXT });
219
227
  if (resource === null || resource === void 0) throw unresolved(`${method.name}'s input names no account and operation for ${method.action} to be resolved on`);
220
228
  if (typeof resource !== "string" || !RESOURCE_PATTERN.test(resource)) throw unresolved(`${method.name}'s input resolves to a resource that is not <account>:<operation>`);
221
229
  const operation = resource.slice(resource.indexOf(":") + 1);
222
- if (method.class === "read" && !readOperation(operation)) {
230
+ if (method.class === "read" && method.resourceKind !== "any" && !readOperation(operation)) {
223
231
  throw new ScriptError({
224
232
  code: "PERMISSION_DENIED",
225
233
  what: `${method.name} is a read, and ${operation} is not a read operation`,
@@ -228,6 +236,18 @@ async function registerToolsRpc(ctx, options) {
228
236
  }
229
237
  return resource;
230
238
  };
239
+ const codedRefusal = (error) => {
240
+ const own = pluginError(error);
241
+ if (own) return own;
242
+ if (!record(error)) return void 0;
243
+ const code = error["code"];
244
+ const next = error["next"];
245
+ if (typeof code !== "string" || !/^[A-Z][A-Z0-9_]*$/.test(code) || typeof next !== "string" || next.trim() === "") return void 0;
246
+ const message = typeof error["message"] === "string" ? error["message"].split(/\r?\n/, 1)[0] : "";
247
+ const what = typeof error["what"] === "string" && error["what"].trim() !== "" ? error["what"] : message.replace(new RegExp(`^${code}:\\s*`), "").replace(/\s*Next step:.*$/, "");
248
+ if (what.trim() === "") return void 0;
249
+ return { code, what: upstreamText(what), next };
250
+ };
231
251
  const session = async (sessionID) => {
232
252
  let info;
233
253
  try {