@xnetjs/data 2.2.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/{account-ZD3HMRY6.js → account-LYZ3VDC4.js} +4 -4
  2. package/dist/{account-ledger-ZHBNVREV.js → account-ledger-7VF5SHTT.js} +2 -2
  3. package/dist/{agent-OFQJQMNB.js → agent-IJLOS2LA.js} +4 -4
  4. package/dist/auth/index.d.ts +4 -4
  5. package/dist/{budget-FTGZEXX6.js → budget-WXX7PAWQ.js} +4 -4
  6. package/dist/canvas-64KGRYXI.js +10 -0
  7. package/dist/channel-DXLP6PEJ.js +12 -0
  8. package/dist/chat-message-EZW77LY3.js +10 -0
  9. package/dist/{checkpoint-MZHJ7PCZ.js → checkpoint-SAKNGDI3.js} +4 -4
  10. package/dist/{chunk-ZKMWJNDQ.js → chunk-2DAVPHDV.js} +1 -1
  11. package/dist/{chunk-KTPSQJ5L.js → chunk-2JROE7ML.js} +2 -2
  12. package/dist/{chunk-JWGS7JMA.js → chunk-2K6BLSNC.js} +2 -2
  13. package/dist/{chunk-IKGUBSZP.js → chunk-37PXEMYQ.js} +1 -1
  14. package/dist/{chunk-M4KGY2PC.js → chunk-3FWYS6AW.js} +2 -2
  15. package/dist/chunk-3UOUVEZW.js +122 -0
  16. package/dist/{chunk-EYRZ6ZUB.js → chunk-4HJZJMPI.js} +14 -1
  17. package/dist/{chunk-T45PWXNA.js → chunk-4SIMTLCC.js} +2 -2
  18. package/dist/{chunk-II7WS264.js → chunk-56EXPOJ4.js} +47 -6
  19. package/dist/{chunk-5UJMY3AH.js → chunk-57AT2DT2.js} +2 -2
  20. package/dist/{chunk-4KJ4NAMC.js → chunk-5ECIKN6Z.js} +1 -1
  21. package/dist/{chunk-MEAIGK3W.js → chunk-6AKAZHVZ.js} +1 -1
  22. package/dist/{chunk-UUQVNDBG.js → chunk-7MSSPUMC.js} +2 -2
  23. package/dist/{chunk-OF6455OV.js → chunk-AKKBG7HW.js} +2 -2
  24. package/dist/{chunk-FWCM2TKJ.js → chunk-CM57A2GS.js} +2 -2
  25. package/dist/{chunk-OD2JYCVG.js → chunk-CNGEXCIH.js} +192 -189
  26. package/dist/{chunk-HPUXHSKR.js → chunk-CTQALHJM.js} +2 -2
  27. package/dist/{chunk-WC7EDJHC.js → chunk-CY6EJUNV.js} +1 -1
  28. package/dist/{chunk-JLUFPUIL.js → chunk-EA2PZ3EU.js} +2 -2
  29. package/dist/{chunk-4S73XDWH.js → chunk-EGGRKSRH.js} +93 -8
  30. package/dist/{chunk-NSMSOIEW.js → chunk-EUJR5QQC.js} +2 -2
  31. package/dist/{chunk-RXBLWQQI.js → chunk-EZJ3OD5A.js} +2 -2
  32. package/dist/{chunk-SOXXBQ4P.js → chunk-F6ICOU6R.js} +2 -2
  33. package/dist/{chunk-D4EVJN2P.js → chunk-FTKHARBY.js} +2 -2
  34. package/dist/{chunk-LK5ZIAIE.js → chunk-GSLOK5KV.js} +8 -1
  35. package/dist/{chunk-EZTBWWMS.js → chunk-HSCGVBQN.js} +2 -2
  36. package/dist/{chunk-Z5I2T75Z.js → chunk-HXIEK5L6.js} +6 -2
  37. package/dist/{chunk-I7JMGCV6.js → chunk-ICBC5VLZ.js} +2 -2
  38. package/dist/{chunk-C4CQH7UD.js → chunk-IJZ5YPYT.js} +1 -1
  39. package/dist/{chunk-WWQO7QKV.js → chunk-IKREWSCX.js} +2 -2
  40. package/dist/{chunk-XQDXQ7WG.js → chunk-IVCHWQY7.js} +2 -2
  41. package/dist/{chunk-ZKJXGQCR.js → chunk-JB6BPIVP.js} +2 -2
  42. package/dist/{chunk-3PV6QTKF.js → chunk-JUTPAFDP.js} +1 -1
  43. package/dist/{chunk-HTZTBXKL.js → chunk-KHLOVRMQ.js} +2 -2
  44. package/dist/{chunk-IKI5FBNO.js → chunk-L6DF76E2.js} +2 -2
  45. package/dist/{chunk-7PCMTV6J.js → chunk-LDKJDNSW.js} +1 -1
  46. package/dist/{chunk-22FKOLMX.js → chunk-M6STMJ2V.js} +2 -2
  47. package/dist/{chunk-RRXJNZX5.js → chunk-NH6OLO3X.js} +46 -0
  48. package/dist/{chunk-26HTTVJN.js → chunk-O34JPX6Q.js} +2 -2
  49. package/dist/{chunk-YD2ZPFT7.js → chunk-PKLHOQSO.js} +2 -2
  50. package/dist/{chunk-DPJ4T2LQ.js → chunk-QH7RZEHT.js} +2 -2
  51. package/dist/{chunk-S6JWYPVW.js → chunk-QOTR4SGT.js} +2 -2
  52. package/dist/{chunk-52DR23IW.js → chunk-QVGTYLL3.js} +2 -2
  53. package/dist/{chunk-IA23CLGV.js → chunk-R2AZXT3D.js} +2 -2
  54. package/dist/{chunk-YSD4NSCE.js → chunk-RAJNAD64.js} +2 -2
  55. package/dist/{chunk-JA56EQJO.js → chunk-RLRAWZJE.js} +1 -1
  56. package/dist/{chunk-ZKVRGKLM.js → chunk-RRIRY7FP.js} +3 -3
  57. package/dist/{chunk-GCTONBF6.js → chunk-TH2BJPDZ.js} +1 -1
  58. package/dist/{chunk-6ZUJID52.js → chunk-TOQ2LBAN.js} +2 -2
  59. package/dist/{chunk-SMYZILJ6.js → chunk-UFV5QWCL.js} +3 -3
  60. package/dist/{chunk-QDLWTOII.js → chunk-WOBZDEKQ.js} +2 -2
  61. package/dist/{chunk-S5RP5RKY.js → chunk-WOEFYS7Y.js} +16 -1
  62. package/dist/{chunk-W3QOEPUN.js → chunk-WQRBUG65.js} +1 -1
  63. package/dist/{chunk-57UZYV3L.js → chunk-XFOUIAJF.js} +1 -1
  64. package/dist/{chunk-OIWW5TG3.js → chunk-XP3VSSXD.js} +2 -2
  65. package/dist/{chunk-YHO7GNZK.js → chunk-Y2XWK7AA.js} +2 -2
  66. package/dist/{chunk-Q6VTTPG4.js → chunk-YFLL3CME.js} +1 -1
  67. package/dist/{chunk-EN6XTVLZ.js → chunk-YRFCXKJC.js} +2 -2
  68. package/dist/{chunk-DP4Q2HMO.js → chunk-ZEMCCIIO.js} +2 -2
  69. package/dist/{chunk-XJBDESCX.js → chunk-ZNHLH7SC.js} +1 -1
  70. package/dist/{clone-CU6rTzC0.d.ts → clone-BsoRt89i.d.ts} +4 -4
  71. package/dist/comment-2AS6EGH3.js +10 -0
  72. package/dist/{crm-AFJSSPHK.js → crm-VIJIXKFO.js} +4 -4
  73. package/dist/dashboard-BDKJKEGQ.js +10 -0
  74. package/dist/database/index.d.ts +5 -5
  75. package/dist/database/index.js +12 -10
  76. package/dist/database-VJSYCFXH.js +10 -0
  77. package/dist/database-field-JTTDAN4A.js +10 -0
  78. package/dist/database-row-NFINK37Z.js +10 -0
  79. package/dist/database-select-option-TYDAHMXK.js +10 -0
  80. package/dist/database-view-3OHCI5YK.js +10 -0
  81. package/dist/debug-report-JFSUVHHJ.js +10 -0
  82. package/dist/{draft-KGHITKX2.js → draft-T5KDLPC4.js} +2 -2
  83. package/dist/experiment-ZEUCF3B7.js +10 -0
  84. package/dist/{external-item-ZVD33IXV.js → external-item-K7MZNXKZ.js} +4 -4
  85. package/dist/{external-reference-LGFNVEKC.js → external-reference-NWFUYRF3.js} +2 -2
  86. package/dist/feed-WR4A7XUF.js +12 -0
  87. package/dist/{feed-item-QXRIE6FU.js → feed-item-S7XTCRWW.js} +4 -4
  88. package/dist/{folder-NU5TJFOT.js → folder-D4IL7UHP.js} +2 -2
  89. package/dist/{form-types-xc7NdHaW.d.ts → form-types-Dkqm9UO2.d.ts} +18 -3
  90. package/dist/{game-7WW2JX6O.js → game-NEQP7OFX.js} +4 -4
  91. package/dist/{grant-W772T6FE.js → grant-LNTRVBUG.js} +2 -2
  92. package/dist/{grant-expiration-cleaner-B_Q2pncC.d.ts → grant-expiration-cleaner-BwdmRFua.d.ts} +3 -3
  93. package/dist/{import-batch-ZRU4FY6Y.js → import-batch-4AI3Q2HT.js} +4 -4
  94. package/dist/{inbox-state-IO5C7HVE.js → inbox-state-4XQSSHUQ.js} +2 -2
  95. package/dist/index.d.ts +320 -9
  96. package/dist/index.js +1038 -371
  97. package/dist/map-TDNNBSMU.js +10 -0
  98. package/dist/{media-asset-VHFL65HI.js → media-asset-BQOGFRJZ.js} +2 -2
  99. package/dist/{meeting-PVNKBGTI.js → meeting-XQWTQK7J.js} +4 -4
  100. package/dist/{memory-5PD3XCKB.js → memory-PAPUIKWD.js} +2 -2
  101. package/dist/metric-ZZ3C6T2W.js +10 -0
  102. package/dist/{milestone-MZAZCWGR.js → milestone-HACU5NDB.js} +4 -4
  103. package/dist/{moderation-CXQB77CP.js → moderation-HRMMBFVH.js} +2 -2
  104. package/dist/observation-MVIQQNYJ.js +10 -0
  105. package/dist/page-RUS2BKMX.js +10 -0
  106. package/dist/{posting-5VZZMOKS.js → posting-ZQRTWYSE.js} +4 -4
  107. package/dist/{profile-USKJ6PN7.js → profile-5H6XWCK4.js} +2 -2
  108. package/dist/project-PBEJY4LU.js +10 -0
  109. package/dist/{query-ast-Bn3-oRUo.d.ts → query-ast-DYGcKxoa.d.ts} +1 -1
  110. package/dist/reaction-MRZHOGPW.js +10 -0
  111. package/dist/{registry-Wk8Rt0kh.d.ts → registry-D_3b1Lg6.d.ts} +1 -1
  112. package/dist/saved-view-NQ7QS2YM.js +10 -0
  113. package/dist/schema/index.d.ts +144 -13
  114. package/dist/schema/index.js +104 -90
  115. package/dist/{schema-extension-DV5D7JCQ.js → schema-extension-3AYLTMFL.js} +4 -4
  116. package/dist/{space-THD2MWHR.js → space-GBTEHZOK.js} +5 -5
  117. package/dist/{space-membership-M3QFMONE.js → space-membership-PS2O5TEQ.js} +2 -2
  118. package/dist/store/index.d.ts +4 -4
  119. package/dist/store/index.js +6 -4
  120. package/dist/{store-CyGU48TX.d.ts → store-BMnhBWzM.d.ts} +17 -1
  121. package/dist/{system-LFIMY3QQ.js → system-X2F6HN3K.js} +2 -2
  122. package/dist/{tag-W7ZYPXHK.js → tag-LHP2J53R.js} +2 -2
  123. package/dist/{task-DHTPD66H.js → task-YLRF5NBH.js} +4 -4
  124. package/dist/task-view-YUGGCX7N.js +10 -0
  125. package/dist/{transaction-ANNDXCJM.js → transaction-XVDTENOA.js} +4 -4
  126. package/dist/{transcription-DFTQ4FQ4.js → transcription-H5COCUFG.js} +4 -4
  127. package/dist/{types-BFnYlC8Z.d.ts → types-cycApzib.d.ts} +2 -2
  128. package/dist/{user-widget-5IRVORF3.js → user-widget-Q4A2BKRN.js} +2 -2
  129. package/dist/{workspace-RC4V4IF3.js → workspace-CGRCQCJN.js} +2 -2
  130. package/package.json +11 -7
  131. package/dist/canvas-NQBTRNLS.js +0 -10
  132. package/dist/channel-474QAZGP.js +0 -12
  133. package/dist/chat-message-LGLCITLE.js +0 -10
  134. package/dist/comment-IAZJHG6G.js +0 -10
  135. package/dist/dashboard-2DLFZM2J.js +0 -10
  136. package/dist/database-5M7ZA33U.js +0 -10
  137. package/dist/database-field-IFUWOK7X.js +0 -10
  138. package/dist/database-row-C52KCOPB.js +0 -10
  139. package/dist/database-select-option-AEAPKXEE.js +0 -10
  140. package/dist/database-view-NMG3AGXK.js +0 -10
  141. package/dist/debug-report-BTNZAKX3.js +0 -10
  142. package/dist/experiment-JXHENWXV.js +0 -10
  143. package/dist/feed-CLEHVA6Q.js +0 -12
  144. package/dist/map-BZAVGCR6.js +0 -10
  145. package/dist/metric-6IGGFJMB.js +0 -10
  146. package/dist/observation-O3DLKVIH.js +0 -10
  147. package/dist/page-UE5NPYEF.js +0 -10
  148. package/dist/project-UHGGEFLP.js +0 -10
  149. package/dist/reaction-KD3G75UH.js +0 -10
  150. package/dist/saved-view-AZTUINZA.js +0 -10
  151. package/dist/task-view-J2WRE62C.js +0 -10
