@wirecat/attio-cli 0.2.1 → 0.2.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 (131) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/contracts/wirecat.json +5 -20
  3. package/dist/bin/attio.js +2 -2
  4. package/dist/bundle/agent-3FYEIRN4.js +37 -0
  5. package/dist/bundle/{all-profiles-LZDKPHN2.js → all-profiles-RAFO3NFW.js} +10 -10
  6. package/dist/bundle/{anthropic-BF72H77D.js → anthropic-TNR6QJGA.js} +5 -5
  7. package/dist/bundle/{app-server-H57FZJX5.js → app-server-BXVGXUGQ.js} +61 -61
  8. package/dist/bundle/attio.js +11 -11
  9. package/dist/bundle/{bun-WO77T4LG.js → bun-3RTK5XYF.js} +2 -2
  10. package/dist/bundle/{bun-sqlite-2BP7JDVO.js → bun-sqlite-I5K5Z2ZK.js} +6 -6
  11. package/dist/bundle/{chunk-CMO5ND3Y.js → chunk-2CS7VHUB.js} +34 -34
  12. package/dist/bundle/{chunk-XXOTX4M3.js → chunk-2JB5XD5R.js} +7 -7
  13. package/dist/bundle/{chunk-EQGXEKSV.js → chunk-2PSAS4TT.js} +7 -7
  14. package/dist/bundle/{chunk-EEPE3SOW.js → chunk-2TLGP7BS.js} +5 -5
  15. package/dist/bundle/{chunk-X5S5KUSU.js → chunk-3BM6KBWP.js} +19 -19
  16. package/dist/bundle/{chunk-QLHDUYGE.js → chunk-3JRLPNPO.js} +1 -1
  17. package/dist/bundle/{chunk-J5P5VSRG.js → chunk-3LMW7U7F.js} +8 -8
  18. package/dist/bundle/{chunk-G6FQMVKW.js → chunk-4F3FQ5QX.js} +3 -3
  19. package/dist/bundle/{chunk-LWJ4ZGUM.js → chunk-53BHLQRA.js} +13 -13
  20. package/dist/bundle/{chunk-EQXT7KO4.js → chunk-62FENOMX.js} +6 -6
  21. package/dist/bundle/{chunk-JSTBW7F4.js → chunk-6HYTDMOL.js} +6 -6
  22. package/dist/bundle/{chunk-L5WS6CYZ.js → chunk-6ZBJCBXA.js} +2 -2
  23. package/dist/bundle/{chunk-Q7BSTQ3T.js → chunk-7626I3P4.js} +1 -1
  24. package/dist/bundle/{chunk-VW5F6FK3.js → chunk-7JVKQ6NM.js} +4 -4
  25. package/dist/bundle/{chunk-PMP37KLR.js → chunk-7QH5BZUG.js} +3 -3
  26. package/dist/bundle/{chunk-ZDBTYBFR.js → chunk-7WS4ONXZ.js} +3 -3
  27. package/dist/bundle/{chunk-MT2ZUZRA.js → chunk-AHPGTDO2.js} +43 -64
  28. package/dist/bundle/{chunk-GBZ6JUXU.js → chunk-AMRELFBT.js} +2 -2
  29. package/dist/bundle/{chunk-S7K2XFQB.js → chunk-APNSAKSO.js} +6 -6
  30. package/dist/bundle/{chunk-DSRXCLPO.js → chunk-AV2ZJ4WX.js} +1 -1
  31. package/dist/bundle/{chunk-2E6JGBM5.js → chunk-AXGSAG53.js} +14 -14
  32. package/dist/bundle/{chunk-I3WS6V5H.js → chunk-B7U5FLPP.js} +8 -8
  33. package/dist/bundle/{chunk-HG7FT3H3.js → chunk-BDFNXTNK.js} +7 -7
  34. package/dist/bundle/{chunk-AMUONYQR.js → chunk-BFWERPF6.js} +2 -2
  35. package/dist/bundle/{chunk-5K3FGXZH.js → chunk-CFQQTDSA.js} +1 -1
  36. package/dist/bundle/{chunk-VDMIJ3JW.js → chunk-CKG7GIHR.js} +3 -3
  37. package/dist/bundle/{chunk-X6R74TWX.js → chunk-CZP6C6MX.js} +4 -4
  38. package/dist/bundle/{chunk-RU5J7DWY.js → chunk-DKSO7UTS.js} +31 -9
  39. package/dist/bundle/{chunk-IDU4ESRZ.js → chunk-EMZ4MGPD.js} +8 -1
  40. package/dist/bundle/{chunk-MNQACPXG.js → chunk-FPMWW2HK.js} +25 -25
  41. package/dist/bundle/{chunk-WK7GLHHL.js → chunk-FRCORPOY.js} +5 -5
  42. package/dist/bundle/{chunk-G3JTLVVL.js → chunk-GT3HXSKW.js} +7 -7
  43. package/dist/bundle/{chunk-BUGROVF3.js → chunk-HM6AMYHR.js} +2 -2
  44. package/dist/bundle/{chunk-3NVOKVRY.js → chunk-HMYJLOXE.js} +343 -274
  45. package/dist/bundle/{chunk-3I2FGNWO.js → chunk-HVXOA4FO.js} +1 -1
  46. package/dist/bundle/{chunk-ASCUOOLO.js → chunk-JFFCP52L.js} +1 -1
  47. package/dist/bundle/{chunk-AFAULIL5.js → chunk-JSAXTIRX.js} +1 -1
  48. package/dist/bundle/{chunk-DF2IIO32.js → chunk-JWRI6ZY6.js} +174 -159
  49. package/dist/bundle/{chunk-4STBJZR4.js → chunk-L7BMGR5W.js} +76 -37
  50. package/dist/bundle/{chunk-XXLQNHKF.js → chunk-LG6Y4NAT.js} +2 -2
  51. package/dist/bundle/{chunk-WARIIYSW.js → chunk-LHKVAZ5T.js} +2 -2
  52. package/dist/bundle/{chunk-GLHFJPYS.js → chunk-LIIOT3AN.js} +3 -3
  53. package/dist/bundle/{chunk-H7QDPW3D.js → chunk-MG4U6AKG.js} +1 -1
  54. package/dist/bundle/{chunk-MC2RQ2OB.js → chunk-MHMHZ6GY.js} +1 -1
  55. package/dist/bundle/{chunk-V6BTAILB.js → chunk-MI6IH5UW.js} +61 -61
  56. package/dist/bundle/{chunk-KHDXRFJZ.js → chunk-MW2OS2GD.js} +8 -8
  57. package/dist/bundle/{chunk-6ALPRBNV.js → chunk-NQJ7QMEF.js} +3 -3
  58. package/dist/bundle/{chunk-OFR3YYT6.js → chunk-NQNFMKL2.js} +1 -1
  59. package/dist/bundle/{chunk-76RRELCU.js → chunk-NWDO4DE3.js} +958 -550
  60. package/dist/bundle/{chunk-7MXCUMHG.js → chunk-O4SX6FXT.js} +1 -1
  61. package/dist/bundle/{chunk-SQHDE3TC.js → chunk-OC35ZLPE.js} +4 -4
  62. package/dist/bundle/{chunk-MRREDVPY.js → chunk-OHCYBSCA.js} +20 -14
  63. package/dist/bundle/{chunk-OBXDRUO4.js → chunk-P76XVKVC.js} +1 -1
  64. package/dist/bundle/{chunk-3YFDZSM3.js → chunk-PRERT2BZ.js} +1 -1
  65. package/dist/bundle/{chunk-MOSH2KPD.js → chunk-Q2U6DGSV.js} +10 -10
  66. package/dist/bundle/{chunk-O4A33Y54.js → chunk-QSUFJGTG.js} +2 -2
  67. package/dist/bundle/{chunk-ERW2WOJT.js → chunk-RKKY3MSZ.js} +1 -1
  68. package/dist/bundle/{chunk-4SMGM2Q6.js → chunk-SEDD6YZQ.js} +4 -4
  69. package/dist/bundle/{chunk-Q3JCUUOR.js → chunk-SYBAMYFY.js} +3 -3
  70. package/dist/bundle/{chunk-ZGADZ4CH.js → chunk-T6DV3ED2.js} +15 -15
  71. package/dist/bundle/{chunk-JA26HG7T.js → chunk-TUOFAUBR.js} +8 -8
  72. package/dist/bundle/{chunk-6SK3YB2B.js → chunk-UTTNGFKW.js} +12 -12
  73. package/dist/bundle/{chunk-CHZ26CW5.js → chunk-UZYL4AMA.js} +61 -58
  74. package/dist/bundle/{chunk-IXCIQ7FZ.js → chunk-V4JWUVNO.js} +4 -4
  75. package/dist/bundle/{chunk-34FJ26K2.js → chunk-VQSVE4RD.js} +2 -2
  76. package/dist/bundle/{chunk-GW4G5KLS.js → chunk-WALQNDXO.js} +8 -8
  77. package/dist/bundle/{chunk-6NDJDDSQ.js → chunk-WHDVRMB7.js} +35 -35
  78. package/dist/bundle/{chunk-ESH2QGCA.js → chunk-XQIRF6PS.js} +24 -8
  79. package/dist/bundle/{chunk-7ZUOI3HY.js → chunk-XSUU7PB7.js} +3 -3
  80. package/dist/bundle/{chunk-DQ6P3R4B.js → chunk-YBJBYPS7.js} +3 -3
  81. package/dist/bundle/{chunk-W6F2CQZ6.js → chunk-Z3HZD24R.js} +17 -17
  82. package/dist/bundle/{chunk-TF7ZGCOK.js → chunk-ZI3IRII7.js} +3 -3
  83. package/dist/bundle/command-contract-N5X3UOTT.js +37 -0
  84. package/dist/bundle/{command-server-entry-MNVPYQZ3.js → command-server-entry-ZKWL26Q5.js} +25 -25
  85. package/dist/bundle/{decode-MQNKNXLK.js → decode-TG45PUJW.js} +5 -5
  86. package/dist/bundle/{dispatch-TAQ7635E.js → dispatch-JQBAZWCL.js} +8 -8
  87. package/dist/bundle/{echarts-6ZSUNO4L.js → echarts-AWICNZBO.js} +2 -2
  88. package/dist/bundle/{embed-PHCCJJ5Z.js → embed-TN6HQUK2.js} +6 -6
  89. package/dist/bundle/{embedder-WLZZQTKZ.js → embedder-T3KJA3I4.js} +9 -9
  90. package/dist/bundle/{failure-MR2XVHFP.js → failure-I6AAF5R5.js} +2 -2
  91. package/dist/bundle/{first-run-64LREHSV.js → first-run-BZUITKMF.js} +12 -12
  92. package/dist/bundle/first-screen-I23NJLFH.js +37 -0
  93. package/dist/bundle/{instructions-22GCKNR5.js → instructions-FRJHLLZX.js} +1 -1
  94. package/dist/bundle/{mcp-CNV7F2XZ.js → mcp-YGOAUNC3.js} +2 -2
  95. package/dist/bundle/meeting-combined-7ZNV4MZ2.js +24 -0
  96. package/dist/bundle/{meeting-model-JWDTCGLZ.js → meeting-model-TENJU3OG.js} +11 -11
  97. package/dist/bundle/{meeting-semantic-375GYPZQ.js → meeting-semantic-ZKOG2XMU.js} +6 -6
  98. package/dist/bundle/{node-ITDTNRRZ.js → node-3ZISJOEM.js} +2 -2
  99. package/dist/bundle/{node-sqlite-IRAGRMEZ.js → node-sqlite-KA35X4F4.js} +7 -7
  100. package/dist/bundle/{oauth-CACOQJEL.js → oauth-C74B6XHN.js} +7 -7
  101. package/dist/bundle/{open-HU4KHKDR.js → open-CJESRWUG.js} +5 -5
  102. package/dist/bundle/{openai-JQUPAVKX.js → openai-WLXOXSTV.js} +15 -15
  103. package/dist/bundle/{process-QS5OHEUK.js → process-JV3KVGJY.js} +1 -1
  104. package/dist/bundle/{program-5OTAVU5S.js → program-HSVLSH7A.js} +694 -477
  105. package/dist/bundle/{prompt-VA5MKXJU.js → prompt-EEBVB3XG.js} +5 -5
  106. package/dist/bundle/{recognize-JGA5IVKC.js → recognize-ZFITQZ4W.js} +4 -4
  107. package/dist/bundle/{remote-NPY2KZQ4.js → remote-RZXSYHOJ.js} +9 -9
  108. package/dist/bundle/{rerank-4H2QR4XU.js → rerank-2BHYAEO3.js} +7 -7
  109. package/dist/bundle/{schemas-THAI3G5S.js → schemas-6GTYA2NR.js} +1 -1
  110. package/dist/bundle/{serve-UH46SZQG.js → serve-G3M5H5JM.js} +9 -9
  111. package/dist/bundle/server-3ZL5TECF.js +79 -0
  112. package/dist/bundle/{server-6H7JS6SU.js → server-44WJ5K2W.js} +53 -53
  113. package/dist/bundle/{sqlite-runtime-EJWEUTBR.js → sqlite-runtime-TRISCWIG.js} +6 -6
  114. package/dist/bundle/{state-34B6AUQZ.js → state-BF6IMDP2.js} +6 -6
  115. package/dist/bundle/{store-XSE35P3U.js → store-LZPZC72J.js} +20 -20
  116. package/dist/bundle/{store-3R4ILTCJ.js → store-VSKYLTLH.js} +22 -18
  117. package/dist/bundle/store-maintenance-command-IDAYDJLQ.js +66 -0
  118. package/dist/bundle/surface-OHYA3YS6.js +65 -0
  119. package/dist/commands/crm.d.ts.map +1 -1
  120. package/dist/commands/crm.js +2 -0
  121. package/dist/commands/crm.js.map +1 -1
  122. package/dist/version.d.ts +1 -1
  123. package/dist/version.js +1 -1
  124. package/package.json +3 -3
  125. package/dist/bundle/agent-DYTWDBTT.js +0 -37
  126. package/dist/bundle/command-contract-7M6EPH3D.js +0 -37
  127. package/dist/bundle/first-screen-YSCAZIYJ.js +0 -37
  128. package/dist/bundle/meeting-combined-YX3T5WJD.js +0 -24
  129. package/dist/bundle/server-SR52KBL3.js +0 -79
  130. package/dist/bundle/store-maintenance-command-ABJARLI4.js +0 -66
  131. package/dist/bundle/surface-NOTIEJB5.js +0 -65
@@ -10,11 +10,11 @@ import {
10
10
  analyzerIdentity,
11
11
  createStemmer,
12
12
  parseStemmers
13
- } from "./chunk-GW4G5KLS.js";
13
+ } from "./chunk-WALQNDXO.js";
14
14
  import {
15
15
  calendarMoment,
16
16
  dayIn
17
- } from "./chunk-Q3JCUUOR.js";
17
+ } from "./chunk-SYBAMYFY.js";
18
18
  import {
19
19
  PRESENCE,
20
20
  QUERY_LIMITS,
@@ -26,12 +26,12 @@ import {
26
26
  plainQuery,
27
27
  searchError,
28
28
  tooWideTerm
29
- } from "./chunk-G3JTLVVL.js";
29
+ } from "./chunk-GT3HXSKW.js";
30
30
  import {
31
31
  NORMALIZER_VERSION,
32
32
  fold,
33
33
  normalize
34
- } from "./chunk-QLHDUYGE.js";
34
+ } from "./chunk-3JRLPNPO.js";
35
35
  import {
36
36
  ACCOUNT_GROUPS,
37
37
  ADDED_ACCOUNT,
@@ -157,14 +157,14 @@ import {
157
157
  usableLinkSql,
158
158
  useStoredProviders,
159
159
  walletLine
160
- } from "./chunk-6NDJDDSQ.js";
160
+ } from "./chunk-WHDVRMB7.js";
161
161
  import {
162
162
  sqliteCode
163
- } from "./chunk-GLHFJPYS.js";
163
+ } from "./chunk-LIIOT3AN.js";
164
164
  import {
165
165
  normalizeTag,
166
166
  tagOf
167
- } from "./chunk-O4A33Y54.js";
167
+ } from "./chunk-QSUFJGTG.js";
168
168
  import {
169
169
  CHAT_MESSAGES_READ,
170
170
  FACT_TYPES,
@@ -220,27 +220,27 @@ import {
220
220
  validateQuery,
221
221
  walkQuery,
222
222
  zonedMoment
223
- } from "./chunk-V6BTAILB.js";
223
+ } from "./chunk-MI6IH5UW.js";
224
224
  import {
225
225
  DEFAULT_TASK_CATEGORIES,
226
226
  sharedConfigPath,
227
227
  storedTaskCategories,
228
228
  taskCategoriesReader
229
- } from "./chunk-EQGXEKSV.js";
229
+ } from "./chunk-2PSAS4TT.js";
230
230
  import {
231
231
  refuseOwnerStoreInTests,
232
232
  storePath
233
- } from "./chunk-34FJ26K2.js";
233
+ } from "./chunk-VQSVE4RD.js";
234
234
  import {
235
235
  quietSqliteWarning,
236
236
  storeCapable
237
- } from "./chunk-S7K2XFQB.js";
237
+ } from "./chunk-APNSAKSO.js";
238
238
  import {
239
239
  PRAGMAS,
240
240
  TIME_LIMIT_FUNCTION,
241
241
  TimeLimitReached,
242
242
  isQueryOnly
243
- } from "./chunk-MC2RQ2OB.js";
243
+ } from "./chunk-MHMHZ6GY.js";
244
244
  import {
245
245
  array,
246
246
  boolean,
@@ -266,7 +266,7 @@ import {
266
266
  CliError,
267
267
  isCliError,
268
268
  singleLine
269
- } from "./chunk-BUGROVF3.js";
269
+ } from "./chunk-HM6AMYHR.js";
270
270
  import {
271
271
  SQLiteTable,
272
272
  TableAliasProxyHandler,
@@ -291,7 +291,7 @@ import {
291
291
  sql,
292
292
  sqliteTable,
293
293
  text
294
- } from "./chunk-OFR3YYT6.js";
294
+ } from "./chunk-NQNFMKL2.js";
295
295
  import {
296
296
  __commonJS,
297
297
  __name,
@@ -10035,7 +10035,7 @@ var require_cjs = __commonJS({
10035
10035
  }
10036
10036
  });
10037
10037
 
10038
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/account-store.js
10038
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/account-store.js
10039
10039
  var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
10040
10040
  const methods = whole;
10041
10041
  return Object.fromEntries(Object.keys(keyed).map((name) => [
@@ -10163,7 +10163,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
10163
10163
  };
10164
10164
  }, "bindAccount");
10165
10165
 
