@joe-broadhead/opencode-mem 0.12.0 → 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 (51) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/docs/agent-protocol.md +1 -1
  3. package/package.json +1 -1
  4. package/src/collector.js +11 -1
  5. package/src/plugins/source-contract/index.js +2 -2
  6. package/src/plugins/source-contract/policy.js +3 -7
  7. package/src/plugins/source-contract/vendor/PROVENANCE.json +8 -8
  8. package/src/plugins/source-contract/vendor/RELEASE-SHA256SUMS +3 -3
  9. package/src/plugins/source-contract/vendor/RELEASE.json +9 -9
  10. package/src/plugins/source-contract/vendor/SHA256SUMS +28 -28
  11. package/src/plugins/source-contract/vendor/broker-client.js +14 -14
  12. package/src/plugins/source-contract/vendor/chunks/{chunk-Q3RQA5J2.js → chunk-77MJETEE.js} +9 -9
  13. package/src/plugins/source-contract/vendor/chunks/{chunk-6HDIB2SA.js → chunk-BOUWB5UP.js} +2 -2
  14. package/src/plugins/source-contract/vendor/chunks/{chunk-KYWBTAF4.js → chunk-EHIOPXPL.js} +9 -8
  15. package/src/plugins/source-contract/vendor/chunks/{chunk-RYNKNCPP.js → chunk-F4K2Y64D.js} +1 -1
  16. package/src/plugins/source-contract/vendor/chunks/{chunk-RRUAIQ4I.js → chunk-HVBOAYBO.js} +43 -9
  17. package/src/plugins/source-contract/vendor/chunks/{chunk-ELPJD3ND.js → chunk-IL565TRX.js} +1 -1
  18. package/src/plugins/source-contract/vendor/chunks/{chunk-W5SHR7DQ.js → chunk-JUWIMDGF.js} +2 -2
  19. package/src/{vendor/source-contract/chunks/chunk-I2RXJJJM.js → plugins/source-contract/vendor/chunks/chunk-NUEROZNU.js} +1 -1
  20. package/src/plugins/source-contract/vendor/chunks/{chunk-3M5PAKSS.js → chunk-OZMX7VR7.js} +22 -2
  21. package/src/plugins/source-contract/vendor/chunks/{chunk-HLVAKAYG.js → chunk-T4QM7B3S.js} +1 -1
  22. package/src/plugins/source-contract/vendor/chunks/{chunk-KWEWSZ4V.js → chunk-X6XP7YK2.js} +24 -4
  23. package/src/plugins/source-contract/vendor/chunks/{chunk-4ERCA4TK.js → chunk-XVA6H6OO.js} +2 -2
  24. package/src/plugins/source-contract/vendor/chunks/{chunk-ZUKF7P6U.js → chunk-YH323FAZ.js} +51 -10
  25. package/src/plugins/source-contract/vendor/cursor.js +3 -3
  26. package/src/plugins/source-contract/vendor/descriptor.js +11 -11
  27. package/src/plugins/source-contract/vendor/events.js +9 -5
  28. package/src/plugins/source-contract/vendor/index.js +3 -3
  29. package/src/plugins/source-contract/vendor/params.js +3 -3
  30. package/src/plugins/source-contract/vendor/permission.js +9 -3
  31. package/src/plugins/source-contract/vendor/pick.js +5 -5
  32. package/src/plugins/source-contract/vendor/read.js +14 -14
  33. package/src/plugins/source-contract/vendor/registry.js +4 -4
  34. package/src/plugins/source-contract/vendor/schema.js +8 -8
  35. package/src/plugins/source-contract/vendor/schemas/sources.json +158 -4
  36. package/src/plugins/source-contract/vendor/schemas.js +9 -9
  37. package/src/plugins/source-contract/vendor/tools-rpc.js +4 -4
  38. package/src/tools/share.js +1 -1
  39. package/src/vendor/source-contract/README.md +6 -5
  40. package/src/vendor/source-contract/VENDOR.json +46 -46
  41. package/src/vendor/source-contract/chunks/{chunk-6HDIB2SA.js → chunk-BOUWB5UP.js} +2 -2
  42. package/src/vendor/source-contract/chunks/{chunk-W5SHR7DQ.js → chunk-JUWIMDGF.js} +2 -2
  43. package/src/{plugins/source-contract/vendor/chunks/chunk-I2RXJJJM.js → vendor/source-contract/chunks/chunk-NUEROZNU.js} +1 -1
  44. package/src/vendor/source-contract/chunks/{chunk-3M5PAKSS.js → chunk-OZMX7VR7.js} +22 -2
  45. package/src/vendor/source-contract/chunks/{chunk-HLVAKAYG.js → chunk-T4QM7B3S.js} +1 -1
  46. package/src/vendor/source-contract/chunks/{chunk-KWEWSZ4V.js → chunk-X6XP7YK2.js} +24 -4
  47. package/src/vendor/source-contract/chunks/{chunk-ZUKF7P6U.js → chunk-YH323FAZ.js} +51 -10
  48. package/src/vendor/source-contract/cursor.js +3 -3
  49. package/src/vendor/source-contract/events.js +9 -5
  50. package/src/vendor/source-contract/registry.js +4 -4
  51. package/src/vendor/source-contract/tools-rpc.js +4 -4