@@ -1,18 +1,28 @@
1
1
  import {
2
- applyNodeQueryDescriptor,
3
- getNodeQuerySearchTokens,
4
- withoutNodeQueryMaterializedView,
5
- withoutNodeQueryPagination
6
- } from "./chunk-S5RP5RKY.js";
2
+ evaluateLedgerWrite,
3
+ foldAccountRecord,
4
+ ledgerAccountId,
5
+ ledgerWriteKind
6
+ } from "./chunk-3UOUVEZW.js";
7
+ import {
8
+ accountRecordId,
9
+ revocationRecordId
10
+ } from "./chunk-5ECIKN6Z.js";
7
11
  import {
8
12
  SYSTEM_SCHEMA_BASE_IRIS,
9
13
  isSystemNamespaceResource,
10
14
  isSystemSchemaIri
11
- } from "./chunk-XJBDESCX.js";
15
+ } from "./chunk-ZNHLH7SC.js";
16
+ import {
17
+ applyNodeQueryDescriptor,
18
+ getNodeQuerySearchTokens,
19
+ withoutNodeQueryMaterializedView,
20
+ withoutNodeQueryPagination
21
+ } from "./chunk-WOEFYS7Y.js";
12
22
  import {
13
23
  createNodeId,
14
24
  getBaseSchemaIRI
15
- } from "./chunk-RRXJNZX5.js";
25
+ } from "./chunk-NH6OLO3X.js";
16
26
 