10166
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
10166
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
10167
10167
  var IndexBuilderOn = class {
10168
10168
  static {
10169
10169
  __name(this, "IndexBuilderOn");
@@ -10358,7 +10358,7 @@ function alias(table, alias2) {
10358
10358
  }
10359
10359
  __name(alias, "alias");
10360
10360
 
10361
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/record-fields.js
10361
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/record-fields.js
10362
10362
  var DECIMAL_PATTERN = "^[0-9]{1,16}(\\.[0-9]{1,6})?$";
10363
10363
  var SIGNED_DECIMAL = "^-?[0-9]{1,16}(\\.[0-9]{1,6})?$";
10364
10364
  var DAY = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$";
@@ -10408,7 +10408,7 @@ var arrayOf = /* @__PURE__ */ __name((item, maxItems, description) => ({
10408
10408
  }), "arrayOf");
10409
10409
  var isObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isObject");
10410
10410
 
10411
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/record-types.js
10411
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/record-types.js
10412
10412
  var kept = /* @__PURE__ */ __name((description) => ({ description }), "kept");
10413
10413
  var PARTY = ["person", "organization"];
10414
10414
  var ORGANIZATION = ["organization"];
@@ -10803,7 +10803,7 @@ var hasV1Roles = /* @__PURE__ */ __name((type) => rolesOf2(type).some(([, role])
10803
10803
  var IDENTITY_TYPES = RECORD_ENTITY_TYPES.filter((type) => RECORD_TYPES[type].review === "identity");
10804
10804
  var article = /* @__PURE__ */ __name((word2) => /^[aeiou]/.test(word2) ? "an" : "a", "article");
10805
10805
 
10806
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
10806
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
10807
10807
  var ENTITY_TABLES = {
10808
10808
  ...RECORD_TABLES,
10809
10809
  account: "accounts",
@@ -10830,6 +10830,7 @@ var ENTITY_TABLES = {
10830
10830
  message: "messages",
10831
10831
  note: "notes",
10832
10832
  place: "places",
10833
+ post: "content_posts",
10833
10834
  tag: "canonical_tags",
10834
10835
  task: "tasks"
10835
10836
  };
@@ -10842,7 +10843,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
10842
10843
  return { table, pointer, type, count: count2, known: known2 };
10843
10844
  }).filter(({ count: count2 }) => count2 > 0)), "orphanPointers");
10844
10845
 
10845
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/identity-links.js
10846
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/identity-links.js
10846
10847
  var IDENTITY_LINK_KIND = "identity_link";
10847
10848
  var IDENTITY_LINK_SIGNALS = ["agent", "phone", "email", "guest-email", "name", "account"];
10848
10849
  var LINK_WEAKNESSES = [
@@ -10855,7 +10856,7 @@ var LINK_WEAKNESSES = [
10855
10856
  "not-own-number"
10856
10857
  ];
10857
10858
 
10858
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/merged-persons.js
10859
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/merged-persons.js
10859
10860
  var SEPARATIONS = ["unlink", "split", "undo-merge"];
10860
10861
  var mergeSql = /* @__PURE__ */ __name((event2) => `(${event2}.from_person_id IS NOT NULL AND ${event2}.from_person_id <> ${event2}.to_person_id AND ${event2}.method NOT IN (${SEPARATIONS.map((method) => `'${method}'`).join(", ")}) AND NOT EXISTS (SELECT 1 FROM identity_link_events stay WHERE stay.to_person_id = ${event2}.from_person_id AND stay.identity_id <> ${event2}.identity_id AND stay.id < ${event2}.id AND stay.id = (SELECT max(s.id) FROM identity_link_events s WHERE s.identity_id = stay.identity_id AND s.id < ${event2}.id) AND NOT EXISTS (SELECT 1 FROM identity_link_events went WHERE went.identity_id = stay.identity_id AND went.from_person_id = ${event2}.from_person_id AND went.to_person_id = ${event2}.to_person_id AND went.id = (SELECT min(w.id) FROM identity_link_events w WHERE w.identity_id = stay.identity_id AND w.id > ${event2}.id))))`, "mergeSql");
10861
10862
  var mergedAwaySql = /* @__PURE__ */ __name((person2) => `(${person2}.owner = 0 AND NOT EXISTS (SELECT 1 FROM identity_links ml WHERE ml.person_id = ${person2}.id) AND EXISTS (SELECT 1 FROM identity_link_events me WHERE me.from_person_id = ${person2}.id AND ${mergeSql("me")}))`, "mergedAwaySql");
@@ -10887,7 +10888,7 @@ var samePersons = /* @__PURE__ */ __name((database, pk) => {
10887
10888
  }, "samePersons");
10888
10889
  var idsOf = /* @__PURE__ */ __name((database, type, id2) => JSON.stringify(type === "person" ? samePersons(database, id2) : [id2]), "idsOf");
10889
10890
 
10890
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-link-rows.js
10891
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-link-rows.js
10891
10892
  var pairOf = /* @__PURE__ */ __name((a, b) => [Number(a), Number(b)].sort((x, y) => x - y).join("-"), "pairOf");
10892
10893
  var pkOf = /* @__PURE__ */ __name((database, ref3) => {
10893
10894
  const at2 = ref3.indexOf(":");
@@ -10994,13 +10995,13 @@ var forgetErasedLinks = /* @__PURE__ */ __name((database) => {
10994
10995
  database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
10995
10996
  }, "forgetErasedLinks");
10996
10997
 
10997
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/identity-splits.js
10998
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/identity-splits.js
10998
10999
  var IDENTITY_SPLIT_KIND = "identity_split";
10999
11000
 
11000
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
11001
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
11001
11002
  var MAIL_FINDINGS_KIND = "mail_findings";
11002
11003
 
11003
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/decisions.js
11004
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/decisions.js
11004
11005
  var TASK_CLOSE_KIND = "task_close";
11005
11006
  var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
11006
11007
  var isOwnerOnlyKind = /* @__PURE__ */ __name((kind3) => kind3 === MAIL_FINDINGS_KIND || kind3 === MEETING_FINDINGS_KIND || kind3 === TASK_CLOSE_KIND || kind3 === SOURCE_REVIEW_KIND || kind3 === IDENTITY_LINK_KIND || kind3 === IDENTITY_SPLIT_KIND, "isOwnerOnlyKind");
@@ -11048,7 +11049,7 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
11048
11049
  }, "assertMayDecide");
11049
11050
  var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
11050
11051
 
11051
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/addresses.js
11052
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/addresses.js
11052
11053
  var EMAIL_ADDRESS = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
11053
11054
  var isEmailAddress = /* @__PURE__ */ __name((value) => EMAIL_ADDRESS.test(value), "isEmailAddress");
11054
11055
  var ROLE_ADDRESS_WORDS = {
@@ -11110,7 +11111,7 @@ var PERSON_LIKE = /* @__PURE__ */ new Set(["hr"]);
11110
11111
  var isPersonLikeRoleAddress = /* @__PURE__ */ __name((address) => PERSON_LIKE.has(localWord(address)), "isPersonLikeRoleAddress");
11111
11112
  var isNoReplyAddress = /* @__PURE__ */ __name((address) => NO_REPLY.has(localWord(address)), "isNoReplyAddress");
11112
11113
 
11113
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/mail/score.js
11114
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/mail/score.js
11114
11115
  var import_disposable_email_domains_js = __toESM(require_dist(), 1);
11115
11116
  var import_tldts = __toESM(require_cjs(), 1);
11116
11117
  var FREE_MAIL = /* @__PURE__ */ new Set([
@@ -11140,7 +11141,7 @@ var FREE_MAIL = /* @__PURE__ */ new Set([
11140
11141
  ]);
11141
11142
  var DAY_MS = 24 * 60 * 60 * 1e3;
11142
11143
 
11143
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/address-organization.js
11144
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/address-organization.js
11144
11145
  var BY_ADDRESS = "SELECT DISTINCT o.id FROM organizations o JOIN organization_identities oi ON oi.organization_id = o.id JOIN identities i ON i.id = oi.identity_id WHERE o.deleted_at IS NULL AND i.provider = 'email' AND ";
11145
11146
  var idsOf2 = /* @__PURE__ */ __name((rows) => rows.map((row2) => Number(row2.id)), "idsOf");
11146
11147
  var holdAddress = /* @__PURE__ */ __name(({ database, now: now2 }, organization2, email, { method, author }) => {
@@ -11165,7 +11166,7 @@ var organizationOfAddress = /* @__PURE__ */ __name((context, { name, email, meth
11165
11166
  return id2;
11166
11167
  }, "organizationOfAddress");
11167
11168
 
11168
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
11169
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
11169
11170
  var PHONE_PLANS = [
11170
11171
  {
11171
11172
  country: "us",
@@ -11545,7 +11546,7 @@ var PHONE_PLANS = [
11545
11546
  }
11546
11547
  ];
11547
11548
 
11548
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/phones.js
11549
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/phones.js
11549
11550
  var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
11550
11551
  var DEFAULT_PHONE_COUNTRIES = ["ru"];
11551
11552
  var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
@@ -11620,10 +11621,10 @@ var storedPhone = /* @__PURE__ */ __name((raw, provider) => {
11620
11621
  return found2 ? `+${found2[1]}` : void 0;
11621
11622
  }, "storedPhone");
11622
11623
 
11623
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
11624
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
11624
11625
  import { AsyncLocalStorage } from "node:async_hooks";
11625
11626
 
11626
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/journal.js
11627
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/journal.js
11627
11628
  import { existsSync, statSync } from "node:fs";
11628
11629
  var watched = /* @__PURE__ */ new WeakMap();
11629
11630
  var walInode = /* @__PURE__ */ __name((store) => statSync(`${store}-wal`, { throwIfNoEntry: false })?.ino, "walInode");
@@ -11649,7 +11650,7 @@ var checkJournal = /* @__PURE__ */ __name((database) => {
11649
11650
  throw new CliError("conflict", "the store's journal file was deleted or replaced by another program while this command had the store open, so nothing more is written; `store recover` says what to do", { reason: "store.journal-replaced" });
11650
11651
  }, "checkJournal");
11651
11652
 
11652
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/write-events.js
11653
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/write-events.js
11653
11654
  var WRITE = /^\s*(?:WITH\b[\s\S]*?\)\s*)?(INSERT|REPLACE|UPDATE|DELETE)\b(?:\s+OR\s+[A-Za-z]+)?\s+(?:INTO\s+|FROM\s+)?(?:("?)(\w+)\2\.)?["`[]?(\w+)/i;
11654
11655
  var writeTarget = /* @__PURE__ */ __name((sql2) => {
11655
11656
  const match = WRITE.exec(sql2);
@@ -11729,7 +11730,7 @@ var committedWrites = /* @__PURE__ */ __name((database) => {
11729
11730
  }, "committedWrites");
11730
11731
  var droppedWrites = /* @__PURE__ */ __name((database) => tallies.get(database)?.pending.clear(), "droppedWrites");
11731
11732
 
11732
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
11733
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
11733
11734
  var ARMS = [
11734
11735
  [
11735
11736
  "message",
@@ -11857,7 +11858,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
11857
11858
  return recomputed;
11858
11859
  }, "drainInvolvementQueue");
11859
11860
 
11860
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/mentions.js
11861
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/mentions.js
11861
11862
  import { domainToUnicode } from "node:url";
11862
11863
 
11863
11864
  // node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
@@ -21879,7 +21880,7 @@ var oa = /* @__PURE__ */ __name((e) => {
21879
21880
  }, "oa");
21880
21881
  var na = { parse: O, get: aa, isValid: oa };
21881
21882
 
21882
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
21883
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
21883
21884
  var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
21884
21885
  var ID = /^[\w-]{10,}$/;
21885
21886
  var trimUrl = /* @__PURE__ */ __name((url) => {
@@ -21921,7 +21922,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text9) => [...text9.matchAll(L
21921
21922
  return { url, documentId: googleDocumentId(url) };
21922
21923
  }), "googleDocumentLinks");
21923
21924
 
21924
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/places.js
21925
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/places.js
21925
21926
  var BEFORE = [
21926
21927
  [/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
21927
21928
  [/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
@@ -22181,7 +22182,7 @@ var findPlaces = /* @__PURE__ */ __name((text9) => {
22181
22182
  return found2.sort((a, b) => a.start - b.start);
22182
22183
  }, "findPlaces");
22183
22184
 
22184
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/mentions.js
22185
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/mentions.js
22185
22186
  var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
22186
22187
  var MENTION_VERSIONS = {
22187
22188
  phone: 1,
@@ -22357,7 +22358,7 @@ var exactlyOne = /* @__PURE__ */ __name((text9, options) => {
22357
22358
  return one2 && one2.start === 0 && one2.end === text9.length ? one2.value : void 0;
22358
22359
  }, "exactlyOne");
22359
22360
 
22360
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/first-names.js
22361
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/first-names.js
22361
22362
  var RUSSIAN = "\u0410\u043B\u0435\u043A\u0441\u0430\u043D\u0434\u0440 \u0410\u043B\u0435\u043A\u0441\u0435\u0439 \u0410\u043D\u0430\u0442\u043E\u043B\u0438\u0439 \u0410\u043D\u0434\u0440\u0435\u0439 \u0410\u043D\u0442\u043E\u043D \u0410\u0440\u043A\u0430\u0434\u0438\u0439 \u0410\u0440\u0441\u0435\u043D\u0438\u0439 \u0410\u0440\u0442\u0451\u043C \u0410\u0440\u0442\u0435\u043C \u0410\u0440\u0442\u0443\u0440 \u0411\u043E\u0440\u0438\u0441 \u0412\u0430\u0434\u0438\u043C \u0412\u0430\u043B\u0435\u043D\u0442\u0438\u043D \u0412\u0430\u043B\u0435\u0440\u0438\u0439 \u0412\u0430\u0441\u0438\u043B\u0438\u0439 \u0412\u0438\u043A\u0442\u043E\u0440 \u0412\u0438\u0442\u0430\u043B\u0438\u0439 \u0412\u043B\u0430\u0434\u0438\u043C\u0438\u0440 \u0412\u043B\u0430\u0434\u0438\u0441\u043B\u0430\u0432 \u0412\u0441\u0435\u0432\u043E\u043B\u043E\u0434 \u0412\u044F\u0447\u0435\u0441\u043B\u0430\u0432 \u0413\u0435\u043D\u043D\u0430\u0434\u0438\u0439 \u0413\u0435\u043E\u0440\u0433\u0438\u0439 \u0413\u043B\u0435\u0431 \u0413\u0440\u0438\u0433\u043E\u0440\u0438\u0439 \u0414\u0430\u043D\u0438\u0438\u043B \u0414\u0430\u043D\u0438\u043B\u0430 \u0414\u0435\u043D\u0438\u0441 \u0414\u043C\u0438\u0442\u0440\u0438\u0439 \u0415\u0432\u0433\u0435\u043D\u0438\u0439 \u0415\u0433\u043E\u0440 \u0418\u0432\u0430\u043D \u0418\u0433\u043E\u0440\u044C \u0418\u043B\u044C\u044F \u041A\u0438\u0440\u0438\u043B\u043B \u041A\u043E\u043D\u0441\u0442\u0430\u043D\u0442\u0438\u043D \u041B\u0435\u043E\u043D\u0438\u0434 \u041C\u0430\u043A\u0441\u0438\u043C \u041C\u0430\u0440\u0430\u0442 \u041C\u0430\u0442\u0432\u0435\u0439 \u041C\u0438\u0445\u0430\u0438\u043B \u041D\u0438\u043A\u0438\u0442\u0430 \u041D\u0438\u043A\u043E\u043B\u0430\u0439 \u041E\u043B\u0435\u0433 \u041F\u0430\u0432\u0435\u043B \u041F\u0451\u0442\u0440 \u041F\u0435\u0442\u0440 \u0420\u043E\u0434\u0438\u043E\u043D \u0420\u043E\u0441\u0442\u0438\u0441\u043B\u0430\u0432 \u0420\u0443\u0441\u043B\u0430\u043D \u0420\u0443\u0441\u0442\u0430\u043C \u0421\u0435\u043C\u0451\u043D \u0421\u0435\u043C\u0435\u043D \u0421\u0435\u0440\u0433\u0435\u0439 \u0421\u0442\u0430\u043D\u0438\u0441\u043B\u0430\u0432 \u0421\u0442\u0435\u043F\u0430\u043D \u0422\u0438\u043C\u043E\u0444\u0435\u0439 \u0422\u0438\u043C\u0443\u0440 \u0424\u0451\u0434\u043E\u0440 \u0424\u0435\u0434\u043E\u0440 \u0424\u0438\u043B\u0438\u043F\u043F \u042D\u0434\u0443\u0430\u0440\u0434 \u042E\u0440\u0438\u0439 \u042F\u0440\u043E\u0441\u043B\u0430\u0432 \u042F\u043A\u043E\u0432 \u042D\u043B\u044C\u0434\u0430\u0440 \u0414\u0430\u0432\u0438\u0434 \u0417\u0430\u0445\u0430\u0440 \u0421\u0430\u0432\u0435\u043B\u0438\u0439 \u041C\u0438\u0440\u043E\u043D \u041F\u043B\u0430\u0442\u043E\u043D \u0414\u0435\u043C\u0438\u0434 \u0410\u0440\u0441\u0435\u043D \u041D\u0443\u0440\u043B\u0430\u043D \u0410\u043D\u0437\u043E\u0440 \u0410\u043B\u0435\u043A\u0441\u0430\u043D\u0434\u0440\u0430 \u0410\u043B\u0438\u043D\u0430 \u0410\u043B\u0438\u0441\u0430 \u0410\u043B\u043B\u0430 \u0410\u043D\u0430\u0441\u0442\u0430\u0441\u0438\u044F \u0410\u043D\u0433\u0435\u043B\u0438\u043D\u0430 \u0410\u043D\u043D\u0430 \u0410\u043D\u0442\u043E\u043D\u0438\u043D\u0430 \u0412\u0430\u043B\u0435\u043D\u0442\u0438\u043D\u0430 \u0412\u0430\u043B\u0435\u0440\u0438\u044F \u0412\u0430\u0440\u0432\u0430\u0440\u0430 \u0412\u0435\u0440\u043E\u043D\u0438\u043A\u0430 \u0412\u0438\u043A\u0442\u043E\u0440\u0438\u044F \u0413\u0430\u043B\u0438\u043D\u0430 \u0414\u0430\u0440\u044C\u044F \u0414\u0438\u0430\u043D\u0430 \u0415\u0432\u0433\u0435\u043D\u0438\u044F \u0415\u043A\u0430\u0442\u0435\u0440\u0438\u043D\u0430 \u0415\u043B\u0435\u043D\u0430 \u0415\u043B\u0438\u0437\u0430\u0432\u0435\u0442\u0430 \u0416\u0430\u043D\u043D\u0430 \u0417\u0438\u043D\u0430\u0438\u0434\u0430 \u041A\u0430\u0440\u0438\u043D\u0430 \u041A\u0438\u0440\u0430 \u041A\u043B\u0430\u0432\u0434\u0438\u044F \u041A\u0440\u0438\u0441\u0442\u0438\u043D\u0430 \u041A\u0441\u0435\u043D\u0438\u044F \u041B\u0430\u0440\u0438\u0441\u0430 \u041B\u0438\u0434\u0438\u044F \u041B\u044E\u0434\u043C\u0438\u043B\u0430 \u041C\u0430\u0440\u0433\u0430\u0440\u0438\u0442\u0430 \u041C\u0430\u0440\u0438\u043D\u0430 \u041C\u0430\u0440\u0438\u044F \u041C\u0438\u043B\u0430\u043D\u0430 \u041D\u0430\u0442\u0430\u043B\u044C\u044F \u041D\u0430\u0442\u0430\u043B\u0438\u044F \u041D\u0438\u043D\u0430 \u041E\u043A\u0441\u0430\u043D\u0430 \u041E\u043B\u0435\u0441\u044F \u041E\u043B\u044C\u0433\u0430 \u041F\u043E\u043B\u0438\u043D\u0430 \u0420\u0430\u0438\u0441\u0430 \u0421\u0432\u0435\u0442\u043B\u0430\u043D\u0430 \u0421\u043E\u0444\u0438\u044F \u0421\u043E\u0444\u044C\u044F \u0422\u0430\u0438\u0441\u0438\u044F \u0422\u0430\u043C\u0430\u0440\u0430 \u0422\u0430\u0442\u044C\u044F\u043D\u0430 \u0423\u043B\u044C\u044F\u043D\u0430 \u042E\u043B\u0438\u044F \u042D\u043B\u044C\u0432\u0438\u0440\u0430 \u0420\u0435\u0433\u0438\u043D\u0430 \u0421\u043D\u0435\u0436\u0430\u043D\u0430 \u0410\u043B\u0451\u043D\u0430 \u0410\u043B\u0435\u043D\u0430 \u0412\u0430\u0441\u0438\u043B\u0438\u0441\u0430 \u0410\u0440\u0438\u043D\u0430 \u0415\u0441\u0435\u043D\u0438\u044F \u042D\u0432\u0435\u043B\u0438\u043D\u0430 \u0421\u0430\u0448\u0430 \u0416\u0435\u043D\u044F \u0412\u0430\u043B\u044F \u0414\u0438\u043C\u0430 \u041C\u0438\u0448\u0430 \u041A\u043E\u043B\u044F \u041F\u0435\u0442\u044F \u0412\u0430\u0441\u044F \u0421\u0435\u0440\u0451\u0436\u0430 \u0421\u0435\u0440\u0435\u0436\u0430 \u041F\u0430\u0448\u0430 \u041B\u0451\u0448\u0430 \u041B\u0435\u0448\u0430 \u0412\u0438\u0442\u044F \u041A\u043E\u0441\u0442\u044F \u0412\u043E\u0432\u0430 \u0412\u043E\u043B\u043E\u0434\u044F \u0412\u0430\u043D\u044F \u0413\u043E\u0448\u0430 \u0413\u0440\u0438\u0448\u0430 \u0422\u043E\u043B\u044F \u0411\u043E\u0440\u044F \u0421\u0442\u0430\u0441 \u0422\u0451\u043C\u0430 \u0422\u0430\u043D\u044F \u041A\u0430\u0442\u044F \u041B\u0435\u043D\u0430 \u041D\u0430\u0442\u0430\u0448\u0430 \u0421\u0432\u0435\u0442\u0430 \u042E\u043B\u044F \u041D\u0430\u0441\u0442\u044F \u0414\u0430\u0448\u0430 \u041C\u0430\u0448\u0430 \u041B\u044E\u0434\u0430 \u0413\u0430\u043B\u044F \u0412\u0438\u043A\u0430 \u041A\u0441\u044E\u0448\u0430 \u041B\u0438\u0437\u0430 \u0421\u043E\u043D\u044F \u041D\u0430\u0434\u044F \u041B\u0435\u0440\u0430 \u0410\u043B\u0451\u0448\u0430 \u0410\u043B\u0435\u0448\u0430 \u041C\u0438\u0442\u044F \u0421\u0435\u043D\u044F \u0424\u0435\u0434\u044F \u0416\u0435\u043D\u0435\u0447\u043A\u0430 \u041E\u043B\u0435\u043D\u044C\u043A\u0430 \u0422\u0430\u043D\u0435\u0447\u043A\u0430";
22362
22363
  var EUROPEAN = "James John Robert Michael William David Richard Joseph Thomas Charles Christopher Daniel Matthew Anthony Donald Steven Paul Andrew Joshua Kenneth Kevin Brian George Timothy Ronald Edward Jason Jeffrey Ryan Jacob Gary Nicholas Eric Jonathan Stephen Larry Justin Scott Brandon Benjamin Samuel Gregory Alexander Patrick Raymond Dennis Jerry Tyler Aaron Nathan Henry Peter Zachary Douglas Harold Kyle Noah Ethan Oliver Harry Lucas Liam Mary Patricia Jennifer Linda Elizabeth Barbara Susan Jessica Sarah Karen Lisa Nancy Betty Margaret Sandra Ashley Kimberly Emily Donna Michelle Carol Amanda Dorothy Melissa Deborah Stephanie Rebecca Sharon Laura Cynthia Kathleen Angela Shirley Anna Brenda Pamela Emma Nicole Helen Samantha Katherine Christine Rachel Carolyn Janet Catherine Maria Heather Diane Ruth Julie Olivia Joyce Kelly Lauren Christina Joan Evelyn Judith Megan Andrea Cheryl Hannah Jacqueline Martha Teresa Sara Madison Frances Kathryn Janice Abigail Alice Julia Judy Sophia Denise Doris Marilyn Danielle Beverly Isabella Theresa Diana Natalie Charlotte Marie Kayla Alexis Javier Carlos Antonio Manuel Francisco Juan Pedro Alejandro Miguel Rafael Pablo Sergio Fernando Jorge Luis Alberto \xC1lvaro Diego Adri\xE1n Rub\xE9n Iv\xE1n \xD3scar Andr\xE9s Ra\xFAl Enrique Vicente Joaqu\xEDn Ignacio Gonzalo Marcos V\xEDctor Jaime Alfonso Guillermo Tom\xE1s Emilio Gabriel Nicol\xE1s Mart\xEDn Jordi Josep Xavier Luc\xEDa Carmen Isabel Cristina Marta Elena Raquel Silvia Beatriz Paula Nuria N\xFAria Sonia Alicia Irene Montserrat Inmaculada Noelia Lorena Sof\xEDa Valeria Claudia Natalia Sandra Ver\xF3nica Esther Yolanda Vanesa Laia Klaus J\xFCrgen Wolfgang Stefan Andreas Matthias Markus Tobias Florian Lukas Jonas Maximilian Sebastian Dirk Sabine Ursula Petra Monika Katrin Anja Pierre Michel Philippe Alain Fran\xE7ois Christophe Laurent Olivier Julien Mathieu S\xE9bastien Guillaume Antoine Camille Nathalie Isabelle Sylvie Sophie C\xE9line Aur\xE9lie Chlo\xE9 Manon Giuseppe Giovanni Marco Luca Francesco Alessandro Matteo Lorenzo Stefano Paolo Roberto Davide Simone Federico Giulia Francesca Chiara Valentina Alessia Martina Elisa Jo\xE3o Pedro Tiago Beatriz In\xEAs Mariana Piotr Krzysztof Tomasz Marcin Agnieszka Katarzyna Ma\u0142gorzata Magdalena";
22363
22364
  var WORDS = "\u0412\u0435\u0440\u0430 \u041D\u0430\u0434\u0435\u0436\u0434\u0430 \u041B\u044E\u0431\u043E\u0432\u044C \u0421\u043B\u0430\u0432\u0430 \u0420\u043E\u043C\u0430\u043D \u0420\u043E\u0437\u0430 \u041C\u0430\u0439\u044F \u041B\u0438\u043B\u0438\u044F \u0417\u043B\u0430\u0442\u0430 \u041C\u0438\u043B\u0430 \u041D\u0438\u043A\u0430 \u041B\u0435\u0432 \u0413\u043B\u043E\u0440\u0438\u044F Will Mark Rose Grace Hope Faith Bill Frank Jack June April Summer Amber Ruby Lily Daisy Victoria Virginia Georgia Florence Sydney Chelsea Jordan Austin Dallas Mercedes Dolores Rosa Pilar Marina Esperanza Gloria Amparo Consuelo Roc\xEDo Salvador Santiago Jes\xFAs \xC1ngeles Hugo Ram\xF3n Christian Felix F\xE9lix Mario Martin Victor Pierre Paz Merc\xE8 Estrella Aurora Concepci\xF3n Remedios Soledad Milagros Angel \xC1ngel Dawn Joy Holly Ivy Iris Violet Pearl";
@@ -22365,7 +22366,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
22365
22366
  var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
22366
22367
  var NAME_WORDS = WORDS.split(" ");
22367
22368
 
22368
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/person-names.js
22369
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/person-names.js
22369
22370
  var LATIN_TO_CYRILLIC = {
22370
22371
  shch: "\u0449",
22371
22372
  sch: "\u0449",
@@ -22573,7 +22574,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text9, stem, taken) => {
22573
22574
  return found2;
22574
22575
  }, "findUnknownNames");
22575
22576
 
22576
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/attachments.js
22577
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/attachments.js
22577
22578
  var NOT_FILES = /* @__PURE__ */ new Set([
22578
22579
  "webpage",
22579
22580
  "share",
@@ -22614,7 +22615,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored4, files2) => {
22614
22615
  });
22615
22616
  }, "matchDownloads");
22616
22617
 
22617
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
22618
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
22618
22619
  var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
22619
22620
  var literal2 = /* @__PURE__ */ __name((c) => ({
22620
22621
  kind: "char",
@@ -23014,7 +23015,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
23014
23015
  return out;
23015
23016
  }, "foldRegex");
23016
23017
 
23017
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
23018
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
23018
23019
  var PRESET_VERSION = 1;
23019
23020
  var PRESETS = {
23020
23021
  password: {
@@ -23068,12 +23069,12 @@ var PRESETS = {
23068
23069
  }
23069
23070
  };
23070
23071
 
23071
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
23072
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
23072
23073
  var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
23073
23074
  var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
23074
23075
  var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
23075
23076
 
23076
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
23077
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
23077
23078
  var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
23078
23079
  var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
23079
23080
  var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
@@ -23097,7 +23098,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
23097
23098
  };
23098
23099
  }, "linkMatch");
23099
23100
 
23100
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
23101
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
23101
23102
  var SETTING = "phoneCountries";
23102
23103
  var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
23103
23104
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
@@ -23128,7 +23129,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
23128
23129
  return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
23129
23130
  }, "valueMatch");
23130
23131
 
23131
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
23132
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
23132
23133
  var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
23133
23134
  if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
23134
23135
  throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
@@ -23156,7 +23157,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
23156
23157
  return 2 * intersection2 / (aa2.size + bb.size);
23157
23158
  }, "vocabularySimilarity");
23158
23159
 
23159
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
23160
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
23160
23161
  import { createHash } from "node:crypto";
23161
23162
  var folded2 = /* @__PURE__ */ __name((name) => {
23162
23163
  try {
@@ -23222,7 +23223,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
23222
23223
  });
23223
23224
  }, "guardTagCreation");
23224
23225
 
23225
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
23226
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
23226
23227
  var invalid = /* @__PURE__ */ __name((message3) => {
23227
23228
  throw new CliError("validation_error", message3);
23228
23229
  }, "invalid");
@@ -23299,7 +23300,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
23299
23300
  };
23300
23301
  }, "createTagRedirectIndex");
23301
23302
 
23302
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
23303
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
23303
23304
  var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
23304
23305
  const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
23305
23306
  if (!row2)
@@ -23327,7 +23328,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
23327
23328
  return snapshot2;
23328
23329
  }, "tagRedirectSnapshot");
23329
23330
 
23330
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
23331
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
23331
23332
  import { createHash as createHash2 } from "node:crypto";
23332
23333
  var TASK_KEY_PREFIXES = {
23333
23334
  question: "Q",
@@ -23355,7 +23356,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
23355
23356
  return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
23356
23357
  }, "taskAccountOf");
23357
23358
 
23358
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
23359
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
23359
23360
  var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
23360
23361
  var REFERABLE = {
23361
23362
  ...Object.fromEntries(Object.entries(RECORD_TYPES).map(([type, { tombstone: tombstone2 }]) => [type, { tombstone: tombstone2 }])),
@@ -23519,7 +23520,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
23519
23520
  return row2 ? String(row2.id ?? row2.key) : void 0;
23520
23521
  }, "taskIdOf");
23521
23522
 
23522
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
23523
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
23523
23524
  var toMs = /* @__PURE__ */ __name((iso17) => {
23524
23525
  if (iso17 === null || iso17 === void 0)
23525
23526
  return null;
@@ -23533,7 +23534,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
23533
23534
  var DELIVERY = { delivered: 1, read: 2 };
23534
23535
  var deliveryOf = /* @__PURE__ */ __name((stored4) => stored4 === DELIVERY.read ? "read" : stored4 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
23535
23536
 
23536
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
23537
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
23537
23538
  var TAG_KINDS = ["tag", "topic"];
23538
23539
  var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
23539
23540
  var TAG_TYPE = {
@@ -23736,7 +23737,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
23736
23737
  return result;
23737
23738
  }, "tagsOf");
23738
23739
 
23739
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/trigram-match.js
23740
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/trigram-match.js
23740
23741
  var MOST_YO_SPELLINGS = 64;
23741
23742
  var yoSpellings = /* @__PURE__ */ __name((run) => {
23742
23743
  let spellings2 = [""];
@@ -23758,7 +23759,7 @@ var anyCaseGlob = /* @__PURE__ */ __name((word2) => `*${[...word2.normalize("NFC
23758
23759
  return forms2.size === 1 ? c : `[${[...forms2].join("")}]`;
23759
23760
  }).join("")}*`, "anyCaseGlob");
23760
23761
 
23761
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
23762
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
23762
23763
  var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
23763
23764
  var SPEECH = speech("att");
23764
23765
  var mentionText = /* @__PURE__ */ __name((alias2) => `CASE WHEN coalesce(json_extract(${alias2}.contact, '$.phone'), '') <> '' THEN 'phone: ' || json_extract(${alias2}.contact, '$.phone') ELSE ${alias2}.text END`, "mentionText");
@@ -24246,7 +24247,7 @@ var FIELD_COMPILERS = {
24246
24247
  subject
24247
24248
  };
24248
24249
 
24249
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
24250
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
24250
24251
  var placeOf = /* @__PURE__ */ __name((database) => {
24251
24252
  const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
24252
24253
  const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
@@ -24262,7 +24263,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
24262
24263
  };
24263
24264
  }, "placeOf");
24264
24265
 
24265
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
24266
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
24266
24267
  var DRAIN_ON_WRITE = 500;
24267
24268
  var METHOD = "rules";
24268
24269
  var telegramLink = /* @__PURE__ */ __name((database) => {
@@ -24428,7 +24429,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
24428
24429
  return queued.length;
24429
24430
  }, "drainMentions");
24430
24431
 
24431
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
24432
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
24432
24433
  var indexRow = /* @__PURE__ */ __name((database, name) => {
24433
24434
  const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
24434
24435
  if (!exists2)
@@ -24436,7 +24437,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
24436
24437
  return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
24437
24438
  }, "indexRow");
24438
24439
 
24439
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
24440
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
24440
24441
  var INDEX = "message_stems";
24441
24442
  var SETTING2 = "searchStemmers";
24442
24443
  var DRAIN_ON_WRITE2 = 500;
@@ -24562,7 +24563,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
24562
24563
  };
24563
24564
  }, "stemmerCache");
24564
24565
 
24565
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
24566
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
24566
24567
  var rehearsal = new AsyncLocalStorage();
24567
24568
  var SQLITE_BUSY = 5;
24568
24569
  var pause = new Int32Array(new SharedArrayBuffer(4));
@@ -24705,7 +24706,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
24705
24706
  }
24706
24707
  }, "read");
24707
24708
 
24708
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
24709
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
24709
24710
  var FOLDED = [
24710
24711
  { table: "tasks", column: "title" },
24711
24712
  { table: "tasks", column: "close_reason" },
@@ -24742,7 +24743,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
24742
24743
  return filled;
24743
24744
  }, "fillFolded");
24744
24745
 
24745
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
24746
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
24746
24747
  import { createHash as createHash3 } from "node:crypto";
24747
24748
  var CHUNK_CHARS = 1200;
24748
24749
  var CHUNK_OVERLAP = 150;
@@ -24847,7 +24848,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
24847
24848
  return chunks2;
24848
24849
  }, "cutChunks");
24849
24850
 
24850
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/search/task-signature.js
24851
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/search/task-signature.js
24851
24852
  var DAY2 = 864e5;
24852
24853
  var CURRENCY = [
24853
24854
  [/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
@@ -24973,7 +24974,7 @@ var dueDayOf = /* @__PURE__ */ __name((text9, createdMs) => {
24973
24974
  return best?.day ?? null;
24974
24975
  }, "dueDayOf");
24975
24976
 
24976
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
24977
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
24977
24978
  var DAY3 = 864e5;
24978
24979
  var STOP_WORDS = new Set([
24979
24980
  // Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
@@ -25128,7 +25129,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
25128
25129
  ...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
25129
25130
  })).sort((a, b) => b.score - a.score), "rankCandidates");
25130
25131
 
25131
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
25132
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
25132
25133
  var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
25133
25134
  coalesce(CASE k.chunkable_type
25134
25135
  WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
@@ -25270,7 +25271,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
25270
25271
  }, "dropUnusedVectors");
25271
25272
  var dropAllUnusedVectors = /* @__PURE__ */ __name((database) => database.prepare("DELETE FROM embeddings WHERE NOT EXISTS (SELECT 1 FROM chunks k WHERE k.content_hash = embeddings.content_hash) RETURNING 1").all().length, "dropAllUnusedVectors");
25272
25273
 
25273
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
25274
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
25274
25275
  var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
25275
25276
  r.last_message_id, r.text_start, r.text_end FROM conversations c
25276
25277
  CROSS JOIN chunks k ON k.chunkable_type = 'conversation' AND k.chunkable_id = c.id
@@ -25615,7 +25616,7 @@ var vectorCounts = /* @__PURE__ */ __name(({ orm }, models) => new Map(models.ma
25615
25616
  Number(orm.get(sql`SELECT count(*) AS n FROM embeddings WHERE model = ${model}`)?.n ?? 0)
25616
25617
  ])), "vectorCounts");
25617
25618
 
25618
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
25619
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
25619
25620
  var DOCUMENT_PICTURE = "document_picture";
25620
25621
  var SCAN_PAGE2 = 5e3;
25621
25622
  var idOf = /* @__PURE__ */ __name((ref3) => {
@@ -25678,12 +25679,12 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
25678
25679
  }, "nearestPictures")
25679
25680
  }), "documentPicturesOver");
25680
25681
 
25681
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/index-text.js
25682
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/index-text.js
25682
25683
  var noteIndexText = /* @__PURE__ */ __name((title2, text9) => title2 ? `${title2}
25683
25684
 
25684
25685
  ${text9}` : text9, "noteIndexText");
25685
25686
 
25686
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/enrichments.js
25687
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/enrichments.js
25687
25688
  var ENRICHMENT_SUBJECTS = ["document", "note", "email"];
25688
25689
  var ENRICHMENT_POSITION = 1e6;
25689
25690
  var EMAIL_ENRICHMENT = "email_enrichment";
@@ -25777,7 +25778,7 @@ var enrichmentsOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
25777
25778
  }), "clear")
25778
25779
  }), "enrichmentsOver");
25779
25780
 
25780
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
25781
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
25781
25782
  var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
25782
25783
  const literal5 = escaped2 ?? plain2 ?? "";
25783
25784
  return wildcard ?? (/[*?[]/u.test(literal5) ? `[${literal5}]` : literal5);
@@ -25853,7 +25854,7 @@ var compile = /* @__PURE__ */ __name((node, columns2, options) => {
25853
25854
  var queryFilter = /* @__PURE__ */ __name((ast, columns2, options) => compile(ast.root, columns2, options), "queryFilter");
25854
25855
  var bound2 = /* @__PURE__ */ __name(({ sql: text9, params }) => sql.join(text9.split("?").map((part2, at2) => at2 < params.length ? sql`${sql.raw(part2)}${params[at2]}` : sql.raw(part2)), sql``), "bound");
25855
25856
 
25856
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
25857
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
25857
25858
  var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
25858
25859
  var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
25859
25860
  var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
@@ -25943,7 +25944,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
25943
25944
  });
25944
25945
  }, "linkMeeting");
25945
25946
 
25946
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/task-titles.js
25947
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/task-titles.js
25947
25948
  var MAX_TITLE = 120;
25948
25949
  var placeholderTitleOf = /* @__PURE__ */ __name((row2) => `${String(row2.type)} \u2014 ${String(row2.source_locator ?? "")}`, "placeholderTitleOf");
25949
25950
  var PLACEHOLDER_TITLE_SQL = "title = type || ' \u2014 ' || coalesce(source_locator, '')";
@@ -26005,7 +26006,7 @@ var fillFoundTaskTitles = /* @__PURE__ */ __name((database, warn, { batch = 500
26005
26006
  }
26006
26007
  }, "fillFoundTaskTitles");
26007
26008
 
26008
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
26009
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
26009
26010
  var EVENT_TEXT = "trim(coalesce(e.description, '') || ' ' || coalesce(e.location, '') || ' ' || coalesce((SELECT group_concat(p.name, ' ') FROM calendar_entries ce JOIN calendar_entry_participants p ON p.entry_id = ce.id WHERE ce.event_id = e.id AND ce.deleted_at IS NULL AND p.resource = 0 AND p.name IS NOT NULL), ''))";
26010
26011
  var UNSEARCHED_EVENT_TYPES = [
26011
26012
  "working-location",
@@ -26252,7 +26253,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
26252
26253
  return true;
26253
26254
  }, "resetNoteIndex");
26254
26255
 
26255
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
26256
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
26256
26257
  var keyOf2 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
26257
26258
  var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
26258
26259
  for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf2))) {
@@ -26271,7 +26272,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
26271
26272
  }
26272
26273
  }, "resolvePersonLinks");
26273
26274
 
26274
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
26275
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
26275
26276
  var canonicalTags = sqliteTable("canonical_tags", {
26276
26277
  id: integer("id").primaryKey(),
26277
26278
  name: text("name").notNull().unique(),
@@ -26280,7 +26281,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
26280
26281
  updatedAt: integer("updated_at").notNull()
26281
26282
  });
26282
26283
 
26283
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/link-revisions.js
26284
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/link-revisions.js
26284
26285
  var linkRevisions = sqliteTable("link_revisions", {
26285
26286
  id: integer("id").primaryKey(),
26286
26287
  linkId: integer("link_id").notNull(),
@@ -26292,7 +26293,7 @@ var linkRevisions = sqliteTable("link_revisions", {
26292
26293
  createdAt: integer("created_at").notNull()
26293
26294
  }, (table) => [index("link_revisions_by_link_id_created_at").on(table.linkId, table.createdAt)]);
26294
26295
 
26295
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
26296
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
26296
26297
  var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
26297
26298
  sourceKey: text("source_key").notNull(),
26298
26299
  collection: text("collection").notNull(),
@@ -26302,13 +26303,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
26302
26303
  createdAt: integer("created_at").notNull()
26303
26304
  }, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
26304
26305
 
26305
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
26306
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
26306
26307
  var documentIndexPending = sqliteTable("document_index_pending", {
26307
26308
  id: integer("id").notNull(),
26308
26309
  indexableType: text("indexable_type").notNull()
26309
26310
  }, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
26310
26311
 
26311
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/decision-requests.js
26312
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/decision-requests.js
26312
26313
  var decisionRequests = sqliteTable("decision_requests", {
26313
26314
  id: integer("id").primaryKey(),
26314
26315
  tokenDigest: text("token_digest").notNull().unique(),
@@ -26328,7 +26329,7 @@ var decisionRequests = sqliteTable("decision_requests", {
26328
26329
  index("decision_requests_by_channel_bot_profile_chat_id_message_id").on(table.channel, table.botProfile, table.chatId, table.messageId)
26329
26330
  ]);
26330
26331
 
26331
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/enrichments.js
26332
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/enrichments.js
26332
26333
  var enrichments = sqliteTable("enrichments", {
26333
26334
  subjectType: text("subject_type").notNull(),
26334
26335
  subjectId: integer("subject_id").notNull(),
@@ -26340,7 +26341,7 @@ var enrichments = sqliteTable("enrichments", {
26340
26341
  createdAt: integer("created_at").notNull()
26341
26342
  }, (table) => [primaryKey({ columns: [table.subjectType, table.subjectId] })]);
26342
26343
 
26343
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/templates.js
26344
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/templates.js
26344
26345
  var templates = sqliteTable("templates", {
26345
26346
  key: text("key").notNull(),
26346
26347
  channel: text("channel").notNull(),
@@ -26362,7 +26363,7 @@ var templatesHistory = sqliteTable("templates_history", {
26362
26363
  index("templates_history_by_key_channel_language_id").on(table.key, table.channel, table.language, table.id)
26363
26364
  ]);
26364
26365
 
26365
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/links.js
26366
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/links.js
26366
26367
  var links = sqliteTable("links", {
26367
26368
  id: integer("id").primaryKey(),
26368
26369
  fromType: text("from_type").notNull(),
@@ -26393,7 +26394,7 @@ var links = sqliteTable("links", {
26393
26394
  index("links_by_to_type_to_id").on(table.toType, table.toId)
26394
26395
  ]);
26395
26396
 
26396
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
26397
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
26397
26398
  var tagRedirects = sqliteTable("tag_redirects", {
26398
26399
  sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
26399
26400
  survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
@@ -26419,7 +26420,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
26419
26420
  index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
26420
26421
  ]);
26421
26422
 
26422
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
26423
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
26423
26424
  var accounts = sqliteTable("accounts", {
26424
26425
  id: integer("id").primaryKey(),
26425
26426
  provider: text("provider").notNull(),
@@ -28496,13 +28497,97 @@ var trackerItems = sqliteTable("tracker_items", {
28496
28497
  unique().on(table.accountId, table.kind, table.externalId),
28497
28498
  index("tracker_items_by_account_id_kind_parent_id").on(table.accountId, table.kind, table.parentId)
28498
28499
  ]);
28500
+ var contentChannels = sqliteTable("content_channels", {
28501
+ id: integer("id").primaryKey(),
28502
+ accountId: integer("account_id").notNull().references(() => accounts.id),
28503
+ externalId: text("external_id").notNull(),
28504
+ kind: text("kind").notNull(),
28505
+ network: text("network").notNull(),
28506
+ name: text("name").notNull(),
28507
+ url: text("url"),
28508
+ handle: text("handle"),
28509
+ deletedAt: integer("deleted_at"),
28510
+ syncedAt: integer("synced_at").notNull()
28511
+ }, (table) => [unique().on(table.accountId, table.externalId)]);
28512
+ var contentAuthors = sqliteTable("content_authors", {
28513
+ id: integer("id").primaryKey(),
28514
+ accountId: integer("account_id").notNull().references(() => accounts.id),
28515
+ externalId: text("external_id").notNull(),
28516
+ name: text("name").notNull(),
28517
+ email: text("email"),
28518
+ data: text("data").notNull(),
28519
+ sourceUpdatedAt: integer("source_updated_at"),
28520
+ deletedAt: integer("deleted_at"),
28521
+ syncedAt: integer("synced_at").notNull()
28522
+ }, (table) => [unique().on(table.accountId, table.externalId)]);
28523
+ var contentTerms = sqliteTable("content_terms", {
28524
+ id: integer("id").primaryKey(),
28525
+ accountId: integer("account_id").notNull().references(() => accounts.id),
28526
+ externalId: text("external_id").notNull(),
28527
+ kind: text("kind").notNull(),
28528
+ name: text("name").notNull(),
28529
+ slug: text("slug"),
28530
+ parentId: text("parent_id"),
28531
+ tagId: integer("tag_id").references(() => canonicalTags.id),
28532
+ data: text("data").notNull(),
28533
+ sourceUpdatedAt: integer("source_updated_at"),
28534
+ deletedAt: integer("deleted_at"),
28535
+ syncedAt: integer("synced_at").notNull()
28536
+ }, (table) => [unique().on(table.accountId, table.externalId), index("content_terms_by_tag_id").on(table.tagId)]);
28537
+ var contentPosts = sqliteTable("content_posts", {
28538
+ id: integer("id").primaryKey(),
28539
+ accountId: integer("account_id").notNull().references(() => accounts.id),
28540
+ externalId: text("external_id").notNull(),
28541
+ channelId: text("channel_id"),
28542
+ type: text("type").notNull(),
28543
+ title: text("title"),
28544
+ titleFolded: text("title_folded").notNull(),
28545
+ body: text("body"),
28546
+ contentHash: text("content_hash").notNull(),
28547
+ status: text("status").notNull(),
28548
+ publishedAt: integer("published_at"),
28549
+ scheduledFor: integer("scheduled_for"),
28550
+ sourceCreatedAt: integer("source_created_at"),
28551
+ sourceUpdatedAt: integer("source_updated_at"),
28552
+ version: text("version"),
28553
+ normalizedText: text("normalized_text").notNull(),
28554
+ data: text("data").notNull(),
28555
+ deletedAt: integer("deleted_at"),
28556
+ syncedAt: integer("synced_at").notNull()
28557
+ }, (table) => [
28558
+ unique().on(table.accountId, table.externalId),
28559
+ index("content_posts_by_account_id_status").on(table.accountId, table.status),
28560
+ index("content_posts_by_account_id_published_at").on(table.accountId, table.publishedAt)
28561
+ ]);
28562
+ var contentPostRevisions = sqliteTable("content_post_revisions", {
28563
+ id: integer("id").primaryKey(),
28564
+ postId: integer("post_id").notNull().references(() => contentPosts.id),
28565
+ title: text("title"),
28566
+ body: text("body"),
28567
+ status: text("status").notNull(),
28568
+ contentHash: text("content_hash").notNull(),
28569
+ version: text("version"),
28570
+ reason: text("reason").notNull(),
28571
+ createdAt: integer("created_at").notNull()
28572
+ }, (table) => [index("content_post_revisions_by_post_id_created_at").on(table.postId, table.createdAt)]);
28573
+ var contentMetrics = sqliteTable("content_metrics", {
28574
+ id: integer("id").primaryKey(),
28575
+ postId: integer("post_id").notNull().references(() => contentPosts.id),
28576
+ at: integer("at").notNull(),
28577
+ views: integer("views"),
28578
+ reactions: integer("reactions"),
28579
+ comments: integer("comments"),
28580
+ shares: integer("shares"),
28581
+ clicks: integer("clicks"),
28582
+ raw: text("raw")
28583
+ }, (table) => [index("content_metrics_by_post_id_at").on(table.postId, table.at)]);
28499
28584
  var storeSettings = sqliteTable("store_settings", {
28500
28585
  key: text("key").primaryKey(),
28501
28586
  value: text("value").notNull(),
28502
28587
  at: integer("at").notNull()
28503
28588
  });
28504
28589
 
28505
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
28590
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
28506
28591
  var contactsOf = /* @__PURE__ */ __name(({ phones: phones2, emails: emails3 }) => {
28507
28592
  if (phones2 === void 0 && emails3 === void 0)
28508
28593
  return void 0;
@@ -28748,7 +28833,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
28748
28833
  }, "meetingIdentityPk");
28749
28834
  var phoneOf = /* @__PURE__ */ __name(({ orm }, provider, nativeId) => orm.select({ phone: identities.phone }).from(identities).where(and(eq(identities.provider, provider), eq(identities.externalId, nativeId))).get()?.phone ?? null, "phoneOf");
28750
28835
 
28751
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/ref-arguments.js
28836
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/ref-arguments.js
28752
28837
  var TAKES = {
28753
28838
  chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
28754
28839
  message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
@@ -28808,7 +28893,7 @@ var ensureAccount = /* @__PURE__ */ __name(async (reference2, scope3, profilesOn
28808
28893
  throw wrongAccount(reference2, scope3, profiles);
28809
28894
  }, "ensureAccount");
28810
28895
 
28811
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/search/trigrams.js
28896
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/search/trigrams.js
28812
28897
  var trigrams = /* @__PURE__ */ __name((term) => {
28813
28898
  const padded = ` ${term} `;
28814
28899
  const pieces = /* @__PURE__ */ new Set();
@@ -28817,7 +28902,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
28817
28902
  return [...pieces];
28818
28903
  }, "trigrams");
28819
28904
 
28820
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/resolve.js
28905
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/resolve.js
28821
28906
  var isId = /* @__PURE__ */ __name((reference2) => /^-?\d+$/.test(reference2.trim()), "isId");
28822
28907
  var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase().replaceAll("\u0451", "\u0435"), "foldName");
28823
28908
  var pickChat = /* @__PURE__ */ __name((reference2, chats2) => {
@@ -28888,7 +28973,7 @@ ${lines}`, { candidates });
28888
28973
  }, "ambiguous");
28889
28974
  var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
28890
28975
 
28891
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/display-names.js
28976
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/display-names.js
28892
28977
  var QUOTES = [
28893
28978
  ['"', '"'],
28894
28979
  ["'", "'"],
@@ -28946,7 +29031,7 @@ var nameKey = /* @__PURE__ */ __name((name) => {
28946
29031
  }, "nameKey");
28947
29032
  var isReadable = /* @__PURE__ */ __name((shown2) => shown2 !== null && READABLE.test(shown2), "isReadable");
28948
29033
 
28949
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/person-separation.js
29034
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/person-separation.js
28950
29035
  var identitiesOf = /* @__PURE__ */ __name(({ database }, person2) => database.prepare("SELECT identity_id AS pk FROM identity_links WHERE person_id = ?").all(person2).map(({ pk }) => Number(pk)), "identitiesOf");
28951
29036
  var MOVED_AWAY = `moved.identity_id IN (SELECT value FROM json_each(?))
28952
29037
  AND (moved.from_person_id IN (SELECT value FROM json_each(?))
@@ -28961,7 +29046,7 @@ var apart = /* @__PURE__ */ __name(({ database }, one2, other) => {
28961
29046
  var separated = /* @__PURE__ */ __name((context, one2, other) => one2 !== other && apart(context, { identities: identitiesOf(context, one2), person: one2 }, { identities: identitiesOf(context, other), person: other }), "separated");
28962
29047
  var identitySeparated = /* @__PURE__ */ __name((context, identity, person2) => apart(context, { identities: [identity] }, { identities: identitiesOf(context, person2).filter((pk) => pk !== identity), person: person2 }), "identitySeparated");
28963
29048
 
28964
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
29049
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
28965
29050
  var MESSAGE_FIELDS = {
28966
29051
  pk: messages.id,
28967
29052
  nativeId: messages.externalId,
@@ -29141,7 +29226,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
29141
29226
  storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
29142
29227
  }), "chatActivity");
29143
29228
 
29144
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
29229
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
29145
29230
  var HIT_FIELDS = {
29146
29231
  ...MESSAGE_FIELDS,
29147
29232
  chatTitle: sql`${chats.title}`.as("chat_title"),
@@ -29242,7 +29327,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
29242
29327
  };
29243
29328
  }, "directReplies");
29244
29329
 
29245
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
29330
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
29246
29331
  var identityRow = /* @__PURE__ */ __name(({ orm }, { provider, id: id2 }) => orm.select({ pk: identities.id, personPk: identityLinks.personId }).from(identities).innerJoin(identityLinks, eq(identityLinks.identityId, identities.id)).where(and(eq(identities.provider, provider), eq(identities.externalId, id2))).get(), "identityRow");
29247
29332
  var required = /* @__PURE__ */ __name((context, ref3) => {
29248
29333
  const found2 = identityRow(context, ref3);
@@ -29455,7 +29540,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
29455
29540
  }, "mentioning");
29456
29541
  var escaped = /* @__PURE__ */ __name((text9) => text9.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
29457
29542
 
29458
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
29543
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
29459
29544
  var BOT_KINDS = ["agent", "rule", "script", "integration"];
29460
29545
  var ownerPerson = /* @__PURE__ */ __name((database) => {
29461
29546
  const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
@@ -29512,7 +29597,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
29512
29597
  return { sql: bot("pb.name = ?"), params: [by.bot] };
29513
29598
  }, "proposedBySql");
29514
29599
 
29515
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review-marks.js
29600
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review-marks.js
29516
29601
  var TABLES = { memory: "memories", fact: "facts" };
29517
29602
  var HOLDING = { memory: ["proposed", "confirmed"], fact: ["proposed", "accepted"] };
29518
29603
  var KEPT = 20;
@@ -29607,7 +29692,7 @@ var scrubSourceReviews = /* @__PURE__ */ __name((database, erased, { refs }) =>
29607
29692
  return scrubbed;
29608
29693
  }, "scrubSourceReviews");
29609
29694
 
29610
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-signature.js
29695
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-signature.js
29611
29696
  var QUOTE_LIMIT = 500;
29612
29697
  var GONE = { sig: "gone", rev: null, deleted: true, changedAt: null };
29613
29698
  var part = /* @__PURE__ */ __name((value) => value == null ? "" : String(value), "part");
@@ -29886,11 +29971,11 @@ var deleteDocumentRow = /* @__PURE__ */ __name((database, id2, at2) => {
29886
29971
  database.prepare("DELETE FROM documents WHERE id = ?").run(id2);
29887
29972
  }, "deleteDocumentRow");
29888
29973
 
29889
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
29974
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
29890
29975
  var profilesOn = /* @__PURE__ */ __name((profiles, app, key2) => Object.entries(profiles[app] ?? {}).filter(([, saved]) => saved.provider === key2.provider && saved.account === key2.account).map(([name]) => name), "profilesOn");
29891
29976
  var oneLine = /* @__PURE__ */ __name((text9) => singleLine(text9.replace(/\s+/g, " ").trim()), "oneLine");
29892
29977
 
29893
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-accounts.js
29978
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-accounts.js
29894
29979
  var accountKeys = /* @__PURE__ */ __name((database, ids3) => {
29895
29980
  const unique2 = [...new Set(ids3)];
29896
29981
  if (unique2.length === 0)
@@ -29979,7 +30064,7 @@ var refEndsOf = /* @__PURE__ */ __name((database, text9) => {
29979
30064
  }, "refEndsOf");
29980
30065
  var refAccountsOf = /* @__PURE__ */ __name((database, text9) => refEndsOf(database, text9)?.flat(), "refAccountsOf");
29981
30066
 
29982
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
30067
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
29983
30068
  var EXCERPT_CHARS = 280;
29984
30069
  var TITLE_CHARS = 120;
29985
30070
  var MEMORY_TITLE_CHARS = 80;
@@ -30403,7 +30488,7 @@ var refsStoreOver = /* @__PURE__ */ __name((context) => ({
30403
30488
  ends: /* @__PURE__ */ __name(async (text9) => refEndsOf(context.database, text9), "ends")
30404
30489
  }), "refsStoreOver");
30405
30490
 
30406
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
30491
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
30407
30492
  var sourceOf3 = /* @__PURE__ */ __name((read2, ref3) => ({
30408
30493
  ref: ref3,
30409
30494
  kind: read2.kind,
@@ -30441,7 +30526,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
30441
30526
  });
30442
30527
  }, "evidenceSourcesOf");
30443
30528
 
30444
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/attachments/limits.js
30529
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/attachments/limits.js
30445
30530
  var MAX_FILE_BYTES = 50 * 1024 * 1024;
30446
30531
  var MAX_TEXT_CHARS = 2e6;
30447
30532
  var ATTACHMENT_LIMIT_ENV = [
@@ -30467,7 +30552,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
30467
30552
  return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
30468
30553
  }, "pdfPreviewLimits");
30469
30554
 
30470
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/ulid.js
30555
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/ulid.js
30471
30556
  import { randomBytes } from "node:crypto";
30472
30557
  var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
30473
30558
  var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
@@ -30480,7 +30565,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
30480
30565
  return time3 + random;
30481
30566
  }, "ulid");
30482
30567
 
30483
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
30568
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
30484
30569
  var FOLDED_FIELDS = ["title", "site", "language", "author"];
30485
30570
  var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
30486
30571
  if (!meta && !sections?.length)
@@ -30501,11 +30586,11 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
30501
30586
  return typeof language === "string" && language !== "" ? language : null;
30502
30587
  }, "languageOf");
30503
30588
 
30504
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/file-note.js
30589
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/file-note.js
30505
30590
  var LIVE3 = "f.deleted_at IS NULL AND d.deleted_at IS NULL AND coalesce(json_extract(d.metadata, '$.catalog.active'), 1)=1";
30506
30591
  var fileNoteRow = /* @__PURE__ */ __name((database, account, local, path) => database.prepare(local ? `SELECT d.*, f.account_id AS account_id, f.external_id AS external_id, coalesce(f.external_updated_at, d.external_updated_at) AS external_updated_at FROM files f JOIN documents d ON d.id = f.document_id WHERE f.account_id = ? AND f.external_id = ? AND ${LIVE3} ORDER BY d.created_at, d.id LIMIT 1` : `SELECT d.*, f.account_id AS account_id, coalesce(f.external_updated_at, d.external_updated_at) AS external_updated_at FROM documents d JOIN files f ON f.document_id = d.id AND f.account_id = d.account_id WHERE d.account_id = ? AND d.external_id = ? AND ${LIVE3} LIMIT 1`).get(account, path), "fileNoteRow");
30507
30592
 
30508
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
30593
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
30509
30594
  var isObject2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
30510
30595
  var objectOf2 = /* @__PURE__ */ __name((value) => {
30511
30596
  if (isObject2(value))
@@ -30752,7 +30837,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
30752
30837
  };
30753
30838
  }, "filesStoreOver");
30754
30839
 
30755
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
30840
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
30756
30841
  var IMPORTED_DOCUMENT_QUERY = defineQuery({
30757
30842
  entity: "document",
30758
30843
  backend: "sql",
@@ -30798,7 +30883,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
30798
30883
  return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns2, { zone: timezoneOf() });
30799
30884
  }, "importedDocumentWhere");
30800
30885
 
30801
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
30886
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
30802
30887
  var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
30803
30888
  database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
30804
30889
  VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
@@ -30806,7 +30891,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
30806
30891
  reason = excluded.reason, updated_at = excluded.updated_at WHERE link_reviews.status = 'open'`).run(linkable.type, linkable.id, entity, JSON.stringify([...candidates].sort((a, b) => a - b)), reason, now2, now2);
30807
30892
  }, "reviewLink");
30808
30893
 
30809
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/link-row.js
30894
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/link-row.js
30810
30895
  var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
30811
30896
  var thingRef = /* @__PURE__ */ __name((database, type, id2) => type == null || id2 == null ? null : referenceOfThing(database, storedThing(type, id2)) ?? null, "thingRef");
30812
30897
  var hasBothEnds = /* @__PURE__ */ __name((link3) => link3.from !== null && link3.to !== null, "hasBothEnds");
@@ -30840,7 +30925,7 @@ var linkOf = /* @__PURE__ */ __name((database, row2) => {
30840
30925
  };
30841
30926
  }, "linkOf");
30842
30927
 
30843
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/note-dates.js
30928
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/note-dates.js
30844
30929
  var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
30845
30930
  const fileAt = database.prepare("SELECT id, document_id FROM files WHERE account_id = ? AND external_id = ? AND kind <> 'folder' AND deleted_at IS NULL");
30846
30931
  const legacy = database.prepare("SELECT id FROM documents WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL");
@@ -30861,7 +30946,7 @@ var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
30861
30946
  return changed;
30862
30947
  }, "dateFileNotes");
30863
30948
 
30864
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/text-input.js
30949
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/text-input.js
30865
30950
  var textOf2 = /* @__PURE__ */ __name((text9, what, max = 1e5, allowEmpty = false) => {
30866
30951
  const value = text9.trim();
30867
30952
  if (!value && !allowEmpty || value.length > max)
@@ -30874,7 +30959,7 @@ var oneOf = /* @__PURE__ */ __name((value, allowed, what) => {
30874
30959
  return value;
30875
30960
  }, "oneOf");
30876
30961
 
30877
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
30962
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
30878
30963
  var NOTE_FORMATS = ["obsidian", "markdown"];
30879
30964
  var RELATIONSHIPS = RELATION_KINDS.map(linkKind).join(", ");
30880
30965
  var iso4 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
@@ -31396,10 +31481,10 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
31396
31481
  };
31397
31482
  }, "notesStoreOver");
31398
31483
 
31399
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/rows-page.js
31484
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/rows-page.js
31400
31485
  var pageOfRows = /* @__PURE__ */ __name((rows, limit, offset = 0) => rows.length > limit ? { items: rows.slice(0, limit), hasMore: true, nextOffset: offset + limit } : { items: rows, hasMore: false }, "pageOfRows");
31401
31486
 
31402
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
31487
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
31403
31488
  var NAMED = "SELECT m.*, b.name AS author_name, b.kind AS author_kind FROM memories m LEFT JOIN bots b ON m.author_type = 'bot' AND b.id = m.author_id";
31404
31489
  var iso5 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
31405
31490
  var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
@@ -31664,7 +31749,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
31664
31749
  };