@@ -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 {
@@ -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
  isExtensionOutput,
4
4
  outputValidator
5
- } from "./chunk-6HDIB2SA.js";
5
+ } from "./chunk-BOUWB5UP.js";
6
6
 
7
7
  // src/pick.ts
8
8
  var MAX_PICK_PATHS = 50;
@@ -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
  MAX_CURSOR_LENGTH,
4
4
  canonicalScope
5
- } from "./chunk-I2RXJJJM.js";
5
+ } from "./chunk-NUEROZNU.js";
6
6
 
7
7
  // src/internal/secrets.ts
8
8
  var PRIVATE_KEY_BLOCK = /-----BEGIN (?:[A-Z0-9]+ )*PRIVATE KEY(?: BLOCK)?-----[\s\S]*?(?:-----END (?:[A-Z0-9]+ )*PRIVATE KEY(?: BLOCK)?-----|$)/g;
@@ -159,7 +159,15 @@ var MAX_PAGE_BYTES = 65536;
159
159
  var MAX_BYTES = { default: 65536, max: 1048576 };
160
160
  var FIRST_RUN_HOURS = 24;
161
161
  var TRUST = "untrusted";
162
+ function ownerShapeProblems(owner, what) {
163
+ if (!plainObject(owner) || !line(owner["id"], EVENT_LIMITS.ownerId) || !line(owner["label"], EVENT_LIMITS.ownerLabel) || Object.keys(owner).some((key) => key !== "id" && key !== "label" && key !== "verified")) {
164
+ return [`${what} must be { id, label }, two non-empty lines`];
165
+ }
166
+ if (owner["verified"] !== void 0 && owner["verified"] !== false) return [`${what}.verified must be false, or left out for an owner the provider named`];
167
+ return [];
168
+ }
162
169
  var REFUSAL_REASONS = ["instruction", "secret", "owner"];
170
+ var REMOVAL_REASONS = ["deleted", "withheld", "expired"];
163
171
  var GAP_REASONS = ["expired", "window-truncated"];