17
27
  // src/store/query-ast.ts
18
28
  var QUERY_AST_VERSION = 1;
@@ -2642,6 +2652,53 @@ var NodeStore = class {
2642
2652
  *
2643
2653
  * @throws Error if signature verification fails
2644
2654
  */
2655
+ /**
2656
+ * Account-ledger enforcement for inbound changes (0149/0243, wired by 0337):
2657
+ * hydrate the account's controllers/epoch and the author's revocation status
2658
+ * from local storage, then require the write to pass `evaluateLedgerWrite`.
2659
+ * Mirrors the hub's `enforceLedgerWrite` so a hostile or auth-less hub still
2660
+ * cannot push unauthorized ledger records into a client.
2661
+ */
2662
+ async enforceRemoteLedgerWrite(change) {
2663
+ const schemaId = change.payload.schemaId;
2664
+ const kind = ledgerWriteKind(schemaId);
2665
+ if (!kind) return;
2666
+ const properties = change.payload.properties ?? {};
2667
+ const accountId = ledgerAccountId(kind, properties);
2668
+ let account = null;
2669
+ let authorRevoked = false;
2670
+ if (accountId) {
2671
+ const accountNode = await this.storage.getNode(accountRecordId(accountId));
2672
+ if (accountNode) {
2673
+ account = foldAccountRecord(accountNode.properties);
2674
+ }
2675
+ const revocationNode = await this.storage.getNode(
2676
+ revocationRecordId(accountId, change.authorDID)
2677
+ );
2678
+ authorRevoked = revocationNode !== null && revocationNode !== void 0;
2679
+ }
2680
+ const decision = evaluateLedgerWrite({
2681
+ schemaId,
2682
+ authorDid: change.authorDID,
2683
+ properties,
2684
+ state: { account, authorRevoked }
2685
+ });
2686
+ if (!decision.allowed) {
2687
+ this.telemetry?.reportSecurityEvent("data.ledger_write_rejected", "high");
2688
+ throw new PermissionError({
2689
+ allowed: false,
2690
+ action: "update",
2691
+ subject: change.authorDID,
2692
+ resource: change.payload.nodeId,
2693
+ roles: [],
2694
+ grants: [],
2695
+ reasons: ["DENY_NODE_POLICY"],
2696
+ cached: false,
2697
+ evaluatedAt: Date.now(),
2698
+ duration: 0
2699
+ });
2700
+ }
2701
+ }
2645
2702
  async applyRemoteChange(change) {
2646
2703
  const start = this.telemetry ? Date.now() : 0;
2647
2704
  try {
@@ -2669,6 +2726,7 @@ var NodeStore = class {
2669
2726
  `[NodeStore] Remote change ${change.id} failed verification: ${err instanceof Error ? err.message : String(err)}`
2670
2727
  );
2671
2728
  }
2729
+ await this.enforceRemoteLedgerWrite(change);
2672
2730
  if (this.authEvaluator) {
2673
2731
  const stored = await this.storage.getNode(change.payload.nodeId);
2674
2732
  const action = this.inferActionFromChange(change, stored);
@@ -2749,6 +2807,18 @@ var NodeStore = class {
2749
2807
  async getAllChanges() {
2750
2808
  return this.storage.getAllChanges();
2751
2809
  }
2810
+ /**
2811
+ * Whether a change with this hash is already in the local log. Cheap
2812
+ * existence probe (falls back to a full fetch when the adapter lacks the
2813
+ * optional fast path) — used for idempotent import and bundle
2814
+ * prerequisite checks (exploration 0344).
2815
+ */
2816
+ async hasChange(hash) {
2817
+ if (this.storage.hasChange) {
2818
+ return this.storage.hasChange(hash);
2819
+ }
2820
+ return await this.storage.getChangeByHash(hash) !== null;
2821
+ }
2752
2822
  /**
2753
2823
  * Get changes since a Lamport time (for delta sync).
2754
2824
  */
@@ -4792,7 +4862,22 @@ CREATE INDEX IF NOT EXISTS idx_node_spatial_ids_schema
4792
4862
  return null;
4793
4863
  }
4794
4864
  const value = node.properties[key];
4795
- return typeof value === "number" && Number.isFinite(value) ? value : null;
4865
+ if (typeof value === "number" && Number.isFinite(value)) {
4866
+ return value;
4867
+ }
4868
+ if (value === void 0) {
4869
+ const dot = key.indexOf(".");
4870
+ if (dot > 0) {
4871
+ const parent = node.properties[key.slice(0, dot)];
4872
+ if (typeof parent === "object" && parent !== null && !Array.isArray(parent)) {
4873
+ const sub = parent[key.slice(dot + 1)];
4874
+ if (typeof sub === "number" && Number.isFinite(sub)) {
4875
+ return sub;
4876
+ }
4877
+ }
4878
+ }
4879
+ }
4880
+ return null;
4796
4881
  }
4797
4882
  };
4798
4883
 
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  defineSchema,
6
6
  json,
7
7
  relation,
8
8
  select,
9
9
  text
10
- } from "./chunk-RRXJNZX5.js";
10
+ } from "./chunk-NH6OLO3X.js";
11
11
 