31665
31750
  }, "memoriesStoreOver");
31666
31751
 
31667
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/reviewed.js
31752
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/reviewed.js
31668
31753
  var prefixesText = /* @__PURE__ */ __name((types) => `${article(types[0] ?? "")} ${types.map((type) => `${type}:`).join(" or ")}`, "prefixesText");
31669
31754
  var refuse = /* @__PURE__ */ __name((message3, reason, code = "validation_error") => {
31670
31755
  throw new CliError(code, message3, { reason });
@@ -31812,7 +31897,7 @@ var reviewedRowsOver = /* @__PURE__ */ __name((context) => {
31812
31897
  return { partyOf, partyThing, reviewedOf, written, keepEvidence, ownerOnly: ownerOnly2, linkedId, ...decisionsOver(context) };
31813
31898
  }, "reviewedRowsOver");
31814
31899
 
31815
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/money-lines.js
31900
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/money-lines.js
31816
31901
  var MAX_LINES = 500;
31817
31902
  var PARENTS = {
31818
31903
  invoice: {
@@ -31912,7 +31997,7 @@ var moneyLinesOver = /* @__PURE__ */ __name(({ database }) => {
31912
31997
  return { linesOf, insertLines, shownLines, appendLine, deleteLine, sumOf, retotal };
31913
31998
  }, "moneyLinesOver");
31914
31999
 
31915
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/refunds.js
32000
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/refunds.js
31916
32001
  var COUNTED = {
31917
32002
  confirmed: "np.review = 'confirmed' AND np.deleted_at IS NULL",
31918
32003
  // A proposed refund promises nothing back yet, so it must not free room an import could then fill.
@@ -31987,7 +32072,7 @@ var refundRulesOver = /* @__PURE__ */ __name((context) => {
31987
32072
  return { originalFor, refundShare, confirmable, keepsRefunded, keepsShare, keepsInvoice };
31988
32073
  }, "refundRulesOver");
31989
32074
 
31990
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
32075
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
31991
32076
  var FINANCE_TYPES = ["invoice", "payment"];
31992
32077
  var isFinanceType = /* @__PURE__ */ __name((type) => FINANCE_TYPES.includes(type), "isFinanceType");
31993
32078
  var PAID = netPaidSql("i.id");
@@ -32391,7 +32476,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
32391
32476
  };
32392
32477
  }, "financeStoreOver");
32393
32478
 
32394
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
32479
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
32395
32480
  var refuse2 = /* @__PURE__ */ __name((message3, reason) => {
32396
32481
  throw new CliError("validation_error", message3, { reason });
32397
32482
  }, "refuse");
@@ -32469,7 +32554,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
32469
32554
  };
32470
32555
  }, "paymentEntriesOver");
32471
32556
 
32472
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
32557
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
32473
32558
  var EVIDENCE_FINDINGS_KIND = "evidence_findings";
32474
32559
  var reference = /* @__PURE__ */ __name((raw) => {
32475
32560
  if (/^(document|note):[1-9]\d*$/.test(raw))
@@ -32496,7 +32581,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
32496
32581
  return valid;
32497
32582
  }, "validateEvidenceFindings");
32498
32583
 
32499
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
32584
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
32500
32585
  var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
32501
32586
  var PROPOSAL_VERDICTS = ["useful", "not_useful"];
32502
32587
  var iso7 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
@@ -32690,7 +32775,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
32690
32775
  };
32691
32776
  }, "proposedActionsStoreOver");
32692
32777
 
32693
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-proposals.js
32778
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-proposals.js
32694
32779
  var CONFIRMED = "proposal";
32695
32780
  var refOf = /* @__PURE__ */ __name(({ database }, pk) => {
32696
32781
  const row2 = database.prepare("SELECT provider, external_id FROM identities WHERE id = ?").get(pk);
@@ -33042,7 +33127,7 @@ var identityLinkRows = /* @__PURE__ */ __name((context, { person: person2, statu
33042
33127
  return { items, hasMore: rows.length > limit };
33043
33128
  }, "identityLinkRows");
33044
33129
 
33045
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/person-merges.js
33130
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/person-merges.js
33046
33131
  var mergeId = /* @__PURE__ */ __name((to, from2) => `merge:${to}-${from2}`, "mergeId");
33047
33132
  var parseMergeId = /* @__PURE__ */ __name((id2) => {
33048
33133
  const found2 = /^merge:([1-9]\d*)-([1-9]\d*)$/.exec(id2.trim());
@@ -33145,7 +33230,7 @@ var split = /* @__PURE__ */ __name((context, uid, refs, by) => {
33145
33230
  return recordOf(context, alone);
33146
33231
  }, "split");
33147
33232
 
33148
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-split-proposals.js
33233
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-split-proposals.js
33149
33234
  var refOf2 = /* @__PURE__ */ __name(({ provider, id: id2 }) => `${provider}:${id2}`, "refOf");
33150
33235
  var keyOf3 = /* @__PURE__ */ __name((split2, person2, identities2) => `${split2} ${person2} ${[...identities2].sort().join(" ")}`, "keyOf");
33151
33236
  var planOf = /* @__PURE__ */ __name((context, input) => {
@@ -33322,7 +33407,7 @@ var forgetErasedSplits = /* @__PURE__ */ __name((database) => {
33322
33407
  database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
33323
33408
  }, "forgetErasedSplits");
33324
33409
 
33325
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/test-data.js
33410
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/test-data.js
33326
33411
  var SEED_PEOPLE = [
33327
33412
  { name: "Owner", username: "owner" },
33328
33413
  { name: "Ann Lee", username: "ann" },
@@ -33339,7 +33424,7 @@ var RESERVED_ADDRESS_GLOBS = [
33339
33424
  ];
33340
33425
  var SEED_ID_GLOBS = ["person-[0-9]*"];
33341
33426
 
33342
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/test-people.js
33427
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/test-people.js
33343
33428
  var TEST_DATA_KIND = "test_data";
33344
33429
  var globs = /* @__PURE__ */ __name((column2, patterns) => patterns.map((pattern) => `${column2} GLOB '${pattern}'`).join(" OR "), "globs");
33345
33430
  var SURE = `(${globs("i.external_id", SEED_ID_GLOBS)} OR ${globs("lower(i.email)", RESERVED_ADDRESS_GLOBS)})`;
@@ -33408,7 +33493,7 @@ var forgetErasedTestData = /* @__PURE__ */ __name((database) => {
33408
33493
  database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
33409
33494
  }, "forgetErasedTestData");
33410
33495
 
33411
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
33496
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
33412
33497
  var accountPk = /* @__PURE__ */ __name(({ orm, now: now2 }, { provider, account, scope: scope3 }, name = null, startScope) => Number(orm.insert(accounts).values({
33413
33498
  provider,
33414
33499
  externalId: account,
@@ -33502,7 +33587,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
33502
33587
  AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
33503
33588
  }, "dropOrphanPeople");
33504
33589
 
33505
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
33590
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
33506
33591
  var HISTORY_KEY = "$history";
33507
33592
  var objectOf3 = /* @__PURE__ */ __name((text9) => {
33508
33593
  if (typeof text9 !== "string")
@@ -33578,7 +33663,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
33578
33663
  return rest;
33579
33664
  }, "withoutHistory");
33580
33665
 
33581
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
33666
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
33582
33667
  var chatOf = /* @__PURE__ */ __name(({ orm }, accountKey, chatKey) => orm.select({ id: chats.externalId }).from(chats).where(and(eq(chats.id, chatKey), eq(chats.accountId, accountKey))).get()?.id, "chatOf");
33583
33668
  var findChatPk = /* @__PURE__ */ __name(({ orm }, accountKey, chatId) => orm.select({ pk: chats.id }).from(chats).where(and(eq(chats.accountId, accountKey), eq(chats.externalId, chatId))).get()?.pk, "findChatPk");
33584
33669
  var setChatScope = /* @__PURE__ */ __name((context, accountKey, chatId, scope3) => {
@@ -33876,7 +33961,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
33876
33961
  }
33877
33962
  }, "replaceAutoTags");
33878
33963
 
33879
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/counters.js
33964
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/counters.js
33880
33965
  var COUNTER_FIELDS = ["views", "reactions", "comments"];
33881
33966
  var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
33882
33967
  var counterObservationTime = /* @__PURE__ */ __name((observation, now2) => {
@@ -33895,7 +33980,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
33895
33980
  return states.some((one2) => one2.freshness === "stale") ? "stale" : "fresh";
33896
33981
  }, "counterFreshness");
33897
33982
 
33898
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-tokens.js
33983
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-tokens.js
33899
33984
  var BOT_TOKEN = /(?<!\d)(\d{6,12}):[A-Za-z0-9_-]{30,40}(?![A-Za-z0-9_-])/g;
33900
33985
  var MAY_HOLD = "*[0-9][0-9][0-9][0-9][0-9][0-9]:*";
33901
33986
  var MASKED_THROUGH = "bot_tokens_masked_through";
@@ -33935,7 +34020,7 @@ var maskStoredBotTokens = /* @__PURE__ */ __name((context) => {
33935
34020
  }, "maskStoredBotTokens");
33936
34021
  var masks = /* @__PURE__ */ __name((value) => value != null && withoutBotTokens(String(value)) !== value, "masks");
33937
34022
 
33938
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/context/evidence.js
34023
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/context/evidence.js
33939
34024
  import { createHash as createHash4 } from "node:crypto";
33940
34025
  var CONTEXT_MAX_READ_BYTES = 262144;
33941
34026
  var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
@@ -34033,7 +34118,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
34033
34118
  return { source: source2, query, chat: chat2, senders, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
34034
34119
  }, "contextEvidenceRequest");
34035
34120
 
34036
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
34121
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
34037
34122
  var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
34038
34123
  var ACTIVITY = `
34039
34124
  SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
@@ -34163,7 +34248,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
34163
34248
  threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
34164
34249
  }), "mailActivity");
34165
34250
 
34166
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
34251
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
34167
34252
  var GREETING = new RegExp("^(hi|hello|hey|dear|greetings|good (morning|afternoon|evening)|\u043F\u0440\u0438\u0432\u0435\u0442|\u0437\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439(\u0442\u0435)?|\u0434\u043E\u0431\u0440(\u044B\u0439|\u043E\u0435|\u043E\u0433\u043E) (\u0434\u0435\u043D\u044C|\u0432\u0435\u0447\u0435\u0440|\u0443\u0442\u0440\u043E|\u0443\u0442\u0440\u0430|\u0434\u043D\u044F)|hola|buen(os|as) (d\xEDas|dias|tardes|noches)|estimad[oa]s?|querid[oa]s?)(?![\\p{L}\\p{N}])([\\s,]+\\p{L}[\\p{L}.'\u2019-]*){0,3}\\s*[,!.:]?$", "iu");
34168
34253
  var SIGN_OFF = /^(best|best regards|best wishes|kind regards|warm regards|regards|thanks|thanks again|thanks a lot|thank you|many thanks|cheers|sincerely|yours|yours truly|yours sincerely|br|с уважением|спасибо|заранее спасибо|всего доброго|всего хорошего|un saludo|saludos|saludos cordiales|atentamente|gracias|muchas gracias)[\s,.!]*$/iu;
34169
34254
  var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
@@ -34244,7 +34329,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
34244
34329
  return withoutSignOff(withoutGreeting(kept2)).join("\n").trim();
34245
34330
  }, "mailCore");
34246
34331
 
34247
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
34332
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
34248
34333
  var titleOf2 = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
34249
34334
  var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
34250
34335
  k.start_offset, k.end_offset, k.account_id, k.occurred_at,
@@ -34357,7 +34442,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
34357
34442
  return emails3 + threads;
34358
34443
  }, "drainEmailIndex");
34359
34444
 
34360
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
34445
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
34361
34446
  var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
34362
34447
  SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
34363
34448
  var folderEmails = /* @__PURE__ */ __name((database, accountId, folder, uidvalidity) => database.prepare(`SELECT l.uid, e.external_id, coalesce(e.received_at, e.sent_at) AS at, e.read, e.flagged,
@@ -34455,7 +34540,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
34455
34540
  var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
34456
34541
  SELECT id FROM emails WHERE account_id = ? AND sent_at IS NULL AND received_at IS NOT NULL LIMIT ?)`).run(accountId, limit).changes), "backfillSentAt");
34457
34542
 
34458
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
34543
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
34459
34544
  var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
34460
34545
  emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
34461
34546
  last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
@@ -34505,7 +34590,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
34505
34590
  return threads.length;
34506
34591
  }, "markEmailsRestored");
34507
34592
 
34508
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-nearest.js
34593
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-nearest.js
34509
34594
  var MAIL_PIECE_ROWS = `SELECT p.id, p.content_hash AS hash, p.type, p.owner, p.position, p.email_id AS email, v.vector
34510
34595
  FROM ${MAIL_PIECES} JOIN embeddings v ON v.model = ? AND v.content_hash = p.content_hash
34511
34596
  WHERE p.account_id = ?
@@ -34565,7 +34650,7 @@ var indexedMailPieces = /* @__PURE__ */ __name((database, model, query, filter,
34565
34650
  }, "indexedMailPieces");
34566
34651
  var nearestMailPieces = /* @__PURE__ */ __name((database, model, query, filter, depth) => (filter.threadExternalId === void 0 ? indexedMailPieces(database, model, query, filter, depth) : void 0) ?? scannedMailPieces(database, model, query, filter), "nearestMailPieces");
34567
34652
 
34568
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
34653
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
34569
34654
  var sorted = /* @__PURE__ */ __name((value) => Array.isArray(value) ? value.map(sorted) : value !== null && typeof value === "object" ? Object.fromEntries(Object.keys(value).sort().map((key2) => [key2, sorted(value[key2])])) : value, "sorted");
34570
34655
  var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
34571
34656
  var ruleOf = /* @__PURE__ */ __name((row2) => ({
@@ -34632,7 +34717,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
34632
34717
  }
34633
34718
  }), "mailRulesOver");
34634
34719
 
34635
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
34720
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
34636
34721
  function checkMeetingCancelled(signal) {
34637
34722
  if (!signal?.aborted)
34638
34723
  return;
@@ -34643,7 +34728,7 @@ function checkMeetingCancelled(signal) {
34643
34728
  }
34644
34729
  __name(checkMeetingCancelled, "checkMeetingCancelled");
34645
34730
 
34646
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
34731
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
34647
34732
  var managerOf = /* @__PURE__ */ __name((database, meetingId) => {
34648
34733
  const found2 = database.prepare("SELECT p.display_name, i.name, l.person_id FROM meeting_participants p JOIN identities i ON i.id = p.identity_id LEFT JOIN identity_links l ON l.identity_id = p.identity_id WHERE p.meeting_id = ? AND p.role = 'manager' ORDER BY p.id LIMIT 1").get(meetingId);
34649
34734
  if (!found2)
@@ -34708,7 +34793,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
34708
34793
  createdAt: Number(row2.created_at)
34709
34794
  }), "transcriptRowOf");
34710
34795
 
34711
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
34796
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
34712
34797
  var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
34713
34798
  var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
34714
34799
  var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
@@ -34875,7 +34960,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
34875
34960
  }
34876
34961
  }), "meetingReadsOver");
34877
34962
 
34878
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
34963
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
34879
34964
  var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
34880
34965
  const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
34881
34966
  const params = [input.accountId];
@@ -34918,7 +35003,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
34918
35003
  return { clauses, params };
34919
35004
  }, "meetingSelectionSql");
34920
35005
 
34921
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-calls.js
35006
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-calls.js
34922
35007
  var MOST_CALLS = 2e5;
34923
35008
  var parsed3 = /* @__PURE__ */ __name((value) => {
34924
35009
  if (typeof value !== "string")
@@ -34973,7 +35058,7 @@ var meetingCallsOver = /* @__PURE__ */ __name(({ database }) => ({
34973
35058
  }
34974
35059
  }), "meetingCallsOver");
34975
35060
 
34976
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
35061
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
34977
35062
  var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
34978
35063
  async meetingChatLines(input) {
34979
35064
  checkMeetingCancelled(input.signal);
@@ -35001,7 +35086,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
35001
35086
  }
35002
35087
  }), "meetingChatLinesOver");
35003
35088
 
35004
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
35089
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
35005
35090
  var missing2 = /* @__PURE__ */ __name(() => {
35006
35091
  throw new CliError("not_found", "Meeting, participant or selected target not found");
35007
35092
  }, "missing");
@@ -35124,7 +35209,7 @@ function meetingContextLinksOver(context) {
35124
35209
  }
35125
35210
  __name(meetingContextLinksOver, "meetingContextLinksOver");
35126
35211
 
35127
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-documents.js
35212
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-documents.js
35128
35213
  var TRANSCRIPT_ROLE = "transcript";
35129
35214
  var roleOf3 = /* @__PURE__ */ __name((value) => MEETING_DOCUMENT_ROLES.find((role) => role === value), "roleOf");
35130
35215
  var attach = /* @__PURE__ */ __name((database, meetingId, fileId, role, metadata3, listed, now2) => {
@@ -35198,7 +35283,7 @@ var meetingTranscriptDocumentsOver = /* @__PURE__ */ __name(({ database }) => {
35198
35283
  };
35199
35284
  }, "meetingTranscriptDocumentsOver");
35200
35285
 
35201
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
35286
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
35202
35287
  var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
35203
35288
  var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
35204
35289
  var summaryOf2 = /* @__PURE__ */ __name((row2) => ({
@@ -35227,7 +35312,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
35227
35312
  return row2 ? summaryText(summaryOf2(row2)) : null;
35228
35313
  }, "indexedText");
35229
35314
 
35230
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
35315
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
35231
35316
  var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
35232
35317
  var meetingCurrentIndexRows = `
35233
35318
  SELECT 'meeting_transcript_row' AS indexable_type,r.id,r.id*4+1 AS rid,1 AS live,coalesce(length(CAST(r.text AS BLOB)),0) AS bytes FROM meeting_transcript_rows r JOIN meeting_transcripts t ON t.id=r.meeting_transcript_id JOIN meetings m ON m.id=t.meeting_id WHERE m.account_id=? AND m.deleted_at IS NULL AND t.deleted_at IS NULL AND t.superseded_at IS NULL
@@ -35258,7 +35343,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
35258
35343
  }, "invalidateMeetingStems");
35259
35344
  var meetingStemmableText = /* @__PURE__ */ __name((text9) => text9.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
35260
35345
 
35261
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
35346
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
35262
35347
  function meetingHitIndexOver({ database, now: now2 }) {
35263
35348
  return {
35264
35349
  async indexSearch(original) {
@@ -35326,10 +35411,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
35326
35411
  }
35327
35412
  __name(meetingHitIndexOver, "meetingHitIndexOver");
35328
35413
 
35329
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
35414
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
35330
35415
  import { createHash as createHash5 } from "node:crypto";
35331
35416
 
35332
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/search/correct.js
35417
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/search/correct.js
35333
35418
  var SHORTEST_CORRECTION = 3;
35334
35419
  var maxEdits = /* @__PURE__ */ __name((word2) => word2.length <= 4 ? 1 : 2, "maxEdits");
35335
35420
  var editDistance = /* @__PURE__ */ __name((a, b, max) => {
@@ -35376,7 +35461,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words4) => {
35376
35461
  return corrections;
35377
35462
  }, "correctWords");
35378
35463
 
35379
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/search/garbled.js
35464
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/search/garbled.js
35380
35465
  var SHORTEST_GARBLED = 4;
35381
35466
  var MOST_WIDENED = 64;
35382
35467
  var plain = /* @__PURE__ */ __name((word2) => word2.replaceAll("\u044D", "\u0435"), "plain");
@@ -35468,7 +35553,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
35468
35553
  return found2.map((words4) => words4.sort((a, b) => a.distance - b.distance || b.docs - a.docs || a.term.localeCompare(b.term)).slice(0, MOST_WIDENED).map((word2) => word2.term));
35469
35554
  }, "widenWords");
35470
35555
 
35471
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
35556
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
35472
35557
  import { readFileSync } from "node:fs";
35473
35558
  var loaded;
35474
35559
  var dictionary = /* @__PURE__ */ __name(() => {
@@ -35527,7 +35612,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word2) => {
35527
35612
  return false;
35528
35613
  }, "knownRussianWord");
35529
35614
 
35530
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
35615
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
35531
35616
  var WORD2 = /[\p{L}\p{N}\p{M}]+/gu;
35532
35617
  var MOST_WORDS = 128;
35533
35618
  var quote = /* @__PURE__ */ __name((word2) => `"${word2.replaceAll('"', '""')}"`, "quote");
@@ -35783,7 +35868,7 @@ var matchedMeetingWords = /* @__PURE__ */ __name((tree, text9, stemmer2) => {
35783
35868
  return [...found2];
35784
35869
  }, "matchedMeetingWords");
35785
35870
 
35786
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
35871
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
35787
35872
  var fail = /* @__PURE__ */ __name((message3) => {
35788
35873
  throw new CliError("validation_error", message3);
35789
35874
  }, "fail");
@@ -35967,7 +36052,7 @@ function meetingHitSearchOver({ database }) {
35967
36052
  }
35968
36053
  __name(meetingHitSearchOver, "meetingHitSearchOver");
35969
36054
 
35970
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
36055
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
35971
36056
  var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
35972
36057
  async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
35973
36058
  positiveReadInteger(accountId, "accountId");
@@ -35999,7 +36084,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
35999
36084
  }
36000
36085
  }), "meetingLanguagesOver");
36001
36086
 
36002
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
36087
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
36003
36088
  import { createHash as createHash6 } from "node:crypto";
36004
36089
  var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
36005
36090
  if (value === void 0)
@@ -36092,7 +36177,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
36092
36177
  }
36093
36178
  }), "meetingParticipantSearchOver");
36094
36179
 