164
172
  var ERROR_CODES = [
165
173
  "NEEDS_SIGN_IN",
@@ -178,7 +186,7 @@ var ERROR_CODES = [
178
186
  "SOURCE_UNKNOWN"
179
187
  ];
180
188
  var PROPOSED_CODES = [];
181
- var ERROR_ALIASES = { AUTH_REQUIRED: "NEEDS_SIGN_IN" };
189
+ var ERROR_ALIASES = { AUTH_REQUIRED: "NEEDS_SIGN_IN", ACCOUNT_UNKNOWN: "ACCOUNT_MISMATCH" };
182
190
  var CONTRACT1_CODES = {
183
191
  EVENTS_INVALID_INPUT: "INPUT_INVALID",
184
192
  EVENTS_CURSOR_INVALID: "CURSOR_INVALID",
@@ -397,7 +405,7 @@ function probeResult(identity, extras = {}) {
397
405
  return {
398
406
  source: identity.source,
399
407
  account: identity.account,
400
- owner: { id: identity.owner.id, label: identity.owner.label },
408
+ owner: { id: identity.owner.id, label: identity.owner.label, ...identity.owner.verified === void 0 ? {} : { verified: identity.owner.verified } },
401
409
  ...extras.scopes === void 0 ? {} : { scopes: [...new Set(extras.scopes)] },
402
410
  ...extras.cost === void 0 ? {} : { cost: extras.cost },
403
411
  trust: TRUST
@@ -413,8 +421,11 @@ function probeResultProblems(result, expected = {}) {
413
421
  if (!line(result["account"], EVENT_LIMITS.account)) problems.push(`the probe answer's account must be a non-empty name of at most ${EVENT_LIMITS.account} characters`);
414
422
  else if (expected.account !== void 0 && result["account"] !== expected.account) problems.push("the probe answer names another account than the one asked for");
415
423
  const owner = result["owner"];
416
- if (!plainObject(owner) || !line(owner["id"], EVENT_LIMITS.ownerId) || !line(owner["label"], EVENT_LIMITS.ownerLabel) || Object.keys(owner).some((key) => key !== "id" && key !== "label")) {
417
- problems.push("the probe answer's owner must be { id, label }, two non-empty lines");
424
+ const ownerShape = ownerShapeProblems(owner, "the probe answer's owner");
425
+ if (ownerShape.length > 0) {
426
+ problems.push(...ownerShape);
427
+ } else if (!SCHEMED.test(owner["id"])) {
428
+ problems.push("the probe answer's owner.id must be a scheme-qualified id such as mailto:someone@example.com or slack:U0123");
418
429
  }
419
430
  const scopes = result["scopes"];
420
431
  if (scopes !== void 0 && (!Array.isArray(scopes) || scopes.length > PROBE_LIMITS.scopes || scopes.some((scope) => !line(scope, PROBE_LIMITS.scope)) || new Set(scopes).size !== scopes.length)) {
@@ -436,6 +447,7 @@ function eventsListResult(identity, events, cursor, more, extras = {}) {
436
447
  ...extras.scope === void 0 ? {} : { scope: canonicalScope(extras.scope) },
437
448
  ...extras.refused && extras.refused.length > 0 ? { refused: [...extras.refused] } : {},
438
449
  ...extras.failed && extras.failed.length > 0 ? { failed: [...extras.failed] } : {},
450
+ ...extras.removals && extras.removals.length > 0 ? { removals: [...extras.removals] } : {},
439
451
  ...extras.gap === void 0 ? {} : { gap: extras.gap },
440
452
  ...extras.cost === void 0 ? {} : { cost: extras.cost },
441
453
  ...extras.plugin === void 0 ? {} : { plugin: extras.plugin },
@@ -496,7 +508,35 @@ function eventProblems(event, where = "event") {
496
508
  return problems;
497
509
  }
498
510
  var RESULT_KEYS = ["source", "account", "owner", "events", "cursor", "more", "trust"];
499
- var EXTRA_KEYS = ["scope", "refused", "failed", "gap", "cost", "plugin", "asOf"];
511
+ var EXTRA_KEYS = ["scope", "refused", "failed", "removals", "gap", "cost", "plugin", "asOf"];
512
+ function removalProblems(result) {
513
+ if (!plainObject(result) || result["removals"] === void 0) return [];
514
+ const list = result["removals"];
515
+ if (!Array.isArray(list) || list.length > EVENT_LIMITS.refused) return [`the result's removals must be a list of at most ${EVENT_LIMITS.refused}`];
516
+ const problems = [];
517
+ const asOf = isoUtc(result["asOf"]) ? Date.parse(result["asOf"]) : void 0;
518
+ const seen = /* @__PURE__ */ new Set();
519
+ for (const [index, entry] of list.entries()) {
520
+ const at = `removals[${index}]`;
521
+ if (!plainObject(entry)) {
522
+ problems.push(`${at} is not an object`);
523
+ continue;
524
+ }
525
+ for (const key of Object.keys(entry)) if (!["external_id", "at", "reason"].includes(key)) problems.push(`${at} has the field "${key}", which the contract does not define`);
526
+ const id = entry["external_id"];
527
+ if (!line(id, EVENT_LIMITS.externalId)) problems.push(`${at}.external_id must be a non-empty id of at most ${EVENT_LIMITS.externalId} characters`);
528
+ else if (seen.has(id)) problems.push("the result's removals lists one event twice");
529
+ else seen.add(id);
530
+ if (!isoUtc(entry["at"])) problems.push(`${at}.at must be a UTC ISO date-time ending in Z`);
531
+ else if (asOf !== void 0 && Date.parse(entry["at"]) > asOf) problems.push(`${at}.at is later than the page's asOf`);
532
+ if (!REMOVAL_REASONS.includes(entry["reason"])) problems.push(`${at}.reason must be one of ${REMOVAL_REASONS.join(", ")}`);
533
+ }
534
+ const failed = result["failed"];
535
+ if (Array.isArray(failed) && failed.some((entry) => plainObject(entry) && typeof entry["external_id"] === "string" && seen.has(entry["external_id"]))) {
536
+ problems.push("an event is both removed and failed: a removal is final, so nothing is retried");
537
+ }
538
+ return problems;
539
+ }
500
540
  function extraProblems(result, ids) {
501
541
  const problems = [];
502
542
  if (result["scope"] !== void 0) {
@@ -548,6 +588,7 @@ function extraProblems(result, ids) {
548
588
  const refused = new Set(result["refused"].map((entry) => plainObject(entry) ? entry["external_id"] : void 0));
549
589
  if (result["failed"].some((entry) => plainObject(entry) && refused.has(entry["external_id"]))) problems.push("an event is both refused and failed");
550
590
  }
591
+ problems.push(...removalProblems(result));
551
592
  if (result["gap"] !== void 0) {
552
593
  const gap = result["gap"];
553
594
  if (!plainObject(gap) || Object.keys(gap).some((key) => key !== "reason" && key !== "since") || !GAP_REASONS.includes(gap["reason"]) || !isoUtc(gap["since"])) {
@@ -577,9 +618,7 @@ function resultProblems(result, limit = PAGE.max, maxBytes = MAX_PAGE_BYTES) {
577
618
  if (!named) problems.push("the result's source must be a lowercase name such as gmail");
578
619
  if (!line(account, EVENT_LIMITS.account)) problems.push(`the result's account must be a non-empty name of at most ${EVENT_LIMITS.account} characters`);
579
620
  const owner = result["owner"];
580
- if (!plainObject(owner) || !line(owner["id"], EVENT_LIMITS.ownerId) || !line(owner["label"], EVENT_LIMITS.ownerLabel) || Object.keys(owner).some((key) => key !== "id" && key !== "label")) {
581
- problems.push("the result's owner must be { id, label }, two non-empty lines");
582
- }
621
+ problems.push(...ownerShapeProblems(owner, "the result's owner"));
583
622
  const cursor = result["cursor"];
584
623
  if (typeof cursor !== "string" || cursor.length === 0 || cursor.length > EVENT_LIMITS.cursor) problems.push(`the result's cursor must be a non-empty string of at most ${EVENT_LIMITS.cursor} characters`);
585
624
  if (typeof result["more"] !== "boolean") problems.push("the result's more must be true or false");
@@ -621,6 +660,7 @@ export {
621
660
  FIRST_RUN_HOURS,
622
661
  TRUST,
623
662
  REFUSAL_REASONS,
663
+ REMOVAL_REASONS,
624
664
  GAP_REASONS,
625
665
  ERROR_CODES,
626
666
  PROPOSED_CODES,
@@ -649,5 +689,6 @@ export {
649
689
  probeResultProblems,
650
690
  eventsListResult,
651
691
  eventProblems,
692
+ removalProblems,
652
693
  resultProblems
653
694
  };
@@ -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
  CURSOR_V1,
4
4
  CURSOR_V2,
@@ -10,8 +10,8 @@ import {
10
10
  decodeCursor,
11
11
  encodeBoundCursor,
12
12
  encodeCursor
13
- } from "./chunks/chunk-I2RXJJJM.js";
14
- import "./chunks/chunk-HLVAKAYG.js";
13
+ } from "./chunks/chunk-NUEROZNU.js";
14
+ import "./chunks/chunk-T4QM7B3S.js";
15
15
  export {
16
16
  CURSOR_V1,
17
17
  CURSOR_V2,
@@ -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
  DEFAULT_MAX_BYTES,
4
4
  DETAIL_FIELDS,
@@ -10,16 +10,16 @@ import {
10
10
  findSource,
11
11
  maxBytesOf,
12
12
  readInstalledDescriptor
13
- } from "./chunks/chunk-KYWBTAF4.js";
14
- import "./chunks/chunk-RRUAIQ4I.js";
15
- import "./chunks/chunk-KWEWSZ4V.js";
16
- import "./chunks/chunk-ELPJD3ND.js";
17
- import "./chunks/chunk-ZUKF7P6U.js";
18
- import "./chunks/chunk-I2RXJJJM.js";
19
- import "./chunks/chunk-3M5PAKSS.js";
20
- import "./chunks/chunk-6HDIB2SA.js";
21
- import "./chunks/chunk-W5SHR7DQ.js";
22
- import "./chunks/chunk-HLVAKAYG.js";
13
+ } from "./chunks/chunk-EHIOPXPL.js";
14
+ import "./chunks/chunk-HVBOAYBO.js";
15
+ import "./chunks/chunk-X6XP7YK2.js";
16
+ import "./chunks/chunk-IL565TRX.js";
17
+ import "./chunks/chunk-YH323FAZ.js";
18
+ import "./chunks/chunk-NUEROZNU.js";
19
+ import "./chunks/chunk-OZMX7VR7.js";
20
+ import "./chunks/chunk-BOUWB5UP.js";
21
+ import "./chunks/chunk-JUWIMDGF.js";
22
+ import "./chunks/chunk-T4QM7B3S.js";
23
23
  export {
24
24
  DEFAULT_MAX_BYTES,
25
25
  DETAIL_FIELDS,
@@ -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
  CONTRACT1_CODES,
4
4
  ERROR_ALIASES,
@@ -18,6 +18,7 @@ import {
18
18
  PROBE_LIMITS,
19
19
  PROPOSED_CODES,
20
20
  REFUSAL_REASONS,
21
+ REMOVAL_REASONS,
21
22
  SCOPE_KEY_PATTERN,
22
23
  SINCE_PATTERN,
23
24
  SOURCE_PATTERN,
@@ -40,6 +41,7 @@ import {
40
41
  parseSourceError,
41
42
  probeResult,
42
43
  probeResultProblems,
44
+ removalProblems,
43
45
  resultProblems,
44
46
  scopeProblems,
45
47
  screenEvents,
@@ -47,14 +49,14 @@ import {
47
49
  sinceTime,
48
50
  sourceNamespace,
49
51
  startTime
50
- } from "./chunks/chunk-ZUKF7P6U.js";
52
+ } from "./chunks/chunk-YH323FAZ.js";
51
53
  import {
52
54
  decodeBoundCursor,
53
55
  decodeCursor,
54
56
  encodeBoundCursor,
55
57
  encodeCursor
56
- } from "./chunks/chunk-I2RXJJJM.js";
57
- import "./chunks/chunk-HLVAKAYG.js";
58
+ } from "./chunks/chunk-NUEROZNU.js";
59
+ import "./chunks/chunk-T4QM7B3S.js";
58
60
 
59
61
  // src/internal/events-conformance.ts
60
62
  var describeError = (error) => error instanceof Error ? error.message.split("\n", 1)[0] : String(error);
@@ -97,7 +99,7 @@ async function eventsListConformance(list, fixtures) {
97
99
  if (fixtures.account !== void 0 && result.account !== fixtures.account) problems.push(`${what}: the result names the account ${result.account}, not ${fixtures.account}`);
98
100
  accounts.add(result.account);
99
101
  owners.add(JSON.stringify(result.owner));
100
- if (fixtures.owner && JSON.stringify(result.owner) !== JSON.stringify({ id: fixtures.owner.id, label: fixtures.owner.label })) problems.push(`${what}: the owner is not the fixture's owner`);
102
+ if (fixtures.owner && JSON.stringify(result.owner) !== JSON.stringify({ id: fixtures.owner.id, label: fixtures.owner.label, ...fixtures.owner.verified === void 0 ? {} : { verified: fixtures.owner.verified } })) problems.push(`${what}: the owner is not the fixture's owner`);
101
103
  if (fixtures.scopeEcho && fixtures.scope !== void 0) {
102
104
  if (result.scope === void 0) problems.push(`${what}: the result does not echo the scope`);
103
105
  else if (JSON.stringify(result.scope) !== JSON.stringify(sortedScope(fixtures.scope))) problems.push(`${what}: the result's scope is not the call's scope`);
@@ -221,6 +223,7 @@ export {
221
223
  PROBE_LIMITS,
222
224
  PROPOSED_CODES,
223
225
  REFUSAL_REASONS,
226
+ REMOVAL_REASONS,
224
227
  SCOPE_KEY_PATTERN,
225
228
  SINCE_PATTERN,
226
229
  SOURCE_PATTERN,
@@ -247,6 +250,7 @@ export {
247
250
  parseSourceError,
248
251
  probeResult,
249
252
  probeResultProblems,
253
+ removalProblems,
250
254
  resultProblems,
251
255
  scopeProblems,
252
256
  screenEvents,
@@ -1,9 +1,9 @@
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
  CONTRACT_VERSION,
4
4
  SUPPORTED_CONTRACT_VERSIONS
5
- } from "./chunks/chunk-ELPJD3ND.js";
6
- import "./chunks/chunk-HLVAKAYG.js";
5
+ } from "./chunks/chunk-IL565TRX.js";
6
+ import "./chunks/chunk-T4QM7B3S.js";
7
7
  export {
8
8
  CONTRACT_VERSION,
9
9
  SUPPORTED_CONTRACT_VERSIONS
@@ -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
  MAX_RELATIVE_DAYS,
4
4
  ME,
@@ -8,8 +8,8 @@ import {
8
8
  resolveRelativeTime,
9
9
  resolveSince,
10
10
  resolveWindow
11
- } from "./chunks/chunk-RYNKNCPP.js";
12
- import "./chunks/chunk-HLVAKAYG.js";
11
+ } from "./chunks/chunk-F4K2Y64D.js";
12
+ import "./chunks/chunk-T4QM7B3S.js";
13
13
  export {
14
14
  MAX_RELATIVE_DAYS,
15
15
  ME,
@@ -1,7 +1,9 @@
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
+ DEFAULT_ACCOUNT,
4
5
  DENY_ALL,
6
+ SERVER_ACCOUNT_PATTERN,
5
7
  accountProblem,
6
8
  detailRules,
7
9
  evaluate,
@@ -10,12 +12,15 @@ import {
10
12
  namespaceOf,
11
13
  operationRule,
12
14
  probeRules,
15
+ serverOf,
13
16
  sessionRules
14
- } from "./chunks/chunk-3M5PAKSS.js";
15
- import "./chunks/chunk-HLVAKAYG.js";
17
+ } from "./chunks/chunk-OZMX7VR7.js";
18
+ import "./chunks/chunk-T4QM7B3S.js";
16
19
  export {
17
20
  ACCOUNT_PATTERN,
21
+ DEFAULT_ACCOUNT,
18
22
  DENY_ALL,
23
+ SERVER_ACCOUNT_PATTERN,
19
24
  accountProblem,
20
25
  detailRules,
21
26
  evaluate,
@@ -24,5 +29,6 @@ export {
24
29
  namespaceOf,
25
30
  operationRule,
26
31
  probeRules,
32
+ serverOf,
27
33
  sessionRules
28
34
  };
@@ -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
  MAX_PICK_PATHS,
4
4
  MAX_PICK_PATH_LENGTH,
@@ -7,10 +7,10 @@ import {
7
7
  pick,
8
8
  pickProblems,
9
9
  pickProblemsForOutput
10
- } from "./chunks/chunk-4ERCA4TK.js";
11
- import "./chunks/chunk-6HDIB2SA.js";
12
- import "./chunks/chunk-W5SHR7DQ.js";
13
- import "./chunks/chunk-HLVAKAYG.js";
10
+ } from "./chunks/chunk-XVA6H6OO.js";
11
+ import "./chunks/chunk-BOUWB5UP.js";
12
+ import "./chunks/chunk-JUWIMDGF.js";
13
+ import "./chunks/chunk-T4QM7B3S.js";
14
14
  export {
15
15
  MAX_PICK_PATHS,
16
16
  MAX_PICK_PATH_LENGTH,
@@ -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
  acceptAnswer,
4
4
  checkReadRequest,
@@ -6,19 +6,19 @@ import {
6
6
  probe,
7
7
  read,
8
8
  readDetail
9
- } from "./chunks/chunk-Q3RQA5J2.js";
10
- import "./chunks/chunk-KYWBTAF4.js";
11
- import "./chunks/chunk-RRUAIQ4I.js";
12
- import "./chunks/chunk-KWEWSZ4V.js";
13
- import "./chunks/chunk-ELPJD3ND.js";
14
- import "./chunks/chunk-ZUKF7P6U.js";
15
- import "./chunks/chunk-I2RXJJJM.js";
16
- import "./chunks/chunk-RYNKNCPP.js";
17
- import "./chunks/chunk-3M5PAKSS.js";
18
- import "./chunks/chunk-4ERCA4TK.js";
19
- import "./chunks/chunk-6HDIB2SA.js";
20
- import "./chunks/chunk-W5SHR7DQ.js";
21
- import "./chunks/chunk-HLVAKAYG.js";
9
+ } from "./chunks/chunk-77MJETEE.js";
10
+ import "./chunks/chunk-EHIOPXPL.js";
11
+ import "./chunks/chunk-HVBOAYBO.js";
12
+ import "./chunks/chunk-X6XP7YK2.js";
13
+ import "./chunks/chunk-IL565TRX.js";
14
+ import "./chunks/chunk-YH323FAZ.js";
15
+ import "./chunks/chunk-NUEROZNU.js";
16
+ import "./chunks/chunk-F4K2Y64D.js";
17
+ import "./chunks/chunk-OZMX7VR7.js";
18
+ import "./chunks/chunk-XVA6H6OO.js";
19
+ import "./chunks/chunk-BOUWB5UP.js";
20
+ import "./chunks/chunk-JUWIMDGF.js";
21
+ import "./chunks/chunk-T4QM7B3S.js";
22
22
  export {
23
23
  acceptAnswer,
24
24
  checkReadRequest,
@@ -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
  EXTENSION_OUTPUT,
4
4
  IMAGE_DATA_URI_MAX,
@@ -8,9 +8,9 @@ import {
8
8
  isExtensionOutput,
9
9
  isOutputName,
10
10
  outputValidator
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
  export {
15
15
  EXTENSION_OUTPUT,
16
16
  IMAGE_DATA_URI_MAX,
@@ -1,15 +1,15 @@
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
  MAX_BYTES_DEFAULT,
4
4
  MAX_BYTES_LIMIT,
5
5
  SOURCES_SCHEMA
6
- } from "./chunks/chunk-RRUAIQ4I.js";
7
- import "./chunks/chunk-KWEWSZ4V.js";
8
- import "./chunks/chunk-ZUKF7P6U.js";
9
- import "./chunks/chunk-I2RXJJJM.js";
10
- import "./chunks/chunk-3M5PAKSS.js";
11
- import "./chunks/chunk-W5SHR7DQ.js";
12
- import "./chunks/chunk-HLVAKAYG.js";
6
+ } from "./chunks/chunk-HVBOAYBO.js";
7
+ import "./chunks/chunk-X6XP7YK2.js";
8
+ import "./chunks/chunk-YH323FAZ.js";
9
+ import "./chunks/chunk-NUEROZNU.js";
10
+ import "./chunks/chunk-OZMX7VR7.js";
11
+ import "./chunks/chunk-JUWIMDGF.js";
12
+ import "./chunks/chunk-T4QM7B3S.js";
13
13
  export {
14
14
  MAX_BYTES_DEFAULT,
15
15
  MAX_BYTES_LIMIT,