12
12
  // src/schema/schemas/dashboard.ts
13
13
  var DashboardSchema = defineSchema({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  date,
6
6
  defineSchema,
@@ -8,7 +8,7 @@ import {
8
8
  relation,
9
9
  select,
10
10
  text
11
- } from "./chunk-RRXJNZX5.js";
11
+ } from "./chunk-NH6OLO3X.js";
12
12
 
13
13
  // src/schema/schemas/experiment.ts
14
14
  var ExperimentSchema = defineSchema({
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  defineSchema,
6
6
  money,
7
7
  relation,
8
8
  select,
9
9
  text
10
- } from "./chunk-RRXJNZX5.js";
10
+ } from "./chunk-NH6OLO3X.js";
11
11
 
12
12
  // src/schema/schemas/posting.ts
13
13
  var POSTING_SCHEMA_IRI = "xnet://xnet.fyi/Posting@1.0.0";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  created,
6
6
  createdBy,
@@ -11,7 +11,7 @@ import {
11
11
  select,
12
12
  text,
13
13
  url
14
- } from "./chunk-RRXJNZX5.js";
14
+ } from "./chunk-NH6OLO3X.js";
15
15
 
16
16
  // src/schema/schemas/external-item.ts
17
17
  var EXTERNAL_ITEM_SCHEMA_IRI = "xnet://xnet.fyi/ExternalItem@1.0.0";