36095
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
36180
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
36096
36181
  var preparationQueries = {
36097
36182
  participants: {
36098
36183
  fields: "p.id, p.identity_id, p.display_name, l.person_id",
@@ -36142,7 +36227,7 @@ var preparationQueries = {
36142
36227
  }
36143
36228
  };
36144
36229
 
36145
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
36230
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
36146
36231
  var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
36147
36232
  async preparationContext(original) {
36148
36233
  const input = validateMeetingPreparationContext(original);
@@ -36183,7 +36268,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
36183
36268
  }
36184
36269
  }), "meetingPreparationContextOver");
36185
36270
 
36186
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
36271
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
36187
36272
  var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
36188
36273
  SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
36189
36274
  WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
@@ -36197,7 +36282,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
36197
36282
  JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
36198
36283
  )`, "preparationSubjects");
36199
36284
 
36200
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
36285
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
36201
36286
  var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
36202
36287
  async preparationKnowledge(original) {
36203
36288
  const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
@@ -36242,7 +36327,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
36242
36327
  }
36243
36328
  }), "meetingPreparationKnowledgeOver");
36244
36329
 
36245
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
36330
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
36246
36331
  var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
36247
36332
  async preparationNotes(original) {
36248
36333
  const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
@@ -36295,7 +36380,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
36295
36380
  }
36296
36381
  }), "meetingPreparationNotesOver");
36297
36382
 
36298
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
36383
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
36299
36384
  var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
36300
36385
  async relatedHistory(original) {
36301
36386
  const input = validateMeetingRelatedHistory(original);
@@ -36366,7 +36451,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
36366
36451
  }
36367
36452
  }), "meetingRelatedHistoryOver");
36368
36453
 
36369
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
36454
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
36370
36455
  var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
36371
36456
  var text4 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
36372
36457
  var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
@@ -36447,7 +36532,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
36447
36532
  }
36448
36533
  }), "meetingReviewOver");
36449
36534
 
36450
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
36535
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
36451
36536
  var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
36452
36537
  var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
36453
36538
  if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
@@ -36501,7 +36586,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
36501
36586
  }
36502
36587
  }), "meetingSeriesHistoryOver");
36503
36588
 
36504
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
36589
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
36505
36590
  var MOST_ROWS = 5e5;
36506
36591
  var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
36507
36592
  EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
@@ -36570,7 +36655,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
36570
36655
  }
36571
36656
  }), "meetingStatsOver");
36572
36657
 
36573
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/name-variants.js
36658
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/name-variants.js
36574
36659
  var CYRILLIC_TO_LATIN = {
36575
36660
  \u0430: "a",
36576
36661
  \u0431: "b",
@@ -36792,7 +36877,7 @@ for (const [full, short] of Object.entries(SHORT_FORMS))
36792
36877
  }
36793
36878
  var fullNames = /* @__PURE__ */ __name((skeleton) => [skeleton, ...FULL_NAMES.get(skeleton) ?? []], "fullNames");
36794
36879
 
36795
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/name-traces.js
36880
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/name-traces.js
36796
36881
  var peopleByNameKey = /* @__PURE__ */ __name((database) => {
36797
36882
  const found2 = /* @__PURE__ */ new Map();
36798
36883
  for (const row2 of database.prepare("SELECT p.id, p.name FROM persons p WHERE p.owner = 0 AND p.name IS NOT NULL AND EXISTS (SELECT 1 FROM identity_links l WHERE l.person_id = p.id) ORDER BY p.id").all()) {
@@ -36908,7 +36993,7 @@ function* sharedTraces(database, a, b, name, except) {
36908
36993
  }
36909
36994
  __name(sharedTraces, "sharedTraces");
36910
36995
 
36911
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/person-matcher.js
36996
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/person-matcher.js
36912
36997
  var spellingsOf = /* @__PURE__ */ __name((value) => [value, value.slice(1)], "spellingsOf");
36913
36998
  var PERSON_BY = {
36914
36999
  // UNION, not OR: each branch reads its own index.
@@ -36931,7 +37016,7 @@ var personsByIdentifiers = /* @__PURE__ */ __name((database, ids3) => {
36931
37016
  return [...found2].sort((a, b) => a - b);
36932
37017
  }, "personsByIdentifiers");
36933
37018
 
36934
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/person-match-scan.js
37019
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/person-match-scan.js
36935
37020
  var BY = "rule";
36936
37021
  var RULE = { bot: "rule", kind: "rule" };
36937
37022
  var MOST_SHARING = 6;
@@ -37380,7 +37465,7 @@ var linkPhones = /* @__PURE__ */ __name((context, identities2) => {
37380
37465
  return pass.result;
37381
37466
  }, "linkPhones");
37382
37467
 
37383
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
37468
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
37384
37469
  var CURSOR_KEY = "meetings";
37385
37470
  var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
37386
37471
  id: Number(row2.id),
@@ -37987,7 +38072,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
37987
38072
  };
37988
38073
  }, "meetingStoreOver");
37989
38074
 
37990
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
38075
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
37991
38076
  var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
37992
38077
  const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
37993
38078
  return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
@@ -38013,7 +38098,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder2) => {
38013
38098
  orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder2))).run();
38014
38099
  }, "release");
38015
38100
 
38016
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
38101
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
38017
38102
  var THREAD_COLUMNS = {
38018
38103
  subject: {
38019
38104
  where: /* @__PURE__ */ __name(({ value }) => ({
@@ -38030,7 +38115,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
38030
38115
  AND (${filter.where?.sql ?? "1"}) ORDER BY coalesce(last_email_at, 0) DESC, id DESC LIMIT ? OFFSET ?`).all(filter.accountId ?? null, filter.accountId ?? null, filter.includeDeleted ? 1 : 0, ...filter.where?.params ?? [], limit, offset);
38031
38116
  }, "threadRows");
38032
38117
 
38033
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
38118
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
38034
38119
  var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
38035
38120
  id: `email:${place.emailId}`,
38036
38121
  chatId: place.threadExternalId,
@@ -38572,7 +38657,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
38572
38657
  }
38573
38658
  }), "mailStoreOver");
38574
38659
 
38575
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/search/dictionary.js
38660
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/search/dictionary.js
38576
38661
  import { readFileSync as readFileSync2 } from "node:fs";
38577
38662
  var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
38578
38663
  var folded5 = /* @__PURE__ */ __name((word2) => /^[а-яё'-]*$/.test(word2) ? word2.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word2), "folded");
@@ -38662,7 +38747,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
38662
38747
  }, "knownWord");
38663
38748
  var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
38664
38749
 
38665
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
38750
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
38666
38751
  var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
38667
38752
  var readsTranscripts = /* @__PURE__ */ __name((node) => (node.operator === "term" || node.operator === "phrase") && /[\p{L}\p{N}]/u.test(normalize(node.value)) && (node.field === "transcript" || node.implicit === true && (node.field === "text" || node.field === "exact")), "readsTranscripts");
38668
38753
  var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
@@ -38748,7 +38833,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
38748
38833
  return found2;
38749
38834
  }, "spokenTranscripts");
38750
38835
 
38751
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
38836
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
38752
38837
  var startOf = /* @__PURE__ */ __name((node) => node.operator === "wildcard" && node.implicit ? /^([\p{L}\p{N}]+)\*$/u.exec(normalize(node.value))?.[1] : void 0, "startOf");
38753
38838
  var matchOf = /* @__PURE__ */ __name((node) => {
38754
38839
  const start = startOf(node);
@@ -38806,7 +38891,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
38806
38891
  });
38807
38892
  }, "placeHits");
38808
38893
 
38809
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
38894
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
38810
38895
  var GROUPS = {
38811
38896
  chat: {
38812
38897
  key: "m.chat_id",
@@ -38828,7 +38913,7 @@ var GROUPS = {
38828
38913
  }
38829
38914
  };
38830
38915
 
38831
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
38916
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
38832
38917
  var MESSAGES = {
38833
38918
  rows: "messages",
38834
38919
  threads: "chats",
@@ -39324,7 +39409,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
39324
39409
  };
39325
39410
  }, "runCompiled");
39326
39411
 
39327
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
39412
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
39328
39413
  function invalidMetadata() {
39329
39414
  throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
39330
39415
  }
@@ -39426,7 +39511,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
39426
39511
  };
39427
39512
  }), "counterTargets");
39428
39513
 
39429
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
39514
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
39430
39515
  var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
39431
39516
  var fileAttachments = /* @__PURE__ */ __name(({ database }, accountKey, { chatKey, messageId, beforePk, limit }) => database.prepare(`SELECT att.id AS pk, c.external_id AS chat_id, m.external_id AS message_id, att.position, att.kind, att.name, att.mime,
39432
39517
  att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
@@ -39545,7 +39630,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
39545
39630
  }));
39546
39631
  }, "attachmentViews");
39547
39632
 
39548
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
39633
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
39549
39634
  var transcript2 = /* @__PURE__ */ __name(({ orm }, chatKey, messageId) => orm.select({ text: messageTranscripts.text, source: messageTranscripts.source }).from(messageTranscripts).where(and(eq(messageTranscripts.chatId, chatKey), eq(messageTranscripts.messageExternalId, messageId))).get(), "transcript");
39550
39635
  var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text9, source2) => {
39551
39636
  const { orm, database, now: now2 } = context;
@@ -39583,7 +39668,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
39583
39668
  keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
39584
39669
  }, "intoVoiceAttachment");
39585
39670
 
39586
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
39671
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
39587
39672
  var FIELDS = [
39588
39673
  "threadExternalId",
39589
39674
  "senderIdentityId",
@@ -39907,7 +39992,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
39907
39992
  reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
39908
39993
  }, "writeDerivedReactions");
39909
39994
 
39910
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/keys.js
39995
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/keys.js
39911
39996
  var keysOver = /* @__PURE__ */ __name((context) => {
39912
39997
  const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
39913
39998
  const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
@@ -39928,7 +40013,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
39928
40013
  };
39929
40014
  }, "keysOver");
39930
40015
 
39931
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
40016
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
39932
40017
  var accountGroupsOf = /* @__PURE__ */ __name((database) => {
39933
40018
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
39934
40019
  if (!row2)
@@ -39975,7 +40060,7 @@ var forgetProfile = /* @__PURE__ */ __name((database, app, profile, now2) => {
39975
40060
  database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
39976
40061
  }, "forgetProfile");
39977
40062
 
39978
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
40063
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
39979
40064
  var DAY4 = 864e5;
39980
40065
  var COUNTERPART_LINK = `EXISTS (SELECT 1 FROM links l WHERE l.from_type = 'event' AND l.from_id = e.id AND l.to_type = 'person' AND l.to_id = ? AND l.kind = ${linkKind("related-to")} AND l.role = '${COUNTERPART_ROLE}')`;
39981
40066
  var accountsOf = /* @__PURE__ */ __name((filter) => {
@@ -40091,7 +40176,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
40091
40176
  return database.prepare(`SELECT e.* FROM events e WHERE ${clauses.join(" AND ")} ORDER BY ${filter.newest ? "e.starts_at DESC, e.id DESC" : "e.starts_at, e.id"} LIMIT ? OFFSET ?`).all(...params, limit, offset).map(eventOf);
40092
40177
  }, "listEvents");
40093
40178
 
40094
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
40179
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
40095
40180
  var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
40096
40181
  var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey, now: now2 }, refresh) => {
40097
40182
  const unseenBefore = unreferenced(database, "identities");
@@ -40148,7 +40233,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
40148
40233
  return { entries: entryIds.length, events: goneEvents.length };
40149
40234
  }, "forgetCalendarRows");
40150
40235
 
40151
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
40236
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
40152
40237
  var calendarOf = /* @__PURE__ */ __name((row2) => ({
40153
40238
  id: Number(row2.id),
40154
40239
  accountId: Number(row2.account_id),
@@ -40751,7 +40836,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
40751
40836
  };
40752
40837
  }, "eventStoreOver");
40753
40838
 
40754
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/account-purge.js
40839
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/account-purge.js
40755
40840
  var purgeAccount = /* @__PURE__ */ __name((context, accountKey) => {
40756
40841
  const { orm, database, now: now2 } = context;
40757
40842
  const unseenBefore = unreferenced(database, "identities");
@@ -40828,6 +40913,13 @@ var purgeAccount = /* @__PURE__ */ __name((context, accountKey) => {
40828
40913
  orm.run(sql`DELETE FROM crm_fields WHERE account_id = ${accountKey}`);
40829
40914
  orm.run(sql`DELETE FROM crm_files WHERE account_id = ${accountKey}`);
40830
40915
  orm.run(sql`DELETE FROM tracker_items WHERE account_id = ${accountKey}`);
40916
+ const postsOf = sql`(SELECT id FROM content_posts WHERE account_id = ${accountKey})`;
40917
+ orm.run(sql`DELETE FROM content_post_revisions WHERE post_id IN ${postsOf}`);
40918
+ orm.run(sql`DELETE FROM content_metrics WHERE post_id IN ${postsOf}`);
40919
+ orm.run(sql`DELETE FROM content_posts WHERE account_id = ${accountKey}`);
40920
+ orm.run(sql`DELETE FROM content_terms WHERE account_id = ${accountKey}`);
40921
+ orm.run(sql`DELETE FROM content_authors WHERE account_id = ${accountKey}`);
40922
+ orm.run(sql`DELETE FROM content_channels WHERE account_id = ${accountKey}`);
40831
40923
  const recordsOf = sql`(SELECT id FROM records WHERE account_id = ${accountKey})`;
40832
40924
  orm.run(sql`DELETE FROM record_relations WHERE record_id IN ${recordsOf} OR target_id IN ${recordsOf}`);
40833
40925
  orm.run(sql`DELETE FROM records WHERE account_id = ${accountKey}`);
@@ -40868,7 +40960,7 @@ var purgeCrmCopies = /* @__PURE__ */ __name((database, accountKey) => {
40868
40960
  run("DELETE FROM pipelines WHERE account_id = ?", accountKey);
40869
40961
  }, "purgeCrmCopies");
40870
40962
 
40871
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
40963
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
40872
40964
  var ACCOUNT_REASON = "an account you connected, under another name: a mailbox or messenger you read may be someone else's";
40873
40965
  var ownerNames = /* @__PURE__ */ __name(({ database }, owner) => database.prepare("SELECT i.name FROM identity_links l JOIN identities i ON i.id = l.identity_id WHERE l.person_id = ?").all(owner).map(({ name }) => new Set(nameSkeletons(displayName(typeof name === "string" ? name : null)))).filter((words4) => words4.size > 0), "ownerNames");
40874
40966
  var ownersName = /* @__PURE__ */ __name((name, owner, alone) => {
@@ -40927,7 +41019,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
40927
41019
  return personOf2(context, ref3);
40928
41020
  }, "linkToOwner");
40929
41021
 
40930
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
41022
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
40931
41023
  var PROVIDERS_SETTING = "providers";
40932
41024
  var storedProvidersOf = /* @__PURE__ */ __name((database) => {
40933
41025
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
@@ -40975,7 +41067,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
40975
41067
  });
40976
41068
  }, "registerProvider");
40977
41069
 
40978
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
41070
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
40979
41071
  var DAY5 = 864e5;
40980
41072
  var RECENTLY_CLOSED_MS = 14 * DAY5;
40981
41073
  var TEXT_LIMIT = 20;
@@ -41173,7 +41265,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
41173
41265
  };
41174
41266
  }, "taskSimilarityOver");
41175
41267
 
41176
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
41268
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
41177
41269
  var SETTING3 = "taskCategories";
41178
41270
  var savedTaskCategories = /* @__PURE__ */ __name((database) => {
41179
41271
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
@@ -41192,7 +41284,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
41192
41284
  database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(SETTING3, JSON.stringify(categories), now2);
41193
41285
  }, "saveTaskCategories");
41194
41286
 
41195
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
41287
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
41196
41288
  var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
41197
41289
  var ALLOWED = "taskAgentClose";
41198
41290
  var MIN = "taskAgentCloseMin";
@@ -41248,7 +41340,7 @@ var SUGGESTION_COLUMNS = [
41248
41340
  ];
41249
41341
  var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
41250
41342
 
41251
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
41343
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
41252
41344
  var DEFAULT_FIRST_PASS_PER_CHAT = 0;
41253
41345
  var KEY = "taskFirstPassPerChat";
41254
41346
  var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
@@ -41268,7 +41360,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
41268
41360
  database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(KEY, String(value), now2);
41269
41361
  }, "saveFirstPassPerChat");
41270
41362
 
41271
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/external-links.js
41363
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/external-links.js
41272
41364
  var EXTERNAL_SERVICE = /^[a-z][a-z0-9-]{0,31}$/;
41273
41365
  var EXTERNAL_ID_CHARS = 200;
41274
41366
  var SOURCE_URL_CHARS = 2e3;
@@ -41295,7 +41387,7 @@ var sourceUrlOf = /* @__PURE__ */ __name((value, reason = "task.source-url") =>
41295
41387
  return text9;
41296
41388
  }, "sourceUrlOf");
41297
41389
 
41298
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
41390
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
41299
41391
  var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
41300
41392
  var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
41301
41393
  name,
@@ -41547,7 +41639,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
41547
41639
  var TASK_PEOPLE = `WITH merged AS (SELECT json_extract(value, '$[0]') AS id, json_extract(value, '$[1]') AS now FROM json_each(?)), counts AS (SELECT coalesce(m.now, a.assignee_id) AS person, count(DISTINCT t.id) AS n FROM task_assignments a JOIN tasks t ON t.id = a.task_id AND t.deleted_at IS NULL LEFT JOIN merged m ON m.id = a.assignee_id WHERE a.assignee_type = 'person' GROUP BY 1) SELECT p.id, p.name, p.owner, coalesce(c.n, 0) AS n FROM persons p LEFT JOIN counts c ON c.person = p.id WHERE NOT ${mergedAwaySql("p")} ORDER BY p.owner DESC, n DESC, p.name IS NULL, p.name COLLATE NOCASE, p.id LIMIT ?`;
41548
41640
  var mergedAssignees = /* @__PURE__ */ __name((database) => JSON.stringify(database.prepare(`SELECT DISTINCT a.assignee_id AS id FROM task_assignments a JOIN persons p ON p.id = a.assignee_id WHERE a.assignee_type = 'person' AND ${mergedAwaySql("p")}`).all().map(({ id: id2 }) => [Number(id2), currentPerson(database, Number(id2))])), "mergedAssignees");
41549
41641
 
41550
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
41642
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
41551
41643
  var authorNamed = /* @__PURE__ */ __name((database, row2) => {
41552
41644
  if (row2.author_type == null)
41553
41645
  return null;
@@ -41575,7 +41667,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
41575
41667
  return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
41576
41668
  }, "addComment");
41577
41669
 
41578
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
41670
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
41579
41671
  var TASK_RELATION_KINDS = [
41580
41672
  "blocked-by",
41581
41673
  "follow-up-of",
@@ -41705,7 +41797,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record3) => {
41705
41797
  };
41706
41798
  }, "taskRelationsStoreOver");
41707
41799
 
41708
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
41800
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
41709
41801
  var TASK_ROLES = ["assignee", "reviewer", "watcher"];
41710
41802
  var TASK_EVENT_KINDS = [
41711
41803
  "created",
@@ -42264,7 +42356,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
42264
42356
  };
42265
42357
  }, "workTasksOver");
42266
42358
 
42267
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
42359
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
42268
42360
  var taskCloseOver = /* @__PURE__ */ __name((context) => {
42269
42361
  const { database, now: now2 } = context;
42270
42362
  const liveRow = /* @__PURE__ */ __name((id2) => {
@@ -42313,7 +42405,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
42313
42405
  };
42314
42406
  }, "taskCloseOver");
42315
42407
 
42316
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
42408
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
42317
42409
  var TASK_PAIR_DECISIONS = ["review", "unsure", "merged", "rejected", "unmerged", "attached", "new"];
42318
42410
  var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
42319
42411
  const { database, now: now2 } = context;
@@ -42532,7 +42624,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
42532
42624
  };
42533
42625
  }, "taskPairsOver");
42534
42626
 
42535
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
42627
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
42536
42628
  var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
42537
42629
  var TASK_STATS_SQL = {
42538
42630
  rows: /* @__PURE__ */ __name((board, filter) => `SELECT t.source_group, t.source_kind, t.project_id, t.status, t.created_at, t.closed_at FROM tasks t WHERE ${board ? PROJECT_SCOPE : ACCOUNT_SCOPE}${filter} ORDER BY t.created_at, t.id`, "rows"),
@@ -42571,7 +42663,7 @@ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
42571
42663
  }, "statNames")
42572
42664
  }), "taskStatsOver");
42573
42665
 
42574
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
42666
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
42575
42667
  var COLUMNS3 = "t.id AS row_id, t.package_id, t.source_locator, t.source_kind, t.source_group, t.type, t.status, t.close_reason, t.source, t.created_at, t.due_at, t.closed_at, t.closed_by_type, t.closed_by_id, t.key, t.category, t.claimed_by, t.claimed_until, p.name AS account";
42576
42668
  var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
42577
42669
  const key2 = inboxKey(account);
@@ -42787,7 +42879,7 @@ var oneOf4 = /* @__PURE__ */ __name((values, value, column2) => {
42787
42879
  throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
42788
42880
  }, "oneOf");
42789
42881
 
42790
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/accounts.js
42882
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/accounts.js
42791
42883
  var accountAccountsOver = /* @__PURE__ */ __name((context) => {
42792
42884
  const { database } = context;
42793
42885
  const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
@@ -42857,7 +42949,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
42857
42949
  };
42858
42950
  }, "accountsStoreOver");
42859
42951
 
42860
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
42952
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
42861
42953
  var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
42862
42954
  var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
42863
42955
  const message3 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
@@ -42881,7 +42973,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
42881
42973
  })), "keepDownloads");
42882
42974
  var keepProviderRefs = /* @__PURE__ */ __name((context, chatKey, messageId, files2) => updatePlaced(context, chatKey, messageId, files2.filter((file) => Object.keys(file.providerRef).length > 0), (file) => refColumn(file.providerRef)), "keepProviderRefs");
42883
42975
 
42884
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/attachments.js
42976
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/attachments.js
42885
42977
  var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
42886
42978
  const { database } = context;
42887
42979
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -42938,7 +43030,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
42938
43030
  }, "keepAttachmentText")
42939
43031
  }), "attachmentsStoreOver");
42940
43032
 
42941
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
43033
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
42942
43034
  var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
42943
43035
  var pointerMover = /* @__PURE__ */ __name((context, type) => {
42944
43036
  const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
@@ -43123,7 +43215,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
43123
43215
  return done;
43124
43216
  }, "rekeyChats");
43125
43217
 
43126
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
43218
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
43127
43219
  var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
43128
43220
  var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
43129
43221
  var CHAT_LIST_KEY = "chat_list_complete";
@@ -43181,7 +43273,7 @@ var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
43181
43273
  return { ...coverage, oldestMessageAt: toIso(oldest) };
43182
43274
  }, "chatCoverage");
43183
43275
 
43184
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/chats.js
43276
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/chats.js
43185
43277
  var chatsStoreOver = /* @__PURE__ */ __name((context) => {
43186
43278
  const { database } = context;
43187
43279
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
@@ -43330,7 +43422,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
43330
43422
  };
43331
43423
  }, "chatsStoreOver");
43332
43424
 
43333
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
43425
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
43334
43426
  import { createHash as createHash7 } from "node:crypto";
43335
43427
  var BATCH_CONTEXT = 50;
43336
43428
  var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
@@ -43470,7 +43562,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
43470
43562
  var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
43471
43563
  ${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
43472
43564
 
43473
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
43565
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
43474
43566
  import { setTimeout } from "node:timers/promises";
43475
43567
  var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
43476
43568
  var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
@@ -43782,7 +43874,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
43782
43874
  AND NOT EXISTS (SELECT 1 FROM messages d
43783
43875
  WHERE d.id IN (l.message_id, l.parent_id) AND d.deleted_at > l.created_at)`).map(({ id: id2, parent: parent2 }) => [id2, parent2])), "agentAnswers");
43784
43876
 
43785
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/conversations.js
43877
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/conversations.js
43786
43878
  var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
43787
43879
  const { database } = context;
43788
43880
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -43889,7 +43981,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
43889
43981
  };
43890
43982
  }, "conversationsStoreOver");
43891
43983
 
43892
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/counters.js
43984
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/counters.js
43893
43985
  var LIVE_MESSAGE = "SELECT m.id AS pk FROM messages m JOIN chats c ON c.id=m.chat_id JOIN accounts ac ON ac.id=m.account_id WHERE ac.provider=? AND ac.external_id=? AND c.external_id=? AND m.external_id=? AND m.deleted_at IS NULL";
43894
43986
  var accountCountersOver = /* @__PURE__ */ __name((context) => {
43895
43987
  const { database } = context;
@@ -43914,7 +44006,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
43914
44006
  counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
43915
44007
  }), "countersStoreOver");
43916
44008
 
43917
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
44009
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
43918
44010
  var MENTION_STATUSES = ["found", "linked", "proposed", "dismissed"];
43919
44011
  var MENTION_QUERY = defineQuery({
43920
44012
  entity: "mention",
@@ -44133,7 +44225,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
44133
44225
  return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
44134
44226
  }, "listPlaces");
44135
44227
 
44136
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/mentions.js
44228
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/mentions.js
44137
44229
  var accountMentionsOver = /* @__PURE__ */ __name((context) => {
44138
44230
  const { database } = context;
44139
44231
  const { findAccountPk: findAccountPk2 } = keysOver(context);
@@ -44168,7 +44260,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
44168
44260
  places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
44169
44261
  }), "mentionsStoreOver");
44170
44262
 
44171
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
44263
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
44172
44264
  var FAR = Number.MAX_SAFE_INTEGER;
44173
44265
  var MUTED_NOW = "(coalesce(c.muted,0)=1 AND (c.muted_until IS NULL OR c.muted_until>?))";
44174
44266
  var chatsIn = /* @__PURE__ */ __name((scope3, kinds2, now2) => {
@@ -44267,7 +44359,7 @@ var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
44267
44359
  });
44268
44360
  }, "waitingChats");
44269
44361
 
44270
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-activity-counts.js
44362
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-activity-counts.js
44271
44363
  var SQL = `SELECT coalesce(nullif(trim(c.title), ''), (SELECT sender_name FROM messages WHERE chat_id = c.id AND outgoing = 0 AND deleted_at IS NULL ORDER BY sent_at DESC LIMIT 1)) AS title, ${MUTED_NOW} AS muted, w.messages, w.sent, (SELECT max(sent_at) FROM messages WHERE chat_id = c.id AND deleted_at IS NULL AND sent_at < ?) AS last FROM chats c, (SELECT count(*) AS messages, coalesce(sum(outgoing = 1), 0) AS sent FROM messages WHERE chat_id = ? AND deleted_at IS NULL AND sent_at >= ? AND sent_at < ?) w WHERE c.id = ?`;
44272
44364
  var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since, until, now: now2 }) => {
44273
44365
  const statement = database.prepare(SQL);
@@ -44287,7 +44379,7 @@ var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since
44287
44379
  return found2;
44288
44380
  }, "chatActivityCounts");
44289
44381
 
44290
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
44382
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
44291
44383
  var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
44292
44384
  const read2 = database.prepare("SELECT m.id, m.external_id, m.text, m.sent_at, m.sender_name, coalesce(m.sender_chat_external_id, i.external_id) AS sender_id FROM messages m LEFT JOIN identities i ON i.id = m.sender_identity_id WHERE m.chat_id = ? AND m.deleted_at IS NULL AND (m.text LIKE '%google.com%' OR m.text LIKE '%forms.gle%') " + (messageId === void 0 ? "" : "AND m.external_id = ? ") + "ORDER BY m.sent_at DESC, m.id DESC");
44293
44385
  const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
@@ -44302,7 +44394,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
44302
44394
  }));
44303
44395
  }, "documentLinkMessages");
44304
44396
 
44305
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
44397
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
44306
44398
  var stemmerFor = stemmerCache();
44307
44399
  var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
44308
44400
  if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
@@ -44346,7 +44438,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
44346
44438
  });
44347
44439
  }, "laterSharingRare");
44348
44440
 
44349
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/messages.js
44441
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/messages.js
44350
44442
  var accountMessagesOver = /* @__PURE__ */ __name((context) => {
44351
44443
  const { database } = context;
44352
44444
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
@@ -44487,7 +44579,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
44487
44579
  laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
44488
44580
  }), "messagesStoreOver");
44489
44581
 
44490
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-links.js
44582
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-links.js
44491
44583
  var AGENT_METHOD = "agent";
44492
44584
  var personsOf = /* @__PURE__ */ __name(({ database }) => new Map(database.prepare("SELECT identity_id, person_id FROM identity_links").all().map((row2) => [Number(row2.identity_id), Number(row2.person_id)])), "personsOf");
44493
44585
  var weaknessOf = /* @__PURE__ */ __name((context, kind3, value, holders, sides, others) => {
@@ -44631,7 +44723,7 @@ var agentMerges = /* @__PURE__ */ __name((context, { limit, offset }) => {
44631
44723
  return { items: found2.slice(offset, offset + limit), hasMore: found2.length > offset + limit };
44632
44724
  }, "agentMerges");
44633
44725
 
44634
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-rekey.js
44726
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-rekey.js
44635
44727
  var quoted2 = /* @__PURE__ */ __name((name) => `"${name.replace(/"/g, '""')}"`, "quoted");
44636
44728
  var columnsOf3 = /* @__PURE__ */ __name((database, table) => database.prepare("SELECT name, pk, type FROM pragma_table_info(?)").all(table), "columnsOf");
44637
44729
  var foreignKeysTo = /* @__PURE__ */ __name((database, table) => database.prepare(`SELECT m.name AS tbl, f."from" AS col FROM sqlite_master m JOIN pragma_foreign_key_list(m.name) f
@@ -44775,7 +44867,7 @@ var rekeyIdentities = /* @__PURE__ */ __name((context, provider, pairs, { lockMs
44775
44867
  return done;
44776
44868
  }, "rekeyIdentities");
44777
44869
 
44778
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/person-kinds.js
44870
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/person-kinds.js
44779
44871
  var PERSON_KINDS = ["person", "organization", "automated", "stranger", "unsorted", "test"];
44780
44872
  var AUTOMATED_WORDS = /* @__PURE__ */ new Set([
44781
44873
  "noreply",
@@ -44838,7 +44930,7 @@ var isCompanyName = /* @__PURE__ */ __name((name) => {
44838
44930
  return wordsOf3(name.replaceAll(".", "")).some((word2) => LEGAL_FORMS.has(word2) || COMPANY_WORDS.has(word2));
44839
44931
  }, "isCompanyName");
44840
44932
 
44841
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/person-ties.js
44933
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/person-ties.js
44842
44934
  var SMALL_GROUP_MEMBERS = 10;
44843
44935
  var PERSON_TIES = ["chat", "small-group", "mail", "meeting", "crm", "phone-book"];
44844
44936
  var ALWAYS_SHOWN = ["owner", "added", "task"];
@@ -44893,7 +44985,7 @@ var shownReasons = /* @__PURE__ */ __name((database, people2) => {
44893
44985
  return new Map([...found2].map(([person2, reasons]) => [person2, ORDER.filter((one2) => reasons.has(one2))]));
44894
44986
  }, "shownReasons");
44895
44987
 
44896
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/people-list.js
44988
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/people-list.js
44897
44989
  var PEOPLE_SORTS = ["interactions", "recent", "name", "tasks"];
44898
44990
  var MIN_QUERY = 3;
44899
44991
  var matching2 = /* @__PURE__ */ __name((query) => {
@@ -45238,7 +45330,7 @@ var similarPeople = /* @__PURE__ */ __name((database, typed, limit) => {
45238
45330
  return withLastContact(database, rows).map((person2, at2) => ({ ...person2, sameName: same[at2] === true }));
45239
45331
  }, "similarPeople");
45240
45332
 
45241
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/person-doubts.js
45333
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/person-doubts.js
45242
45334
  var DOUBT_REASONS = ["owner-other-name", "test-data", "shared-address", "mixed-names"];
45243
45335
  var COLUMNS5 = "l.person_id AS person, p.owner, p.name AS person_name, i.id AS pk, i.provider, i.external_id, i.name, i.phone, i.email, i.username, l.method, l.author, l.created_at, EXISTS (SELECT 1 FROM accounts a WHERE a.provider = i.provider AND a.external_id = i.external_id) AS account FROM identity_links l JOIN identities i ON i.id = l.identity_id JOIN persons p ON p.id = l.person_id";
45244
45336
  var text5 = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? value : null, "text");
@@ -45494,7 +45586,7 @@ var markTestData = /* @__PURE__ */ __name((context, uid, by) => {
45494
45586
  return { person: `person:${person2}`, identities: identities2 };
45495
45587
  }, "markTestData");
45496
45588
 
45497
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
45589
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
45498
45590
  var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
45499
45591
  var IN_SCOPES = "IN (SELECT value FROM json_each(?))";
45500
45592
  var projectScope = /* @__PURE__ */ __name((id2) => `(SELECT p.scope FROM main.projects p WHERE p.id=${id2})`, "projectScope");
@@ -45563,7 +45655,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, {
45563
45655
  });
45564
45656
  }, "personPreparation");
45565
45657
 
45566
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
45658
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
45567
45659
  var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
45568
45660
  const id2 = Number(uid);
45569
45661
  if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
@@ -45571,7 +45663,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
45571
45663
  return Boolean(database.prepare("SELECT 1 FROM persons p JOIN identity_links l ON l.person_id=p.id JOIN account_identities a ON a.identity_id=l.identity_id WHERE p.id=? AND a.account_id IN (SELECT value FROM json_each(?)) LIMIT 1").get(currentPerson(database, id2), JSON.stringify(accountIds)));
45572
45664
  }, "personSeenInAccounts");
45573
45665
 
45574
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
45666
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
45575
45667
  var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
45576
45668
  const row2 = database.prepare("SELECT a.id AS account_id, i.id AS identity_id FROM accounts a JOIN account_identities ai ON ai.account_id=a.id JOIN identities i ON i.id=ai.identity_id WHERE a.provider=? AND a.external_id=? AND i.provider=? AND i.external_id=?").get(key2.provider, key2.account, key2.provider, personId);
45577
45669
  if (!row2)
@@ -45638,7 +45730,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
45638
45730
  return { id: id2, personId, removed: true };
45639
45731
  }, "removeNote");
45640
45732
 
45641
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/people.js
45733
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/people.js
45642
45734
  var accountPeopleOver = /* @__PURE__ */ __name((context) => {
45643
45735
  const { database } = context;
45644
45736
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
@@ -45781,13 +45873,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
45781
45873
  };
45782
45874
  }, "peopleStoreOver");
45783
45875
 
45784
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
45876
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
45785
45877
  import { createHash as createHash9 } from "node:crypto";
45786
45878
 
45787
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
45879
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
45788
45880
  import { createHash as createHash8 } from "node:crypto";
45789
45881
 
45790
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
45882
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
45791
45883
  var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
45792
45884
  var AUTHOR_MEASURES = [
45793
45885
  "messages",
@@ -45927,7 +46019,7 @@ var withoutUrls = /* @__PURE__ */ __name((text9) => text9.replace(/\S+/gu, (toke
45927
46019
  var rankingWords = /* @__PURE__ */ __name((text9) => withoutUrls(text9).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
45928
46020
  var rankingQuestion = /* @__PURE__ */ __name((text9) => withoutUrls(text9).includes("?"), "rankingQuestion");
45929
46021
 
45930
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
46022
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
45931
46023
  var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
45932
46024
  var exhausted2 = /* @__PURE__ */ __name((budget) => {
45933
46025
  throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
@@ -46149,7 +46241,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
46149
46241
  };
46150
46242
  }, "rankReplyGraph");
46151
46243
 
46152
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
46244
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
46153
46245
  var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
46154
46246
  var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
46155
46247
  var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
@@ -46323,7 +46415,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
46323
46415
  return { items, evidence, summary, graph: graph.quality };
46324
46416
  }, "calculateAdminStatistics");
46325
46417
 
46326
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
46418
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
46327
46419
  var rankingContextRange = /* @__PURE__ */ __name((root) => {
46328
46420
  const dates = [];
46329
46421
  const visit = /* @__PURE__ */ __name((node, required3) => {
@@ -46345,7 +46437,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
46345
46437
  return dates[0].node.resolution.date;
46346
46438
  }, "rankingContextRange");
46347
46439
 
46348
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
46440
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
46349
46441
  var reactionCounts = /* @__PURE__ */ __name((stored4) => {
46350
46442
  let counts;
46351
46443
  try {
@@ -46640,7 +46732,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
46640
46732
  });
46641
46733
  }, "rankQuery");
46642
46734
 
46643
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
46735
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
46644
46736
  function fail2(message3, reason = "query.too-large") {
46645
46737
  throw new CliError("validation_error", message3, { reason, complete: false });
46646
46738
  }
@@ -46817,7 +46909,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
46817
46909
  return result;
46818
46910
  }), "adminStatisticsQuery");
46819
46911
 
46820
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
46912
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
46821
46913
  var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
46822
46914
  if (!execution.accounts.length)
46823
46915
  return { conversations: [], chats: [] };
@@ -46835,7 +46927,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
46835
46927
  return { conversations: conversations2, chats: chats2 };
46836
46928
  }, "conversationEligibility");
46837
46929
 
46838
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
46930
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
46839
46931
  import { createHash as createHash10 } from "node:crypto";
46840
46932
  var EVIDENCE_BYTES = 64 * 1024;
46841
46933
  var FINGERPRINT_BYTES = 8 * 1024 * 1024;
@@ -46985,7 +47077,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
46985
47077
  return result;
46986
47078
  }, "rankingEvidence");
46987
47079
 
46988
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/queries.js
47080
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/queries.js
46989
47081
  var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
46990
47082
  const mailIndexed = /* @__PURE__ */ __name((execution) => {
46991
47083
  if (execution.corpus === "mail")
@@ -47006,7 +47098,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
47006
47098
  };
47007
47099
  }, "queriesStoreOver");
47008
47100
 
47009
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
47101
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
47010
47102
  var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
47011
47103
  const { database, now: now2 } = context;
47012
47104
  const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
@@ -47045,10 +47137,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
47045
47137
  }));
47046
47138
  }, "chatEventsOf");
47047
47139
 
47048
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
47140
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
47049
47141
  import { createHash as createHash11 } from "node:crypto";
47050
47142
 
47051
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/calendar.js
47143
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/calendar.js
47052
47144
  var calendarKey = /* @__PURE__ */ __name((zone, by) => {
47053
47145
  const format = new Intl.DateTimeFormat("en-CA", {
47054
47146
  timeZone: zone,
@@ -47068,7 +47160,7 @@ var weekKey = /* @__PURE__ */ __name((day3) => {
47068
47160
  return date3.toISOString().slice(0, 10);
47069
47161
  }, "weekKey");
47070
47162
 
47071
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/retention.js
47163
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/retention.js
47072
47164
  var RETENTION_TOLERANCE = 864e5;
47073
47165
  var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
47074
47166
  const { since, until, cutoff, checkpoints, within, limit, by } = options;
@@ -47122,7 +47214,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
47122
47214
  return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
47123
47215
  }, "retentionCohorts");
47124
47216
 
47125
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
47217
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
47126
47218
  var iso10 = /* @__PURE__ */ __name((at2) => new Date(at2).toISOString(), "iso");
47127
47219
  var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
47128
47220
  validateRetentionOptions(options);
@@ -47253,7 +47345,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
47253
47345
  };
47254
47346
  }, "retentionQuery");
47255
47347
 
47256
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
47348
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
47257
47349
  var iso11 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
47258
47350
  var marksOf = /* @__PURE__ */ __name(({ isBot: isBot2, flagged, deleted, hasPhoto }) => ({
47259
47351
  ...isBot2 === void 0 ? {} : { bot: isBot2 },
@@ -47382,7 +47474,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
47382
47474
  lastCount: memberCountsOf(context, pk).at(-1) ?? null
47383
47475
  })), "trackedChats");
47384
47476
 
47385
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/roster.js
47477
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/roster.js
47386
47478
  var rosterStoreOver = /* @__PURE__ */ __name((context) => {
47387
47479
  const { database } = context;
47388
47480
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
@@ -47438,7 +47530,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
47438
47530
  };
47439
47531
  }, "rosterStoreOver");
47440
47532
 
47441
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
47533
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
47442
47534
  var pendingNormalization = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM messages WHERE normalized_text IS NULL AND deleted_at IS NULL").get()?.n), "pendingNormalization");
47443
47535
  var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
47444
47536
  const next = database.prepare(`SELECT id AS pk, text FROM messages WHERE normalized_text IS NULL AND deleted_at IS NULL AND id > ? ORDER BY id LIMIT ?`);
@@ -47462,7 +47554,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
47462
47554
  }
47463
47555
  }, "backfillNormalized");
47464
47556
 
47465
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
47557
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
47466
47558
  var INDEX2 = "message_words";
47467
47559
  var searchIndexState2 = /* @__PURE__ */ __name((database) => {
47468
47560
  const row2 = indexRow(database, INDEX2);
@@ -47589,7 +47681,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
47589
47681
  });
47590
47682
  }, "resetSearchIndex");
47591
47683
 
47592
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
47684
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
47593
47685
  var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
47594
47686
  const filled = { stemmed: 0, drained: 0 };
47595
47687
  const before2 = stemsState(database);
@@ -47684,7 +47776,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
47684
47776
  return resetStems(database, { now: now2 });
47685
47777
  }, "followDefaultStemmers");
47686
47778
 
47687
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
47779
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
47688
47780
  var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
47689
47781
  var knownTerms = /* @__PURE__ */ __name(({ database }, terms) => {
47690
47782
  const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
@@ -47706,7 +47798,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
47706
47798
  });
47707
47799
  }, "termCandidates");
47708
47800
 
47709
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/search-index.js
47801
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/search-index.js
47710
47802
  var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
47711
47803
  const { database } = context;
47712
47804
  const stemmerFor2 = stemmerCache();
@@ -47731,7 +47823,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
47731
47823
  };
47732
47824
  }, "searchIndexStoreOver");
47733
47825
 
47734
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
47826
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
47735
47827
  var HISTORY_KEPT = 1e3;
47736
47828
  var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
47737
47829
  var COLUMNS6 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
@@ -47801,7 +47893,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
47801
47893
  return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
47802
47894
  }, "clearHistory");
47803
47895
 
47804
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/searches.js
47896
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/searches.js
47805
47897
  var searchesStoreOver = /* @__PURE__ */ __name((context) => {
47806
47898
  const { database } = context;
47807
47899
  return {
@@ -47825,7 +47917,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
47825
47917
  };
47826
47918
  }, "searchesStoreOver");
47827
47919
 
47828
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/added-sources.js
47920
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/added-sources.js
47829
47921
  import { createHash as createHash12 } from "node:crypto";
47830
47922
  var ADDED_KINDS = ["text", "file", "page"];
47831
47923
  var TEXT_COLUMNS = "kind = ?, title = ?, file_name = ?, extension = ?, url = ?, mime = ?, size = ?, content_hash = ?, body = ?, extraction = ?, metadata = ?, language = ?";
@@ -48067,7 +48159,7 @@ var addedSourcesOver = /* @__PURE__ */ __name((context) => {
48067
48159
  };
48068
48160
  }, "addedSourcesOver");
48069
48161
 
48070
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
48162
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
48071
48163
  var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
48072
48164
  var ACTION_OUTCOMES = ["ok", "refused", "failed"];
48073
48165
  var CODE = /^[a-z][a-z0-9_]{0,63}$/;
@@ -48115,7 +48207,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
48115
48207
  };
48116
48208
  }, "agentActionsStoreOver");
48117
48209
 
48118
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/base-suggest.js
48210
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/base-suggest.js
48119
48211
  var baseSettingKey = /* @__PURE__ */ __name((kind3) => `stages.base.${kind3}`, "baseSettingKey");
48120
48212
  var storedPipeline = /* @__PURE__ */ __name((value) => {
48121
48213
  if (typeof value !== "string")
@@ -48161,11 +48253,11 @@ var suggestBaseStages = /* @__PURE__ */ __name((database, kind3, pipelines2, { o
48161
48253
  }
48162
48254
  }, "suggestBaseStages");
48163
48255
 
48164
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/copy-viewer.js
48256
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/copy-viewer.js
48165
48257
  var viewerSql = /* @__PURE__ */ __name((alias2, viewer) => viewer === void 0 ? { sql: "1", params: [] } : viewer.assignee === null ? { sql: "0", params: [] } : { sql: `json_extract(${alias2}.metadata, '$.assignee') = ?`, params: [viewer.assignee] }, "viewerSql");
48166
48258
  var seenBy = /* @__PURE__ */ __name((viewer, row2) => viewer === void 0 || row2.provider !== viewer.account.provider || row2.account !== viewer.account.account || viewer.assignee !== null && row2.assignee === viewer.assignee, "seenBy");
48167
48259
 
48168
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/records.js
48260
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/records.js
48169
48261
  import { createHash as createHash13 } from "node:crypto";
48170
48262
  var RECORDS_SCHEMA_VERSION = 1;
48171
48263
  var RECORD_OPERATIONS = ["upsert", "delete"];
@@ -48306,7 +48398,7 @@ var fieldReferences = /* @__PURE__ */ __name((record3, options = {}) => {
48306
48398
  return found2;
48307
48399
  }, "fieldReferences");
48308
48400
 
48309
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-rows.js
48401
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-rows.js
48310
48402
  var TABLES2 = { deal: "deals", lead: "leads" };
48311
48403
  var MONEY_REFUSALS = ["money.currency", "money.amount"];
48312
48404
  var amountFault = /* @__PURE__ */ __name((item, code) => {
@@ -48478,7 +48570,7 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
48478
48570
  return { savePipeline, saveItemRow };
48479
48571
  }, "crmRowsOver");
48480
48572
 
48481
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-activities.js
48573
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-activities.js
48482
48574
  var ACTIVITY_RECORD = "crm.activity";
48483
48575
  var forgetActivitiesOn = /* @__PURE__ */ __name((database, accountId, kind3, externalIds, at2) => {
48484
48576
  const removed = "rr.target_type = ? AND rr.target_external_id IN (SELECT value FROM json_each(?))";
@@ -48666,7 +48758,7 @@ var seenSql = /* @__PURE__ */ __name((viewer) => {
48666
48758
  };
48667
48759
  }, "seenSql");
48668
48760
 
48669
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-stage-entries.js
48761
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-stage-entries.js
48670
48762
  var STAGE_ENTRY_RECORD = "crm.stage-entry";
48671
48763
  var STAGE_ENTRY_DAYS = 90;
48672
48764
  var STAGE_TASK_DAYS = 7;
@@ -48734,7 +48826,7 @@ var crmStageEntriesOver = /* @__PURE__ */ __name((context) => {
48734
48826
  return { save: save2, pending, handled, expire };
48735
48827
  }, "crmStageEntriesOver");
48736
48828
 
48737
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/stage-amounts.js
48829
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/stage-amounts.js
48738
48830
  var TABLES3 = { deal: "deals", lead: "leads" };
48739
48831
  var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, { since, until }, viewer) => {
48740
48832
  const seen = viewerSql("d", viewer);
@@ -48752,7 +48844,7 @@ var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, { si
48752
48844
  });
48753
48845
  }, "stageAmountsOf");
48754
48846
 
48755
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/pipeline-period.js
48847
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/pipeline-period.js
48756
48848
  var TABLES4 = { deal: "deals", lead: "leads" };
48757
48849
  var DAY7 = 864e5;
48758
48850
  var LOST_REASONS = 10;
@@ -48909,7 +49001,7 @@ var pipelinePeriod = /* @__PURE__ */ __name((context, pipeline, window, zone, vi
48909
49001
  };
48910
49002
  }, "pipelinePeriod");
48911
49003
 
48912
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/deals.js
49004
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/deals.js
48913
49005
  var TABLES5 = { deal: "deals", lead: "leads" };
48914
49006
  var itemsSql = /* @__PURE__ */ __name((kind3) => `SELECT d.*, s.name AS stage_name, s.pipeline_id, p.name AS pipeline_name, b.name AS author_name, b.kind AS author_kind, a.provider AS account_provider, a.external_id AS account_external_id, bs.id AS base_stage_ref_id, bs.name AS base_stage_name FROM ${TABLES5[kind3]} d JOIN pipeline_stages s ON s.id = d.stage_id JOIN pipelines p ON p.id = s.pipeline_id LEFT JOIN bots b ON d.author_type = 'bot' AND b.id = d.author_id LEFT JOIN accounts a ON a.id = d.account_id LEFT JOIN pipeline_stages bs ON s.base_confirmed = 1 AND bs.id = s.base_stage_id`, "itemsSql");
48915
49007
  var MAX_STAGES = 30;
@@ -48971,7 +49063,7 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
48971
49063
  const { partyOf, partyThing } = reviewedRowsOver(context);
48972
49064
  const today = /* @__PURE__ */ __name(() => new Date(now2()).toISOString().slice(0, 10), "today");
48973
49065
  const peopleOf2 = /* @__PURE__ */ __name((kind3, id2) => database.prepare(`SELECT to_id, role FROM links WHERE from_type = ? AND from_id = ? AND kind = ${linkKind("related-to")} AND to_type = 'person' AND to_id IS NOT NULL AND deleted_at IS NULL AND ${notOverriddenSql("links")} ORDER BY id`).all(kind3, id2).map((row2) => ({ ...partyOf("person", row2.to_id), role: row2.role })), "peopleOf");
48974
- const itemOf2 = /* @__PURE__ */ __name((kind3) => (row2) => {
49066
+ const itemOf3 = /* @__PURE__ */ __name((kind3) => (row2) => {
48975
49067
  const currency2 = row2.currency == null ? null : String(row2.currency);
48976
49068
  const amount = row2.amount == null || currency2 === null ? null : Number(row2.amount);
48977
49069
  const fields4 = {
@@ -49026,7 +49118,7 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
49026
49118
  }, "rowOf");
49027
49119
  const read2 = /* @__PURE__ */ __name((reference2) => {
49028
49120
  const { kind: kind3, row: row2 } = rowOf4(reference2);
49029
- return itemOf2(kind3)(row2);
49121
+ return itemOf3(kind3)(row2);
49030
49122
  }, "read");
49031
49123
  const inScope = /* @__PURE__ */ __name((scope3, row2) => scope3 === void 0 || (scope3 === "own" ? row2.account_id == null : row2.account_provider === scope3.provider && row2.account_external_id === scope3.account), "inScope");
49032
49124
  const kindOf4 = /* @__PURE__ */ __name((kind3) => kind3 === void 0 ? "deal" : oneOf3(kind3, DEAL_KINDS, "a kind"), "kindOf");
@@ -49236,7 +49328,7 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
49236
49328
  filter.owner === null ? { sql: "json_extract(d.metadata, '$.assignee') IS NULL", params: [] } : { sql: "json_extract(d.metadata, '$.assignee') = ?", params: [filter.owner] }
49237
49329
  ]
49238
49330
  ];
49239
- const rows = database.prepare(`${itemsSql(kind3)} WHERE d.deleted_at IS NULL ${within.map(({ sql: sql2 }) => `AND ${sql2} `).join("")}AND (? IS NULL OR d.status = ?) AND (? IS NULL OR d.project_id = ?) AND (? IS NULL OR s.name_folded = ?) AND (? IS NULL OR p.id = ?) AND (? IS NULL OR d.organization_id = ?) AND (? = 0 OR d.account_id IS NULL) AND (? IS NULL OR (a.provider = ? AND a.external_id = ?)) ${inAccounts}AND ${by.sql} ORDER BY d.created_at DESC, d.id DESC LIMIT ? OFFSET ?`).all(...within.flatMap(({ params }) => params), status2, status2, project2, project2, stage, stage, pipeline, pipeline, organization2?.id ?? null, organization2?.id ?? null, own, provider, provider, account, ...keys ?? [], ...by.params, limit + 1, offset).map(itemOf2(kind3));
49331
+ const rows = database.prepare(`${itemsSql(kind3)} WHERE d.deleted_at IS NULL ${within.map(({ sql: sql2 }) => `AND ${sql2} `).join("")}AND (? IS NULL OR d.status = ?) AND (? IS NULL OR d.project_id = ?) AND (? IS NULL OR s.name_folded = ?) AND (? IS NULL OR p.id = ?) AND (? IS NULL OR d.organization_id = ?) AND (? = 0 OR d.account_id IS NULL) AND (? IS NULL OR (a.provider = ? AND a.external_id = ?)) ${inAccounts}AND ${by.sql} ORDER BY d.created_at DESC, d.id DESC LIMIT ? OFFSET ?`).all(...within.flatMap(({ params }) => params), status2, status2, project2, project2, stage, stage, pipeline, pipeline, organization2?.id ?? null, organization2?.id ?? null, own, provider, provider, account, ...keys ?? [], ...by.params, limit + 1, offset).map(itemOf3(kind3));
49240
49332
  return pageOfRows(rows, limit, offset);
49241
49333
  }, "list"),
49242
49334
  find: /* @__PURE__ */ __name(async (wanted) => {
@@ -49382,7 +49474,7 @@ var dealsStoreOver = /* @__PURE__ */ __name((context) => {
49382
49474
  };
49383
49475
  }, "dealsStoreOver");
49384
49476
 
49385
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/owner-languages.js
49477
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/owner-languages.js
49386
49478
  var KEY2 = "ownerLanguages";
49387
49479
  var ISO_639_1 = new Set("aa ab ae af ak am an ar as av ay az ba be bg bi bm bn bo br bs ca ce ch co cr cs cu cv cy da de dv dz ee el en eo es et eu fa ff fi fj fo fr fy ga gd gl gn gu gv ha he hi ho hr ht hu hy hz ia id ie ig ii ik io is it iu ja jv ka kg ki kj kk kl km kn ko kr ks ku kv kw ky la lb lg li ln lo lt lu lv mg mh mi mk ml mn mr ms mt my na nb nd ne ng nl nn no nr nv ny oc oj om or os pa pi pl ps pt qu rm rn ro ru rw sa sc sd se sg si sk sl sm sn so sq sr ss st su sv sw ta te tg th ti tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa wo xh yi yo za zh zu".split(" "));
49388
49480
  var DEFAULT_OWNER_LANGUAGES = ["ru"];
@@ -49412,7 +49504,7 @@ var saveOwnerLanguages = /* @__PURE__ */ __name((database, languages, now2) => {
49412
49504
  database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(KEY2, JSON.stringify(languages), now2);
49413
49505
  }, "saveOwnerLanguages");
49414
49506
 
49415
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/base-stages.js
49507
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/base-stages.js
49416
49508
  var OUTCOMES = {
49417
49509
  lead: ["open", "open", "open", "won", "lost"],
49418
49510
  deal: ["open", "open", "open", "open", "won", "lost"]
@@ -49745,7 +49837,7 @@ var baseStagesStoreOver = /* @__PURE__ */ __name((context) => {
49745
49837
  };
49746
49838
  }, "baseStagesStoreOver");
49747
49839
 
49748
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
49840
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
49749
49841
  var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
49750
49842
  }) => {
49751
49843
  const { database, now: now2 } = context;
@@ -49804,7 +49896,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
49804
49896
  };
49805
49897
  }, "botUpdateStoreOver");
49806
49898
 
49807
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projection.js
49899
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projection.js
49808
49900
  var IMPORTER = { bot: "import" };
49809
49901
  var importersProposal = /* @__PURE__ */ __name((entity) => entity.review === "proposed" && entity.author.type === "bot" && entity.author.name === IMPORTER.bot, "importersProposal");
49810
49902
  var codeOf = /* @__PURE__ */ __name((error) => {
@@ -49849,7 +49941,7 @@ var moneyLinesOf = /* @__PURE__ */ __name((projection, list2) => (Array.isArray(
49849
49941
  };
49850
49942
  }), "moneyLinesOf");
49851
49943
 
49852
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/relation-role-labels.js
49944
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/relation-role-labels.js
49853
49945
  var label = /* @__PURE__ */ __name((en, ru, es) => ({ en, ru, es }), "label");
49854
49946
  var ROLE_LABELS = {
49855
49947
  organization: {
@@ -49890,7 +49982,7 @@ var ROLE_LABELS = {
49890
49982
  }
49891
49983
  };
49892
49984
 
49893
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-roles.js
49985
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-roles.js
49894
49986
  var settingOf = /* @__PURE__ */ __name((list2) => `relationships.roles.${list2}`, "settingOf");
49895
49987
  var isList = /* @__PURE__ */ __name((list2) => Object.hasOwn(ROLE_LISTS, list2), "isList");
49896
49988
  var listOf2 = /* @__PURE__ */ __name((list2) => {
@@ -49974,7 +50066,7 @@ var relationRolesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
49974
50066
  };
49975
50067
  }, "relationRolesOver");
49976
50068
 
49977
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-settings.js
50069
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-settings.js
49978
50070
  var CRM_LINK_MODES = ["reported", "review"];
49979
50071
  var COMPANY_TYPE_MEANINGS = ["customer-of", "supplier", "partner-of"];
49980
50072
  var CRM_SCOPES = ["mine", "all"];
@@ -50205,7 +50297,7 @@ var crmSettingsOf = /* @__PURE__ */ __name((database) => database.prepare("SELEC
50205
50297
  return [{ setting: String(row2.key), value: settingValue(database, parsed5.key, parsed5.name) }];
50206
50298
  }), "crmSettingsOf");
50207
50299
 
50208
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
50300
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
50209
50301
  var isoOf = /* @__PURE__ */ __name((ms) => ms === void 0 ? null : new Date(ms).toISOString(), "isoOf");
50210
50302
  var relationOf = /* @__PURE__ */ __name((link3, now2) => ({
50211
50303
  id: link3.id,
@@ -50565,7 +50657,7 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
50565
50657
  provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
50566
50658
  }, "decidedOrigin");
50567
50659
 
50568
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/reported-relations.js
50660
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/reported-relations.js
50569
50661
  var keyOf4 = /* @__PURE__ */ __name((kind3, fromType, fromId, toType, toId, role) => `${String(kind3)}|${String(fromType)}:${String(fromId)}|${String(toType)}:${String(toId)}|${role == null ? "" : String(role)}`, "keyOf");
50570
50662
  var metadataOf = /* @__PURE__ */ __name((relation) => relation.metadata && Object.keys(relation.metadata).length ? JSON.stringify(relation.metadata) : null, "metadataOf");
50571
50663
  var syncReportedIn = /* @__PURE__ */ __name((context, key2, relationships, scope3, { source: source2 = "import", by = { bot: key2.provider, kind: "rule" }, onOutcome } = {}) => {
@@ -50703,7 +50795,7 @@ var relationsStoreOver = /* @__PURE__ */ __name((context) => ({
50703
50795
  syncReported: /* @__PURE__ */ __name(async (key2, relationships, scope3, options) => write(context.database, () => syncReportedIn(context, key2, relationships, scope3, options)), "syncReported")
50704
50796
  }), "relationsStoreOver");
50705
50797
 
50706
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relationships.js
50798
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relationships.js
50707
50799
  var importSource = /* @__PURE__ */ __name((provider) => `import:${provider}`, "importSource");
50708
50800
  var noRelationships = /* @__PURE__ */ __name(() => ({
50709
50801
  added: 0,
@@ -50893,7 +50985,7 @@ var recordRelationshipsOver = /* @__PURE__ */ __name((context) => {
50893
50985
  return { report, placeOf: placeOf2, withdrawFrom };
50894
50986
  }, "recordRelationshipsOver");
50895
50987
 
50896
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/business-contracts.js
50988
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/business-contracts.js
50897
50989
  var CONTRACTS = "SELECT k.*, b.name AS author_name, b.kind AS author_kind FROM contracts k LEFT JOIN bots b ON k.author_type = 'bot' AND b.id = k.author_id";
50898
50990
  var DAY_MS2 = 864e5;
50899
50991
  var deadlineOf = /* @__PURE__ */ __name((expiration, days) => expiration === null || days === null ? null : new Date(Date.parse(`${expiration}T00:00:00Z`) - days * DAY_MS2).toISOString().slice(0, 10), "deadlineOf");
@@ -51052,7 +51144,7 @@ var contractsStoreOver = /* @__PURE__ */ __name((context) => {
51052
51144
  };
51053
51145
  }, "contractsStoreOver");
51054
51146
 
51055
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/business-search.js
51147
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/business-search.js
51056
51148
  var BUSINESS_FIND_MAX = 2001;
51057
51149
  var party2 = /* @__PURE__ */ __name((kind3, id2, as) => `LEFT JOIN persons ${as}p ON ${kind3} = 'person' AND ${as}p.id = ${id2} AND ${as}p.owner = 0 LEFT JOIN organizations ${as}o ON ${kind3} = 'organization' AND ${as}o.id = ${id2} LEFT JOIN projects ${as}j ON ${kind3} = 'project' AND ${as}j.id = ${id2}`, "party");
51058
51150
  var partyName = /* @__PURE__ */ __name((as) => `coalesce(${as}p.name, ${as}o.name, ${as}j.name)`, "partyName");
@@ -51157,7 +51249,7 @@ var businessSearchOver = /* @__PURE__ */ __name(({ database }) => {
51157
51249
  };
51158
51250
  }, "businessSearchOver");
51159
51251
 
51160
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
51252
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
51161
51253
  var CATALOG_QUERY = defineQuery({
51162
51254
  entity: "document",
51163
51255
  backend: "sql",
@@ -51390,7 +51482,414 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
51390
51482
  };
51391
51483
  }, "catalogStoreOver");
51392
51484
 
51393
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
51485
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/content.js
51486
+ import { createHash as createHash14 } from "node:crypto";
51487
+
51488
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-files.js
51489
+ import { sep } from "node:path";
51490
+ var MOST = 500;
51491
+ var CURRENTLY = /* @__PURE__ */ __name((table) => `EXISTS (SELECT 1 FROM ${table} r WHERE r.account_id = f.account_id AND r.external_id = f.owner_id AND r.deleted_at IS NULL AND json_extract(r.metadata, '$.assignee') = ?)`, "CURRENTLY");
51492
+ var EXCERPT = 240;
51493
+ var COLUMNS7 = "f.external_id, f.owner_kind, f.owner_id, f.owner_assignee, f.source, f.name, f.mime, f.size, f.external_created_at, f.local_path, f.content_sha256, f.extraction, f.extraction_error, f.downloaded_by, f.downloaded_at";
51494
+ var text6 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
51495
+ var number3 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
51496
+ var rowOf2 = /* @__PURE__ */ __name((row2) => ({
51497
+ externalId: String(row2.external_id),
51498
+ ownerKind: String(row2.owner_kind),
51499
+ ownerId: String(row2.owner_id),
51500
+ ownerAssignee: text6(row2.owner_assignee),
51501
+ source: String(row2.source),
51502
+ name: String(row2.name),
51503
+ mime: text6(row2.mime),
51504
+ size: number3(row2.size),
51505
+ externalCreatedAt: number3(row2.external_created_at),
51506
+ localPath: text6(row2.local_path),
51507
+ contentSha256: text6(row2.content_sha256),
51508
+ extraction: text6(row2.extraction),
51509
+ extractionError: text6(row2.extraction_error),
51510
+ downloadedBy: text6(row2.downloaded_by),
51511
+ downloadedAt: Number(row2.downloaded_at)
51512
+ }), "rowOf");
51513
+ var matchOf2 = /* @__PURE__ */ __name((words4, anyWord, exact) => {
51514
+ const phrases = words4.map((word2) => normalize(word2).trim()).filter(Boolean).map((word2) => {
51515
+ const quoted6 = `"${word2.replaceAll('"', '""')}"`;
51516
+ return exact || /\s/u.test(word2) || word2.length < 3 ? quoted6 : `${quoted6}*`;
51517
+ });
51518
+ return phrases.length ? [...new Set(phrases)].join(anyWord ? " OR " : " AND ") : void 0;
51519
+ }, "matchOf");
51520
+ var excerptOf = /* @__PURE__ */ __name((body2, words4) => {
51521
+ const folded6 = fold(body2);
51522
+ const at2 = words4.map((word2) => folded6.indexOf(fold(word2).trim())).filter((index2) => index2 >= 0).sort((a, b) => a - b)[0];
51523
+ const start = Math.max(0, (at2 ?? 0) - EXCERPT / 4);
51524
+ return body2.slice(start, start + EXCERPT).replace(/\s+/gu, " ").trim();
51525
+ }, "excerptOf");
51526
+ var resetCrmFileWords = /* @__PURE__ */ __name((database) => {
51527
+ if (!database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'crm_file_words'").get())
51528
+ return 0;
51529
+ return write(database, () => {
51530
+ const update2 = database.prepare("UPDATE crm_files SET normalized_text = ? WHERE id = ?");
51531
+ for (const row2 of database.prepare("SELECT id, text, normalized_text FROM crm_files WHERE text IS NOT NULL").all()) {
51532
+ const normalized = normalize(String(row2.text));
51533
+ if (normalized !== row2.normalized_text)
51534
+ update2.run(normalized, Number(row2.id));
51535
+ }
51536
+ database.exec("INSERT INTO crm_file_words (crm_file_words) VALUES ('delete-all')");
51537
+ const { changes } = database.prepare("INSERT INTO crm_file_words (rowid, normalized_text) SELECT id, normalized_text FROM crm_files WHERE normalized_text <> ''").run();
51538
+ return Number(changes);
51539
+ });
51540
+ }, "resetCrmFileWords");
51541
+ var crmFilesOver = /* @__PURE__ */ __name((context) => {
51542
+ const { database } = context;
51543
+ const under = "substr(f.local_path, 1, length(?)) = ?";
51544
+ const inside = /* @__PURE__ */ __name((folder) => folder.endsWith(sep) ? folder : `${folder}${sep}`, "inside");
51545
+ const save2 = /* @__PURE__ */ __name((key2, file) => write(database, () => {
51546
+ const accountId = accountPk(context, key2);
51547
+ database.prepare("INSERT INTO crm_files (account_id, external_id, owner_kind, owner_id, owner_assignee, source, name, name_folded, mime, size, external_created_at, local_path, content_sha256, text, normalized_text, extraction, extraction_error, downloaded_by, downloaded_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT (account_id, external_id) DO UPDATE SET owner_assignee = excluded.owner_assignee, source = excluded.source, name = excluded.name, name_folded = excluded.name_folded, mime = excluded.mime, size = excluded.size, external_created_at = excluded.external_created_at, local_path = excluded.local_path, content_sha256 = excluded.content_sha256, text = excluded.text, normalized_text = excluded.normalized_text, extraction = excluded.extraction, extraction_error = excluded.extraction_error, downloaded_by = excluded.downloaded_by, downloaded_at = excluded.downloaded_at").run(accountId, file.externalId, file.ownerKind, file.ownerId, file.ownerAssignee, file.source, file.name, fold(file.name), file.mime, file.size, file.externalCreatedAt, file.localPath, file.contentSha256, file.text, file.text === null ? null : normalize(file.text), file.extraction, file.extractionError, file.downloadedBy, file.downloadedAt);
51548
+ }), "save");
51549
+ const rowsOf2 = /* @__PURE__ */ __name((key2, columns2, where, ...params) => {
51550
+ const accountId = findAccountPk(context, key2);
51551
+ if (accountId === void 0)
51552
+ return [];
51553
+ return database.prepare(`SELECT ${columns2} FROM crm_files f WHERE f.account_id = ? AND ${where}`).all(accountId, ...params);
51554
+ }, "rowsOf");
51555
+ const find2 = /* @__PURE__ */ __name(({ words: words4, anyWord = false, exact = false, accounts: accounts2, viewers = [], limit }) => {
51556
+ const match = matchOf2(words4, anyWord, exact);
51557
+ if (!match)
51558
+ return { items: [], hasMore: false };
51559
+ const most = Math.min(Math.max(limit ?? 100, 1), MOST);
51560
+ const scoped2 = accounts2?.map((one2) => findAccountPk(context, one2)).filter((one2) => one2 !== void 0) ?? [];
51561
+ if (accounts2 !== void 0 && !scoped2.length)
51562
+ return { items: [], hasMore: false };
51563
+ const limits = viewers.flatMap((viewer) => {
51564
+ const id2 = findAccountPk(context, viewer.account);
51565
+ return id2 === void 0 ? [] : [{ id: id2, assignee: viewer.assignee }];
51566
+ });
51567
+ const params = [match];
51568
+ let sql2 = `SELECT ${COLUMNS7}, f.text, a.provider, a.external_id AS account FROM crm_files f JOIN accounts a ON a.id = f.account_id JOIN (SELECT rowid, rank FROM crm_file_words WHERE crm_file_words MATCH ?) w ON w.rowid = f.id WHERE 1`;
51569
+ if (accounts2 !== void 0) {
51570
+ sql2 += ` AND f.account_id IN (${scoped2.map(() => "?").join(", ")})`;
51571
+ for (const id2 of scoped2)
51572
+ params.push(id2);
51573
+ }
51574
+ for (const one2 of limits) {
51575
+ if (one2.assignee === null) {
51576
+ sql2 += " AND f.account_id <> ?";
51577
+ params.push(one2.id);
51578
+ continue;
51579
+ }
51580
+ sql2 += ` AND (f.account_id <> ? OR CASE f.owner_kind WHEN 'deal' THEN ${CURRENTLY("deals")} WHEN 'lead' THEN ${CURRENTLY("leads")} ELSE f.owner_assignee = ? END)`;
51581
+ params.push(one2.id, one2.assignee, one2.assignee, one2.assignee);
51582
+ }
51583
+ sql2 += " ORDER BY w.rank, f.downloaded_at DESC, f.id DESC LIMIT ?";
51584
+ params.push(most + 1);
51585
+ const hits = database.prepare(sql2).all(...params).map((row2) => ({
51586
+ account: { provider: String(row2.provider), account: String(row2.account) },
51587
+ file: rowOf2(row2),
51588
+ excerpt: excerptOf(String(row2.text ?? ""), words4)
51589
+ }));
51590
+ return pageOfRows(hits, most);
51591
+ }, "find");
51592
+ return {
51593
+ save: /* @__PURE__ */ __name(async (key2, file) => save2(key2, file), "save"),
51594
+ get: /* @__PURE__ */ __name(async (key2, externalId) => {
51595
+ const [row2] = rowsOf2(key2, `${COLUMNS7}, f.text`, "f.external_id = ?", externalId);
51596
+ return row2 ? { ...rowOf2(row2), text: text6(row2.text) } : void 0;
51597
+ }, "get"),
51598
+ ofOwner: /* @__PURE__ */ __name(async (key2, kind3, id2) => rowsOf2(key2, COLUMNS7, "f.owner_kind = ? AND f.owner_id = ? ORDER BY f.downloaded_at DESC, f.id DESC", kind3, id2).map(rowOf2), "ofOwner"),
51599
+ storedBytes: /* @__PURE__ */ __name(async (key2, folder) => rowsOf2(key2, "coalesce(sum(f.size), 0) AS bytes", `f.local_path IS NOT NULL AND ${under}`, inside(folder), inside(folder)).reduce((sum, row2) => sum + Number(row2.bytes), 0), "storedBytes"),
51600
+ droppable: /* @__PURE__ */ __name(async (key2, folder) => rowsOf2(key2, COLUMNS7, `f.local_path IS NOT NULL AND ${under} AND coalesce(f.text, '') <> '' ORDER BY f.downloaded_at, f.id`, inside(folder), inside(folder)).map(rowOf2), "droppable"),
51601
+ savedPaths: /* @__PURE__ */ __name(async (key2) => rowsOf2(key2, "f.local_path", "f.local_path IS NOT NULL ORDER BY f.id").map((row2) => String(row2.local_path)), "savedPaths"),
51602
+ forgetFile: /* @__PURE__ */ __name(async (key2, externalId) => {
51603
+ const accountId = findAccountPk(context, key2);
51604
+ if (accountId === void 0)
51605
+ return;
51606
+ write(database, () => database.prepare("UPDATE crm_files SET local_path = NULL WHERE account_id = ? AND external_id = ?").run(accountId, externalId));
51607
+ }, "forgetFile"),
51608
+ find: /* @__PURE__ */ __name(async (search2) => find2(search2), "find"),
51609
+ limits: /* @__PURE__ */ __name(async (key2) => crmFileLimits(database, key2), "limits")
51610
+ };
51611
+ }, "crmFilesOver");
51612
+
51613
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/content.js
51614
+ var MOST2 = 500;
51615
+ var TABLE = {
51616
+ author: "content_authors",
51617
+ term: "content_terms",
51618
+ post: "content_posts"
51619
+ };
51620
+ var definedOnly = /* @__PURE__ */ __name((record3) => Object.fromEntries(Object.entries(record3).filter(([, value]) => value !== void 0)), "definedOnly");
51621
+ var itemOf = /* @__PURE__ */ __name((kind3, row2) => ({
51622
+ kind: kind3,
51623
+ record: JSON.parse(String(row2.data)),
51624
+ deletedAt: row2.deleted_at == null ? null : Number(row2.deleted_at),
51625
+ syncedAt: Number(row2.synced_at)
51626
+ }), "itemOf");
51627
+ var contentHashOf = /* @__PURE__ */ __name((post) => createHash14("sha256").update(JSON.stringify([post.title ?? null, post.body ?? null])).digest("hex"), "contentHashOf");
51628
+ var resetContentPostWords = /* @__PURE__ */ __name((database) => {
51629
+ if (!database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'content_post_words'").get())
51630
+ return 0;
51631
+ return write(database, () => {
51632
+ const update2 = database.prepare("UPDATE content_posts SET normalized_text = ? WHERE id = ?");
51633
+ for (const row2 of database.prepare("SELECT id, title, body, normalized_text FROM content_posts").all()) {
51634
+ const normalized = normalize([row2.title, row2.body].filter(Boolean).join("\n"));
51635
+ if (normalized !== row2.normalized_text)
51636
+ update2.run(normalized, Number(row2.id));
51637
+ }
51638
+ database.exec("INSERT INTO content_post_words (content_post_words) VALUES ('delete-all')");
51639
+ const { changes } = database.prepare("INSERT INTO content_post_words (rowid, normalized_text) SELECT id, normalized_text FROM content_posts WHERE normalized_text <> ''").run();
51640
+ return Number(changes);
51641
+ });
51642
+ }, "resetContentPostWords");
51643
+ var tagIdOf = /* @__PURE__ */ __name((context, term) => {
51644
+ const name = tagOf(term.slug ?? "") ?? tagOf(term.name);
51645
+ if (name === void 0)
51646
+ return null;
51647
+ try {
51648
+ return ensureTag(context, name).id;
51649
+ } catch (error) {
51650
+ if (isCliError(error))
51651
+ return null;
51652
+ throw error;
51653
+ }
51654
+ }, "tagIdOf");
51655
+ var contentStoreOver = /* @__PURE__ */ __name((context) => {
51656
+ const { database } = context;
51657
+ const keepRevision2 = /* @__PURE__ */ __name((postId2, row2, reason, now2) => database.prepare("INSERT INTO content_post_revisions (post_id, title, body, status, content_hash, version, reason, created_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)").run(postId2, row2.title ?? null, row2.body ?? null, String(row2.status), String(row2.content_hash), row2.version ?? null, reason, now2), "keepRevision");
51658
+ const tagPost = /* @__PURE__ */ __name((accountId, postId2, terms) => {
51659
+ const ids3 = terms.length ? database.prepare(`SELECT DISTINCT t.name FROM content_terms ct JOIN canonical_tags t ON t.id = ct.tag_id WHERE ct.account_id = ? AND ct.deleted_at IS NULL AND ct.external_id IN (${terms.map(() => "?").join(", ")})`).all(accountId, ...terms).map((row2) => String(row2.name)) : [];
51660
+ database.prepare("DELETE FROM taggings WHERE taggable_type = 'post' AND taggable_id = ? AND source = 'file' AND tag_id NOT IN (SELECT t.id FROM canonical_tags t JOIN json_each(?) j ON j.value = t.name)").run(postId2, JSON.stringify(ids3));
51661
+ if (ids3.length)
51662
+ addTags(context, { type: "post", id: postId2 }, ids3, "file");
51663
+ }, "tagPost");
51664
+ const savePost = /* @__PURE__ */ __name((accountId, record3, before2, now2, reason) => {
51665
+ const merged2 = {
51666
+ ...before2 ? JSON.parse(String(before2.data)) : {},
51667
+ ...definedOnly(record3)
51668
+ };
51669
+ const title2 = merged2.title ?? null;
51670
+ const body2 = merged2.body ?? null;
51671
+ const hash2 = contentHashOf(merged2);
51672
+ if (before2 && (before2.content_hash !== hash2 || before2.status !== merged2.status || before2.title !== title2))
51673
+ keepRevision2(Number(before2.id), before2, reason, now2);
51674
+ const row2 = database.prepare("INSERT INTO content_posts (account_id, external_id, channel_id, type, title, title_folded, body, content_hash, status, published_at, scheduled_for, source_created_at, source_updated_at, version, normalized_text, data, deleted_at, synced_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NULL, ?) ON CONFLICT (account_id, external_id) DO UPDATE SET channel_id = excluded.channel_id, type = excluded.type, title = excluded.title, title_folded = excluded.title_folded, body = excluded.body, content_hash = excluded.content_hash, status = excluded.status, published_at = excluded.published_at, scheduled_for = excluded.scheduled_for, source_created_at = excluded.source_created_at, source_updated_at = excluded.source_updated_at, version = excluded.version, normalized_text = excluded.normalized_text, data = excluded.data, deleted_at = NULL, synced_at = excluded.synced_at RETURNING id").get(accountId, merged2.externalId, merged2.channel ?? null, merged2.type ?? "post", title2, fold(title2 ?? ""), body2, hash2, merged2.status, merged2.publishedAt ?? null, merged2.scheduledFor ?? null, merged2.createdAt ?? null, merged2.updatedAt ?? null, merged2.version ?? null, normalize([title2, body2].filter(Boolean).join("\n")), JSON.stringify(merged2), now2);
51675
+ tagPost(accountId, Number(row2?.id), merged2.terms ?? []);
51676
+ }, "savePost");
51677
+ const save2 = /* @__PURE__ */ __name((key2, kind3, records2, now2, reason) => write(database, () => {
51678
+ const accountId = accountPk(context, key2);
51679
+ const stored4 = database.prepare(`SELECT * FROM ${TABLE[kind3]} WHERE account_id = ? AND external_id = ?`);
51680
+ for (const record3 of records2) {
51681
+ const before2 = stored4.get(accountId, record3.externalId);
51682
+ if (kind3 === "post") {
51683
+ savePost(accountId, record3, before2, now2, reason);
51684
+ continue;
51685
+ }
51686
+ const merged2 = {
51687
+ ...before2 ? JSON.parse(String(before2.data)) : {},
51688
+ ...definedOnly(record3)
51689
+ };
51690
+ if (kind3 === "author")
51691
+ database.prepare("INSERT INTO content_authors (account_id, external_id, name, email, data, source_updated_at, deleted_at, synced_at) VALUES (?, ?, ?, ?, ?, ?, NULL, ?) ON CONFLICT (account_id, external_id) DO UPDATE SET name = excluded.name, email = excluded.email, data = excluded.data, source_updated_at = excluded.source_updated_at, deleted_at = NULL, synced_at = excluded.synced_at").run(accountId, merged2.externalId, merged2.name, merged2.email ?? null, JSON.stringify(merged2), merged2.updatedAt ?? null, now2);
51692
+ else
51693
+ database.prepare("INSERT INTO content_terms (account_id, external_id, kind, name, slug, parent_id, tag_id, data, source_updated_at, deleted_at, synced_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, NULL, ?) ON CONFLICT (account_id, external_id) DO UPDATE SET kind = excluded.kind, name = excluded.name, slug = excluded.slug, parent_id = excluded.parent_id, tag_id = excluded.tag_id, data = excluded.data, source_updated_at = excluded.source_updated_at, deleted_at = NULL, synced_at = excluded.synced_at").run(accountId, merged2.externalId, merged2.kind, merged2.name, merged2.slug ?? null, merged2.parent ?? null, tagIdOf(context, merged2), JSON.stringify(merged2), merged2.updatedAt ?? null, now2);
51694
+ }
51695
+ return records2.length;
51696
+ }), "save");
51697
+ const mark = /* @__PURE__ */ __name((accountId, kind3, row2, now2) => {
51698
+ if (kind3 === "post") {
51699
+ keepRevision2(Number(row2.id), row2, "deleted", now2);
51700
+ database.prepare("DELETE FROM taggings WHERE taggable_type = 'post' AND taggable_id = ? AND source = 'file'").run(Number(row2.id));
51701
+ }
51702
+ database.prepare(`UPDATE ${TABLE[kind3]} SET deleted_at = ? WHERE id = ? AND account_id = ?`).run(now2, Number(row2.id), accountId);
51703
+ }, "mark");
51704
+ const unlisted = /* @__PURE__ */ __name((key2, kind3, listed, before2) => {
51705
+ const accountId = findAccountPk(context, key2);
51706
+ if (accountId === void 0)
51707
+ return [];
51708
+ const keep2 = new Set(listed);
51709
+ return database.prepare(`SELECT external_id FROM ${TABLE[kind3]} WHERE account_id = ? AND deleted_at IS NULL AND synced_at < ?`).all(accountId, before2).map((row2) => String(row2.external_id)).filter((id2) => !keep2.has(id2));
51710
+ }, "unlisted");
51711
+ const list2 = /* @__PURE__ */ __name((key2, kind3, filter = {}) => {
51712
+ const accountId = findAccountPk(context, key2);
51713
+ if (accountId === void 0)
51714
+ return { items: [], hasMore: false };
51715
+ const limit = Math.min(Math.max(filter.limit ?? 100, 1), MOST2);
51716
+ const params = [accountId];
51717
+ let sql2 = `SELECT t.* FROM ${TABLE[kind3]} t WHERE t.account_id = ? AND t.deleted_at IS NULL`;
51718
+ if (kind3 === "post") {
51719
+ if (filter.channel !== void 0) {
51720
+ sql2 += " AND t.channel_id = ?";
51721
+ params.push(filter.channel);
51722
+ }
51723
+ if (filter.statuses?.length) {
51724
+ sql2 += ` AND t.status IN (${filter.statuses.map(() => "?").join(", ")})`;
51725
+ params.push(...filter.statuses);
51726
+ }
51727
+ if (filter.type !== void 0) {
51728
+ sql2 += " AND t.type = ?";
51729
+ params.push(filter.type);
51730
+ }
51731
+ for (const [field4, value] of [
51732
+ ["terms", filter.term],
51733
+ ["authors", filter.author]
51734
+ ])
51735
+ if (value !== void 0) {
51736
+ sql2 += ` AND EXISTS (SELECT 1 FROM json_each(t.data, '$.${field4}') j WHERE j.value = ?)`;
51737
+ params.push(value);
51738
+ }
51739
+ if (filter.since !== void 0) {
51740
+ sql2 += " AND t.published_at >= ?";
51741
+ params.push(filter.since);
51742
+ }
51743
+ if (filter.until !== void 0) {
51744
+ sql2 += " AND t.published_at < ?";
51745
+ params.push(filter.until);
51746
+ }
51747
+ }
51748
+ sql2 += " ORDER BY coalesce(t.source_updated_at, t.synced_at) DESC, t.id DESC LIMIT ? OFFSET ?";
51749
+ params.push(limit + 1, filter.offset ?? 0);
51750
+ const rows = database.prepare(sql2).all(...params);
51751
+ return { items: rows.slice(0, limit).map((row2) => itemOf(kind3, row2)), hasMore: rows.length > limit };
51752
+ }, "list");
51753
+ const find2 = /* @__PURE__ */ __name(({ words: words4, anyWord = false, exact = false, accounts: accounts2, limit, offset = 0 }) => {
51754
+ const match = matchOf2(words4, anyWord, exact);
51755
+ if (!match)
51756
+ return { items: [], hasMore: false };
51757
+ const most = Math.min(Math.max(limit ?? 100, 1), MOST2);
51758
+ const scoped2 = accounts2?.map((one2) => findAccountPk(context, one2)).filter((one2) => one2 !== void 0) ?? [];
51759
+ if (accounts2 !== void 0 && !scoped2.length)
51760
+ return { items: [], hasMore: false };
51761
+ const params = [match];
51762
+ let sql2 = "SELECT t.*, a.provider, a.external_id AS account FROM content_posts t JOIN accounts a ON a.id = t.account_id JOIN (SELECT rowid, rank FROM content_post_words WHERE content_post_words MATCH ?) w ON w.rowid = t.id WHERE t.deleted_at IS NULL";
51763
+ if (accounts2 !== void 0) {
51764
+ sql2 += ` AND t.account_id IN (${scoped2.map(() => "?").join(", ")})`;
51765
+ params.push(...scoped2);
51766
+ }
51767
+ sql2 += " ORDER BY w.rank, t.source_updated_at DESC, t.id DESC LIMIT ? OFFSET ?";
51768
+ params.push(most + 1, offset);
51769
+ const rows = database.prepare(sql2).all(...params);
51770
+ return {
51771
+ items: rows.slice(0, most).map((row2) => ({
51772
+ account: { provider: String(row2.provider), account: String(row2.account) },
51773
+ item: itemOf("post", row2),
51774
+ excerpt: excerptOf([row2.title, row2.body].filter(Boolean).join("\n"), words4)
51775
+ })),
51776
+ hasMore: rows.length > most
51777
+ };
51778
+ }, "find");
51779
+ const postId = /* @__PURE__ */ __name((key2, post) => {
51780
+ const accountId = findAccountPk(context, key2);
51781
+ if (accountId === void 0)
51782
+ return void 0;
51783
+ const row2 = database.prepare("SELECT id FROM content_posts WHERE account_id = ? AND external_id = ?").get(accountId, post);
51784
+ return row2 ? Number(row2.id) : void 0;
51785
+ }, "postId");
51786
+ return {
51787
+ saveChannels: /* @__PURE__ */ __name(async (key2, channels, now2) => write(database, () => {
51788
+ const accountId = accountPk(context, key2);
51789
+ const upsert2 = database.prepare("INSERT INTO content_channels (account_id, external_id, kind, network, name, url, handle, deleted_at, synced_at) VALUES (?, ?, ?, ?, ?, ?, ?, NULL, ?) ON CONFLICT (account_id, external_id) DO UPDATE SET kind = excluded.kind, network = excluded.network, name = excluded.name, url = excluded.url, handle = excluded.handle, deleted_at = NULL, synced_at = excluded.synced_at");
51790
+ for (const one2 of channels)
51791
+ upsert2.run(accountId, one2.externalId, one2.kind, one2.network, one2.name, one2.url ?? null, one2.handle ?? null, now2);
51792
+ return channels.length;
51793
+ }), "saveChannels"),
51794
+ channels: /* @__PURE__ */ __name(async (key2) => {
51795
+ const accountId = findAccountPk(context, key2);
51796
+ if (accountId === void 0)
51797
+ return [];
51798
+ return database.prepare("SELECT * FROM content_channels WHERE account_id = ? AND deleted_at IS NULL ORDER BY id").all(accountId).map((row2) => ({
51799
+ externalId: String(row2.external_id),
51800
+ kind: String(row2.kind),
51801
+ network: String(row2.network),
51802
+ name: String(row2.name),
51803
+ url: row2.url == null ? null : String(row2.url),
51804
+ handle: row2.handle == null ? null : String(row2.handle)
51805
+ }));
51806
+ }, "channels"),
51807
+ save: /* @__PURE__ */ __name(async (key2, kind3, records2, now2, options) => save2(key2, kind3, records2, now2, options?.reason ?? "sync"), "save"),
51808
+ unlisted: /* @__PURE__ */ __name(async (key2, kind3, listed, before2) => unlisted(key2, kind3, listed, before2), "unlisted"),
51809
+ markDeleted: /* @__PURE__ */ __name(async (key2, kind3, externalId, now2) => {
51810
+ const accountId = findAccountPk(context, key2);
51811
+ if (accountId === void 0)
51812
+ return false;
51813
+ return write(database, () => {
51814
+ const row2 = database.prepare(`SELECT * FROM ${TABLE[kind3]} WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL`).get(accountId, externalId);
51815
+ if (!row2)
51816
+ return false;
51817
+ mark(accountId, kind3, row2, now2);
51818
+ return true;
51819
+ });
51820
+ }, "markDeleted"),
51821
+ get: /* @__PURE__ */ __name(async (key2, kind3, externalId) => {
51822
+ const accountId = findAccountPk(context, key2);
51823
+ if (accountId === void 0)
51824
+ return void 0;
51825
+ const row2 = database.prepare(`SELECT * FROM ${TABLE[kind3]} WHERE account_id = ? AND external_id = ?`).get(accountId, externalId);
51826
+ return row2 ? itemOf(kind3, row2) : void 0;
51827
+ }, "get"),
51828
+ list: /* @__PURE__ */ __name(async (key2, kind3, filter) => list2(key2, kind3, filter), "list"),
51829
+ find: /* @__PURE__ */ __name(async (search2) => find2(search2), "find"),
51830
+ count: /* @__PURE__ */ __name(async (key2, kind3) => {
51831
+ const accountId = findAccountPk(context, key2);
51832
+ if (accountId === void 0)
51833
+ return 0;
51834
+ return Number(database.prepare(`SELECT count(*) AS n FROM ${TABLE[kind3]} WHERE account_id = ? AND deleted_at IS NULL`).get(accountId)?.n ?? 0);
51835
+ }, "count"),
51836
+ due: /* @__PURE__ */ __name(async (key2, now2) => {
51837
+ const accountId = findAccountPk(context, key2);
51838
+ if (accountId === void 0)
51839
+ return [];
51840
+ return database.prepare("SELECT external_id FROM content_posts WHERE account_id = ? AND deleted_at IS NULL AND status = 'scheduled' AND scheduled_for IS NOT NULL AND scheduled_for <= ? ORDER BY synced_at, scheduled_for, id").all(accountId, now2).map((row2) => String(row2.external_id));
51841
+ }, "due"),
51842
+ revisions: /* @__PURE__ */ __name(async (key2, post) => {
51843
+ const id2 = postId(key2, post);
51844
+ if (id2 === void 0)
51845
+ return [];
51846
+ return database.prepare("SELECT * FROM content_post_revisions WHERE post_id = ? ORDER BY created_at DESC, id DESC").all(id2).map((row2) => ({
51847
+ title: row2.title == null ? null : String(row2.title),
51848
+ body: row2.body == null ? null : String(row2.body),
51849
+ status: String(row2.status),
51850
+ contentHash: String(row2.content_hash),
51851
+ version: row2.version == null ? null : String(row2.version),
51852
+ reason: String(row2.reason),
51853
+ createdAt: Number(row2.created_at)
51854
+ }));
51855
+ }, "revisions"),
51856
+ saveMetrics: /* @__PURE__ */ __name(async (key2, metrics) => write(database, () => {
51857
+ const insert = database.prepare("INSERT INTO content_metrics (post_id, at, views, reactions, comments, shares, clicks, raw) VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
51858
+ let saved = 0;
51859
+ for (const one2 of metrics) {
51860
+ const id2 = postId(key2, one2.post);
51861
+ if (id2 === void 0)
51862
+ continue;
51863
+ insert.run(id2, one2.at, one2.views ?? null, one2.reactions ?? null, one2.comments ?? null, one2.shares ?? null, one2.clicks ?? null, one2.raw === void 0 ? null : JSON.stringify(one2.raw));
51864
+ saved += 1;
51865
+ }
51866
+ return saved;
51867
+ }), "saveMetrics"),
51868
+ metrics: /* @__PURE__ */ __name(async (key2, post, limit = 100) => {
51869
+ const id2 = postId(key2, post);
51870
+ if (id2 === void 0)
51871
+ return [];
51872
+ return database.prepare("SELECT * FROM content_metrics WHERE post_id = ? ORDER BY at DESC, id DESC LIMIT ?").all(id2, Math.min(Math.max(limit, 1), MOST2)).map((row2) => ({
51873
+ post,
51874
+ at: Number(row2.at),
51875
+ ...Object.fromEntries(["views", "reactions", "comments", "shares", "clicks"].flatMap((name) => row2[name] == null ? [] : [[name, Number(row2[name])]])),
51876
+ ...row2.raw == null ? {} : { raw: JSON.parse(String(row2.raw)) }
51877
+ }));
51878
+ }, "metrics"),
51879
+ people: /* @__PURE__ */ __name(async (key2, authors) => {
51880
+ const accountId = findAccountPk(context, key2);
51881
+ if (accountId === void 0 || authors.length === 0)
51882
+ return [];
51883
+ return database.prepare(`SELECT u.external_id AS author, p.id AS person, p.name AS name FROM content_authors u JOIN identities i ON i.email IS NOT NULL AND lower(i.email) = lower(u.email) JOIN identity_links l ON l.identity_id = i.id JOIN persons p ON p.id = l.person_id WHERE u.account_id = ? AND u.external_id IN (${authors.map(() => "?").join(", ")}) GROUP BY u.external_id HAVING count(DISTINCT p.id) = 1 ORDER BY u.external_id`).all(accountId, ...authors).map((row2) => ({
51884
+ author: String(row2.author),
51885
+ person: `person:${String(row2.person)}`,
51886
+ name: row2.name == null ? null : String(row2.name)
51887
+ }));
51888
+ }, "people")
51889
+ };
51890
+ }, "contentStoreOver");
51891
+
51892
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
51394
51893
  var remote = /* @__PURE__ */ __name(() => `CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source') IN (${documentAccountProvidersSql()}) ELSE 0 END`, "remote");
51395
51894
  var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${remote()}) THEN
51396
51895
  CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
@@ -51403,7 +51902,7 @@ var contextDocumentTimeKind = /* @__PURE__ */ __name(() => `CASE WHEN (${remoteT
51403
51902
  THEN 'source-modified' ELSE 'stored-update' END`, "contextDocumentTimeKind");
51404
51903
  var contextDocumentUrl = /* @__PURE__ */ __name(() => `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`, "contextDocumentUrl");
51405
51904
 
51406
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
51905
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
51407
51906
  var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
51408
51907
  const { source: source2, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
51409
51908
  signal?.throwIfAborted();
@@ -51502,7 +52001,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
51502
52001
  });
51503
52002
  }, "readMeetingContextEvidence");