@@ -6,7 +6,7 @@ import {
6
6
  person,
7
7
  relation,
8
8
  select
9
- } from "./chunk-RRXJNZX5.js";
9
+ } from "./chunk-NH6OLO3X.js";
10
10
 
11
11
  // src/schema/schemas/space-membership.ts
12
12
  var SPACE_MEMBERSHIP_SCHEMA_IRI = "xnet://xnet.fyi/SpaceMembership@1.0.0";
@@ -34,6 +34,13 @@ var SpaceMembershipSchema = defineSchema({
34
34
  addedBy: person({}),
35
35
  /** When the member was added (ms since epoch) */
36
36
  addedAt: number({}),
37
+ /**
38
+ * Optional expiry (ms since epoch) for time-boxed grants — e.g. sharing a
39
+ * diagnostics Space with a support identity (exploration 0341). Absent =
40
+ * permanent. Clients treat an expired membership as revoked and sweep the
41
+ * edge node on sight.
42
+ */
43
+ expiresAt: number({}),
37
44
  createdAt: created(),
38
45
  createdBy: createdBy()
39
46
  },
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  defineSchema,
6
6
  json,
7
7
  relation,
8
8
  select,
9
9
  text
10
- } from "./chunk-RRXJNZX5.js";
10
+ } from "./chunk-NH6OLO3X.js";
11
11
 