51504
52003
 
51505
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
52004
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
51506
52005
  var corpora = {
51507
52006
  message: {
51508
52007
  table: "messages",
@@ -51747,7 +52246,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
51747
52246
  }
51748
52247
  }), "contextRecordsOver");
51749
52248
 
51750
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-changes.js
52249
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-changes.js
51751
52250
  var CRM_CHANGES = [
51752
52251
  "created",
51753
52252
  "moved",
@@ -51772,7 +52271,7 @@ var changesQuery = /* @__PURE__ */ __name((context, key2, filter) => {
51772
52271
  const items = /* @__PURE__ */ __name((table, kind3) => `SELECT '${kind3}' AS kind, d.id, d.external_id, d.status, d.created_at, d.closed_date, json_extract(d.metadata, '$.assignee') AS owner, s.pipeline_id FROM ${table} d JOIN pipeline_stages s ON s.id = d.stage_id WHERE d.account_id = ?1 AND d.deleted_at IS NULL AND (?15 IS NULL OR json_extract(d.metadata, '$.assignee') = ?16)`, "items");
51773
52272
  const entries = "SELECT r.id AS record, i.kind, i.id AS item, i.owner, i.pipeline_id, CAST(json_extract(r.fields, '$.at') AS INTEGER) AS at, CAST(json_extract(r.fields, '$.stage_id') AS INTEGER) AS stage, lag(CAST(json_extract(r.fields, '$.stage_id') AS INTEGER)) OVER (PARTITION BY i.kind, i.id ORDER BY json_extract(r.fields, '$.at'), r.id) AS before FROM records r JOIN record_relations rr ON rr.record_id = r.id AND rr.role = 'on' JOIN items i ON i.kind = rr.target_type AND i.external_id = rr.target_external_id WHERE r.account_id = ?1 AND r.type = ?2 AND r.deleted_at IS NULL";
51774
52273
  const closing = "(SELECT outcome FROM pipeline_stages WHERE id = m.stage) IN ('won', 'lost')";
51775
- const itemOf2 = /* @__PURE__ */ __name((record3) => `(SELECT i.kind || ':' || i.id FROM record_relations rr JOIN items i ON i.kind = rr.target_type AND i.external_id = rr.target_external_id WHERE rr.record_id = ${record3} AND rr.role = 'on' LIMIT 1)`, "itemOf");
52274
+ const itemOf3 = /* @__PURE__ */ __name((record3) => `(SELECT i.kind || ':' || i.id FROM record_relations rr JOIN items i ON i.kind = rr.target_type AND i.external_id = rr.target_external_id WHERE rr.record_id = ${record3} AND rr.role = 'on' LIMIT 1)`, "itemOf");
51776
52275
  const closedAt = "(SELECT max(m.at) FROM entries m WHERE m.kind = i.kind AND m.item = i.id AND (SELECT outcome FROM pipeline_stages WHERE id = m.stage) = i.status)";
51777
52276
  const onDealOrLead = "EXISTS (SELECT 1 FROM record_relations x WHERE x.record_id = a.id AND x.role = 'on' AND x.target_type IN ('deal', 'lead'))";
51778
52277
  const linkedToSeen = "EXISTS (SELECT 1 FROM identities n JOIN identity_links l ON l.identity_id = n.id JOIN links k ON k.to_type = 'person' AND k.to_id = l.person_id AND k.deleted_at IS NULL JOIN items v ON v.kind = k.from_type AND v.id = k.from_id WHERE n.provider = ?17 AND n.external_id = ?18 || r.external_id)";
@@ -51783,7 +52282,7 @@ var changesQuery = /* @__PURE__ */ __name((context, key2, filter) => {
51783
52282
  // The closed day only narrows the rows; the window is checked on `at`, so a deal is listed in one window only.
51784
52283
  `SELECT i.status, coalesce(${closedAt}, CAST(strftime('%s', i.closed_date) AS INTEGER) * 1000 + ${HALF_DAY}), i.kind, i.id, NULL, NULL, NULL, ${closedAt} IS NOT NULL, i.owner, i.pipeline_id FROM items i WHERE i.status IN ('won', 'lost') AND i.closed_date BETWEEN ?8 AND ?9`,
51785
52284
  "SELECT 'owner_changed', CAST(json_extract(r.fields, '$.at') AS INTEGER), i.kind, i.id, r.id, NULL, NULL, 0, json_extract(r.fields, '$.to'), i.pipeline_id FROM records r JOIN record_relations rr ON rr.record_id = r.id AND rr.role = 'on' JOIN items i ON i.kind = rr.target_type AND i.external_id = rr.target_external_id WHERE r.account_id = ?1 AND r.type = ?3 AND r.deleted_at IS NULL AND json_extract(r.fields, '$.at') BETWEEN ?6 AND ?7",
51786
- ...["created_at", "done_at"].map((field4) => `SELECT '${field4 === "created_at" ? "activity_added" : "activity_done"}', CAST(json_extract(a.fields, '$.${field4}') AS INTEGER), coalesce(substr(a.item, 1, instr(a.item, ':') - 1), a.target), CAST(substr(a.item, instr(a.item, ':') + 1) AS INTEGER), a.id, NULL, NULL, 0, coalesce((SELECT owner FROM items i WHERE i.kind || ':' || i.id = a.item), json_extract(a.fields, '$.assignee')), (SELECT pipeline_id FROM items i WHERE i.kind || ':' || i.id = a.item) FROM (SELECT r.id, r.fields, ${itemOf2("r.id")} AS item, (SELECT target_type FROM record_relations WHERE record_id = r.id AND role = 'on' LIMIT 1) AS target FROM records r WHERE r.account_id = ?1 AND r.type = ?4 AND r.deleted_at IS NULL AND json_extract(r.fields, '$.${field4}') BETWEEN ?6 AND ?7` + // One that arrived done with no due date was done as it was made: its `activity_added` says it.
52285
+ ...["created_at", "done_at"].map((field4) => `SELECT '${field4 === "created_at" ? "activity_added" : "activity_done"}', CAST(json_extract(a.fields, '$.${field4}') AS INTEGER), coalesce(substr(a.item, 1, instr(a.item, ':') - 1), a.target), CAST(substr(a.item, instr(a.item, ':') + 1) AS INTEGER), a.id, NULL, NULL, 0, coalesce((SELECT owner FROM items i WHERE i.kind || ':' || i.id = a.item), json_extract(a.fields, '$.assignee')), (SELECT pipeline_id FROM items i WHERE i.kind || ':' || i.id = a.item) FROM (SELECT r.id, r.fields, ${itemOf3("r.id")} AS item, (SELECT target_type FROM record_relations WHERE record_id = r.id AND role = 'on' LIMIT 1) AS target FROM records r WHERE r.account_id = ?1 AND r.type = ?4 AND r.deleted_at IS NULL AND json_extract(r.fields, '$.${field4}') BETWEEN ?6 AND ?7` + // One that arrived done with no due date was done as it was made: its `activity_added` says it.
51787
52286
  (field4 === "done_at" ? " AND NOT (json_extract(r.fields, '$.due_at') IS NULL AND json_extract(r.fields, '$.done_at') = json_extract(r.fields, '$.created_at'))" : "") + `) a WHERE ?15 IS NULL OR a.item IS NOT NULL OR (NOT ${onDealOrLead} AND json_extract(a.fields, '$.assignee') = ?16)`),
51788
52287
  `SELECT 'person_added', CAST(json_extract(r.fields, '$.created_at') AS INTEGER), 'person', NULL, r.id, NULL, NULL, 0, json_extract(r.fields, '$.assignee'), NULL FROM records r WHERE r.account_id = ?1 AND r.type = ?5 AND r.deleted_at IS NULL AND json_extract(r.fields, '$.created_at') BETWEEN ?6 AND ?7 AND (?15 IS NULL OR json_extract(r.fields, '$.assignee') = ?16 OR ${linkedToSeen})`
51789
52288
  ];
@@ -51890,7 +52389,7 @@ var crmReadsOver = /* @__PURE__ */ __name((context) => {
51890
52389
  };
51891
52390
  }, "crmReadsOver");
51892
52391
 
51893
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-contacts.js
52392
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-contacts.js
51894
52393
  var PLACEHOLDER = /(?:^|\s)null(?:\s+#\d+)?(?=\s|$)/gi;
51895
52394
  var withoutPlaceholder = /* @__PURE__ */ __name((name) => name.replace(PLACEHOLDER, " ").replace(/\s+/g, " ").trim() || null, "withoutPlaceholder");
51896
52395
  var DryRun = class extends Error {
@@ -51969,7 +52468,7 @@ var removeCrmContacts = /* @__PURE__ */ __name((context, key2, { users, before:
51969
52468
  }
51970
52469
  }, "removeCrmContacts");
51971
52470
 
51972
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/crm.js
52471
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/crm.js
51973
52472
  var PENDING = "crm:pending-relations";
51974
52473
  var PENDING_DAYS = 30;
51975
52474
  var PENDING_MOST = 5e3;
@@ -52524,135 +53023,10 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
52524
53023
  };
52525
53024
  }, "crmCopiesOver");
52526
53025
 
52527
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-files.js
52528
- import { sep } from "node:path";
52529
- var MOST = 500;
52530
- var CURRENTLY = /* @__PURE__ */ __name((table) => `EXISTS (SELECT 1 FROM ${table} r WHERE r.account_id = f.account_id AND r.external_id = f.owner_id AND r.deleted_at IS NULL AND json_extract(r.metadata, '$.assignee') = ?)`, "CURRENTLY");
52531
- var EXCERPT = 240;
52532
- var COLUMNS7 = "f.external_id, f.owner_kind, f.owner_id, f.owner_assignee, f.source, f.name, f.mime, f.size, f.external_created_at, f.local_path, f.content_sha256, f.extraction, f.extraction_error, f.downloaded_by, f.downloaded_at";
52533
- var text6 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
52534
- var number3 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
52535
- var rowOf2 = /* @__PURE__ */ __name((row2) => ({
52536
- externalId: String(row2.external_id),
52537
- ownerKind: String(row2.owner_kind),
52538
- ownerId: String(row2.owner_id),
52539
- ownerAssignee: text6(row2.owner_assignee),
52540
- source: String(row2.source),
52541
- name: String(row2.name),
52542
- mime: text6(row2.mime),
52543
- size: number3(row2.size),
52544
- externalCreatedAt: number3(row2.external_created_at),
52545
- localPath: text6(row2.local_path),
52546
- contentSha256: text6(row2.content_sha256),
52547
- extraction: text6(row2.extraction),
52548
- extractionError: text6(row2.extraction_error),
52549
- downloadedBy: text6(row2.downloaded_by),
52550
- downloadedAt: Number(row2.downloaded_at)
52551
- }), "rowOf");
52552
- var matchOf2 = /* @__PURE__ */ __name((words4, anyWord, exact) => {
52553
- const phrases = words4.map((word2) => normalize(word2).trim()).filter(Boolean).map((word2) => {
52554
- const quoted6 = `"${word2.replaceAll('"', '""')}"`;
52555
- return exact || /\s/u.test(word2) || word2.length < 3 ? quoted6 : `${quoted6}*`;
52556
- });
52557
- return phrases.length ? [...new Set(phrases)].join(anyWord ? " OR " : " AND ") : void 0;
52558
- }, "matchOf");
52559
- var excerptOf = /* @__PURE__ */ __name((body2, words4) => {
52560
- const folded6 = fold(body2);
52561
- const at2 = words4.map((word2) => folded6.indexOf(fold(word2).trim())).filter((index2) => index2 >= 0).sort((a, b) => a - b)[0];
52562
- const start = Math.max(0, (at2 ?? 0) - EXCERPT / 4);
52563
- return body2.slice(start, start + EXCERPT).replace(/\s+/gu, " ").trim();
52564
- }, "excerptOf");
52565
- var resetCrmFileWords = /* @__PURE__ */ __name((database) => {
52566
- if (!database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'crm_file_words'").get())
52567
- return 0;
52568
- return write(database, () => {
52569
- const update2 = database.prepare("UPDATE crm_files SET normalized_text = ? WHERE id = ?");
52570
- for (const row2 of database.prepare("SELECT id, text, normalized_text FROM crm_files WHERE text IS NOT NULL").all()) {
52571
- const normalized = normalize(String(row2.text));
52572
- if (normalized !== row2.normalized_text)
52573
- update2.run(normalized, Number(row2.id));
52574
- }
52575
- database.exec("INSERT INTO crm_file_words (crm_file_words) VALUES ('delete-all')");
52576
- const { changes } = database.prepare("INSERT INTO crm_file_words (rowid, normalized_text) SELECT id, normalized_text FROM crm_files WHERE normalized_text <> ''").run();
52577
- return Number(changes);
52578
- });
52579
- }, "resetCrmFileWords");
52580
- var crmFilesOver = /* @__PURE__ */ __name((context) => {
52581
- const { database } = context;
52582
- const under = "substr(f.local_path, 1, length(?)) = ?";
52583
- const inside = /* @__PURE__ */ __name((folder) => folder.endsWith(sep) ? folder : `${folder}${sep}`, "inside");
52584
- const save2 = /* @__PURE__ */ __name((key2, file) => write(database, () => {
52585
- const accountId = accountPk(context, key2);
52586
- database.prepare("INSERT INTO crm_files (account_id, external_id, owner_kind, owner_id, owner_assignee, source, name, name_folded, mime, size, external_created_at, local_path, content_sha256, text, normalized_text, extraction, extraction_error, downloaded_by, downloaded_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT (account_id, external_id) DO UPDATE SET owner_assignee = excluded.owner_assignee, source = excluded.source, name = excluded.name, name_folded = excluded.name_folded, mime = excluded.mime, size = excluded.size, external_created_at = excluded.external_created_at, local_path = excluded.local_path, content_sha256 = excluded.content_sha256, text = excluded.text, normalized_text = excluded.normalized_text, extraction = excluded.extraction, extraction_error = excluded.extraction_error, downloaded_by = excluded.downloaded_by, downloaded_at = excluded.downloaded_at").run(accountId, file.externalId, file.ownerKind, file.ownerId, file.ownerAssignee, file.source, file.name, fold(file.name), file.mime, file.size, file.externalCreatedAt, file.localPath, file.contentSha256, file.text, file.text === null ? null : normalize(file.text), file.extraction, file.extractionError, file.downloadedBy, file.downloadedAt);
52587
- }), "save");
52588
- const rowsOf2 = /* @__PURE__ */ __name((key2, columns2, where, ...params) => {
52589
- const accountId = findAccountPk(context, key2);
52590
- if (accountId === void 0)
52591
- return [];
52592
- return database.prepare(`SELECT ${columns2} FROM crm_files f WHERE f.account_id = ? AND ${where}`).all(accountId, ...params);
52593
- }, "rowsOf");
52594
- const find2 = /* @__PURE__ */ __name(({ words: words4, anyWord = false, exact = false, accounts: accounts2, viewers = [], limit }) => {
52595
- const match = matchOf2(words4, anyWord, exact);
52596
- if (!match)
52597
- return { items: [], hasMore: false };
52598
- const most = Math.min(Math.max(limit ?? 100, 1), MOST);
52599
- const scoped2 = accounts2?.map((one2) => findAccountPk(context, one2)).filter((one2) => one2 !== void 0) ?? [];
52600
- if (accounts2 !== void 0 && !scoped2.length)
52601
- return { items: [], hasMore: false };
52602
- const limits = viewers.flatMap((viewer) => {
52603
- const id2 = findAccountPk(context, viewer.account);
52604
- return id2 === void 0 ? [] : [{ id: id2, assignee: viewer.assignee }];
52605
- });
52606
- const params = [match];
52607
- let sql2 = `SELECT ${COLUMNS7}, f.text, a.provider, a.external_id AS account FROM crm_files f JOIN accounts a ON a.id = f.account_id JOIN (SELECT rowid, rank FROM crm_file_words WHERE crm_file_words MATCH ?) w ON w.rowid = f.id WHERE 1`;
52608
- if (accounts2 !== void 0) {
52609
- sql2 += ` AND f.account_id IN (${scoped2.map(() => "?").join(", ")})`;
52610
- for (const id2 of scoped2)
52611
- params.push(id2);
52612
- }
52613
- for (const one2 of limits) {
52614
- if (one2.assignee === null) {
52615
- sql2 += " AND f.account_id <> ?";
52616
- params.push(one2.id);
52617
- continue;
52618
- }
52619
- sql2 += ` AND (f.account_id <> ? OR CASE f.owner_kind WHEN 'deal' THEN ${CURRENTLY("deals")} WHEN 'lead' THEN ${CURRENTLY("leads")} ELSE f.owner_assignee = ? END)`;
52620
- params.push(one2.id, one2.assignee, one2.assignee, one2.assignee);
52621
- }
52622
- sql2 += " ORDER BY w.rank, f.downloaded_at DESC, f.id DESC LIMIT ?";
52623
- params.push(most + 1);
52624
- const hits = database.prepare(sql2).all(...params).map((row2) => ({
52625
- account: { provider: String(row2.provider), account: String(row2.account) },
52626
- file: rowOf2(row2),
52627
- excerpt: excerptOf(String(row2.text ?? ""), words4)
52628
- }));
52629
- return pageOfRows(hits, most);
52630
- }, "find");
52631
- return {
52632
- save: /* @__PURE__ */ __name(async (key2, file) => save2(key2, file), "save"),
52633
- get: /* @__PURE__ */ __name(async (key2, externalId) => {
52634
- const [row2] = rowsOf2(key2, `${COLUMNS7}, f.text`, "f.external_id = ?", externalId);
52635
- return row2 ? { ...rowOf2(row2), text: text6(row2.text) } : void 0;
52636
- }, "get"),
52637
- ofOwner: /* @__PURE__ */ __name(async (key2, kind3, id2) => rowsOf2(key2, COLUMNS7, "f.owner_kind = ? AND f.owner_id = ? ORDER BY f.downloaded_at DESC, f.id DESC", kind3, id2).map(rowOf2), "ofOwner"),
52638
- storedBytes: /* @__PURE__ */ __name(async (key2, folder) => rowsOf2(key2, "coalesce(sum(f.size), 0) AS bytes", `f.local_path IS NOT NULL AND ${under}`, inside(folder), inside(folder)).reduce((sum, row2) => sum + Number(row2.bytes), 0), "storedBytes"),
52639
- droppable: /* @__PURE__ */ __name(async (key2, folder) => rowsOf2(key2, COLUMNS7, `f.local_path IS NOT NULL AND ${under} AND coalesce(f.text, '') <> '' ORDER BY f.downloaded_at, f.id`, inside(folder), inside(folder)).map(rowOf2), "droppable"),
52640
- savedPaths: /* @__PURE__ */ __name(async (key2) => rowsOf2(key2, "f.local_path", "f.local_path IS NOT NULL ORDER BY f.id").map((row2) => String(row2.local_path)), "savedPaths"),
52641
- forgetFile: /* @__PURE__ */ __name(async (key2, externalId) => {
52642
- const accountId = findAccountPk(context, key2);
52643
- if (accountId === void 0)
52644
- return;
52645
- write(database, () => database.prepare("UPDATE crm_files SET local_path = NULL WHERE account_id = ? AND external_id = ?").run(accountId, externalId));
52646
- }, "forgetFile"),
52647
- find: /* @__PURE__ */ __name(async (search2) => find2(search2), "find"),
52648
- limits: /* @__PURE__ */ __name(async (key2) => crmFileLimits(database, key2), "limits")
52649
- };
52650
- }, "crmFilesOver");
52651
-
52652
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
52653
- import { createHash as createHash14, randomBytes as randomBytes2 } from "node:crypto";
53026
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
53027
+ import { createHash as createHash15, randomBytes as randomBytes2 } from "node:crypto";
52654
53028
 
52655
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/decision-requests.js
53029
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/decision-requests.js
52656
53030
  var DECISION_ACTIONS = ["confirm", "reject", "ask-confirm", "ask-reject", "back", "later"];
52657
53031
  var DECISION_TTL_MS = 72 * 60 * 60 * 1e3;
52658
53032
  var CALLBACK_PREFIX = "wcr1:";
@@ -52666,8 +53040,8 @@ var callbackDataOf = /* @__PURE__ */ __name((token) => {
52666
53040
  }, "callbackDataOf");
52667
53041
  var parseCallbackData = /* @__PURE__ */ __name((data) => typeof data === "string" ? CALLBACK.exec(data)?.[1] : void 0, "parseCallbackData");
52668
53042
 
52669
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
52670
- var digestOf = /* @__PURE__ */ __name((token) => createHash14("sha256").update(token).digest("hex"), "digestOf");
53043
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
53044
+ var digestOf = /* @__PURE__ */ __name((token) => createHash15("sha256").update(token).digest("hex"), "digestOf");
52671
53045
  var newToken = /* @__PURE__ */ __name(() => randomBytes2(16).toString("base64url"), "newToken");
52672
53046
  var requestOf = /* @__PURE__ */ __name((row2) => ({
52673
53047
  proposalId: row2.proposal_id,
@@ -52765,7 +53139,7 @@ var decisionRequestStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
52765
53139
  };
52766
53140
  }, "decisionRequestStoreOver");
52767
53141
 
52768
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-listing.js
53142
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-listing.js
52769
53143
  var MEETING_ROW_KINDS = ["meeting", "call", "event"];
52770
53144
  var DAY9 = 864e5;
52771
53145
  var JOINED = `(SELECT ce.event_id FROM calendar_entries ce JOIN events je ON je.id = ce.event_id
@@ -53152,7 +53526,7 @@ var meetingListingOver = /* @__PURE__ */ __name((context) => {
53152
53526
  };
53153
53527
  }, "meetingListingOver");
53154
53528
 
53155
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/document-listing.js
53529
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/document-listing.js
53156
53530
  var DOCUMENT_KINDS = [
53157
53531
  "transcript",
53158
53532
  "doc",
@@ -53389,7 +53763,7 @@ var documentListingOver = /* @__PURE__ */ __name((context) => {
53389
53763
  };
53390
53764
  }, "documentListingOver");
53391
53765
 
53392
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
53766
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
53393
53767
  var NOTE_FIELDS = [
53394
53768
  "text",
53395
53769
  "exact",
@@ -53886,7 +54260,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
53886
54260
  };
53887
54261
  }, "noteSearchOver");
53888
54262
 
53889
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
54263
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
53890
54264
  var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
53891
54265
  var inEventAccounts = /* @__PURE__ */ __name((event2) => searchableCopy(event2, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
53892
54266
  var EVENT_CORPUS = {
@@ -54026,7 +54400,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
54026
54400
  };
54027
54401
  }, "eventSearchOver");
54028
54402
 
54029
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
54403
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
54030
54404
  var NAMED4 = "SELECT f.*, b.name AS author_name, b.kind AS author_kind FROM facts f LEFT JOIN bots b ON f.author_type = 'bot' AND b.id = f.author_id";
54031
54405
  var iso13 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
54032
54406
  var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
@@ -54289,7 +54663,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
54289
54663
  };
54290
54664
  }, "factsStoreOver");
54291
54665
 
54292
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
54666
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
54293
54667
  var invalid5 = /* @__PURE__ */ __name((message3) => {
54294
54668
  throw new CliError("validation_error", message3);
54295
54669
  }, "invalid");
@@ -54457,7 +54831,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
54457
54831
  return { snapshot: snapshot2, snapshotParts, previous, settle, keepWaiting, named: named2, sameDecision, create };
54458
54832
  }, "findingsCoreOver");
54459
54833
 
54460
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
54834
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
54461
54835
  var stale = /* @__PURE__ */ __name(() => {
54462
54836
  throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
54463
54837
  reason: "evidence-findings.stale"
@@ -54721,7 +55095,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
54721
55095
  };
54722
55096
  }, "evidenceFindingsStoreOver");
54723
55097
 
54724
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
55098
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
54725
55099
  var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
54726
55100
  var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
54727
55101
  rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
@@ -54775,7 +55149,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
54775
55149
  }, "forPerson")
54776
55150
  }), "involvementStoreOver");
54777
55151
 
54778
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/labelled.js
55152
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/labelled.js
54779
55153
  var LABELLED = {
54780
55154
  note: "note",
54781
55155
  document: "document",
@@ -54788,8 +55162,8 @@ var LABELLED = {
54788
55162
  };
54789
55163
  var accountMeetingTagging = /* @__PURE__ */ __name((alias2) => `(${alias2}.taggable_type <> 'meeting' OR EXISTS (SELECT 1 FROM meetings mt WHERE mt.id = ${alias2}.taggable_id AND mt.deleted_at IS NULL AND (? IS NULL OR mt.account_id = ?)))`, "accountMeetingTagging");
54790
55164
 
54791
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
54792
- import { createHash as createHash15 } from "node:crypto";
55165
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
55166
+ import { createHash as createHash16 } from "node:crypto";
54793
55167
  var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
54794
55168
  var id = /* @__PURE__ */ __name((value) => {
54795
55169
  if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
@@ -54818,7 +55192,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
54818
55192
  project: `project:${row2.to_id}`,
54819
55193
  confirmed: Number(row2.confirmed) === 1,
54820
55194
  provenance: row2.evidence == null ? null : String(row2.evidence),
54821
- fingerprint: createHash15("sha256").update(JSON.stringify([row2.id, row2.from_id, row2.to_id, row2.source, row2.confirmed, row2.evidence, row2.updated_at])).digest("hex")
55195
+ fingerprint: createHash16("sha256").update(JSON.stringify([row2.id, row2.from_id, row2.to_id, row2.source, row2.confirmed, row2.evidence, row2.updated_at])).digest("hex")
54822
55196
  };
54823
55197
  }, "linkOf");
54824
55198
  return {
@@ -54874,7 +55248,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
54874
55248
  };
54875
55249
  }, "meetingProjectsStoreOver");
54876
55250
 
54877
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
55251
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
54878
55252
  var ORGANIZATIONS_QUERY = {
54879
55253
  entity: "organization",
54880
55254
  backend: "sql",
@@ -54915,7 +55289,7 @@ var REMINDERS_QUERY = {
54915
55289
  })
54916
55290
  };
54917
55291
 
54918
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/organization-categories.js
55292
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/organization-categories.js
54919
55293
  var OWN2 = "(SELECT id FROM organizations WHERE deleted_at IS NULL AND json_extract(metadata, '$.own') = 1)";
54920
55294
  var EMPLOYED = "('employee', 'contractor', 'founder')";
54921
55295
  var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now2) => {
@@ -54936,7 +55310,7 @@ var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now
54936
55310
  return { sql: `EXISTS (SELECT 1 FROM links l WHERE ${where} AND ${usable})`, params: keys };
54937
55311
  }, "categorySql");
54938
55312
 
54939
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
55313
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
54940
55314
  var organizationOf = /* @__PURE__ */ __name((row2) => ({
54941
55315
  id: String(row2.id),
54942
55316
  ref: `organization:${row2.id}`,
@@ -54981,7 +55355,7 @@ var organizationsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) =>
54981
55355
  }), "setOwnOrganization")
54982
55356
  }), "organizationsStoreOver");
54983
55357
 
54984
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-list.js
55358
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-list.js
54985
55359
  var KINDS = RELATION_KINDS.map(linkKind).join(", ");
54986
55360
  var ACCOUNT_ENDS = [
54987
55361
  ["deal", "deals"],
@@ -55144,13 +55518,13 @@ var relationListOver = /* @__PURE__ */ __name((context) => {
55144
55518
  __name(proposalItem, "proposalItem");
55145
55519
  }, "relationListOver");
55146
55520
 
55147
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-reads.js
55521
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-reads.js
55148
55522
  var relationReadsOver = /* @__PURE__ */ __name((context) => ({
55149
55523
  ...relationListOver(context),
55150
55524
  ...relationRolesOver(context)
55151
55525
  }), "relationReadsOver");
55152
55526
 
55153
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review.js
55527
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review.js
55154
55528
  var TABLES6 = { memory: "memories", fact: "facts" };
55155
55529
  var RETIRED = /* @__PURE__ */ new Set(["superseded", "reversed", "rejected", "stale"]);
55156
55530
  var DEFAULT_LIMIT = 500;
@@ -55393,16 +55767,16 @@ var sourceReviewStoreOver = /* @__PURE__ */ __name((context) => {
55393
55767
  };
55394
55768
  }, "sourceReviewStoreOver");
55395
55769
 
55396
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
55770
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
55771
+ import { createHash as createHash19 } from "node:crypto";
55772
+
55773
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
55397
55774
  import { createHash as createHash18 } from "node:crypto";
55398
55775
 
55399
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
55776
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
55400
55777
  import { createHash as createHash17 } from "node:crypto";
55401
55778
 
55402
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
55403
- import { createHash as createHash16 } from "node:crypto";
55404
-
55405
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
55779
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
55406
55780
  var consolidationId = /* @__PURE__ */ __name((value, field4) => {
55407
55781
  if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
55408
55782
  throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
@@ -55453,7 +55827,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
55453
55827
  return input;
55454
55828
  }, "consolidationApplyInput");
55455
55829
 
55456
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
55830
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
55457
55831
  var receiptOf = /* @__PURE__ */ __name((row2) => ({
55458
55832
  id: String(row2.id),
55459
55833
  sourceId: String(row2.source_id),
@@ -55477,7 +55851,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
55477
55851
  check3();
55478
55852
  return write(database, () => {
55479
55853
  const owner = ownerPerson(database);
55480
- const request = createHash16("sha256").update(JSON.stringify([
55854
+ const request = createHash17("sha256").update(JSON.stringify([
55481
55855
  source2,
55482
55856
  survivor,
55483
55857
  owner.type,
@@ -55528,7 +55902,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
55528
55902
  }, { beforeCommit: check3 });
55529
55903
  }, "applyTagConsolidation");
55530
55904
 
55531
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
55905
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
55532
55906
  var selections = [
55533
55907
  ["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
55534
55908
  ["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
@@ -55574,7 +55948,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
55574
55948
  const memberIds = JSON.stringify([...sourceMemberIds, ...survivorMemberIds].map(Number));
55575
55949
  const captured = JSON.stringify(graph);
55576
55950
  let readBytes = Buffer.byteLength(captured);
55577
- const hash2 = createHash17("sha256").update(JSON.stringify([source2, survivor, catalog.fingerprint, graph]));
55951
+ const hash2 = createHash18("sha256").update(JSON.stringify([source2, survivor, catalog.fingerprint, graph]));
55578
55952
  for (const [table, where] of selections) {
55579
55953
  cancelled(options);
55580
55954
  const parameters = table === "links" ? [memberIds, memberIds] : [memberIds];
@@ -55672,7 +56046,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
55672
56046
  };
55673
56047
  }, "previewRows");
55674
56048
 
55675
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
56049
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
55676
56050
  var kinds = ["project", "tag", "topic"];
55677
56051
  var cancelled2 = /* @__PURE__ */ __name((signal) => {
55678
56052
  if (signal?.aborted)
@@ -55764,7 +56138,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
55764
56138
  cancelled2(options.signal);
55765
56139
  return {
55766
56140
  entries,
55767
- fingerprint: `v1:${options.kind ?? "all"}:${options.scope ?? "all"}:${createHash18("sha256").update(JSON.stringify(entries)).digest("hex")}`,
56141
+ fingerprint: `v1:${options.kind ?? "all"}:${options.scope ?? "all"}:${createHash19("sha256").update(JSON.stringify(entries)).digest("hex")}`,
55768
56142
  coverage: { complete: true, maxEntries, maxReadBytes }
55769
56143
  };
55770
56144
  }), "catalog");
@@ -55936,7 +56310,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
55936
56310
  };
55937
56311
  }, "vocabularyStoreOver");
55938
56312
 
55939
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
56313
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
55940
56314
  var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
55941
56315
  var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
55942
56316
  var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
@@ -56490,7 +56864,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
56490
56864
  return key2.padEnd(3, "X");
56491
56865
  }, "projectKey");
56492
56866
 
56493
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
56867
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
56494
56868
  var DAY10 = 864e5;
56495
56869
  var SETTING5 = "logs_pruned_at";
56496
56870
  var LOG_RETENTION = { agentActionsMs: 90 * DAY10, botUpdatePayloadsMs: 30 * DAY10 };
@@ -56517,7 +56891,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
56517
56891
  };
56518
56892
  }, "logPruner");
56519
56893
 
56520
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/mail/findings.js
56894
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/mail/findings.js
56521
56895
  var MAIL_FINDINGS_PER_RUN = 30;
56522
56896
  var MAIL_FINDINGS_PER_SENDER = 5;
56523
56897
  var invalid7 = /* @__PURE__ */ __name((message3) => {
@@ -56876,7 +57250,7 @@ var checkMailFindings = /* @__PURE__ */ __name((input) => {
56876
57250
  }, "checkMailFindings");
56877
57251
  var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
56878
57252
 
56879
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
57253
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
56880
57254
  var ORDERS = "SELECT o.*, b.name AS author_name, b.kind AS author_kind FROM orders o LEFT JOIN bots b ON o.author_type = 'bot' AND b.id = o.author_id";
56881
57255
  var orderOperationsOver = /* @__PURE__ */ __name((context) => {
56882
57256
  const { database, now: now2 } = context;
@@ -57091,7 +57465,7 @@ var ordersStoreOver = /* @__PURE__ */ __name((context) => {
57091
57465
  };
57092
57466
  }, "ordersStoreOver");
57093
57467
 
57094
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
57468
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
57095
57469
  var MAIL_EDITS = {
57096
57470
  task: ["title", "type", "reason", "commitment", "project", "dueAt", "dueEvidence", "assignee", "assigneeEvidence"],
57097
57471
  fact: ["statement", "type", "reason", "subject", "project"],
@@ -57580,7 +57954,7 @@ ${evidence.join("\n")}`, agent);
57580
57954
  };
57581
57955
  }, "mailFindingsStoreOver");