12
12
  // src/schema/schemas/map.ts
13
13
  var MapSchema = defineSchema({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  created,
6
6
  createdBy,
@@ -10,7 +10,7 @@ import {
10
10
  relation,
11
11
  select,
12
12
  text
13
- } from "./chunk-RRXJNZX5.js";
13
+ } from "./chunk-NH6OLO3X.js";
14
14
 
15
15
  // src/schema/schemas/debug-report.ts
16
16
  var lanes = [
@@ -41,6 +41,8 @@ var DebugReportSchema = defineSchema({
41
41
  lane: select({ options: lanes, required: true, default: "auto" }),
42
42
  /** Grouping key: hash(errorName + normalized top frame + release). */
43
43
  fingerprint: text({ required: true, maxLength: 64 }),
44
+ /** Cross-release issue identity: the fingerprint minus release (0341). */
45
+ issueKey: text({ maxLength: 64 }),
44
46
  errorName: text({ required: true, maxLength: 120 }),
45
47
  message: text({ maxLength: 500 }),
46
48
  stack: text({ maxLength: 6e3 }),
@@ -55,6 +57,8 @@ var DebugReportSchema = defineSchema({
55
57
  didHash: text({ maxLength: 128 }),
56
58
  occurrences: number({ integer: true }),
57
59
  status: select({ options: statuses, required: true, default: "new" }),
60
+ /** Set when the operator escalated this report to the vendor: the quotable XR-… handle (0341). */
61
+ escalatedId: text({ maxLength: 16 }),
58
62
  firstSeen: number({}),
59
63
  lastSeen: number({}),
60
64
  createdAt: created(),
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spaceContributorAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  checkbox,
6
6
  created,
@@ -13,7 +13,7 @@ import {
13
13
  relation,
14
14
  select,
15
15
  text
16
- } from "./chunk-RRXJNZX5.js";
16
+ } from "./chunk-NH6OLO3X.js";
17
17
  import {
18
18
  allow,
19
19
  role
@@ -7,7 +7,7 @@ import {
7
7
  defineSchema,
8
8
  relation,
9
9
  text
10
- } from "./chunk-RRXJNZX5.js";
10
+ } from "./chunk-NH6OLO3X.js";
11
11
  import {
12
12
  presets
13
13
  } from "./chunk-D4LUUZYD.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  checkbox,
6
6
  defineSchema,
@@ -8,7 +8,7 @@ import {
8
8
  number,
9
9
  relation,
10
10
  text
11
- } from "./chunk-RRXJNZX5.js";
11
+ } from "./chunk-NH6OLO3X.js";
12
12
 
13
13
  // src/schema/schemas/database-field.ts
14
14
  var DatabaseFieldSchema = defineSchema({
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  defineSchema,
6
6
  relation,
7
7
  select,
8
8
  text
9
- } from "./chunk-RRXJNZX5.js";
9
+ } from "./chunk-NH6OLO3X.js";
10
10
 
11
11
  // src/schema/schemas/saved-view.ts
12
12
  var SavedViewSchema = defineSchema({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  defineSchema,
6
6
  file,
@@ -8,7 +8,7 @@ import {
8
8
  relation,
9
9
  select,
10
10
  text
11
- } from "./chunk-RRXJNZX5.js";
11
+ } from "./chunk-NH6OLO3X.js";
12
12
 
13
13
  // src/schema/schemas/database.ts
14
14
  var DatabaseSchema = defineSchema({
@@ -3,7 +3,7 @@ import {
3
3
  json,
4
4
  select,
5
5
  text
6
- } from "./chunk-RRXJNZX5.js";
6
+ } from "./chunk-NH6OLO3X.js";
7
7
  import {
8
8
  presets
9
9
  } from "./chunk-D4LUUZYD.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  defineSchema,
6
6
  money,
7
7
  relation,
8
8
  select,
9
9
  text
10
- } from "./chunk-RRXJNZX5.js";
10
+ } from "./chunk-NH6OLO3X.js";
11
11
 
12
12
  // src/schema/schemas/budget.ts
13
13
  var BUDGET_SCHEMA_IRI = "xnet://xnet.fyi/Budget@1.0.0";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  checkbox,
6
6
  defineSchema,
7
7
  relation,
8
8
  select,
9
9
  text
10
- } from "./chunk-RRXJNZX5.js";
10
+ } from "./chunk-NH6OLO3X.js";
11
11
 
12
12
  // src/schema/schemas/account.ts
13
13
  var ACCOUNT_SCHEMA_IRI = "xnet://xnet.fyi/Account@1.0.0";
@@ -4,7 +4,7 @@ import {
4
4
  number,
5
5
  select,
6
6
  text
7
- } from "./chunk-RRXJNZX5.js";
7
+ } from "./chunk-NH6OLO3X.js";
8
8
  import {
9
9
  presets
10
10
  } from "./chunk-D4LUUZYD.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  date,
6
6
  defineSchema,
@@ -8,7 +8,7 @@ import {
8
8
  relation,
9
9
  select,
10
10
  text
11
- } from "./chunk-RRXJNZX5.js";
11
+ } from "./chunk-NH6OLO3X.js";
12
12
 
13
13
  // src/schema/schemas/import-batch.ts
14
14
  var IMPORT_BATCH_SCHEMA_IRI = "xnet://xnet.fyi/ImportBatch@1.0.0";
@@ -462,6 +462,50 @@ function dateRange(options = {}) {
462
462
  };
463
463
  }
464
464
 
465
+ // src/schema/properties/geo.ts
466
+ function isGeoPoint(value) {
467
+ if (value === null || typeof value !== "object") return false;
468
+ const v = value;
469
+ return typeof v.lat === "number" && Number.isFinite(v.lat) && Math.abs(v.lat) <= 90 && typeof v.lng === "number" && Number.isFinite(v.lng) && Math.abs(v.lng) <= 180;
470
+ }
471
+ function geo(options = {}) {
472
+ return {
473
+ definition: {
474
+ type: "geo",
475
+ required: options.required ?? false
476
+ },
477
+ validate(value) {
478
+ if (value === null || value === void 0) {
479
+ return !options.required;
480
+ }
481
+ return isGeoPoint(value);
482
+ },
483
+ coerce(value) {
484
+ if (value === null || value === void 0) return null;
485
+ if (isGeoPoint(value)) {
486
+ return { lat: value.lat, lng: value.lng };
487
+ }
488
+ if (typeof value === "object") {
489
+ const obj = value;
490
+ const candidate = {
491
+ lat: obj.lat ?? obj.latitude,
492
+ lng: obj.lng ?? obj.lon ?? obj.longitude
493
+ };
494
+ if (isGeoPoint(candidate)) return candidate;
495
+ }
496
+ if (typeof value === "string") {
497
+ const parts = value.split(",").map((s) => Number(s.trim()));
498
+ if (parts.length === 2) {
499
+ const candidate = { lat: parts[0], lng: parts[1] };
500
+ if (isGeoPoint(candidate)) return candidate;
501
+ }
502
+ }
503
+ return null;
504
+ },
505
+ _type: {}
506
+ };
507
+ }
508
+
465
509
  // src/schema/properties/select.ts
466
510
  function select(options) {
467
511
  const validIds = new Set(options.options.map((o) => o.id));
@@ -882,6 +926,8 @@ export {
882
926
  money,
883
927
  date,
884
928
  dateRange,
929
+ isGeoPoint,
930
+ geo,
885
931
  select,
886
932
  multiSelect,
887
933
  person,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  defineSchema,
6
6
  relation,
7
7
  select,
8
8
  text
9
- } from "./chunk-RRXJNZX5.js";
9
+ } from "./chunk-NH6OLO3X.js";
10
10
 
11
11
  // src/schema/schemas/canvas.ts
12
12
  var CanvasSchema = defineSchema({
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  date,
6
6
  defineSchema,
7
7
  relation,
8
8
  select,
9
9
  text
10
- } from "./chunk-RRXJNZX5.js";
10
+ } from "./chunk-NH6OLO3X.js";
11
11
 