57582
57956
 
57583
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
57957
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
57584
57958
  var stale3 = /* @__PURE__ */ __name(() => {
57585
57959
  throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
57586
57960
  reason: "meeting-findings.stale"
@@ -57793,7 +58167,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
57793
58167
  };
57794
58168
  }, "meetingFindingsStoreOver");
57795
58169
 
57796
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
58170
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
57797
58171
  var RANK_BATCH = 512;
57798
58172
  var LIVE6 = "FROM chunks k JOIN meeting_transcripts t ON k.chunkable_type = 'meeting_transcript' AND t.id = k.chunkable_id JOIN meetings m ON m.id = t.meeting_id WHERE m.account_id = ? AND m.deleted_at IS NULL AND t.deleted_at IS NULL AND t.superseded_at IS NULL";
57799
58173
  var limitOf2 = /* @__PURE__ */ __name((value, name, max = 1e3) => {
@@ -58064,7 +58438,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
58064
58438
  }
58065
58439
  }), "meetingVectorsOver");
58066
58440
 
58067
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
58441
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
58068
58442
  var OTHER_SOURCES = ["document", "note", "email"];
58069
58443
  var TEXTS = {
58070
58444
  document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
@@ -58165,7 +58539,7 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
58165
58539
  };
58166
58540
  }, "sourceMentionStoreOver");
58167
58541
 
58168
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/money-transactions.js
58542
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/money-transactions.js
58169
58543
  var TRANSACTIONS = "SELECT t.*, w.name AS wallet_name, b.name AS author_name, b.kind AS author_kind, (SELECT coalesce(sum(amount), 0) FROM transaction_splits WHERE transaction_id = t.id) AS split FROM financial_transactions t JOIN financial_accounts w ON w.id = t.financial_account_id LEFT JOIN bots b ON t.author_type = 'bot' AND b.id = t.author_id";
58170
58544
  var MAX_SPLITS = 100;
58171
58545
  var transactionOperationsOver = /* @__PURE__ */ __name((context) => {
@@ -58399,11 +58773,11 @@ var transactionsStoreOver = /* @__PURE__ */ __name((context) => {
58399
58773
  };
58400
58774
  }, "transactionsStoreOver");
58401
58775
 
58402
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
58776
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
58403
58777
  import { accessSync, constants, existsSync as existsSync2, mkdirSync as mkdirSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
58404
58778
  import { dirname as dirname2 } from "node:path";
58405
58779
 
58406
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
58780
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
58407
58781
  import { readFileSync as readFileSync3 } from "node:fs";
58408
58782
  var CLIENTS_SETTING = "clients";
58409
58783
  var coreVersion = (() => {
@@ -58464,7 +58838,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
58464
58838
  return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
58465
58839
  }, "refusalAdvice");
58466
58840
 
58467
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
58841
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
58468
58842
  var GENERATED = [
58469
58843
  {
58470
58844
  "name": "20261010184427_initial",
@@ -59878,10 +60252,36 @@ WHERE json_type(params, '$.selection') = 'object';`
59878
60252
  "CREATE TRIGGER tracker_item_words_au AFTER UPDATE OF normalized_text ON tracker_items\n WHEN old.normalized_text IS NOT new.normalized_text BEGIN\n DELETE FROM tracker_item_words WHERE rowid = old.id;\n INSERT INTO tracker_item_words (rowid, normalized_text)\n SELECT new.id, new.normalized_text WHERE new.normalized_text <> '';\nEND;",
59879
60253
  "CREATE TRIGGER tracker_item_words_ad AFTER DELETE ON tracker_items BEGIN\n DELETE FROM tracker_item_words WHERE rowid = old.id;\nEND;"
59880
60254
  ]
60255
+ },
60256
+ {
60257
+ "name": "20261118230213_version-71-content",
60258
+ "statements": [
60259
+ "CREATE TABLE `content_authors` (\n `id` integer PRIMARY KEY,\n `account_id` integer NOT NULL,\n `external_id` text NOT NULL,\n `name` text NOT NULL,\n `email` text,\n `data` text NOT NULL,\n `source_updated_at` integer,\n `deleted_at` integer,\n `synced_at` integer NOT NULL,\n CONSTRAINT `fk_content_authors_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`),\n CONSTRAINT `content_authors_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`)\n);",
60260
+ "CREATE TABLE `content_channels` (\n `id` integer PRIMARY KEY,\n `account_id` integer NOT NULL,\n `external_id` text NOT NULL,\n `kind` text NOT NULL,\n `network` text NOT NULL,\n `name` text NOT NULL,\n `url` text,\n `handle` text,\n `deleted_at` integer,\n `synced_at` integer NOT NULL,\n CONSTRAINT `fk_content_channels_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`),\n CONSTRAINT `content_channels_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`)\n);",
60261
+ "CREATE TABLE `content_metrics` (\n `id` integer PRIMARY KEY,\n `post_id` integer NOT NULL,\n `at` integer NOT NULL,\n `views` integer,\n `reactions` integer,\n `comments` integer,\n `shares` integer,\n `clicks` integer,\n `raw` text,\n CONSTRAINT `fk_content_metrics_post_id_content_posts_id_fk` FOREIGN KEY (`post_id`) REFERENCES `content_posts`(`id`)\n);",
60262
+ "CREATE TABLE `content_post_revisions` (\n `id` integer PRIMARY KEY,\n `post_id` integer NOT NULL,\n `title` text,\n `body` text,\n `status` text NOT NULL,\n `content_hash` text NOT NULL,\n `version` text,\n `reason` text NOT NULL,\n `created_at` integer NOT NULL,\n CONSTRAINT `fk_content_post_revisions_post_id_content_posts_id_fk` FOREIGN KEY (`post_id`) REFERENCES `content_posts`(`id`)\n);",
60263
+ "CREATE TABLE `content_posts` (\n `id` integer PRIMARY KEY,\n `account_id` integer NOT NULL,\n `external_id` text NOT NULL,\n `channel_id` text,\n `type` text NOT NULL,\n `title` text,\n `title_folded` text NOT NULL,\n `body` text,\n `content_hash` text NOT NULL,\n `status` text NOT NULL,\n `published_at` integer,\n `scheduled_for` integer,\n `source_created_at` integer,\n `source_updated_at` integer,\n `version` text,\n `normalized_text` text NOT NULL,\n `data` text NOT NULL,\n `deleted_at` integer,\n `synced_at` integer NOT NULL,\n CONSTRAINT `fk_content_posts_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`),\n CONSTRAINT `content_posts_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`)\n);",
60264
+ "CREATE TABLE `content_terms` (\n `id` integer PRIMARY KEY,\n `account_id` integer NOT NULL,\n `external_id` text NOT NULL,\n `kind` text NOT NULL,\n `name` text NOT NULL,\n `slug` text,\n `parent_id` text,\n `tag_id` integer,\n `data` text NOT NULL,\n `source_updated_at` integer,\n `deleted_at` integer,\n `synced_at` integer NOT NULL,\n CONSTRAINT `fk_content_terms_account_id_accounts_id_fk` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`),\n CONSTRAINT `fk_content_terms_tag_id_canonical_tags_id_fk` FOREIGN KEY (`tag_id`) REFERENCES `canonical_tags`(`id`),\n CONSTRAINT `content_terms_account_id_external_id_unique` UNIQUE(`account_id`,`external_id`)\n);",
60265
+ "CREATE INDEX `content_metrics_by_post_id_at` ON `content_metrics` (`post_id`,`at`);",
60266
+ "CREATE INDEX `content_post_revisions_by_post_id_created_at` ON `content_post_revisions` (`post_id`,`created_at`);",
60267
+ "CREATE INDEX `content_posts_by_account_id_status` ON `content_posts` (`account_id`,`status`);",
60268
+ "CREATE INDEX `content_posts_by_account_id_published_at` ON `content_posts` (`account_id`,`published_at`);",
60269
+ "CREATE INDEX `content_terms_by_tag_id` ON `content_terms` (`tag_id`);"
60270
+ ]
60271
+ },
60272
+ {
60273
+ "name": "20261118230214_version-71-content-words",
60274
+ "statements": [
60275
+ "-- Words of a post's title and text, rowid = content_posts.id.\nCREATE VIRTUAL TABLE content_post_words USING fts5(\n normalized_text,\n content = '', contentless_delete = 1,\n tokenize = 'unicode61 remove_diacritics 2', prefix = '3');",
60276
+ "CREATE VIRTUAL TABLE content_post_words_vocab USING fts5vocab(content_post_words, 'col');",
60277
+ "CREATE TRIGGER content_post_words_ai AFTER INSERT ON content_posts WHEN new.normalized_text <> '' BEGIN\n INSERT INTO content_post_words (rowid, normalized_text) VALUES (new.id, new.normalized_text);\nEND;",
60278
+ "CREATE TRIGGER content_post_words_au AFTER UPDATE OF normalized_text ON content_posts\n WHEN old.normalized_text IS NOT new.normalized_text BEGIN\n DELETE FROM content_post_words WHERE rowid = old.id;\n INSERT INTO content_post_words (rowid, normalized_text)\n SELECT new.id, new.normalized_text WHERE new.normalized_text <> '';\nEND;",
60279
+ "-- Taggings are polymorphic, with no foreign key: a post row that goes takes its tags along.\nCREATE TRIGGER content_post_words_ad AFTER DELETE ON content_posts BEGIN\n DELETE FROM content_post_words WHERE rowid = old.id;\n DELETE FROM taggings WHERE taggable_type = 'post' AND taggable_id = old.id;\nEND;"
60280
+ ]
59881
60281
  }
59882
60282
  ];
59883
60283
 
59884
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/rollback-copy.js
60284
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/rollback-copy.js
59885
60285
  import { mkdirSync, rmSync, statfsSync, writeFileSync } from "node:fs";
59886
60286
  import { basename, dirname, join as join3, parse } from "node:path";
59887
60287
  var DERIVED = /(_fts|_words|_stems|_trigrams|_pending)$|^(embeddings|chunks|chunk_messages|mentions|involvements|search_terms)$|^vector_index/;
@@ -60114,7 +60514,7 @@ var rollBack2 = /* @__PURE__ */ __name((database, path) => {
60114
60514
  return { ...result, foreignKeyViolations };
60115
60515
  }, "rollBack");
60116
60516
 
60117
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
60517
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
60118
60518
  var V31_TABLES = [
60119
60519
  "accounts",
60120
60520
  "account_identities",
@@ -60250,7 +60650,9 @@ var MANIFEST = [
60250
60650
  { name: "20261117015456_version-69-conversation-readiness", version: 69, minCompatible: 56 },
60251
60651
  { name: "20261117015457_version-69-conversation-readiness-triggers", version: 69, minCompatible: 56 },
60252
60652
  { name: "20261117211410_version-70-tracker-items", version: 70, minCompatible: 56 },
60253
- { name: "20261117211414_version-70-tracker-item-words", version: 70, minCompatible: 56 }
60653
+ { name: "20261117211414_version-70-tracker-item-words", version: 70, minCompatible: 56 },
60654
+ { name: "20261118230213_version-71-content", version: 71, minCompatible: 56 },
60655
+ { name: "20261118230214_version-71-content-words", version: 71, minCompatible: 56 }
60254
60656
  ];
60255
60657
  var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated = GENERATED) => {
60256
60658
  const migrations = [];
@@ -60286,7 +60688,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
60286
60688
  return migrations;
60287
60689
  }, "generatedMigrations");
60288
60690
 
60289
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/migrations.js
60691
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/migrations.js
60290
60692
  var MIGRATIONS = generatedMigrations();
60291
60693
  var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