12
12
  // src/schema/schemas/transaction.ts
13
13
  var TRANSACTION_SCHEMA_IRI = "xnet://xnet.fyi/Transaction@1.0.0";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  created,
6
6
  createdBy,
@@ -9,7 +9,7 @@ import {
9
9
  relation,
10
10
  text,
11
11
  url
12
- } from "./chunk-RRXJNZX5.js";
12
+ } from "./chunk-NH6OLO3X.js";
13
13
 
14
14
  // src/schema/schemas/feed-item.ts
15
15
  var FEED_ITEM_SCHEMA_IRI = "xnet://xnet.fyi/FeedItem@1.0.0";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  defineSchema,
6
6
  file,
@@ -9,7 +9,7 @@ import {
9
9
  relation,
10
10
  select,
11
11
  text
12
- } from "./chunk-RRXJNZX5.js";
12
+ } from "./chunk-NH6OLO3X.js";
13
13
 
14
14
  // src/schema/schemas/meeting.ts
15
15
  var MEETING_SCHEMA_IRI = "xnet://xnet.fyi/Meeting@1.0.0";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  defineSchema,
6
6
  json,
@@ -8,7 +8,7 @@ import {
8
8
  relation,
9
9
  select,
10
10
  text
11
- } from "./chunk-RRXJNZX5.js";
11
+ } from "./chunk-NH6OLO3X.js";
12
12
 
13
13
  // src/schema/schemas/metric.ts
14
14
  var MetricSchema = defineSchema({
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  date,
6
6
  defineSchema,
7
7
  relation,
8
8
  select,
9
9
  text
10
- } from "./chunk-RRXJNZX5.js";
10
+ } from "./chunk-NH6OLO3X.js";
11
11
 
12
12
  // src/schema/schemas/milestone.ts
13
13
  var MILESTONE_SCHEMA_IRI = "xnet://xnet.fyi/Milestone@1.0.0";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spaceCascadeAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  created,
6
6
  createdBy,
@@ -9,7 +9,7 @@ import {
9
9
  relation,
10
10
  select,
11
11
  text
12
- } from "./chunk-RRXJNZX5.js";
12
+ } from "./chunk-NH6OLO3X.js";
13
13
 
14
14
  // src/schema/schemas/reaction.ts
15
15
  var reactionTypes = [
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SPACE_MEMBERSHIP_SCHEMA_IRI
3
- } from "./chunk-LK5ZIAIE.js";
3
+ } from "./chunk-GSLOK5KV.js";
4
4
  import {
5
5
  allow,
6
6
  role
@@ -4,10 +4,10 @@ import {
4
4
  folderAncestorIds,
5
5
  folderPathIds,
6
6
  wouldCreateFolderCycle
7
- } from "./chunk-C4CQH7UD.js";
7
+ } from "./chunk-IJZ5YPYT.js";
8
8
  import {
9
9
  spaceOwnAuthorization
10
- } from "./chunk-JA56EQJO.js";
10
+ } from "./chunk-RLRAWZJE.js";
11
11
  import {
12
12
  checkbox,
13
13
  created,
@@ -17,7 +17,7 @@ import {
17
17
  relation,
18
18
  select,
19
19
  text
20
- } from "./chunk-RRXJNZX5.js";
20
+ } from "./chunk-NH6OLO3X.js";
21
21
 
22
22
  // src/schema/schemas/space.ts
23
23
  var SPACE_SCHEMA_IRI = "xnet://xnet.fyi/Space@1.0.0";
@@ -3,7 +3,7 @@ import {
3
3
  number,
4
4
  person,
5
5
  text
6
- } from "./chunk-RRXJNZX5.js";
6
+ } from "./chunk-NH6OLO3X.js";
7
7
 
8
8
  // src/schema/schemas/grant.ts
9
9
  var GrantSchema = defineSchema({
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  spaceContributorAuthorization
3
- } from "./chunk-JA56EQJO.js";
3
+ } from "./chunk-RLRAWZJE.js";
4
4
  import {
5
5
  created,
6
6
  createdBy,
@@ -8,7 +8,7 @@ import {
8
8
  json,
9
9
  relation,
10
10
  text
11
- } from "./chunk-RRXJNZX5.js";
11
+ } from "./chunk-NH6OLO3X.js";
12
12
 
13
13
  // src/schema/schemas/checkpoint.ts
14
14
  var CHECKPOINT_SCHEMA_IRI = "xnet://xnet.fyi/Checkpoint@1.0.0";