60292
60694
  version INTEGER PRIMARY KEY,
@@ -60383,7 +60785,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
60383
60785
  }
60384
60786
  }, "migrate");
60385
60787
 
60386
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
60788
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
60387
60789
  var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
60388
60790
  const pending = database.prepare("SELECT id, join_url FROM meetings WHERE join_url IS NOT NULL AND join_key IS NULL AND id > ? ORDER BY id LIMIT ?");
60389
60791
  if (pending.get(0, 1) === void 0)
@@ -60405,7 +60807,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
60405
60807
  }
60406
60808
  }, "fillJoinKeys");
60407
60809
 
60408
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
60810
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
60409
60811
  var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
60410
60812
  refuseOwnerStoreInTests(path);
60411
60813
  const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
@@ -60419,8 +60821,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
60419
60821
  }, "openSqlite");
60420
60822
  var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
60421
60823
  quietSqliteWarning();
60422
- const { drizzle } = await import("./node-ITDTNRRZ.js");
60423
- const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-IRAGRMEZ.js");
60824
+ const { drizzle } = await import("./node-3ZISJOEM.js");
60825
+ const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-KA35X4F4.js");
60424
60826
  const client = await nodeClient(path, { readOnly });
60425
60827
  try {
60426
60828
  if (!readOnly)
@@ -60434,8 +60836,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
60434
60836
  }
60435
60837
  }, "openUnderNode");
60436
60838
  var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
60437
- const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-2BP7JDVO.js");
60438
- const { drizzle } = await import("./bun-WO77T4LG.js");
60839
+ const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-I5K5Z2ZK.js");
60840
+ const { drizzle } = await import("./bun-3RTK5XYF.js");
60439
60841
  const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
60440
60842
  try {
60441
60843
  if (!readOnly)
@@ -60449,7 +60851,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
60449
60851
  }
60450
60852
  }, "openUnderBun");
60451
60853
 
60452
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
60854
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
60453
60855
  var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
60454
60856
  var paymentOf = /* @__PURE__ */ __name((metadata3) => {
60455
60857
  try {
@@ -60517,7 +60919,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
60517
60919
  });
60518
60920
  }, "movePaymentFacts");
60519
60921
 
60520
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
60922
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
60521
60923
  var readCompatibility = /* @__PURE__ */ __name((database, command) => {
60522
60924
  const ours = MIGRATIONS.at(-1)?.version ?? 0;
60523
60925
  if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
@@ -60535,7 +60937,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
60535
60937
  throw new CliError("configuration_error", `The store needs schema ${MIGRATIONS.at(-1)?.version ?? 0} maintenance before a read-only open`);
60536
60938
  }, "assertReadCompatible");
60537
60939
 
60538
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
60940
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
60539
60941
  var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
60540
60942
  var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
60541
60943
  if (provenance2?.startsWith("rule:"))
@@ -60581,7 +60983,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
60581
60983
  });
60582
60984
  }, "moveSuggestedLinks");
60583
60985
 
60584
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
60986
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
60585
60987
  var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
60586
60988
  var TEST_PROVIDER = "chat";
60587
60989
  var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
@@ -60602,7 +61004,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
60602
61004
  }
60603
61005
  }, "purgeTestAccounts");
60604
61006
 
60605
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
61007
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
60606
61008
  var BACKFILL_ON_OPEN = 5e3;
60607
61009
  var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
60608
61010
  var createWritable = /* @__PURE__ */ __name((file) => {
@@ -60714,7 +61116,7 @@ var openStoreContext = /* @__PURE__ */ __name(async (options = {}) => {
60714
61116
  }
60715
61117
  }, "openStoreContext");
60716
61118
 
60717
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/products.js
61119
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/products.js
60718
61120
  var PRODUCTS = "SELECT c.*, b.name AS author_name, b.kind AS author_kind FROM catalog_items c LEFT JOIN bots b ON c.author_type = 'bot' AND b.id = c.author_id";
60719
61121
  var productOperationsOver = /* @__PURE__ */ __name((context) => {
60720
61122
  const { database, now: now2 } = context;
@@ -60822,13 +61224,13 @@ var productsStoreOver = /* @__PURE__ */ __name((context) => {
60822
61224
  };
60823
61225
  }, "productsStoreOver");
60824
61226
 
60825
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
60826
- import { createHash as createHash20 } from "node:crypto";
61227
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
61228
+ import { createHash as createHash21 } from "node:crypto";
60827
61229
 
60828
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
60829
- import { createHash as createHash19 } from "node:crypto";
61230
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
61231
+ import { createHash as createHash20 } from "node:crypto";
60830
61232
 
60831
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
61233
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
60832
61234
  var text7 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
60833
61235
  var ref = text7(2048);
60834
61236
  var timestamp2 = pipe(number(), safeInteger(), minValue(0));
@@ -60898,7 +61300,7 @@ var projectAnnotationsSchema = strictObject({
60898
61300
  }))
60899
61301
  });
60900
61302
 
60901
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
61303
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
60902
61304
  var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
60903
61305
  var invalid10 = /* @__PURE__ */ __name((field4) => {
60904
61306
  throw new CliError("validation_error", `invalid project annotations.${field4}`);
@@ -61028,10 +61430,10 @@ var projectAnnotationsFingerprint = /* @__PURE__ */ __name((json3) => {
61028
61430
  links: manifest.links.toSorted((a, b) => a.ref.localeCompare(b.ref)),
61029
61431
  external: manifest.external.toSorted((a, b) => a.ref.localeCompare(b.ref))
61030
61432
  };
61031
- return createHash19("sha256").update(JSON.stringify(normalized)).digest("hex");
61433
+ return createHash20("sha256").update(JSON.stringify(normalized)).digest("hex");
61032
61434
  }, "projectAnnotationsFingerprint");
61033
61435
 
61034
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
61436
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
61035
61437
  var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
61036
61438
  var ref2 = pipe(string(), minLength(1), maxLength(2048));
61037
61439
  var targetSchema = strictObject({
@@ -61119,7 +61521,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
61119
61521
  }
61120
61522
  if (target.annotation_count > 0)
61121
61523
  conflicts.push({ reference: target.project, reason: "populated" });
61122
- const fingerprint2 = createHash20("sha256").update(JSON.stringify({
61524
+ const fingerprint2 = createHash21("sha256").update(JSON.stringify({
61123
61525
  manifest_fingerprint,
61124
61526
  target: {
61125
61527
  ...checked3.output,
@@ -61138,8 +61540,8 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
61138
61540
  }, "planBoundProjectAnnotations");
61139
61541
  var planProjectAnnotations = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotations(json3), projectAnnotationsFingerprint(json3), target, bindings), "planProjectAnnotations");
61140
61542
 
61141
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
61142
- import { createHash as createHash21 } from "node:crypto";
61543
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
61544
+ import { createHash as createHash22 } from "node:crypto";
61143
61545
  var text8 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
61144
61546
  var timestamp3 = pipe(number(), safeInteger(), minValue(0));
61145
61547
  var projectAnnotationSnapshotSchema = strictObject({
@@ -61223,7 +61625,7 @@ var decodeProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3) => {
61223
61625
  var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
61224
61626
  const snapshot2 = decodeProjectAnnotationSnapshot(json3);
61225
61627
  const order = /* @__PURE__ */ __name((a, b) => a.ref < b.ref ? -1 : a.ref > b.ref ? 1 : 0, "order");
61226
- return createHash21("sha256").update(JSON.stringify({
61628
+ return createHash22("sha256").update(JSON.stringify({
61227
61629
  ...snapshot2,
61228
61630
  aliases: snapshot2.aliases.toSorted((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0),
61229
61631
  facts: snapshot2.facts.toSorted(order),
@@ -61232,7 +61634,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
61232
61634
  })).digest("hex");
61233
61635
  }, "projectAnnotationSnapshotFingerprint");
61234
61636
 
61235
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
61637
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
61236
61638
  var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
61237
61639
  if (!request || typeof request !== "object" || Array.isArray(request))
61238
61640
  throw new CliError("validation_error", "project annotation request is required");
@@ -61249,7 +61651,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
61249
61651
  return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
61250
61652
  }, "projectAnnotationRequest");
61251
61653
 
61252
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
61654
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
61253
61655
  var SnapshotBudget = class {
61254
61656
  static {
61255
61657
  __name(this, "SnapshotBudget");
@@ -61275,14 +61677,14 @@ var SnapshotBudget = class {
61275
61677
  }
61276
61678
  };
61277
61679
 
61278
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
61279
- import { createHash as createHash23 } from "node:crypto";
61680
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
61681
+ import { createHash as createHash24 } from "node:crypto";
61280
61682
 
61281
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
61683
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
61282
61684
  var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
61283
61685
 
61284
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
61285
- import { createHash as createHash22 } from "node:crypto";
61686
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
61687
+ import { createHash as createHash23 } from "node:crypto";
61286
61688
  var invalid12 = /* @__PURE__ */ __name(() => {
61287
61689
  throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
61288
61690
  }, "invalid");
@@ -61420,11 +61822,11 @@ var ProjectSnapshotSources = class {
61420
61822
  return this.digest("meeting_transcript", [header, cues]);
61421
61823
  }
61422
61824
  digest(kind3, content2) {
61423
- return createHash22("sha256").update(JSON.stringify(["wirecat.project-source", 1, kind3, content2])).digest("hex");
61825
+ return createHash23("sha256").update(JSON.stringify(["wirecat.project-source", 1, kind3, content2])).digest("hex");
61424
61826
  }
61425
61827
  };
61426
61828
 
61427
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
61829
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
61428
61830
  var unsupported = /* @__PURE__ */ __name(() => {
61429
61831
  throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
61430
61832
  }, "unsupported");
@@ -61602,7 +62004,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
61602
62004
  return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
61603
62005
  }), "projectAnnotationSnapshot");
61604
62006
 
61605
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
62007
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
61606
62008
  var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
61607
62009
  const current2 = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
61608
62010
  const sources = new ProjectSnapshotSources(database, budget);
@@ -61643,7 +62045,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
61643
62045
  const target = {
61644
62046
  project: current2.project.ref,
61645
62047
  annotation_count: current2.aliases.length + current2.facts.length + current2.links.length,
61646
- revision_sha256: createHash23("sha256").update(JSON.stringify({
62048
+ revision_sha256: createHash24("sha256").update(JSON.stringify({
61647
62049
  snapshot: projectAnnotationSnapshotFingerprint(JSON.stringify(current2)),
61648
62050
  projects: projects2,
61649
62051
  aliases: aliases2,
@@ -61658,13 +62060,13 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
61658
62060
  descriptor_conflicts,
61659
62061
  namespace_conflicts,
61660
62062
  ready: plan.ready && descriptor_conflicts.length === 0 && namespace_conflicts.length === 0,
61661
- fingerprint: createHash23("sha256").update(JSON.stringify({ plan: plan.fingerprint, descriptor_conflicts, namespace_conflicts })).digest("hex"),
62063
+ fingerprint: createHash24("sha256").update(JSON.stringify({ plan: plan.fingerprint, descriptor_conflicts, namespace_conflicts })).digest("hex"),
61662
62064
  read_bytes: budget.bytes,
61663
62065
  records: budget.records
61664
62066
  };
61665
62067
  }), "previewAnnotationSnapshot");
61666
62068
 
61667
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
62069
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
61668
62070
  var metadataOf2 = /* @__PURE__ */ __name((database, link3, to) => {
61669
62071
  const provenance2 = link3.provenance === null ? {} : { provenance: link3.provenance };
61670
62072
  if (link3.kind === "evidence" && to)
@@ -61731,7 +62133,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
61731
62133
  return mappings;
61732
62134
  }, "restoreAnnotationRecords");
61733
62135
 
61734
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
62136
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
61735
62137
  var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
61736
62138
  async preview(request) {
61737
62139
  const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
@@ -61761,7 +62163,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
61761
62163
  }
61762
62164
  }), "projectAnnotationStoreOver");
61763
62165
 
61764
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relations.js
62166
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relations.js
61765
62167
  var isDerived = /* @__PURE__ */ __name((role) => role.startsWith("fields."), "isDerived");
61766
62168
  var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
61767
62169
  const sql2 = /* @__PURE__ */ __name((text9) => database.prepare(text9), "sql");
@@ -61832,7 +62234,7 @@ var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
61832
62234
  return { entityRef, relatedOf, storedRelations, relate, missingOf };
61833
62235
  }, "recordRelationsOver");
61834
62236
 
61835
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/record-remap.js
62237
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/record-remap.js
61836
62238
  var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
61837
62239
  const pointedAt = /* @__PURE__ */ __name((type, id2) => {
61838
62240
  for (const { table, pointer } of pointerPairs(database))
@@ -61886,7 +62288,7 @@ var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
61886
62288
  return { pointedAt, remap };
61887
62289
  }, "recordRemapOver");
61888
62290
 
61889
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/record-run.js
62291
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/record-run.js
61890
62292
  var runs = 0;
61891
62293
  var PAGE = 500;
61892
62294
  var recordRunOver = /* @__PURE__ */ __name((context, writes) => {
@@ -62099,7 +62501,7 @@ var waitingPointer = /* @__PURE__ */ __name((index2, missing4) => {
62099
62501
  return pointerOf("records", index2, "fields", key2);
62100
62502
  }, "waitingPointer");
62101
62503
 
62102
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/record-matching.js
62504
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/record-matching.js
62103
62505
  var valuesOf = /* @__PURE__ */ __name((value) => (Array.isArray(value) ? value : [value]).filter((one2) => typeof one2 === "string"), "valuesOf");
62104
62506
  var SCHEME = /^(email|domain|tax-id:[a-z]{2}|registration:[a-z]{2})$/;
62105
62507
  var ORG_EMAIL = "org-email";
@@ -62265,7 +62667,7 @@ var renameMade = /* @__PURE__ */ __name(({ database, now: now2 }, type, id2, nam
62265
62667
  ]);
62266
62668
  }, "renameMade");
62267
62669
 
62268
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-direct.js
62670
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-direct.js
62269
62671
  var productFields = /* @__PURE__ */ __name((fields4) => ({
62270
62672
  name: given2(fields4, "name"),
62271
62673
  unit: given2(fields4, "unit"),
@@ -62388,7 +62790,7 @@ var DIRECT_PROJECTORS = {
62388
62790
  lead: dealProjector("lead")
62389
62791
  };
62390
62792
 
62391
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-document.js
62793
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-document.js
62392
62794
  var TEXT_ONLY = { storage: "text", localPath: null };
62393
62795
  var textOf7 = /* @__PURE__ */ __name(({ fields: fields4, externalId }) => {
62394
62796
  const text9 = String(fields4.text ?? "");
@@ -62457,7 +62859,7 @@ var DOCUMENT_PROJECTORS = {
62457
62859
  }
62458
62860
  };
62459
62861
 
62460
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-money.js
62862
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-money.js
62461
62863
  var allocatedByOthers = /* @__PURE__ */ __name((context, paymentId) => {
62462
62864
  const importer = authorActor(context, IMPORTER).actor;
62463
62865
  return context.database.prepare("SELECT 1 FROM payment_allocations WHERE payment_id = ? AND NOT (author_type = ? AND author_id = ?) LIMIT 1").get(paymentId, importer.type, importer.id) !== void 0;
@@ -62667,7 +63069,7 @@ var MONEY_PROJECTORS = {
62667
63069
  }
62668
63070
  };
62669
63071
 
62670
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-phone.js
63072
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-phone.js
62671
63073
  var CALLS_CALENDAR = "calls";
62672
63074
  var importOnly = /* @__PURE__ */ __name((source2, type) => {
62673
63075
  if (!isImportedProvider(source2.provider))
@@ -62842,7 +63244,7 @@ var PHONE_PROJECTORS = {
62842
63244
  }
62843
63245
  };
62844
63246
 
62845
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors.js
63247
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors.js
62846
63248
  var RECORD_PROJECTORS = {
62847
63249
  ...MONEY_PROJECTORS,
62848
63250
  ...DIRECT_PROJECTORS,
@@ -62853,7 +63255,7 @@ var RECORD_PROJECTORS = {
62853
63255
  project: null
62854
63256
  };
62855
63257
 
62856
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/record-settling.js
63258
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/record-settling.js
62857
63259
  var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
62858
63260
  const sql2 = /* @__PURE__ */ __name((text9) => database.prepare(text9), "sql");
62859
63261
  const freeOn = /* @__PURE__ */ __name((invoice, payment) => {
@@ -62915,8 +63317,8 @@ var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
62915
63317
  return { settle, checkShares };
62916
63318
  }, "recordSettlingOver");
62917
63319
 
62918
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/record-stamps.js
62919
- import { createHash as createHash24 } from "node:crypto";
63320
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/record-stamps.js
63321
+ import { createHash as createHash25 } from "node:crypto";
62920
63322
  var VOLATILE = /* @__PURE__ */ new Set(["id", "created_at", "updated_at", "metadata"]);
62921
63323
  var content = /* @__PURE__ */ __name((row2) => row2 === void 0 ? null : Object.fromEntries(Object.entries(row2).filter(([column2]) => !VOLATILE.has(column2))), "content");
62922
63324
  var importStampsOver = /* @__PURE__ */ __name(({ database }) => {
@@ -62924,14 +63326,14 @@ var importStampsOver = /* @__PURE__ */ __name(({ database }) => {
62924
63326
  const { table } = RECORD_TYPES[type];
62925
63327
  const parts = nestedOf(type).map(([, nested]) => database.prepare(`SELECT * FROM ${nested.table} WHERE ${nested.parent} = ? ORDER BY id`).all(id2).map((row3) => content(row3)));
62926
63328
  const row2 = database.prepare(`SELECT * FROM ${table} WHERE id = ?`).get(id2);
62927
- return createHash24("sha256").update(JSON.stringify([content(row2), parts])).digest("hex");
63329
+ return createHash25("sha256").update(JSON.stringify([content(row2), parts])).digest("hex");
62928
63330
  }, "stateOf");
62929
63331
  const stamp = /* @__PURE__ */ __name((type, id2) => database.prepare(`UPDATE ${RECORD_TYPES[type].table} SET metadata = json_set(coalesce(metadata, '{}'), '$.imported', ?) WHERE id = ?`).run(stateOf3(type, id2), id2), "stamp");
62930
63332
  const untouched = /* @__PURE__ */ __name((type, id2) => database.prepare(`SELECT json_extract(metadata, '$.imported') AS stamp FROM ${RECORD_TYPES[type].table} WHERE id = ?`).get(id2)?.stamp === stateOf3(type, id2), "untouched");
62931
63333
  return { stamp, untouched };
62932
63334
  }, "importStampsOver");
62933
63335
 
62934
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/subscriptions.js
63336
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/subscriptions.js
62935
63337
  var SUBSCRIPTIONS = "SELECT s.*, b.name AS author_name, b.kind AS author_kind FROM subscriptions s LEFT JOIN bots b ON s.author_type = 'bot' AND b.id = s.author_id";
62936
63338
  var PRICES = "SELECT p.*, b.name AS author_name, b.kind AS author_kind FROM subscription_prices p LEFT JOIN bots b ON p.author_type = 'bot' AND b.id = p.author_id";
62937
63339
  var PRICE_REF = /^subscription_price:([1-9]\d{0,15})$/;
@@ -63168,7 +63570,7 @@ var subscriptionsStoreOver = /* @__PURE__ */ __name((context) => {
63168
63570
  };
63169
63571
  }, "subscriptionsStoreOver");
63170
63572
 
63171
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/wallets.js
63573
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/wallets.js
63172
63574
  var WALLETS = "SELECT w.*, b.name AS author_name, b.kind AS author_kind FROM financial_accounts w LEFT JOIN bots b ON w.author_type = 'bot' AND b.id = w.author_id";
63173
63575
  var SIGNED = "CASE t.direction WHEN 'in' THEN t.amount ELSE -t.amount END";
63174
63576
  var walletOperationsOver = /* @__PURE__ */ __name((context) => {
@@ -63293,7 +63695,7 @@ var walletsStoreOver = /* @__PURE__ */ __name((context) => {
63293
63695
  };
63294
63696
  }, "walletsStoreOver");
63295
63697
 
63296
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/record-writes.js
63698
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/record-writes.js
63297
63699
  var specOf = /* @__PURE__ */ __name((type) => RECORD_TYPES[type], "specOf");
63298
63700
  var unsettled = /* @__PURE__ */ __name((fields4, relations) => recordFingerprint(fields4, relations.filter((relation) => !AMOUNT_ROLES.includes(relation.role))), "unsettled");
63299
63701
  var tableOf2 = /* @__PURE__ */ __name((type) => typeof type === "string" && Object.hasOwn(DECIDED_TABLES, type) ? DECIDED_TABLES[type] : void 0, "tableOf");
@@ -63552,7 +63954,7 @@ var recordWritesOver = /* @__PURE__ */ __name((context) => {
63552
63954
  return { writeOne, project: project2, completeDependents, entityRef, missingOf: relations.missingOf };
63553
63955
  }, "recordWritesOver");
63554
63956
 
63555
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
63957
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
63556
63958
  var LIMIT = 1e3;
63557
63959
  var iso16 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
63558
63960
  var checkLimit = /* @__PURE__ */ __name((limit) => {
@@ -63776,7 +64178,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
63776
64178
  };
63777
64179
  }, "recordStoreOver");
63778
64180
 
63779
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/templates.js
64181
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/templates.js
63780
64182
  var templateOf = /* @__PURE__ */ __name((row2) => ({
63781
64183
  key: row2.key,
63782
64184
  channel: row2.channel,
@@ -63831,21 +64233,21 @@ var storedTemplateBodies = /* @__PURE__ */ __name((database, key2, language) =>
63831
64233
  return Object.fromEntries(rows.map((row2) => [row2.channel, row2.body]));
63832
64234
  }, "storedTemplateBodies");
63833
64235
 
63834
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/domain/tracker.js
64236
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/domain/tracker.js
63835
64237
  var trackerTitleOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "issue" ? record3.title : kind3 === "comment" ? record3.body.split("\n")[0]?.slice(0, 120) || "(comment)" : record3.name, "trackerTitleOf");
63836
64238
  var trackerBodyOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "comment" ? record3.body : kind3 === "issue" || kind3 === "project" ? record3.description : null, "trackerBodyOf");
63837
64239
  var trackerParentOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "comment" ? record3.issue : kind3 === "state" || kind3 === "label" ? record3.team : kind3 === "issue" ? record3.team : null, "trackerParentOf");
63838
64240
 
63839
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/tracker.js
63840
- var MOST2 = 500;
63841
- var itemOf = /* @__PURE__ */ __name((row2) => ({
64241
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/tracker.js
64242
+ var MOST3 = 500;
64243
+ var itemOf2 = /* @__PURE__ */ __name((row2) => ({
63842
64244
  kind: String(row2.kind),
63843
64245
  record: JSON.parse(String(row2.data)),
63844
64246
  deletedAt: row2.deleted_at == null ? null : Number(row2.deleted_at),
63845
64247
  syncedAt: Number(row2.synced_at)
63846
64248
  }), "itemOf");
63847
64249
  var COLUMNS10 = "t.kind, t.data, t.deleted_at, t.synced_at";
63848
- var definedOnly = /* @__PURE__ */ __name((record3) => Object.fromEntries(Object.entries(record3).filter(([, value]) => value !== void 0)), "definedOnly");
64250
+ var definedOnly2 = /* @__PURE__ */ __name((record3) => Object.fromEntries(Object.entries(record3).filter(([, value]) => value !== void 0)), "definedOnly");
63849
64251
  var resetTrackerItemWords = /* @__PURE__ */ __name((database) => {
63850
64252
  if (!database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'tracker_item_words'").get())
63851
64253
  return 0;
@@ -63872,7 +64274,7 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
63872
64274
  const before2 = stored4.get(accountId, kind3, record3.externalId);
63873
64275
  const merged2 = {
63874
64276
  ...before2 ? JSON.parse(String(before2.data)) : {},
63875
- ...definedOnly(record3)
64277
+ ...definedOnly2(record3)
63876
64278
  };
63877
64279
  const title2 = trackerTitleOf(kind3, merged2);
63878
64280
  const body2 = trackerBodyOf(kind3, merged2) ?? null;
@@ -63902,7 +64304,7 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
63902
64304
  const accountId = findAccountPk(context, key2);
63903
64305
  if (accountId === void 0)
63904
64306
  return { items: [], hasMore: false };
63905
- const limit = Math.min(Math.max(filter.limit ?? 100, 1), MOST2);
64307
+ const limit = Math.min(Math.max(filter.limit ?? 100, 1), MOST3);
63906
64308
  const params = [accountId, kind3];
63907
64309
  let sql2 = `SELECT ${COLUMNS10} FROM tracker_items t WHERE t.account_id = ? AND t.kind = ? AND t.deleted_at IS NULL`;
63908
64310
  if (!filter.archived)
@@ -63934,13 +64336,13 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
63934
64336
  sql2 += " ORDER BY coalesce(t.source_updated_at, t.synced_at) DESC, t.id DESC LIMIT ? OFFSET ?";
63935
64337
  params.push(limit + 1, filter.offset ?? 0);
63936
64338
  const rows = database.prepare(sql2).all(...params);
63937
- return { items: rows.slice(0, limit).map((row2) => itemOf(row2)), hasMore: rows.length > limit };
64339
+ return { items: rows.slice(0, limit).map((row2) => itemOf2(row2)), hasMore: rows.length > limit };
63938
64340
  }, "list");
63939
64341
  const find2 = /* @__PURE__ */ __name(({ words: words4, anyWord = false, exact = false, accounts: accounts2, kinds: kinds2, limit, offset = 0 }) => {
63940
64342
  const match = matchOf2(words4, anyWord, exact);
63941
64343
  if (!match)
63942
64344
  return { items: [], hasMore: false };
63943
- const most = Math.min(Math.max(limit ?? 100, 1), MOST2);
64345
+ const most = Math.min(Math.max(limit ?? 100, 1), MOST3);
63944
64346
  const scoped2 = accounts2?.map((one2) => findAccountPk(context, one2)).filter((one2) => one2 !== void 0) ?? [];
63945
64347
  if (accounts2 !== void 0 && !scoped2.length)
63946
64348
  return { items: [], hasMore: false };
@@ -63962,7 +64364,7 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
63962
64364
  return {
63963
64365
  items: rows.slice(0, most).map((row2) => ({
63964
64366
  account: { provider: String(row2.provider), account: String(row2.account) },
63965
- item: itemOf(row2),
64367
+ item: itemOf2(row2),
63966
64368
  excerpt: excerptOf([row2.title, row2.body].filter(Boolean).join("\n"), words4)
63967
64369
  })),
63968
64370
  hasMore: rows.length > most
@@ -63976,14 +64378,14 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
63976
64378
  if (accountId === void 0)
63977
64379
  return void 0;
63978
64380
  const row2 = database.prepare(`SELECT ${COLUMNS10} FROM tracker_items t WHERE t.account_id = ? AND t.kind = ? AND t.external_id = ?`).get(accountId, kind3, externalId);
63979
- return row2 ? itemOf(row2) : void 0;
64381
+ return row2 ? itemOf2(row2) : void 0;
63980
64382
  }, "get"),
63981
64383
  issueByKey: /* @__PURE__ */ __name(async (key2, issueKey) => {
63982
64384
  const accountId = findAccountPk(context, key2);
63983
64385
  if (accountId === void 0)
63984
64386
  return void 0;
63985
64387
  const row2 = database.prepare(`SELECT ${COLUMNS10} FROM tracker_items t WHERE t.account_id = ? AND t.kind = 'issue' AND upper(json_extract(t.data, '$.key')) = upper(?) ORDER BY t.deleted_at IS NOT NULL LIMIT 1`).get(accountId, issueKey);
63986
- return row2 ? itemOf(row2) : void 0;
64388
+ return row2 ? itemOf2(row2) : void 0;
63987
64389
  }, "issueByKey"),
63988
64390
  list: /* @__PURE__ */ __name(async (key2, kind3, filter) => list2(key2, kind3, filter), "list"),
63989
64391
  find: /* @__PURE__ */ __name(async (search2) => find2(search2), "find"),
@@ -64006,7 +64408,7 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
64006
64408
  };
64007
64409
  }, "trackerStoreOver");
64008
64410
 
64009
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/store-errors.js
64411
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/store-errors.js
64010
64412
  var refusalOf2 = /* @__PURE__ */ __name((error) => error instanceof Error && error.name === "DrizzleQueryError" && error.cause instanceof CliError ? error.cause : error, "refusalOf");
64011
64413
  var wrapped2 = /* @__PURE__ */ new WeakMap();
64012
64414
  var storeErrors = /* @__PURE__ */ __name((area) => {
@@ -64041,7 +64443,7 @@ var storeErrors = /* @__PURE__ */ __name((area) => {
64041
64443
  return proxy;
64042
64444
  }, "storeErrors");
64043
64445
 
64044
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
64446
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
64045
64447
  var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
64046
64448
  const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
64047
64449
  let merged2 = { from: from2, to };
@@ -64054,7 +64456,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
64054
64456
  }, "markRange");
64055
64457
  var ranges = /* @__PURE__ */ __name(({ orm }, chatKey) => orm.select({ from: syncRanges.fromKey, to: syncRanges.toKey }).from(syncRanges).where(eq(syncRanges.chatId, chatKey)).orderBy(syncRanges.fromKey).all(), "ranges");
64056
64458
 
64057
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
64459
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
64058
64460
  var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
64059
64461
  var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
64060
64462
  chatId: String(row2.key).slice(prefix.length),
@@ -64075,7 +64477,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
64075
64477
  database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(prefixOf2(account) + chatId, JSON.stringify({ ...saved, checkedAt: checkedAt ?? new Date(now2).toISOString() }), now2);
64076
64478
  }, "setTaskAnalysisMark");
64077
64479
 
64078
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
64480
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
64079
64481
  var keyOf6 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
64080
64482
  var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
64081
64483
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf6(account));
@@ -64085,7 +64487,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
64085
64487
  database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(keyOf6(account), JSON.stringify(until), now2);
64086
64488
  }, "setTaskRulesStop");
64087
64489
 
64088
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sync.js
64490
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sync.js
64089
64491
  var syncStoreOver = /* @__PURE__ */ __name((context) => {
64090
64492
  const { database } = context;
64091
64493
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
@@ -64144,7 +64546,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
64144
64546
  };
64145
64547
  }, "syncStoreOver");
64146
64548
 
64147
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/tags.js
64549
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/tags.js
64148
64550
  var tagsStoreOver = /* @__PURE__ */ __name((context) => {
64149
64551
  const { database } = context;
64150
64552
  return {
@@ -64166,7 +64568,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
64166
64568
  };
64167
64569
  }, "tagsStoreOver");
64168
64570
 
64169
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
64571
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
64170
64572
  var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
64171
64573
  var neighbours = /* @__PURE__ */ __name(({ orm }, chatKey, messagePk, sentAt, { messages: messages2, withinMs }, side) => orm.all(sql`SELECT sender_name AS sender, text, sent_at AS sentAt FROM messages
64172
64574
  WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
@@ -64293,7 +64695,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
64293
64695
  dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
64294
64696
  }, "savePictureChunks");
64295
64697
 
64296
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
64698
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
64297
64699
  var messagesToEmbed = /* @__PURE__ */ __name(({ orm }, accountPk2, { chatKey, model, after: after2, limit }) => orm.all(sql`SELECT m.id AS messagePk, m.text, m.sent_at AS sentAt, k.content_hash AS hash,
64298
64700
  EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
64299
64701
  FROM messages m
@@ -64382,7 +64784,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
64382
64784
  return plain2(best(found2));
64383
64785
  }, "nearestMessages");
64384
64786
 
64385
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/vectors.js
64787
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/vectors.js
64386
64788
  var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
64387
64789
  const { database } = context;
64388
64790
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -64646,7 +65048,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
64646
65048
  vectorCounts: /* @__PURE__ */ __name(async (models) => vectorCounts(context, models), "vectorCounts")
64647
65049
  }), "vectorsStoreOver");
64648
65050
 
64649
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
65051
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
64650
65052
  import { existsSync as existsSync3, readFileSync as readFileSync4 } from "node:fs";
64651
65053
  import { dirname as dirname3, join as join4 } from "node:path";
64652
65054
  var BOOKKEEPING2 = ["schema_migrations", "store_settings"];
@@ -64734,10 +65136,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
64734
65136
  }
64735
65137
  }, "lastBackup");
64736
65138
 
64737
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/providers.js
65139
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/providers.js
64738
65140
  var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
64739
65141
 
64740
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
65142
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
64741
65143
  var COUNTED_TABLES = [
64742
65144
  "accounts",
64743
65145
  "chats",
@@ -64822,7 +65224,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
64822
65224
  };
64823
65225
  }, "storeContents");
64824
65226
 
64825
- // node_modules/.pnpm/@wirecat+cli-core@0.703.0_@wirecat+cli-base@0.119.0_commander@15.0.0_esbuild@0.28.2_typ_5630bd43f49d4f78ecc9c491970e88a0/node_modules/@wirecat/cli-core/dist/store/store.js
65227
+ // node_modules/.pnpm/@wirecat+cli-core@0.708.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_81d85e6e33f43ec6c2f1405ef858ec13/node_modules/@wirecat/cli-core/dist/store/store.js
64826
65228
  var openStore = /* @__PURE__ */ __name(async (options = {}) => {
64827
65229
  const context = await openStoreContext(options);
64828
65230
  try {
@@ -64894,6 +65296,7 @@ var storeOver = /* @__PURE__ */ __name((context) => {
64894
65296
  const crm = once3(() => crmCopiesOver(context, accountPeopleOver(context)));
64895
65297
  const crmFiles2 = once3(() => crmFilesOver(context));
64896
65298
  const tracker = once3(() => trackerStoreOver(context));
65299
+ const content2 = once3(() => contentStoreOver(context));
64897
65300
  const relations = once3(() => relationsStoreOver(context));
64898
65301
  const decisionRequests2 = once3(() => decisionRequestStoreOver(context));
64899
65302
  const templates2 = once3(() => templateStoreOver(context));
@@ -65042,6 +65445,9 @@ var storeOver = /* @__PURE__ */ __name((context) => {
65042
65445
  get tracker() {
65043
65446
  return tracker();
65044
65447
  },
65448
+ get content() {
65449
+ return content2();
65450
+ },
65045
65451
  get crmFiles() {
65046
65452
  return crmFiles2();
65047
65453
  },
@@ -65259,8 +65665,10 @@ export {
65259
65665
  crmSettingsOf,
65260
65666
  BUSINESS_FIND_MAX,
65261
65667
  CATALOG_QUERY,
65262
- CRM_CHANGES,
65263
65668
  resetCrmFileWords,
65669
+ contentHashOf,
65670
+ resetContentPostWords,
65671
+ CRM_CHANGES,
65264
65672
  DECISION_ACTIONS,
65265
65673
  DECISION_TTL_MS,
65266
65674
  CALLBACK_PREFIX,