@wirecat/cli-memo 0.131.21 → 0.131.23

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 (150) hide show
  1. package/README.md +3 -3
  2. package/dist/bin/memo.js +2 -2
  3. package/dist/bundle/{all-profiles-EZLU6CY7.js → all-profiles-VIPS6NHI.js} +7 -7
  4. package/dist/bundle/{anthropic-XC34PJH5.js → anthropic-2QZHSXBA.js} +5 -5
  5. package/dist/bundle/{app-server-26YPLJ7M.js → app-server-NTSADYGW.js} +38 -38
  6. package/dist/bundle/auto-MJWSDIMF.js +86 -0
  7. package/dist/bundle/{bun-CKGKUKW5.js → bun-KF5QK2YN.js} +2 -2
  8. package/dist/bundle/{bun-sqlite-S6KUSMTC.js → bun-sqlite-XUCC2PWC.js} +4 -4
  9. package/dist/bundle/{chunk-YAUDFROV.js → chunk-24P36RXS.js} +466 -337
  10. package/dist/bundle/{chunk-NELE7AIX.js → chunk-2IKXEL4V.js} +1 -1
  11. package/dist/bundle/{program-3ZTQ5FEM.js → chunk-32FPXLNY.js} +877 -11207
  12. package/dist/bundle/{chunk-R26CXR5Z.js → chunk-37NN65PB.js} +5 -5
  13. package/dist/bundle/{chunk-7NEWBM2O.js → chunk-44NQLD5C.js} +6 -6
  14. package/dist/bundle/{chunk-UXCSNSUU.js → chunk-46WO42ZW.js} +316 -255
  15. package/dist/bundle/{chunk-TMNHNZVA.js → chunk-4DKMYDLT.js} +42 -22
  16. package/dist/bundle/{chunk-INURBEAO.js → chunk-4QY7XOVI.js} +13 -13
  17. package/dist/bundle/{chunk-RNXYDBQO.js → chunk-5M4KSMYN.js} +52 -52
  18. package/dist/bundle/{chunk-EAYYWS67.js → chunk-5WCEWK2F.js} +11 -11
  19. package/dist/bundle/{chunk-KUNA6MQZ.js → chunk-6EZ7XGRG.js} +1 -1
  20. package/dist/bundle/{chunk-NWB5NAGB.js → chunk-6I7XGWGH.js} +5 -5
  21. package/dist/bundle/{chunk-PF3ALSAV.js → chunk-6PXE6QSQ.js} +1 -1
  22. package/dist/bundle/{chunk-DZSWKA3K.js → chunk-7PQOYNMA.js} +1 -1
  23. package/dist/bundle/{chunk-SMDWUPXE.js → chunk-AETJWLHX.js} +3 -3
  24. package/dist/bundle/{chunk-ZCKU6WMX.js → chunk-AHFMQAJT.js} +10 -10
  25. package/dist/bundle/{chunk-CP5N3KH3.js → chunk-BIYSJBQR.js} +4 -4
  26. package/dist/bundle/{chunk-E5FQ7U7L.js → chunk-BSDOH7DN.js} +2 -2
  27. package/dist/bundle/{chunk-VECICKTE.js → chunk-BSR4QZW5.js} +2 -2
  28. package/dist/bundle/{chunk-2TBIVKBH.js → chunk-CKLCJ6O7.js} +5 -5
  29. package/dist/bundle/{chunk-LGNS4JVK.js → chunk-CTT5VK66.js} +5 -5
  30. package/dist/bundle/{chunk-VXHN3SWW.js → chunk-DIELPPLF.js} +2 -2
  31. package/dist/bundle/{chunk-2NJUPIAO.js → chunk-DIP3ENSY.js} +1 -1
  32. package/dist/bundle/{chunk-THGFFQCK.js → chunk-FXF34MI2.js} +2 -2
  33. package/dist/bundle/{chunk-JXH22ZGA.js → chunk-G4GEARGN.js} +9 -9
  34. package/dist/bundle/{chunk-QMMUPDRK.js → chunk-GDGY2KIX.js} +4 -4
  35. package/dist/bundle/{chunk-OUF6RCRZ.js → chunk-GQOFHKUX.js} +5 -5
  36. package/dist/bundle/{chunk-5RBLNI6C.js → chunk-H76MIWB2.js} +4 -4
  37. package/dist/bundle/{chunk-GV2FSWFS.js → chunk-HBXZ7WIV.js} +7 -7
  38. package/dist/bundle/{chunk-NOG5O2NS.js → chunk-IJI62T4U.js} +28 -28
  39. package/dist/bundle/{chunk-3V4WIGWC.js → chunk-JCCL7RGH.js} +2 -2
  40. package/dist/bundle/{chunk-RC7TIYUZ.js → chunk-JDNA36EX.js} +8 -8
  41. package/dist/bundle/{chunk-YUFUUQUO.js → chunk-JRJIFGU2.js} +4 -4
  42. package/dist/bundle/{chunk-EG2OMKWH.js → chunk-JY4LVWGZ.js} +12 -0
  43. package/dist/bundle/{chunk-IRDGD3QQ.js → chunk-KQ5P5NLL.js} +1 -1
  44. package/dist/bundle/{chunk-7F6FGMCC.js → chunk-L6FKTS3L.js} +7 -7
  45. package/dist/bundle/{chunk-VQM3H422.js → chunk-MJWFSOJN.js} +362 -179
  46. package/dist/bundle/{chunk-B3YV6Z7Y.js → chunk-N5L6YYYW.js} +2 -2
  47. package/dist/bundle/{chunk-CCOYC6HL.js → chunk-NY4IKP35.js} +2 -2
  48. package/dist/bundle/{chunk-FFWK5NEZ.js → chunk-O7OI5V7W.js} +7 -7
  49. package/dist/bundle/{chunk-RHJC4PHV.js → chunk-PDQFWOR5.js} +3 -3
  50. package/dist/bundle/{chunk-JJ3C5AYK.js → chunk-QFO6K6CW.js} +45 -45
  51. package/dist/bundle/{chunk-WUCQ56RP.js → chunk-QSN5NUVL.js} +2 -2
  52. package/dist/bundle/{chunk-7MLWSUEK.js → chunk-QWRBAQZ7.js} +1 -1
  53. package/dist/bundle/{chunk-DNGHE2Q4.js → chunk-QZXHMQCM.js} +1 -1
  54. package/dist/bundle/{chunk-WEOFWTWZ.js → chunk-R4V63U6A.js} +3 -3
  55. package/dist/bundle/{chunk-BB2MGFOZ.js → chunk-RE5SEGSR.js} +3 -3
  56. package/dist/bundle/{chunk-LR5EY5JY.js → chunk-STZMKXK5.js} +3 -3
  57. package/dist/bundle/{chunk-CDZZ2DZO.js → chunk-T4LW6UYQ.js} +1 -1
  58. package/dist/bundle/{chunk-AIIQ7YU4.js → chunk-UJEO3VWA.js} +1 -1
  59. package/dist/bundle/{chunk-SXGAIQ5X.js → chunk-UMWR5PKA.js} +12 -12
  60. package/dist/bundle/{chunk-J4GC33JU.js → chunk-UQA5UFJ2.js} +1 -1
  61. package/dist/bundle/{chunk-ZD3STMY7.js → chunk-V5ZID7KC.js} +1 -1
  62. package/dist/bundle/{chunk-XPRYBLTS.js → chunk-V7Y5FOYJ.js} +2 -2
  63. package/dist/bundle/{chunk-J55Z6EJ3.js → chunk-W53TRO7J.js} +1006 -280
  64. package/dist/bundle/{chunk-MCPDL5YU.js → chunk-XRJIQC6P.js} +1 -1
  65. package/dist/bundle/{chunk-MHDLZCEO.js → chunk-XTARXRP6.js} +8 -8
  66. package/dist/bundle/{chunk-XA6YO24S.js → chunk-YKZNFSQE.js} +1 -1
  67. package/dist/bundle/{chunk-PO5C7VNC.js → chunk-Z6YD3YK4.js} +21 -21
  68. package/dist/bundle/{chunk-RG6ITTLQ.js → chunk-Z7XHH2Q5.js} +14 -14
  69. package/dist/bundle/{chunk-OJRLTJRS.js → chunk-ZCPUKUST.js} +1 -1
  70. package/dist/bundle/{command-contract-TMVGYSQQ.js → command-contract-XBYNZVP5.js} +13 -13
  71. package/dist/bundle/{decode-6XSZIZAA.js → decode-LFASKQPE.js} +4 -4
  72. package/dist/bundle/{dispatch-VUMQPYMA.js → dispatch-MELZFYOS.js} +1 -1
  73. package/dist/bundle/{echarts-NGS4QG4E.js → echarts-5AB3LFVD.js} +2 -2
  74. package/dist/bundle/{embed-YNH5M6UL.js → embed-6KQN523T.js} +5 -5
  75. package/dist/bundle/{embedder-LLNK4JF4.js → embedder-7SGPMINO.js} +8 -8
  76. package/dist/bundle/{entry-DO6ZBFIS.js → entry-CNZGHHZB.js} +6 -6
  77. package/dist/bundle/failure-LJAYEPTS.js +66 -0
  78. package/dist/bundle/{failure-Z2FXWIBY.js → failure-RBNZBCZJ.js} +1 -1
  79. package/dist/bundle/{first-run-BXFQN6M5.js → first-run-UI6UT4OR.js} +8 -8
  80. package/dist/bundle/first-screen-3WDPZZXV.js +30 -0
  81. package/dist/bundle/{instructions-4EJ4BBWD.js → instructions-52W6ZQTU.js} +1 -1
  82. package/dist/bundle/mcp-JIOYIKWO.js +90 -0
  83. package/dist/bundle/memo.js +9 -9
  84. package/dist/bundle/{node-QQXKQWNC.js → node-TL2PBNKO.js} +2 -2
  85. package/dist/bundle/{node-sqlite-GJI2GMLW.js → node-sqlite-64QIEQ37.js} +5 -5
  86. package/dist/bundle/{oauth-Q5VGUPUR.js → oauth-GH7GLGEJ.js} +6 -6
  87. package/dist/bundle/{open-NSXIYF3N.js → open-PCKU5XOH.js} +4 -4
  88. package/dist/bundle/{openai-LHH7MSGQ.js → openai-P5QVLTF6.js} +9 -9
  89. package/dist/bundle/{process-PI6XUJWP.js → process-PWAGP6YY.js} +1 -1
  90. package/dist/bundle/program-D7OTNHGU.js +10947 -0
  91. package/dist/bundle/{prompt-VFXA7IKL.js → prompt-FNBKJZLM.js} +4 -4
  92. package/dist/bundle/{recognize-UWAARXOH.js → recognize-5TKRMMA2.js} +3 -3
  93. package/dist/bundle/{remote-KGEVCB2Q.js → remote-XZJ7ZAKJ.js} +6 -6
  94. package/dist/bundle/{rerank-SCBTCBPO.js → rerank-JUH3QHX7.js} +6 -6
  95. package/dist/bundle/{serve-WPVKVR24.js → serve-JP6U3PUO.js} +8 -8
  96. package/dist/bundle/server-5M4YI3V4.js +48 -0
  97. package/dist/bundle/{server-BMQBWBBN.js → server-VXI43PF5.js} +53 -53
  98. package/dist/bundle/server-XAHF22CQ.js +61 -0
  99. package/dist/bundle/{setup-FGSVWQ32.js → setup-YLI4S4TW.js} +42 -42
  100. package/dist/bundle/{state-KGHS4C6J.js → state-G4NEN2OZ.js} +5 -5
  101. package/dist/bundle/{store-VCVOIQES.js → store-NHFLFHD5.js} +11 -11
  102. package/dist/bundle/store-maintenance-command-6UEORZWI.js +48 -0
  103. package/dist/bundle/update-6SD2JZUC.js +69 -0
  104. package/dist/config-command.d.ts.map +1 -1
  105. package/dist/config-command.js +23 -2
  106. package/dist/config-command.js.map +1 -1
  107. package/dist/config.d.ts +11 -2
  108. package/dist/config.d.ts.map +1 -1
  109. package/dist/config.js +50 -3
  110. package/dist/config.js.map +1 -1
  111. package/dist/examples.d.ts.map +1 -1
  112. package/dist/examples.js +7 -1
  113. package/dist/examples.js.map +1 -1
  114. package/dist/knowledge/command.d.ts.map +1 -1
  115. package/dist/knowledge/command.js +8 -52
  116. package/dist/knowledge/command.js.map +1 -1
  117. package/dist/knowledge/project-gather-command.d.ts.map +1 -1
  118. package/dist/knowledge/project-gather-command.js +32 -19
  119. package/dist/knowledge/project-gather-command.js.map +1 -1
  120. package/dist/knowledge/relationships-scan.d.ts +8 -0
  121. package/dist/knowledge/relationships-scan.d.ts.map +1 -0
  122. package/dist/knowledge/relationships-scan.js +95 -0
  123. package/dist/knowledge/relationships-scan.js.map +1 -0
  124. package/dist/mail/review-command.d.ts.map +1 -1
  125. package/dist/mail/review-command.js +6 -0
  126. package/dist/mail/review-command.js.map +1 -1
  127. package/dist/review/kinds.js +2 -2
  128. package/dist/review/kinds.js.map +1 -1
  129. package/dist/store/source-list.d.ts +2 -0
  130. package/dist/store/source-list.d.ts.map +1 -1
  131. package/dist/store/source-list.js +6 -0
  132. package/dist/store/source-list.js.map +1 -1
  133. package/dist/tasks/command.js +2 -2
  134. package/dist/tasks/command.js.map +1 -1
  135. package/dist/tasks/tasks.d.ts +1 -1
  136. package/dist/tasks/tasks.d.ts.map +1 -1
  137. package/dist/version.d.ts +1 -1
  138. package/dist/version.js +1 -1
  139. package/package.json +2 -2
  140. package/skills/cli-memo/SKILL.md +1 -1
  141. package/dist/bundle/auto-QHTPHGNA.js +0 -86
  142. package/dist/bundle/chunk-CRZSJHAK.js +0 -412
  143. package/dist/bundle/failure-LHMJNFY6.js +0 -66
  144. package/dist/bundle/first-screen-56KZKY77.js +0 -30
  145. package/dist/bundle/mcp-A4HPKQK5.js +0 -90
  146. package/dist/bundle/server-NQK5EX7P.js +0 -48
  147. package/dist/bundle/server-UN43Y6BY.js +0 -61
  148. package/dist/bundle/store-maintenance-command-QTEWWDST.js +0 -48
  149. package/dist/bundle/update-XC6KAVCK.js +0 -69
  150. /package/dist/bundle/{chunk-YYQN5ES2.js → chunk-WX2WLEEF.js} +0 -0
@@ -70,11 +70,11 @@ import {
70
70
  validateQuery,
71
71
  walkQuery,
72
72
  zonedMoment
73
- } from "./chunk-RNXYDBQO.js";
73
+ } from "./chunk-5M4KSMYN.js";
74
74
  import {
75
75
  holdsCredential,
76
76
  secretNamed
77
- } from "./chunk-PF3ALSAV.js";
77
+ } from "./chunk-6PXE6QSQ.js";
78
78
  import {
79
79
  DEFAULT_STEMMERS,
80
80
  DEFAULT_STEMMERS_VERSION,
@@ -87,26 +87,26 @@ import {
87
87
  fold,
88
88
  normalize,
89
89
  parseStemmers
90
- } from "./chunk-7F6FGMCC.js";
90
+ } from "./chunk-L6FKTS3L.js";
91
91
  import {
92
92
  DEFAULT_TASK_CATEGORIES,
93
93
  sharedConfigPath,
94
94
  storedTaskCategories,
95
95
  taskCategoriesReader
96
- } from "./chunk-2TBIVKBH.js";
96
+ } from "./chunk-CKLCJ6O7.js";
97
97
  import {
98
98
  refuseOwnerStoreInTests,
99
99
  storePath
100
- } from "./chunk-VXHN3SWW.js";
100
+ } from "./chunk-DIELPPLF.js";
101
101
  import {
102
102
  quietSqliteWarning,
103
103
  storeCapable
104
- } from "./chunk-OUF6RCRZ.js";
104
+ } from "./chunk-GQOFHKUX.js";
105
105
  import {
106
106
  PRAGMAS,
107
107
  TIME_LIMIT_FUNCTION,
108
108
  TimeLimitReached
109
- } from "./chunk-2NJUPIAO.js";
109
+ } from "./chunk-DIP3ENSY.js";
110
110
  import {
111
111
  array,
112
112
  boolean,
@@ -123,7 +123,7 @@ import {
123
123
  safeParse,
124
124
  strictObject,
125
125
  string
126
- } from "./chunk-EG2OMKWH.js";
126
+ } from "./chunk-JY4LVWGZ.js";
127
127
  import {
128
128
  resolveFrom
129
129
  } from "./chunk-Y5E2WNWB.js";
@@ -156,12 +156,12 @@ import {
156
156
  sql,
157
157
  sqliteTable,
158
158
  text
159
- } from "./chunk-7MLWSUEK.js";
159
+ } from "./chunk-QWRBAQZ7.js";
160
160
  import {
161
161
  __name
162
162
  } from "./chunk-ZVVMGPBJ.js";
163
163
 
164
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/account-store.js
164
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/account-store.js
165
165
  var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
166
166
  const methods = whole;
167
167
  return Object.fromEntries(Object.keys(keyed).map((name) => [
@@ -289,7 +289,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
289
289
  };
290
290
  }, "bindAccount");
291
291
 
292
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/locator.js
292
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/locator.js
293
293
  var SCHEME = "msg:";
294
294
  var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat: chat2, message: message2 }) => SCHEME + [provider, account, chat2, message2].map(encodeURIComponent).join("/"), "formatLocator");
295
295
  var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
@@ -303,7 +303,7 @@ var parseLocator = /* @__PURE__ */ __name((reference2) => {
303
303
  return { provider, account, chat: chat2, message: message2 };
304
304
  }, "parseLocator");
305
305
 
306
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/references.js
306
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/references.js
307
307
  var SIMPLE_REFERENCES = [
308
308
  "note",
309
309
  "document",
@@ -450,7 +450,7 @@ var looksLikeReference = /* @__PURE__ */ __name((text6) => {
450
450
  return match !== null && byPrefix.has(match[1]);
451
451
  }, "looksLikeReference");
452
452
 
453
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/providers.js
453
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/providers.js
454
454
  var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events"];
455
455
  var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
456
456
  var PROVIDERS = [
@@ -566,7 +566,7 @@ var providerNamed = /* @__PURE__ */ __name((word) => {
566
566
  var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
567
567
  var kindOf = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
568
568
 
569
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/search/query.js
569
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/search/query.js
570
570
  var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
571
571
  var inSource = /* @__PURE__ */ __name((source2, provider) => source2 === "all" || source2 === "bots" && isBotProvider(provider) || source2 === "personal" && !isBotProvider(provider) || source2 === provider || providerNamed(source2)?.name === provider || isKind(source2) && kindOf(provider) === source2, "inSource");
572
572
  var fail = /* @__PURE__ */ __name((message2) => {
@@ -589,7 +589,7 @@ var sourceOf = /* @__PURE__ */ __name((name, value, providers2) => {
589
589
  return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
590
590
  }, "sourceOf");
591
591
 
592
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/search/account-list.js
592
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/search/account-list.js
593
593
  var ACCOUNT_GROUPS = "accountGroups";
594
594
  var ACCOUNT_GROUPS_SETTING = "account_groups";
595
595
  var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
@@ -776,7 +776,7 @@ var fitting = /* @__PURE__ */ __name((entries, kinds2, what, reasonOf2 = (kind4)
776
776
  return { accounts: [...chosen.values()], skipped };
777
777
  }, "fitting");
778
778
 
779
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
779
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
780
780
  var IndexBuilderOn = class {
781
781
  static {
782
782
  __name(this, "IndexBuilderOn");
@@ -971,7 +971,7 @@ function alias(table, alias2) {
971
971
  }
972
972
  __name(alias, "alias");
973
973
 
974
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
974
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
975
975
  var ENTITY_TABLES = {
976
976
  account: "accounts",
977
977
  attachment: "attachments",
@@ -1013,7 +1013,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
1013
1013
  return { table, pointer, type, count, known: known2 };
1014
1014
  }).filter(({ count }) => count > 0)), "orphanPointers");
1015
1015
 
1016
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
1016
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
1017
1017
  var canonicalTags = sqliteTable("canonical_tags", {
1018
1018
  id: integer("id").primaryKey(),
1019
1019
  name: text("name").notNull().unique(),
@@ -1022,7 +1022,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
1022
1022
  updatedAt: integer("updated_at").notNull()
1023
1023
  });
1024
1024
 
1025
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
1025
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
1026
1026
  var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
1027
1027
  sourceKey: text("source_key").notNull(),
1028
1028
  collection: text("collection").notNull(),
@@ -1032,13 +1032,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
1032
1032
  createdAt: integer("created_at").notNull()
1033
1033
  }, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
1034
1034
 
1035
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
1035
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
1036
1036
  var documentIndexPending = sqliteTable("document_index_pending", {
1037
1037
  id: integer("id").notNull(),
1038
1038
  indexableType: text("indexable_type").notNull()
1039
1039
  }, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
1040
1040
 
1041
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
1041
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
1042
1042
  var tagRedirects = sqliteTable("tag_redirects", {
1043
1043
  sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
1044
1044
  survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
@@ -1064,7 +1064,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
1064
1064
  index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
1065
1065
  ]);
1066
1066
 
1067
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
1067
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
1068
1068
  var accounts = sqliteTable("accounts", {
1069
1069
  id: integer("id").primaryKey(),
1070
1070
  provider: text("provider").notNull(),
@@ -2687,7 +2687,7 @@ var storeSettings = sqliteTable("store_settings", {
2687
2687
  at: integer("at").notNull()
2688
2688
  });
2689
2689
 
2690
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
2690
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
2691
2691
  var ARMS = [
2692
2692
  [
2693
2693
  "message",
@@ -2814,7 +2814,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
2814
2814
  return recomputed;
2815
2815
  }, "drainInvolvementQueue");
2816
2816
 
2817
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/mentions.js
2817
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/mentions.js
2818
2818
  import { domainToUnicode } from "node:url";
2819
2819
 
2820
2820
  // node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
@@ -12836,7 +12836,7 @@ var oa = /* @__PURE__ */ __name((e) => {
12836
12836
  }, "oa");
12837
12837
  var na = { parse: O, get: aa, isValid: oa };
12838
12838
 
12839
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
12839
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
12840
12840
  var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
12841
12841
  var ID = /^[\w-]{10,}$/;
12842
12842
  var trimUrl = /* @__PURE__ */ __name((url) => {
@@ -12877,7 +12877,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text6) => [...text6.matchAll(L
12877
12877
  return { url, documentId: googleDocumentId(url) };
12878
12878
  }), "googleDocumentLinks");
12879
12879
 
12880
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
12880
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
12881
12881
  var PHONE_PLANS = [
12882
12882
  {
12883
12883
  country: "us",
@@ -13257,7 +13257,7 @@ var PHONE_PLANS = [
13257
13257
  }
13258
13258
  ];
13259
13259
 
13260
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/phones.js
13260
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/phones.js
13261
13261
  var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
13262
13262
  var DEFAULT_PHONE_COUNTRIES = ["ru"];
13263
13263
  var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
@@ -13298,7 +13298,7 @@ var nationalPhone = /* @__PURE__ */ __name((digits, countries, { anyType }) => {
13298
13298
  return void 0;
13299
13299
  }, "nationalPhone");
13300
13300
 
13301
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/places.js
13301
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/places.js
13302
13302
  var BEFORE = [
13303
13303
  [/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
13304
13304
  [/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
@@ -13558,7 +13558,7 @@ var findPlaces = /* @__PURE__ */ __name((text6) => {
13558
13558
  return found2.sort((a, b) => a.start - b.start);
13559
13559
  }, "findPlaces");
13560
13560
 
13561
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/mentions.js
13561
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/mentions.js
13562
13562
  var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
13563
13563
  var MENTION_VERSIONS = {
13564
13564
  phone: 1,
@@ -13748,7 +13748,7 @@ var typedPhone = /* @__PURE__ */ __name((typed, { phoneCountries = DEFAULT_PHONE
13748
13748
  };
13749
13749
  }, "typedPhone");
13750
13750
 
13751
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/first-names.js
13751
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/first-names.js
13752
13752
  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";
13753
13753
  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";
13754
13754
  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";
@@ -13756,7 +13756,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
13756
13756
  var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
13757
13757
  var NAME_WORDS = WORDS.split(" ");
13758
13758
 
13759
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/person-names.js
13759
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/person-names.js
13760
13760
  var LATIN_TO_CYRILLIC = {
13761
13761
  shch: "\u0449",
13762
13762
  sch: "\u0449",
@@ -13964,7 +13964,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text6, stem, taken) => {
13964
13964
  return found2;
13965
13965
  }, "findUnknownNames");
13966
13966
 
13967
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/attachments.js
13967
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/attachments.js
13968
13968
  var NOT_FILES = /* @__PURE__ */ new Set([
13969
13969
  "webpage",
13970
13970
  "share",
@@ -14004,7 +14004,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored3, files2) => {
14004
14004
  });
14005
14005
  }, "matchDownloads");
14006
14006
 
14007
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
14007
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
14008
14008
  var QUERY_VERSION = 1;
14009
14009
  var QUERY_LIMITS2 = {
14010
14010
  ...QUERY_LIMITS,
@@ -14040,7 +14040,7 @@ function exhausted(budget) {
14040
14040
  }
14041
14041
  __name(exhausted, "exhausted");
14042
14042
 
14043
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
14043
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
14044
14044
  var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
14045
14045
  var literal2 = /* @__PURE__ */ __name((c) => ({
14046
14046
  kind: "char",
@@ -14440,7 +14440,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
14440
14440
  return out;
14441
14441
  }, "foldRegex");
14442
14442
 
14443
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
14443
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
14444
14444
  var PRESET_VERSION = 1;
14445
14445
  var PRESETS = {
14446
14446
  password: {
@@ -14494,7 +14494,7 @@ var PRESETS = {
14494
14494
  }
14495
14495
  };
14496
14496
 
14497
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
14497
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
14498
14498
  var FIELD_VERSION = 2;
14499
14499
  var UNITS = {
14500
14500
  "": 1,
@@ -14954,12 +14954,12 @@ var validateAst = /* @__PURE__ */ __name((input) => {
14954
14954
  return validateFields(parsed3.output);
14955
14955
  }, "validateAst");
14956
14956
 
14957
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
14957
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
14958
14958
  var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
14959
14959
  var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
14960
14960
  var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
14961
14961
 
14962
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
14962
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
14963
14963
  var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
14964
14964
  var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
14965
14965
  var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
@@ -14983,7 +14983,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
14983
14983
  };
14984
14984
  }, "linkMatch");
14985
14985
 
14986
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
14986
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
14987
14987
  var SETTING = "phoneCountries";
14988
14988
  var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
14989
14989
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
@@ -15014,7 +15014,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
15014
15014
  return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
15015
15015
  }, "valueMatch");
15016
15016
 
15017
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
15017
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
15018
15018
  var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
15019
15019
  if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
15020
15020
  throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
@@ -15042,7 +15042,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
15042
15042
  return 2 * intersection2 / (aa2.size + bb.size);
15043
15043
  }, "vocabularySimilarity");
15044
15044
 
15045
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
15045
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
15046
15046
  import { createHash } from "node:crypto";
15047
15047
  var folded2 = /* @__PURE__ */ __name((name) => {
15048
15048
  try {
@@ -15108,7 +15108,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind4, by, options
15108
15108
  });
15109
15109
  }, "guardTagCreation");
15110
15110
 
15111
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
15111
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
15112
15112
  var invalid2 = /* @__PURE__ */ __name((message2) => {
15113
15113
  throw new CliError("validation_error", message2);
15114
15114
  }, "invalid");
@@ -15185,7 +15185,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
15185
15185
  };
15186
15186
  }, "createTagRedirectIndex");
15187
15187
 
15188
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
15188
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
15189
15189
  var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
15190
15190
  const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
15191
15191
  if (!row2)
@@ -15213,7 +15213,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
15213
15213
  return snapshot2;
15214
15214
  }, "tagRedirectSnapshot");
15215
15215
 
15216
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
15216
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
15217
15217
  import { createHash as createHash2 } from "node:crypto";
15218
15218
  var TASK_KEY_PREFIXES = {
15219
15219
  question: "Q",
@@ -15241,7 +15241,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
15241
15241
  return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
15242
15242
  }, "taskAccountOf");
15243
15243
 
15244
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
15244
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
15245
15245
  var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
15246
15246
  var REFERABLE = {
15247
15247
  note: { tombstone: true },
@@ -15405,7 +15405,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
15405
15405
  return row2 ? String(row2.id ?? row2.key) : void 0;
15406
15406
  }, "taskIdOf");
15407
15407
 
15408
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
15408
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
15409
15409
  var toMs = /* @__PURE__ */ __name((iso13) => {
15410
15410
  if (iso13 === null || iso13 === void 0)
15411
15411
  return null;
@@ -15419,7 +15419,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
15419
15419
  var DELIVERY = { delivered: 1, read: 2 };
15420
15420
  var deliveryOf = /* @__PURE__ */ __name((stored3) => stored3 === DELIVERY.read ? "read" : stored3 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
15421
15421
 
15422
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
15422
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
15423
15423
  var TAG_KINDS = ["tag", "topic"];
15424
15424
  var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
15425
15425
  var TAG_TYPE = {
@@ -15622,7 +15622,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
15622
15622
  return result;
15623
15623
  }, "tagsOf");
15624
15624
 
15625
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
15625
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
15626
15626
  var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
15627
15627
  var SPEECH = speech("att");
15628
15628
  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");
@@ -15896,7 +15896,8 @@ var messengerOnly = /* @__PURE__ */ __name((compile2) => (node, scope3) => {
15896
15896
  return compile2(node, scope3);
15897
15897
  }, "messengerOnly");
15898
15898
  var topic = messengerOnly(({ value }) => always(bound("m.thread_external_id = ?", value)));
15899
- var kind2 = messengerOnly(({ value }) => always(bound("CASE WHEN json_extract(c.metadata,'$.peerKind') IN ('private','saved','bot','service','group','channel','unknown') THEN json_extract(c.metadata,'$.peerKind') WHEN c.kind='dialog' AND json_extract(c.metadata,'$.isBot')=1 THEN 'bot' WHEN c.kind='dialog' THEN 'private' ELSE c.kind END = ?", value.toLowerCase())));
15899
+ var PEER_KIND = "CASE WHEN json_extract(c.metadata,'$.peerKind') IN ('private','saved','bot','service','group','channel','unknown') THEN json_extract(c.metadata,'$.peerKind') WHEN c.kind='dialog' AND json_extract(c.metadata,'$.isBot')=1 THEN 'bot' WHEN c.kind='dialog' THEN 'private' ELSE c.kind END";
15900
+ var kind2 = messengerOnly(({ value }) => always(bound(`${PEER_KIND} = ?`, value.toLowerCase())));
15900
15901
  var has = /* @__PURE__ */ __name(({ value }, { corpus, mail }) => {
15901
15902
  const wanted = value.toLowerCase();
15902
15903
  return always(wanted === "text" ? bound("length(trim(coalesce(m.text,''))) > 0") : wanted === "link" ? bound(`(${mail ? "m.text LIKE '%' || ? || '%'" : "m.id IN (SELECT rowid FROM messages_fts WHERE messages_fts MATCH ?)"} OR EXISTS (SELECT 1 FROM attachments att WHERE att.attachable_type='${corpus.item}' AND att.attachable_id=m.id AND att.kind IN ('share','webpage')))`, mail ? "://" : quoted("://")) : wanted === "attachment" ? bound(`EXISTS (SELECT 1 FROM attachments att WHERE att.attachable_type='${corpus.item}' AND att.attachable_id=m.id)`) : bound(`EXISTS (SELECT 1 FROM attachments att WHERE att.attachable_type='${corpus.item}' AND att.attachable_id=m.id AND att.kind IN (${storedKinds(wanted).map(() => "?").join(",")}))`, ...storedKinds(wanted)));
@@ -15983,7 +15984,7 @@ var FIELD_COMPILERS = {
15983
15984
  subject
15984
15985
  };
15985
15986
 
15986
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
15987
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
15987
15988
  var placeOf = /* @__PURE__ */ __name((database) => {
15988
15989
  const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
15989
15990
  const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
@@ -15999,7 +16000,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
15999
16000
  };
16000
16001
  }, "placeOf");
16001
16002
 
16002
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
16003
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
16003
16004
  var DRAIN_ON_WRITE = 500;
16004
16005
  var METHOD = "rules";
16005
16006
  var telegramLink = /* @__PURE__ */ __name((database) => {
@@ -16162,7 +16163,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
16162
16163
  return queued.length;
16163
16164
  }, "drainMentions");
16164
16165
 
16165
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
16166
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
16166
16167
  var indexRow = /* @__PURE__ */ __name((database, name) => {
16167
16168
  const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
16168
16169
  if (!exists2)
@@ -16170,7 +16171,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
16170
16171
  return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
16171
16172
  }, "indexRow");
16172
16173
 
16173
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
16174
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
16174
16175
  var INDEX = "message_stems";
16175
16176
  var SETTING2 = "searchStemmers";
16176
16177
  var DRAIN_ON_WRITE2 = 500;
@@ -16292,7 +16293,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
16292
16293
  };
16293
16294
  }, "stemmerCache");
16294
16295
 
16295
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
16296
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
16296
16297
  var SQLITE_BUSY = 5;
16297
16298
  var pause = new Int32Array(new SharedArrayBuffer(4));
16298
16299
  var isBusy = /* @__PURE__ */ __name((error) => {
@@ -16387,7 +16388,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
16387
16388
  }
16388
16389
  }, "read");
16389
16390
 
16390
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
16391
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
16391
16392
  var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
16392
16393
  coalesce(CASE k.chunkable_type
16393
16394
  WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
@@ -16529,7 +16530,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
16529
16530
  }, "dropUnusedVectors");
16530
16531
  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");
16531
16532
 
16532
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
16533
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
16533
16534
  var accountPk = /* @__PURE__ */ __name(({ orm, now: now2 }, { provider, account, scope: scope3 }, name = null) => Number(orm.insert(accounts).values({ provider, externalId: account, name, scope: scope3 ?? "personal", createdAt: now2(), updatedAt: now2() }).onConflictDoUpdate({
16534
16535
  target: [accounts.provider, accounts.externalId],
16535
16536
  set: {
@@ -16638,7 +16639,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
16638
16639
  AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
16639
16640
  }, "dropOrphanPeople");
16640
16641
 
16641
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
16642
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
16642
16643
  var FOLDED = [
16643
16644
  { table: "tasks", column: "title" },
16644
16645
  { table: "tasks", column: "close_reason" },
@@ -16675,7 +16676,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
16675
16676
  return filled2;
16676
16677
  }, "fillFolded");
16677
16678
 
16678
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
16679
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
16679
16680
  var HISTORY_KEY = "$history";
16680
16681
  var objectOf = /* @__PURE__ */ __name((text6) => {
16681
16682
  if (typeof text6 !== "string")
@@ -16751,7 +16752,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
16751
16752
  return rest;
16752
16753
  }, "withoutHistory");
16753
16754
 
16754
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
16755
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
16755
16756
  import { createHash as createHash3 } from "node:crypto";
16756
16757
  var CHUNK_CHARS = 1200;
16757
16758
  var CHUNK_OVERLAP = 150;
@@ -16856,7 +16857,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
16856
16857
  return chunks2;
16857
16858
  }, "cutChunks");
16858
16859
 
16859
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/search/task-signature.js
16860
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/search/task-signature.js
16860
16861
  var DAY = 864e5;
16861
16862
  var CURRENCY = [
16862
16863
  [/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
@@ -16982,7 +16983,7 @@ var dueDayOf = /* @__PURE__ */ __name((text6, createdMs) => {
16982
16983
  return best?.day ?? null;
16983
16984
  }, "dueDayOf");
16984
16985
 
16985
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
16986
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
16986
16987
  var DAY2 = 864e5;
16987
16988
  var STOP_WORDS = new Set([
16988
16989
  // Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
@@ -17137,7 +17138,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
17137
17138
  ...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
17138
17139
  })).sort((a, b) => b.score - a.score), "rankCandidates");
17139
17140
 
17140
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
17141
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
17141
17142
  var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
17142
17143
  r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
17143
17144
  JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
@@ -17408,7 +17409,7 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
17408
17409
  };
17409
17410
  }, "readiness");
17410
17411
 
17411
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
17412
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
17412
17413
  var DOCUMENT_PICTURE = "document_picture";
17413
17414
  var SCAN_PAGE2 = 5e3;
17414
17415
  var idOf = /* @__PURE__ */ __name((ref3) => {
@@ -17471,7 +17472,7 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
17471
17472
  }, "nearestPictures")
17472
17473
  }), "documentPicturesOver");
17473
17474
 
17474
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
17475
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
17475
17476
  var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
17476
17477
  const literal4 = escaped2 ?? plain2 ?? "";
17477
17478
  return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
@@ -17536,7 +17537,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
17536
17537
  var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
17537
17538
  var bound2 = /* @__PURE__ */ __name(({ sql: text6, params }) => sql.join(text6.split("?").map((part, at) => at < params.length ? sql`${sql.raw(part)}${params[at]}` : sql.raw(part)), sql``), "bound");
17538
17539
 
17539
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
17540
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
17540
17541
  var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
17541
17542
  var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
17542
17543
  var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
@@ -17626,7 +17627,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
17626
17627
  });
17627
17628
  }, "linkMeeting");
17628
17629
 
17629
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
17630
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
17630
17631
  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), ''))";
17631
17632
  var UNSEARCHED_EVENT_TYPES = [
17632
17633
  "working-location",
@@ -17856,7 +17857,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
17856
17857
  return true;
17857
17858
  }, "resetNoteIndex");
17858
17859
 
17859
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
17860
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
17860
17861
  var keyOf3 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
17861
17862
  var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
17862
17863
  for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf3))) {
@@ -17875,7 +17876,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
17875
17876
  }
17876
17877
  }, "resolvePersonLinks");
17877
17878
 
17878
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
17879
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
17879
17880
  var flag2 = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
17880
17881
  var prepare = /* @__PURE__ */ __name((orm) => ({
17881
17882
  find: orm.select({
@@ -18100,7 +18101,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
18100
18101
  }, "meetingIdentityPk");
18101
18102
  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");
18102
18103
 
18103
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
18104
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
18104
18105
  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");
18105
18106
  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");
18106
18107
  var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
@@ -18380,7 +18381,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
18380
18381
  }
18381
18382
  }, "replaceAutoTags");
18382
18383
 
18383
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/counters.js
18384
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/counters.js
18384
18385
  var COUNTER_FIELDS = ["views", "reactions", "comments"];
18385
18386
  var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
18386
18387
  var counterObservationTime = /* @__PURE__ */ __name((observation, now2) => {
@@ -18399,7 +18400,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
18399
18400
  return states.some((one2) => one2.freshness === "stale") ? "stale" : "fresh";
18400
18401
  }, "counterFreshness");
18401
18402
 
18402
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/context/evidence.js
18403
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/context/evidence.js
18403
18404
  import { createHash as createHash4 } from "node:crypto";
18404
18405
  var CONTEXT_MAX_READ_BYTES = 262144;
18405
18406
  var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
@@ -18497,7 +18498,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
18497
18498
  return { source: source2, query, chat: chat2, senders, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
18498
18499
  }, "contextEvidenceRequest");
18499
18500
 
18500
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
18501
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
18501
18502
  var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
18502
18503
  var ACTIVITY = `
18503
18504
  SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
@@ -18613,7 +18614,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
18613
18614
  threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
18614
18615
  }), "mailActivity");
18615
18616
 
18616
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
18617
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
18617
18618
  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");
18618
18619
  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;
18619
18620
  var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
@@ -18694,7 +18695,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
18694
18695
  return withoutSignOff(withoutGreeting(kept)).join("\n").trim();
18695
18696
  }, "mailCore");
18696
18697
 
18697
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
18698
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
18698
18699
  var titleOf = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
18699
18700
  var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
18700
18701
  k.start_offset, k.end_offset, k.account_id, k.occurred_at, a.attachable_id AS email_id,
@@ -18804,7 +18805,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
18804
18805
  return emails3 + threads;
18805
18806
  }, "drainEmailIndex");
18806
18807
 
18807
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
18808
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
18808
18809
  var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
18809
18810
  SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
18810
18811
  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,
@@ -18823,6 +18824,17 @@ var folderEmails = /* @__PURE__ */ __name((database, accountId, folder, uidvalid
18823
18824
  locations: Number(row2.locations),
18824
18825
  folders: Number(row2.folders)
18825
18826
  })), "folderEmails");
18827
+ var placed = /* @__PURE__ */ __name((row2) => ({
18828
+ externalId: String(row2.external_id),
18829
+ threadExternalId: String(row2.thread),
18830
+ receivedAt: row2.at === null ? null : Number(row2.at),
18831
+ metadata: fromJson(row2.metadata),
18832
+ locations: JSON.parse(String(row2.places)).map((place) => ({
18833
+ folder: String(place.folder),
18834
+ uidvalidity: String(place.uidvalidity),
18835
+ uid: Number(place.uid)
18836
+ }))
18837
+ }), "placed");
18826
18838
  var partialEmails = /* @__PURE__ */ __name((database, accountId, limit) => {
18827
18839
  const rows = database.prepare(`SELECT e.external_id, t.external_id AS thread, coalesce(e.received_at, e.sent_at) AS at, e.metadata,
18828
18840
  count(*) OVER () AS total,
@@ -18839,23 +18851,24 @@ var partialEmails = /* @__PURE__ */ __name((database, accountId, limit) => {
18839
18851
  return {
18840
18852
  total: rows.length ? Number(rows[0]?.total) : 0,
18841
18853
  stuck: Number(stuck?.n ?? 0),
18842
- emails: rows.map((row2) => ({
18843
- externalId: String(row2.external_id),
18844
- threadExternalId: String(row2.thread),
18845
- receivedAt: row2.at === null ? null : Number(row2.at),
18846
- metadata: fromJson(row2.metadata),
18847
- locations: JSON.parse(String(row2.places)).map((place) => ({
18848
- folder: String(place.folder),
18849
- uidvalidity: String(place.uidvalidity),
18850
- uid: Number(place.uid)
18851
- }))
18852
- }))
18854
+ emails: rows.map(placed)
18853
18855
  };
18854
18856
  }, "partialEmails");
18857
+ var emailPlace = /* @__PURE__ */ __name((database, accountId, externalId) => {
18858
+ const row2 = database.prepare(`SELECT e.external_id, t.external_id AS thread, coalesce(e.received_at, e.sent_at) AS at, e.metadata,
18859
+ (SELECT json_group_array(json_object('folder', folder, 'uidvalidity', uidvalidity, 'uid', uid))
18860
+ FROM (SELECT b.external_id AS folder, l.uidvalidity, l.uid
18861
+ FROM email_locations l JOIN mailboxes b ON b.id = l.mailbox_id
18862
+ WHERE l.email_id = e.id ORDER BY l.rowid DESC)) AS places
18863
+ FROM emails e JOIN email_threads t ON t.id = e.email_thread_id
18864
+ WHERE e.account_id = ? AND e.external_id = ? AND e.deleted_at IS NULL`).get(accountId, externalId);
18865
+ return row2 ? placed(row2) : null;
18866
+ }, "emailPlace");
18855
18867
  var markPartial = /* @__PURE__ */ __name((database, accountId, externalId, mark) => database.prepare(`UPDATE emails SET metadata = json_set(metadata, '$.partial', json(?)) WHERE account_id = ? AND external_id = ?
18856
18868
  AND json_extract(metadata, '$.partial') IS NOT NULL`).run(JSON.stringify(mark), accountId, externalId), "markPartial");
18857
18869
  var partialMail = /* @__PURE__ */ __name((database) => ({
18858
18870
  partialEmails: /* @__PURE__ */ __name(async (accountId, limit) => partialEmails(database, accountId, limit), "partialEmails"),
18871
+ emailPlace: /* @__PURE__ */ __name(async (accountId, externalId) => emailPlace(database, accountId, externalId), "emailPlace"),
18859
18872
  markPartial: /* @__PURE__ */ __name(async (accountId, externalId, mark) => {
18860
18873
  write(database, () => markPartial(database, accountId, externalId, mark));
18861
18874
  }, "markPartial")
@@ -18890,7 +18903,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
18890
18903
  var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
18891
18904
  SELECT id FROM emails WHERE account_id = ? AND sent_at IS NULL AND received_at IS NOT NULL LIMIT ?)`).run(accountId, limit).changes), "backfillSentAt");
18892
18905
 
18893
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
18906
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
18894
18907
  var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
18895
18908
  emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
18896
18909
  last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
@@ -18940,7 +18953,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
18940
18953
  return threads.length;
18941
18954
  }, "markEmailsRestored");
18942
18955
 
18943
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
18956
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
18944
18957
  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");
18945
18958
  var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
18946
18959
  var ruleOf = /* @__PURE__ */ __name((row2) => ({
@@ -19007,7 +19020,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
19007
19020
  }
19008
19021
  }), "mailRulesOver");
19009
19022
 
19010
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
19023
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
19011
19024
  var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
19012
19025
  database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
19013
19026
  VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
@@ -19015,7 +19028,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
19015
19028
  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);
19016
19029
  }, "reviewLink");
19017
19030
 
19018
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
19031
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
19019
19032
  function checkMeetingCancelled(signal) {
19020
19033
  if (!signal?.aborted)
19021
19034
  return;
@@ -19026,7 +19039,7 @@ function checkMeetingCancelled(signal) {
19026
19039
  }
19027
19040
  __name(checkMeetingCancelled, "checkMeetingCancelled");
19028
19041
 
19029
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
19042
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
19030
19043
  var meetingOf = /* @__PURE__ */ __name((row2) => ({
19031
19044
  id: Number(row2.id),
19032
19045
  accountId: Number(row2.account_id),
@@ -19076,7 +19089,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
19076
19089
  createdAt: Number(row2.created_at)
19077
19090
  }), "transcriptRowOf");
19078
19091
 
19079
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
19092
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
19080
19093
  var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
19081
19094
  var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
19082
19095
  var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
@@ -19243,7 +19256,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
19243
19256
  }
19244
19257
  }), "meetingReadsOver");
19245
19258
 
19246
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
19259
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
19247
19260
  var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
19248
19261
  const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
19249
19262
  const params = [input.accountId];
@@ -19286,7 +19299,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
19286
19299
  return { clauses, params };
19287
19300
  }, "meetingSelectionSql");
19288
19301
 
19289
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
19302
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
19290
19303
  var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
19291
19304
  async meetingChatLines(input) {
19292
19305
  checkMeetingCancelled(input.signal);
@@ -19314,7 +19327,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
19314
19327
  }
19315
19328
  }), "meetingChatLinesOver");
19316
19329
 
19317
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
19330
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
19318
19331
  var MESSAGE_FIELDS = {
19319
19332
  pk: messages.id,
19320
19333
  nativeId: messages.externalId,
@@ -19485,7 +19498,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
19485
19498
  storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
19486
19499
  }), "chatActivity");
19487
19500
 
19488
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
19501
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
19489
19502
  var HIT_FIELDS = {
19490
19503
  ...MESSAGE_FIELDS,
19491
19504
  chatTitle: sql`${chats.title}`.as("chat_title"),
@@ -19584,7 +19597,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
19584
19597
  };
19585
19598
  }, "directReplies");
19586
19599
 
19587
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
19600
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
19588
19601
  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");
19589
19602
  var required = /* @__PURE__ */ __name((context, ref3) => {
19590
19603
  const found2 = identityRow(context, ref3);
@@ -19715,7 +19728,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
19715
19728
  }, "mentioning");
19716
19729
  var escaped = /* @__PURE__ */ __name((text6) => text6.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
19717
19730
 
19718
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
19731
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
19719
19732
  var missing2 = /* @__PURE__ */ __name(() => {
19720
19733
  throw new CliError("not_found", "Meeting, participant or selected target not found");
19721
19734
  }, "missing");
@@ -19837,7 +19850,7 @@ function meetingContextLinksOver(context) {
19837
19850
  }
19838
19851
  __name(meetingContextLinksOver, "meetingContextLinksOver");
19839
19852
 
19840
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
19853
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
19841
19854
  var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
19842
19855
  var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
19843
19856
  var summaryOf = /* @__PURE__ */ __name((row2) => ({
@@ -19866,7 +19879,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
19866
19879
  return row2 ? summaryText(summaryOf(row2)) : null;
19867
19880
  }, "indexedText");
19868
19881
 
19869
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
19882
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
19870
19883
  var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
19871
19884
  var meetingCurrentIndexRows = `
19872
19885
  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
@@ -19897,7 +19910,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
19897
19910
  }, "invalidateMeetingStems");
19898
19911
  var meetingStemmableText = /* @__PURE__ */ __name((text6) => text6.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
19899
19912
 
19900
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
19913
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
19901
19914
  function meetingHitIndexOver({ database, now: now2 }) {
19902
19915
  return {
19903
19916
  async indexSearch(original) {
@@ -19965,10 +19978,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
19965
19978
  }
19966
19979
  __name(meetingHitIndexOver, "meetingHitIndexOver");
19967
19980
 
19968
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
19981
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
19969
19982
  import { createHash as createHash5 } from "node:crypto";
19970
19983
 
19971
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/search/trigrams.js
19984
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/search/trigrams.js
19972
19985
  var trigrams = /* @__PURE__ */ __name((term) => {
19973
19986
  const padded = ` ${term} `;
19974
19987
  const pieces = /* @__PURE__ */ new Set();
@@ -19977,7 +19990,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
19977
19990
  return [...pieces];
19978
19991
  }, "trigrams");
19979
19992
 
19980
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/search/correct.js
19993
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/search/correct.js
19981
19994
  var SHORTEST_CORRECTION = 3;
19982
19995
  var maxEdits = /* @__PURE__ */ __name((word) => word.length <= 4 ? 1 : 2, "maxEdits");
19983
19996
  var editDistance = /* @__PURE__ */ __name((a, b, max) => {
@@ -20024,7 +20037,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words3) => {
20024
20037
  return corrections;
20025
20038
  }, "correctWords");
20026
20039
 
20027
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/search/garbled.js
20040
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/search/garbled.js
20028
20041
  var SHORTEST_GARBLED = 4;
20029
20042
  var MOST_WIDENED = 64;
20030
20043
  var plain = /* @__PURE__ */ __name((word) => word.replaceAll("\u044D", "\u0435"), "plain");
@@ -20116,7 +20129,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
20116
20129
  return found2.map((words3) => words3.sort((a, b) => a.distance - b.distance || b.docs - a.docs || a.term.localeCompare(b.term)).slice(0, MOST_WIDENED).map((word) => word.term));
20117
20130
  }, "widenWords");
20118
20131
 
20119
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
20132
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
20120
20133
  import { readFileSync } from "node:fs";
20121
20134
  var loaded;
20122
20135
  var dictionary = /* @__PURE__ */ __name(() => {
@@ -20175,7 +20188,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word) => {
20175
20188
  return false;
20176
20189
  }, "knownRussianWord");
20177
20190
 
20178
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
20191
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
20179
20192
  var WORD3 = /[\p{L}\p{N}\p{M}]+/gu;
20180
20193
  var MOST_WORDS = 128;
20181
20194
  var quote = /* @__PURE__ */ __name((word) => `"${word.replaceAll('"', '""')}"`, "quote");
@@ -20402,7 +20415,7 @@ var matchMeetingText = /* @__PURE__ */ __name((tree, text6, stemmer) => {
20402
20415
  return check3(tree);
20403
20416
  }, "matchMeetingText");
20404
20417
 
20405
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
20418
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
20406
20419
  var fail3 = /* @__PURE__ */ __name((message2) => {
20407
20420
  throw new CliError("validation_error", message2);
20408
20421
  }, "fail");
@@ -20584,7 +20597,7 @@ function meetingHitSearchOver({ database }) {
20584
20597
  }
20585
20598
  __name(meetingHitSearchOver, "meetingHitSearchOver");
20586
20599
 
20587
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
20600
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
20588
20601
  var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
20589
20602
  async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
20590
20603
  positiveReadInteger(accountId, "accountId");
@@ -20616,7 +20629,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
20616
20629
  }
20617
20630
  }), "meetingLanguagesOver");
20618
20631
 
20619
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
20632
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
20620
20633
  import { createHash as createHash6 } from "node:crypto";
20621
20634
  var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
20622
20635
  if (value === void 0)
@@ -20706,7 +20719,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
20706
20719
  }
20707
20720
  }), "meetingParticipantSearchOver");
20708
20721
 
20709
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
20722
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
20710
20723
  var preparationQueries = {
20711
20724
  participants: {
20712
20725
  fields: "p.id, p.identity_id, p.display_name, l.person_id",
@@ -20756,7 +20769,7 @@ var preparationQueries = {
20756
20769
  }
20757
20770
  };
20758
20771
 
20759
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
20772
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
20760
20773
  var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
20761
20774
  async preparationContext(original) {
20762
20775
  const input = validateMeetingPreparationContext(original);
@@ -20797,7 +20810,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
20797
20810
  }
20798
20811
  }), "meetingPreparationContextOver");
20799
20812
 
20800
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
20813
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
20801
20814
  var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
20802
20815
  SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
20803
20816
  WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
@@ -20811,7 +20824,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
20811
20824
  JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
20812
20825
  )`, "preparationSubjects");
20813
20826
 
20814
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
20827
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
20815
20828
  var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
20816
20829
  async preparationKnowledge(original) {
20817
20830
  const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
@@ -20856,7 +20869,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
20856
20869
  }
20857
20870
  }), "meetingPreparationKnowledgeOver");
20858
20871
 
20859
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
20872
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
20860
20873
  var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
20861
20874
  async preparationNotes(original) {
20862
20875
  const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
@@ -20909,7 +20922,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
20909
20922
  }
20910
20923
  }), "meetingPreparationNotesOver");
20911
20924
 
20912
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
20925
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
20913
20926
  var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
20914
20927
  async relatedHistory(original) {
20915
20928
  const input = validateMeetingRelatedHistory(original);
@@ -20980,7 +20993,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
20980
20993
  }
20981
20994
  }), "meetingRelatedHistoryOver");
20982
20995
 
20983
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
20996
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
20984
20997
  var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
20985
20998
  var text2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
20986
20999
  var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
@@ -21061,7 +21074,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
21061
21074
  }
21062
21075
  }), "meetingReviewOver");
21063
21076
 
21064
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
21077
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
21065
21078
  var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
21066
21079
  var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
21067
21080
  if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
@@ -21115,7 +21128,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
21115
21128
  }
21116
21129
  }), "meetingSeriesHistoryOver");
21117
21130
 
21118
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
21131
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
21119
21132
  var MOST_ROWS = 5e5;
21120
21133
  var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
21121
21134
  async meetingStats(input) {
@@ -21162,7 +21175,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
21162
21175
  }
21163
21176
  }), "meetingStatsOver");
21164
21177
 
21165
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
21178
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
21166
21179
  var CURSOR_KEY = "meetings";
21167
21180
  var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
21168
21181
  id: Number(row2.id),
@@ -21731,7 +21744,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
21731
21744
  };
21732
21745
  }, "meetingStoreOver");
21733
21746
 
21734
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
21747
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
21735
21748
  var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
21736
21749
  const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
21737
21750
  return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
@@ -21757,7 +21770,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder) => {
21757
21770
  orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder))).run();
21758
21771
  }, "release");
21759
21772
 
21760
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
21773
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
21761
21774
  var THREAD_COLUMNS = {
21762
21775
  subject: {
21763
21776
  where: /* @__PURE__ */ __name(({ value }) => ({
@@ -21774,7 +21787,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
21774
21787
  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);
21775
21788
  }, "threadRows");
21776
21789
 
21777
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
21790
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
21778
21791
  var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
21779
21792
  id: `email:${place.emailId}`,
21780
21793
  chatId: place.threadExternalId,
@@ -22330,7 +22343,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
22330
22343
  }
22331
22344
  }), "mailStoreOver");
22332
22345
 
22333
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/search/dictionary.js
22346
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/search/dictionary.js
22334
22347
  import { readFileSync as readFileSync2 } from "node:fs";
22335
22348
  var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
22336
22349
  var folded4 = /* @__PURE__ */ __name((word) => /^[а-яё'-]*$/.test(word) ? word.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word), "folded");
@@ -22420,7 +22433,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
22420
22433
  }, "knownWord");
22421
22434
  var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
22422
22435
 
22423
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
22436
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
22424
22437
  var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
22425
22438
  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");
22426
22439
  var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
@@ -22506,7 +22519,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
22506
22519
  return found2;
22507
22520
  }, "spokenTranscripts");
22508
22521
 
22509
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
22522
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
22510
22523
  var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
22511
22524
  const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
22512
22525
  if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
@@ -22553,7 +22566,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
22553
22566
  });
22554
22567
  }, "placeHits");
22555
22568
 
22556
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
22569
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
22557
22570
  var MESSAGES2 = {
22558
22571
  rows: "messages",
22559
22572
  threads: "chats",
@@ -22883,8 +22896,8 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
22883
22896
  count: Number(row2.count)
22884
22897
  }));
22885
22898
  }, "grouped");
22886
- const placed = /* @__PURE__ */ __name((found2, pks) => placeHits(database, corpus, [...fragments.values()], transcripts, found2, pks), "placed");
22887
- const hits = /* @__PURE__ */ __name((pks) => placed(mail ? emailHitsByPk(database, pks) : hitsByPk(context, pks), pks), "hits");
22899
+ const placed2 = /* @__PURE__ */ __name((found2, pks) => placeHits(database, corpus, [...fragments.values()], transcripts, found2, pks), "placed");
22900
+ const hits = /* @__PURE__ */ __name((pks) => placed2(mail ? emailHitsByPk(database, pks) : hitsByPk(context, pks), pks), "hits");
22888
22901
  return {
22889
22902
  corpus,
22890
22903
  rowsFrom,
@@ -23048,7 +23061,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
23048
23061
  };
23049
23062
  }, "runCompiled");
23050
23063
 
23051
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
23064
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
23052
23065
  function invalidMetadata() {
23053
23066
  throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
23054
23067
  }
@@ -23150,7 +23163,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
23150
23163
  };
23151
23164
  }), "counterTargets");
23152
23165
 
23153
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
23166
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
23154
23167
  var NOT_FILE_LIST = [...NOT_FILES].map((kind4) => `'${kind4}'`).join(",");
23155
23168
  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,
23156
23169
  att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
@@ -23269,7 +23282,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
23269
23282
  }));
23270
23283
  }, "attachmentViews");
23271
23284
 
23272
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
23285
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
23273
23286
  var transcript = /* @__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");
23274
23287
  var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text6, source2) => {
23275
23288
  const { orm, database, now: now2 } = context;
@@ -23307,7 +23320,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
23307
23320
  keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
23308
23321
  }, "intoVoiceAttachment");
23309
23322
 
23310
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
23323
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
23311
23324
  var FIELDS = [
23312
23325
  "threadExternalId",
23313
23326
  "senderIdentityId",
@@ -23624,7 +23637,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
23624
23637
  reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
23625
23638
  }, "writeDerivedReactions");
23626
23639
 
23627
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/keys.js
23640
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/keys.js
23628
23641
  var keysOver = /* @__PURE__ */ __name((context) => {
23629
23642
  const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
23630
23643
  const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
@@ -23645,7 +23658,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
23645
23658
  };
23646
23659
  }, "keysOver");
23647
23660
 
23648
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
23661
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
23649
23662
  var accountGroupsOf = /* @__PURE__ */ __name((database) => {
23650
23663
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
23651
23664
  if (!row2)
@@ -23680,7 +23693,7 @@ var saveProfile = /* @__PURE__ */ __name((database, app, profile, key2, now2) =>
23680
23693
  database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
23681
23694
  }, "saveProfile");
23682
23695
 
23683
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
23696
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
23684
23697
  var BOT_KINDS = ["agent", "rule", "script", "integration"];
23685
23698
  var ownerPerson = /* @__PURE__ */ __name((database) => {
23686
23699
  const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
@@ -23737,7 +23750,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
23737
23750
  return { sql: bot("pb.name = ?"), params: [by.bot] };
23738
23751
  }, "proposedBySql");
23739
23752
 
23740
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
23753
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
23741
23754
  var linkOwnIdentities = /* @__PURE__ */ __name((context) => {
23742
23755
  const owner = ownerPerson(context.database).id;
23743
23756
  const strays = context.database.prepare("SELECT DISTINCT l.person_id AS person FROM identity_links l JOIN identities i ON i.id = l.identity_id JOIN accounts a ON a.provider = i.provider AND a.external_id = i.external_id WHERE l.person_id <> ?").all(owner);
@@ -23758,7 +23771,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
23758
23771
  return personOf(context, ref3);
23759
23772
  }, "linkToOwner");
23760
23773
 
23761
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
23774
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
23762
23775
  var PROVIDERS_SETTING = "providers";
23763
23776
  var storedProvidersOf = /* @__PURE__ */ __name((database) => {
23764
23777
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
@@ -23793,7 +23806,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
23793
23806
  });
23794
23807
  }, "registerProvider");
23795
23808
 
23796
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
23809
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
23797
23810
  var DAY3 = 864e5;
23798
23811
  var RECENTLY_CLOSED_MS = 14 * DAY3;
23799
23812
  var TEXT_LIMIT = 20;
@@ -23992,7 +24005,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
23992
24005
  };
23993
24006
  }, "taskSimilarityOver");
23994
24007
 
23995
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
24008
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
23996
24009
  var SETTING3 = "taskCategories";
23997
24010
  var savedTaskCategories = /* @__PURE__ */ __name((database) => {
23998
24011
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
@@ -24011,7 +24024,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
24011
24024
  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);
24012
24025
  }, "saveTaskCategories");
24013
24026
 
24014
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
24027
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
24015
24028
  var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
24016
24029
  var ALLOWED = "taskAgentClose";
24017
24030
  var MIN = "taskAgentCloseMin";
@@ -24067,8 +24080,12 @@ var SUGGESTION_COLUMNS = [
24067
24080
  ];
24068
24081
  var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
24069
24082
 
24070
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/decisions.js
24083
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
24084
+ var MAIL_FINDINGS_KIND = "mail_findings";
24085
+
24086
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/decisions.js
24071
24087
  var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
24088
+ var isOwnerOnlyKind = /* @__PURE__ */ __name((kind4) => kind4 === MAIL_FINDINGS_KIND || kind4 === MEETING_FINDINGS_KIND, "isOwnerOnlyKind");
24072
24089
  var mayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISION_POLICY) => {
24073
24090
  if (by === "owner")
24074
24091
  return null;
@@ -24078,7 +24095,7 @@ var mayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISION_POLI
24078
24095
  reason,
24079
24096
  message: message2
24080
24097
  }), "refuse");
24081
- if (row2.ownerOnly)
24098
+ if (row2.ownerOnly || isOwnerOnlyKind(row2.kind))
24082
24099
  return refuse4("permission_error", "proposal.owner-only", `only the owner decides ${row2.id}`);
24083
24100
  if (!policy.agentDecisions)
24084
24101
  return refuse4("permission_error", "proposals.agent-decisions-off", "agent decisions are turned off; the owner decides");
@@ -24113,7 +24130,7 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
24113
24130
  }, "assertMayDecide");
24114
24131
  var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
24115
24132
 
24116
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/money.js
24133
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/money.js
24117
24134
  var CURRENCY_SCALES = {
24118
24135
  AED: 2,
24119
24136
  AMD: 2,
@@ -24198,7 +24215,7 @@ var quantityOf = /* @__PURE__ */ __name((text6) => {
24198
24215
  }, "quantityOf");
24199
24216
  var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
24200
24217
 
24201
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/finance.js
24218
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/finance.js
24202
24219
  var INVOICE_DIRECTIONS = ["receivable", "payable"];
24203
24220
  var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
24204
24221
  var MONEY_DIRECTIONS = ["in", "out"];
@@ -24227,7 +24244,7 @@ var paymentLine = /* @__PURE__ */ __name((payment) => {
24227
24244
  var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
24228
24245
  var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
24229
24246
 
24230
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
24247
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
24231
24248
  var PROFILE_PLACEHOLDER = "<profile>";
24232
24249
  var oneLine = /* @__PURE__ */ __name((text6) => singleLine(text6.replace(/\s+/g, " ").trim()), "oneLine");
24233
24250
  var openKind = /* @__PURE__ */ __name((kind4) => kind4 === "email" ? "message" : kind4 === "email_thread" ? "chat" : kind4 === "unknown" ? void 0 : kind4, "openKind");
@@ -24279,7 +24296,7 @@ var refLabel = /* @__PURE__ */ __name((summary) => {
24279
24296
  return `${WORDS2[summary.kind]} ${named2}${notes3 === "" ? "" : ` (${notes3})`}`;
24280
24297
  }, "refLabel");
24281
24298
 
24282
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
24299
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
24283
24300
  var EXCERPT_CHARS = 280;
24284
24301
  var TITLE_CHARS = 120;
24285
24302
  var MEMORY_TITLE_CHARS = 80;
@@ -24632,7 +24649,7 @@ var refReadsOf = /* @__PURE__ */ __name((database, texts2, { excerpt = false } =
24632
24649
  var summaryOf2 = /* @__PURE__ */ __name(({ sender, excerpt, ...summary }, withExcerpt) => withExcerpt ? { ...summary, excerpt } : summary, "summaryOf");
24633
24650
  var refSummariesOf = /* @__PURE__ */ __name((database, texts2, options = {}) => new Map([...refReadsOf(database, texts2, options)].map(([text6, read2]) => [text6, summaryOf2(read2, options.excerpt === true)])), "refSummariesOf");
24634
24651
 
24635
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
24652
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
24636
24653
  var sourceOf3 = /* @__PURE__ */ __name((read2, ref3) => ({
24637
24654
  ref: ref3,
24638
24655
  kind: read2.kind,
@@ -24668,7 +24685,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
24668
24685
  });
24669
24686
  }, "evidenceSourcesOf");
24670
24687
 
24671
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/attachments/limits.js
24688
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/attachments/limits.js
24672
24689
  var MAX_FILE_BYTES = 50 * 1024 * 1024;
24673
24690
  var MAX_TEXT_CHARS = 2e6;
24674
24691
  var ATTACHMENT_LIMIT_ENV = [
@@ -24694,7 +24711,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
24694
24711
  return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
24695
24712
  }, "pdfPreviewLimits");
24696
24713
 
24697
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/ulid.js
24714
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/ulid.js
24698
24715
  import { randomBytes } from "node:crypto";
24699
24716
  var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
24700
24717
  var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
@@ -24707,7 +24724,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
24707
24724
  return time3 + random;
24708
24725
  }, "ulid");
24709
24726
 
24710
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
24727
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
24711
24728
  var FOLDED_FIELDS = ["title", "site", "language", "author"];
24712
24729
  var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
24713
24730
  if (!meta && !sections?.length)
@@ -24728,7 +24745,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
24728
24745
  return typeof language === "string" && language !== "" ? language : null;
24729
24746
  }, "languageOf");
24730
24747
 
24731
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
24748
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
24732
24749
  var isObject = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
24733
24750
  var objectOf2 = /* @__PURE__ */ __name((value) => {
24734
24751
  if (isObject(value))
@@ -24839,13 +24856,13 @@ var syncFile = /* @__PURE__ */ __name((database, now2, documentId, { seen = true
24839
24856
  if (!existing) {
24840
24857
  const columns = Object.keys(values);
24841
24858
  const row2 = database.prepare(`INSERT INTO files (${columns.join(", ")}, created_at, updated_at) VALUES (${columns.map(() => "?").join(", ")}, ?, ?) RETURNING id`).get(...Object.values(values), Number(doc.created_at), now2);
24842
- const placed = { id: Number(row2?.id), path };
24843
- logFileLink(database, now2, placed.id, null, documentId, method);
24859
+ const placed2 = { id: Number(row2?.id), path };
24860
+ logFileLink(database, now2, placed2.id, null, documentId, method);
24844
24861
  if (remote)
24845
24862
  linkAttached(database, now2, externalId);
24846
24863
  if (remote && kind4 === "folder")
24847
24864
  placeChildren(database, now2, accountId, String(doc.external_id), depth);
24848
- return placed;
24865
+ return placed2;
24849
24866
  }
24850
24867
  const id2 = Number(existing.id);
24851
24868
  if (existing.document_id !== documentId)
@@ -24971,7 +24988,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
24971
24988
  };
24972
24989
  }, "filesStoreOver");
24973
24990
 
24974
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
24991
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
24975
24992
  var IMPORTED_DOCUMENT_QUERY = defineQuery({
24976
24993
  entity: "document",
24977
24994
  backend: "sql",
@@ -25017,7 +25034,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
25017
25034
  return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
25018
25035
  }, "importedDocumentWhere");
25019
25036
 
25020
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
25037
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
25021
25038
  var NOTE_FORMATS = ["obsidian", "markdown"];
25022
25039
  var iso2 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
25023
25040
  var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null : iso2(value), "optionalIso");
@@ -25543,7 +25560,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
25543
25560
  };
25544
25561
  }, "notesStoreOver");
25545
25562
 
25546
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
25563
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
25547
25564
  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";
25548
25565
  var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
25549
25566
  var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
@@ -25765,7 +25782,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
25765
25782
  };
25766
25783
  }, "memoriesStoreOver");
25767
25784
 
25768
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
25785
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
25769
25786
  var DEFAULT_FIRST_PASS_PER_CHAT = 0;
25770
25787
  var KEY = "taskFirstPassPerChat";
25771
25788
  var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
@@ -25785,7 +25802,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
25785
25802
  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);
25786
25803
  }, "saveFirstPassPerChat");
25787
25804
 
25788
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
25805
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
25789
25806
  var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
25790
25807
  var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
25791
25808
  name,
@@ -26006,7 +26023,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
26006
26023
  return root === void 0 ? void 0 : { ...query, root };
26007
26024
  }, "withoutField");
26008
26025
 
26009
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
26026
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
26010
26027
  var authorNamed = /* @__PURE__ */ __name((database, row2) => {
26011
26028
  if (row2.author_type == null)
26012
26029
  return null;
@@ -26034,7 +26051,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
26034
26051
  return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
26035
26052
  }, "addComment");
26036
26053
 
26037
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
26054
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
26038
26055
  var TASK_RELATION_KINDS = [
26039
26056
  "blocked-by",
26040
26057
  "follow-up-of",
@@ -26164,7 +26181,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
26164
26181
  };
26165
26182
  }, "taskRelationsStoreOver");
26166
26183
 
26167
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
26184
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
26168
26185
  var TASK_ROLES = ["assignee", "reviewer", "watcher"];
26169
26186
  var iso4 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
26170
26187
  var recordTaskEvent = /* @__PURE__ */ __name((database, task, actor, kind4, changes, at) => {
@@ -26282,7 +26299,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
26282
26299
  const onBoard = /* @__PURE__ */ __name((task) => Boolean(database.prepare(`SELECT 1 FROM tasks t WHERE t.id = ? AND ${BOARD_SCOPE}`).get(task)), "onBoard");
26283
26300
  const moveToProject = /* @__PURE__ */ __name((task, before2, target, actor, at, detach) => {
26284
26301
  if (target === Number(before2.project_id))
26285
- return;
26302
+ return [];
26286
26303
  if (!onBoard(task))
26287
26304
  throw new CliError("validation_error", "only a project task moves to another project");
26288
26305
  const targetRow = database.prepare("SELECT key FROM projects WHERE id = ?").get(target);
@@ -26292,18 +26309,28 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
26292
26309
  const parent2 = taskIdOf(database, Number(before2.parent_id));
26293
26310
  throw new CliError("validation_error", `${String(before2.key)} is a subtask of ${parent2}; detach it in the same write (parent none) to move it alone`, { reason: "task.is-subtask", parent: parent2 });
26294
26311
  }
26295
- const children = database.prepare("SELECT key FROM tasks WHERE parent_id = ? AND deleted_at IS NULL ORDER BY id").all(task).map((row2) => String(row2.key));
26296
- if (children.length)
26297
- throw new CliError("validation_error", `${String(before2.key)} has subtasks (${children.join(", ")}); move or detach them first`, { reason: "task.has-subtasks", subtasks: children });
26298
- const counted = database.prepare("UPDATE projects SET tasks_count = tasks_count + 1, updated_at = ? WHERE id = ? RETURNING key, tasks_count").get(at, target);
26299
- const number3 = Number(counted.tasks_count);
26300
- const key2 = `${String(counted.key)}-${number3}`;
26301
- database.prepare("UPDATE tasks SET project_id = ?, number = ?, key = ?, parent_id = NULL, updated_at = ? WHERE id = ?").run(target, number3, key2, at, task);
26302
- recordTaskEvent(database, task, actor, "project", {
26303
- project: [`project:${before2.project_id}`, `project:${target}`],
26304
- key: [String(before2.key), key2],
26305
- ...before2.parent_id == null ? {} : { parent: [`task:${taskIdOf(database, Number(before2.parent_id))}`, null] }
26306
- }, at);
26312
+ const renumber = /* @__PURE__ */ __name((row2, parent2) => {
26313
+ const counted = database.prepare("UPDATE projects SET tasks_count = tasks_count + 1, updated_at = ? WHERE id = ? RETURNING key, tasks_count").get(at, target);
26314
+ const number3 = Number(counted.tasks_count);
26315
+ const key2 = `${String(counted.key)}-${number3}`;
26316
+ database.prepare("UPDATE tasks SET project_id = ?, number = ?, key = ?, parent_id = ?, updated_at = ? WHERE id = ?").run(target, number3, key2, parent2, at, Number(row2.id));
26317
+ recordTaskEvent(database, Number(row2.id), actor, "project", {
26318
+ project: [`project:${row2.project_id}`, `project:${target}`],
26319
+ key: [String(row2.key), key2],
26320
+ ...row2.parent_id === parent2 ? {} : { parent: [`task:${taskIdOf(database, Number(row2.parent_id))}`, null] }
26321
+ }, at);
26322
+ return key2;
26323
+ }, "renumber");
26324
+ renumber(before2, null);
26325
+ const moved = [];
26326
+ const childrenOf = database.prepare("SELECT * FROM tasks WHERE parent_id = ? AND deleted_at IS NULL ORDER BY id");
26327
+ for (const queue = [task]; queue.length > 0; ) {
26328
+ for (const child of childrenOf.all(queue.shift())) {
26329
+ moved.push({ from: String(child.key), to: renumber(child, child.parent_id) });
26330
+ queue.push(Number(child.id));
26331
+ }
26332
+ }
26333
+ return moved;
26307
26334
  }, "moveToProject");
26308
26335
  const edit = /* @__PURE__ */ __name((task, fields4, actor, created = false) => {
26309
26336
  const before2 = rowById(task);
@@ -26381,16 +26408,16 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
26381
26408
  change("type", fields4.type, "type");
26382
26409
  bump = true;
26383
26410
  }
26384
- if (fields4.project !== void 0)
26385
- moveToProject(task, before2, projectOf2(fields4.project), actor, at, fields4.parent === null);
26411
+ const moved = fields4.project === void 0 ? [] : moveToProject(task, before2, projectOf2(fields4.project), actor, at, fields4.parent === null);
26386
26412
  if (set.length === 0) {
26387
26413
  if (bump)
26388
26414
  database.prepare("UPDATE tasks SET revision = revision + 1 WHERE id = ?").run(task);
26389
- return;
26415
+ return moved;
26390
26416
  }
26391
26417
  if (bump)
26392
26418
  set.push("revision = revision + 1");
26393
26419
  database.prepare(`UPDATE tasks SET ${set.join(", ")}, updated_at = ? WHERE id = ?`).run(...values, at, task);
26420
+ return moved;
26394
26421
  }, "edit");
26395
26422
  const columnOf = /* @__PURE__ */ __name((task, status) => database.prepare(`SELECT t.id, t.key, coalesce(t.priority_score, 0) AS score FROM tasks t WHERE ${BOARD_SCOPE} AND t.status = ? AND t.id <> ? ORDER BY ${boardOrder("priority", false)}`).all(status, task).map((row2) => ({ id: Number(row2.id), key: String(row2.key), score: Number(row2.score) })), "columnOf");
26396
26423
  const moveTask = /* @__PURE__ */ __name((task, row2, move2, actor) => {
@@ -26473,11 +26500,11 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
26473
26500
  }, "create"),
26474
26501
  edit: /* @__PURE__ */ __name(async (id2, fields4, by, check3 = {}) => {
26475
26502
  const task = required3(id2);
26476
- write(database, () => {
26503
+ const moved = write(database, () => {
26477
26504
  checkRevision(rowById(task), check3.revision);
26478
- edit(task, fields4, authorActor(context, by).actor);
26505
+ return edit(task, fields4, authorActor(context, by).actor);
26479
26506
  });
26480
- return details2(task);
26507
+ return moved.length > 0 ? { ...details2(task), movedSubtasks: moved } : details2(task);
26481
26508
  }, "edit"),
26482
26509
  /** `edit` inside the caller's write, so a decision that edits a task rolls back with it. */
26483
26510
  editNow: /* @__PURE__ */ __name((id2, fields4, by) => {
@@ -26674,7 +26701,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
26674
26701
  };
26675
26702
  }, "workTasksOver");
26676
26703
 
26677
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
26704
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
26678
26705
  var taskCloseOver = /* @__PURE__ */ __name((context) => {
26679
26706
  const { database, now: now2 } = context;
26680
26707
  const liveRow = /* @__PURE__ */ __name((id2) => {
@@ -26723,7 +26750,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
26723
26750
  };
26724
26751
  }, "taskCloseOver");
26725
26752
 
26726
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
26753
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
26727
26754
  var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
26728
26755
  const { database, now: now2 } = context;
26729
26756
  const required3 = /* @__PURE__ */ __name((id2) => {
@@ -26941,7 +26968,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
26941
26968
  };
26942
26969
  }, "taskPairsOver");
26943
26970
 
26944
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
26971
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
26945
26972
  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";
26946
26973
  var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
26947
26974
  const key2 = inboxKey(account);
@@ -27147,7 +27174,7 @@ var oneOf3 = /* @__PURE__ */ __name((values, value, column2) => {
27147
27174
  throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
27148
27175
  }, "oneOf");
27149
27176
 
27150
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/accounts.js
27177
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/accounts.js
27151
27178
  var accountAccountsOver = /* @__PURE__ */ __name((context) => {
27152
27179
  const { database } = context;
27153
27180
  const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
@@ -27192,7 +27219,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
27192
27219
  };
27193
27220
  }, "accountsStoreOver");
27194
27221
 
27195
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
27222
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
27196
27223
  var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
27197
27224
  var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
27198
27225
  const message2 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
@@ -27216,7 +27243,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
27216
27243
  })), "keepDownloads");
27217
27244
  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");
27218
27245
 
27219
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/attachments.js
27246
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/attachments.js
27220
27247
  var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
27221
27248
  const { database } = context;
27222
27249
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -27273,7 +27300,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
27273
27300
  }, "keepAttachmentText")
27274
27301
  }), "attachmentsStoreOver");
27275
27302
 
27276
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
27303
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
27277
27304
  var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
27278
27305
  var pointerMover = /* @__PURE__ */ __name((context, type) => {
27279
27306
  const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
@@ -27453,7 +27480,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
27453
27480
  return done;
27454
27481
  }, "rekeyChats");
27455
27482
 
27456
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
27483
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
27457
27484
  var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
27458
27485
  var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
27459
27486
  var CHAT_LIST_KEY = "chat_list_complete";
@@ -27485,7 +27512,7 @@ var chatCompleteness = /* @__PURE__ */ __name(({ database }, accountKey, chatIds
27485
27512
  });
27486
27513
  }, "chatCompleteness");
27487
27514
 
27488
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/chats.js
27515
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/chats.js
27489
27516
  var chatsStoreOver = /* @__PURE__ */ __name((context) => {
27490
27517
  const { database } = context;
27491
27518
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
@@ -27616,7 +27643,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
27616
27643
  };
27617
27644
  }, "chatsStoreOver");
27618
27645
 
27619
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
27646
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
27620
27647
  import { createHash as createHash7 } from "node:crypto";
27621
27648
  var BATCH_CONTEXT = 50;
27622
27649
  var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
@@ -27754,7 +27781,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
27754
27781
  var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
27755
27782
  ${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
27756
27783
 
27757
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
27784
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
27758
27785
  import { setTimeout } from "node:timers/promises";
27759
27786
  var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
27760
27787
  var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
@@ -28066,7 +28093,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
28066
28093
  AND NOT EXISTS (SELECT 1 FROM messages d
28067
28094
  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");
28068
28095
 
28069
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/conversations.js
28096
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/conversations.js
28070
28097
  var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
28071
28098
  const { database } = context;
28072
28099
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -28173,7 +28200,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
28173
28200
  };
28174
28201
  }, "conversationsStoreOver");
28175
28202
 
28176
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/counters.js
28203
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/counters.js
28177
28204
  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";
28178
28205
  var accountCountersOver = /* @__PURE__ */ __name((context) => {
28179
28206
  const { database } = context;
@@ -28198,7 +28225,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
28198
28225
  counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
28199
28226
  }), "countersStoreOver");
28200
28227
 
28201
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
28228
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
28202
28229
  var MENTION_STATUSES = ["found", "linked", "dismissed"];
28203
28230
  var MENTION_QUERY = defineQuery({
28204
28231
  entity: "mention",
@@ -28414,7 +28441,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
28414
28441
  return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
28415
28442
  }, "listPlaces");
28416
28443
 
28417
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/mentions.js
28444
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/mentions.js
28418
28445
  var accountMentionsOver = /* @__PURE__ */ __name((context) => {
28419
28446
  const { database } = context;
28420
28447
  const { findAccountPk: findAccountPk2 } = keysOver(context);
@@ -28449,7 +28476,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
28449
28476
  places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
28450
28477
  }), "mentionsStoreOver");
28451
28478
 
28452
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
28479
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
28453
28480
  var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
28454
28481
  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");
28455
28482
  const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
@@ -28464,7 +28491,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
28464
28491
  }));
28465
28492
  }, "documentLinkMessages");
28466
28493
 
28467
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
28494
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
28468
28495
  var stemmerFor = stemmerCache();
28469
28496
  var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
28470
28497
  if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
@@ -28508,7 +28535,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
28508
28535
  });
28509
28536
  }, "laterSharingRare");
28510
28537
 
28511
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/messages.js
28538
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/messages.js
28512
28539
  var accountMessagesOver = /* @__PURE__ */ __name((context) => {
28513
28540
  const { database } = context;
28514
28541
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
@@ -28643,7 +28670,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
28643
28670
  laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
28644
28671
  }), "messagesStoreOver");
28645
28672
 
28646
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
28673
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
28647
28674
  var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
28648
28675
  var iso5 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
28649
28676
  var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: accounts2, limit }) => {
@@ -28700,7 +28727,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
28700
28727
  });
28701
28728
  }, "personPreparation");
28702
28729
 
28703
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
28730
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
28704
28731
  var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
28705
28732
  const id2 = Number(uid);
28706
28733
  if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
@@ -28708,7 +28735,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
28708
28735
  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(id2, JSON.stringify(accountIds)));
28709
28736
  }, "personSeenInAccounts");
28710
28737
 
28711
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
28738
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
28712
28739
  var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
28713
28740
  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);
28714
28741
  if (!row2)
@@ -28774,7 +28801,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
28774
28801
  return { id: id2, personId, removed: true };
28775
28802
  }, "removeNote");
28776
28803
 
28777
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/people.js
28804
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/people.js
28778
28805
  var accountPeopleOver = /* @__PURE__ */ __name((context) => {
28779
28806
  const { database } = context;
28780
28807
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
@@ -28859,13 +28886,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
28859
28886
  };
28860
28887
  }, "peopleStoreOver");
28861
28888
 
28862
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
28889
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
28863
28890
  import { createHash as createHash9 } from "node:crypto";
28864
28891
 
28865
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
28892
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
28866
28893
  import { createHash as createHash8 } from "node:crypto";
28867
28894
 
28868
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
28895
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
28869
28896
  var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
28870
28897
  var AUTHOR_MEASURES = [
28871
28898
  "messages",
@@ -29005,7 +29032,7 @@ var withoutUrls = /* @__PURE__ */ __name((text6) => text6.replace(/\S+/gu, (toke
29005
29032
  var rankingWords = /* @__PURE__ */ __name((text6) => withoutUrls(text6).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
29006
29033
  var rankingQuestion = /* @__PURE__ */ __name((text6) => withoutUrls(text6).includes("?"), "rankingQuestion");
29007
29034
 
29008
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
29035
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
29009
29036
  var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
29010
29037
  var exhausted2 = /* @__PURE__ */ __name((budget) => {
29011
29038
  throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
@@ -29227,18 +29254,18 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
29227
29254
  };
29228
29255
  }, "rankReplyGraph");
29229
29256
 
29230
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
29257
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
29231
29258
  var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
29232
29259
  var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
29233
29260
  var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
29234
- var stats = /* @__PURE__ */ __name((delays) => {
29261
+ var delayStats = /* @__PURE__ */ __name((delays) => {
29235
29262
  const sorted2 = delays.toSorted((a, b) => a - b);
29236
29263
  const middle = Math.floor(sorted2.length / 2);
29237
29264
  return {
29238
29265
  medianMilliseconds: sorted2.length ? sorted2.length % 2 ? sorted2[middle] : (sorted2[middle - 1] + sorted2[middle]) / 2 : null,
29239
29266
  p90Milliseconds: sorted2.length ? sorted2[Math.ceil(sorted2.length * 0.9) - 1] : null
29240
29267
  };
29241
- }, "stats");
29268
+ }, "delayStats");
29242
29269
  var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, inspect) => {
29243
29270
  let work = 0;
29244
29271
  const check3 = /* @__PURE__ */ __name(() => {
@@ -29316,7 +29343,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
29316
29343
  account: { provider: person2.provider, account: person2.account },
29317
29344
  questions: eligible.filter((node) => node.account.provider === person2.provider && node.account.account === person2.account).length,
29318
29345
  answered: rows.length,
29319
- ...stats(rows.map((row2) => row2.contribution)),
29346
+ ...delayStats(rows.map((row2) => row2.contribution)),
29320
29347
  status: "observed"
29321
29348
  }, rows);
29322
29349
  }
@@ -29361,7 +29388,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
29361
29388
  pending: end > options.cutoff,
29362
29389
  questions: held.length,
29363
29390
  answered: delays.length,
29364
- ...stats(delays),
29391
+ ...delayStats(delays),
29365
29392
  status: "partial"
29366
29393
  }, contributions);
29367
29394
  }
@@ -29401,7 +29428,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
29401
29428
  return { items, evidence, summary, graph: graph.quality };
29402
29429
  }, "calculateAdminStatistics");
29403
29430
 
29404
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
29431
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
29405
29432
  var rankingContextRange = /* @__PURE__ */ __name((root) => {
29406
29433
  const dates = [];
29407
29434
  const visit = /* @__PURE__ */ __name((node, required3) => {
@@ -29423,7 +29450,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
29423
29450
  return dates[0].node.resolution.date;
29424
29451
  }, "rankingContextRange");
29425
29452
 
29426
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
29453
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
29427
29454
  var reactionCounts = /* @__PURE__ */ __name((stored3) => {
29428
29455
  let counts;
29429
29456
  try {
@@ -29718,7 +29745,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
29718
29745
  });
29719
29746
  }, "rankQuery");
29720
29747
 
29721
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
29748
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
29722
29749
  function fail4(message2, reason = "query.too-large") {
29723
29750
  throw new CliError("validation_error", message2, { reason, complete: false });
29724
29751
  }
@@ -29895,7 +29922,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
29895
29922
  return result;
29896
29923
  }), "adminStatisticsQuery");
29897
29924
 
29898
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
29925
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
29899
29926
  var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
29900
29927
  if (!execution.accounts.length)
29901
29928
  return { conversations: [], chats: [] };
@@ -29913,7 +29940,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
29913
29940
  return { conversations: conversations2, chats: chats2 };
29914
29941
  }, "conversationEligibility");
29915
29942
 
29916
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
29943
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
29917
29944
  import { createHash as createHash10 } from "node:crypto";
29918
29945
  var EVIDENCE_BYTES = 64 * 1024;
29919
29946
  var FINGERPRINT_BYTES = 8 * 1024 * 1024;
@@ -30063,7 +30090,101 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
30063
30090
  return result;
30064
30091
  }, "rankingEvidence");
30065
30092
 
30066
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/queries.js
30093
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
30094
+ var FAR = Number.MAX_SAFE_INTEGER;
30095
+ var chatsIn = /* @__PURE__ */ __name((scope3, kinds2) => {
30096
+ const params = [...scope3.accounts.flatMap(({ provider, account }) => [provider, account]), ...kinds2];
30097
+ const parts2 = [
30098
+ `(${scope3.accounts.map(() => "(ac.provider=? AND ac.external_id=?)").join(" OR ") || "0"})`,
30099
+ `${PEER_KIND} IN (${kinds2.map(() => "?").join(",")})`
30100
+ ];
30101
+ for (const { account, chatId } of scope3.chats) {
30102
+ parts2.push("ac.provider=? AND ac.external_id=? AND c.external_id=?");
30103
+ params.push(account.provider, account.account, chatId);
30104
+ }
30105
+ for (const kind4 of scope3.kinds) {
30106
+ parts2.push(`${PEER_KIND}=?`);
30107
+ params.push(kind4);
30108
+ }
30109
+ if (scope3.chats.length === 0)
30110
+ parts2.push("c.searchable=1");
30111
+ return { sql: parts2.join(" AND "), params };
30112
+ }, "chatsIn");
30113
+ var replyDelaysQuery = /* @__PURE__ */ __name((scope3, who) => {
30114
+ const since = scope3.since ?? -FAR;
30115
+ const until = scope3.until ?? FAR;
30116
+ const chats2 = chatsIn(scope3, ["private"]);
30117
+ return {
30118
+ sql: `WITH scoped AS MATERIALIZED (
30119
+ SELECT c.id AS chat_id, coalesce((
30120
+ SELECT p.sent_at FROM messages p WHERE p.chat_id=c.id AND p.sent_at<? AND p.deleted_at IS NULL
30121
+ AND coalesce(p.outgoing,0)<>(SELECT coalesce(l.outgoing,0) FROM messages l
30122
+ WHERE l.chat_id=c.id AND l.sent_at<? AND l.deleted_at IS NULL ORDER BY l.sent_at DESC LIMIT 1)
30123
+ ORDER BY p.sent_at DESC LIMIT 1), ?) AS since
30124
+ FROM chats c JOIN accounts ac ON ac.id=c.account_id WHERE ${chats2.sql}
30125
+ ), sides AS (
30126
+ SELECT m.chat_id, m.id, m.sent_at, coalesce(m.outgoing,0) AS mine,
30127
+ lag(coalesce(m.outgoing,0)) OVER (PARTITION BY m.chat_id ORDER BY m.sent_at, m.id) AS before
30128
+ FROM scoped s JOIN messages m ON m.chat_id=s.chat_id AND m.sent_at>=s.since AND m.sent_at<=?
30129
+ WHERE m.deleted_at IS NULL
30130
+ ), runs AS (
30131
+ SELECT sent_at, mine, lag(sent_at) OVER (PARTITION BY chat_id ORDER BY sent_at, id) AS asked_at
30132
+ FROM sides WHERE before IS NULL OR before<>mine
30133
+ )
30134
+ SELECT sent_at AS replied_at, sent_at-asked_at AS delay_ms FROM runs
30135
+ WHERE asked_at IS NOT NULL AND mine=? AND sent_at>=? AND sent_at<=?`,
30136
+ params: [since, since, -FAR, ...chats2.params, until, who === "me" ? 1 : 0, since, until]
30137
+ };
30138
+ }, "replyDelaysQuery");
30139
+ var replyDelays = /* @__PURE__ */ __name((context, scope3, who) => {
30140
+ const { sql: sql2, params } = replyDelaysQuery(scope3, who);
30141
+ return read(context.database, () => context.database.prepare(sql2).all(...params).map((row2) => ({ repliedAt: Number(row2.replied_at), delayMs: Number(row2.delay_ms) })));
30142
+ }, "replyDelays");
30143
+ var newestMessagesQuery = /* @__PURE__ */ __name((scope3, now2) => {
30144
+ const chats2 = chatsIn(scope3, ["private", "group"]);
30145
+ return {
30146
+ sql: `SELECT c.id AS chat_id, ${PEER_KIND} AS kind, m.sent_at, coalesce(m.outgoing,0) AS mine, m.text,
30147
+ (EXISTS (SELECT 1 FROM json_each(CASE WHEN json_valid(m.mentions) THEN m.mentions ELSE '[]' END) WHERE value=ac.external_id)
30148
+ OR coalesce(json_extract(CASE WHEN json_valid(m.reply_to) THEN m.reply_to ELSE '{}' END,'$.outgoing'),0)=1
30149
+ OR EXISTS (SELECT 1 FROM messages q WHERE q.chat_id=c.id AND q.external_id=m.reply_to_external_id AND q.outgoing=1)
30150
+ ) AS addressed,
30151
+ (SELECT i.username FROM identities i WHERE i.provider=ac.provider AND i.external_id=ac.external_id) AS owner_username,
30152
+ ((coalesce(c.muted,0)=1 AND (c.muted_until IS NULL OR c.muted_until>?)) OR coalesce(c.archived,0)=1)
30153
+ AND coalesce(c.marked_unread,0)=0 AS quiet
30154
+ FROM chats c JOIN accounts ac ON ac.id=c.account_id
30155
+ JOIN messages m ON m.id=(SELECT n.id FROM messages n WHERE n.chat_id=c.id AND n.deleted_at IS NULL ORDER BY n.sent_at DESC LIMIT 1)
30156
+ WHERE ${chats2.sql} AND m.sent_at>=? AND m.sent_at<=?`,
30157
+ params: [now2, ...chats2.params, scope3.since ?? -FAR, scope3.until ?? FAR]
30158
+ };
30159
+ }, "newestMessagesQuery");
30160
+ var TAIL_SQL = "SELECT sent_at, coalesce(outgoing,0) AS mine FROM messages WHERE chat_id=? AND deleted_at IS NULL ORDER BY sent_at DESC LIMIT ?";
30161
+ var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
30162
+ const { sql: sql2, params } = newestMessagesQuery(scope3, context.now());
30163
+ const { database } = context;
30164
+ return read(database, () => {
30165
+ const tail = database.prepare(TAIL_SQL);
30166
+ return database.prepare(sql2).all(...params).map((row2) => ({
30167
+ chatId: Number(row2.chat_id),
30168
+ kind: String(row2.kind),
30169
+ sentAt: Number(row2.sent_at),
30170
+ mine: Number(row2.mine) === 1,
30171
+ text: String(row2.text),
30172
+ addressed: Number(row2.addressed) === 1,
30173
+ ownerUsername: row2.owner_username === null ? null : String(row2.owner_username),
30174
+ quiet: Number(row2.quiet) === 1
30175
+ })).filter(waits).map(({ chatId, kind: kind4 }) => {
30176
+ const unanswered = [];
30177
+ for (const row2 of tail.all(chatId, cap)) {
30178
+ if (Number(row2.mine) === 1)
30179
+ break;
30180
+ unanswered.push(Number(row2.sent_at));
30181
+ }
30182
+ return { kind: kind4, unanswered };
30183
+ });
30184
+ });
30185
+ }, "waitingChats");
30186
+
30187
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/queries.js
30067
30188
  var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
30068
30189
  const mailIndexed = /* @__PURE__ */ __name((execution) => {
30069
30190
  if (execution.corpus === "mail")
@@ -30078,11 +30199,13 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
30078
30199
  conversationEligibility: /* @__PURE__ */ __name(async (execution) => conversationEligibility(context, execution), "conversationEligibility"),
30079
30200
  rankQuery: /* @__PURE__ */ __name(async (execution, request) => rankQuery(context, execution, request), "rankQuery"),
30080
30201
  rankingEvidence: /* @__PURE__ */ __name(async (execution, request) => rankingEvidence(context, execution, request), "rankingEvidence"),
30081
- adminStatisticsQuery: /* @__PURE__ */ __name(async (execution, request) => adminStatisticsQuery(context, execution, request), "adminStatisticsQuery")
30202
+ adminStatisticsQuery: /* @__PURE__ */ __name(async (execution, request) => adminStatisticsQuery(context, execution, request), "adminStatisticsQuery"),
30203
+ replyDelays: /* @__PURE__ */ __name(async (scope3, who) => replyDelays(context, scope3, who), "replyDelays"),
30204
+ waitingChats: /* @__PURE__ */ __name(async (scope3, waits, cap) => waitingChats(context, scope3, waits, cap), "waitingChats")
30082
30205
  };
30083
30206
  }, "queriesStoreOver");
30084
30207
 
30085
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
30208
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
30086
30209
  var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
30087
30210
  const { database, now: now2 } = context;
30088
30211
  const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
@@ -30121,10 +30244,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
30121
30244
  }));
30122
30245
  }, "chatEventsOf");
30123
30246
 
30124
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
30247
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
30125
30248
  import { createHash as createHash11 } from "node:crypto";
30126
30249
 
30127
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/calendar.js
30250
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/calendar.js
30128
30251
  var calendarKey = /* @__PURE__ */ __name((zone, by) => {
30129
30252
  const format = new Intl.DateTimeFormat("en-CA", {
30130
30253
  timeZone: zone,
@@ -30139,7 +30262,7 @@ var calendarKey = /* @__PURE__ */ __name((zone, by) => {
30139
30262
  };
30140
30263
  }, "calendarKey");
30141
30264
 
30142
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/retention.js
30265
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/retention.js
30143
30266
  var RETENTION_TOLERANCE = 864e5;
30144
30267
  var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
30145
30268
  const { since, until, cutoff, checkpoints, within, limit, by } = options;
@@ -30193,7 +30316,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
30193
30316
  return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
30194
30317
  }, "retentionCohorts");
30195
30318
 
30196
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
30319
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
30197
30320
  var iso6 = /* @__PURE__ */ __name((at) => new Date(at).toISOString(), "iso");
30198
30321
  var week = /* @__PURE__ */ __name((day) => {
30199
30322
  const date3 = /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
@@ -30329,7 +30452,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
30329
30452
  };
30330
30453
  }, "retentionQuery");
30331
30454
 
30332
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
30455
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
30333
30456
  var iso7 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
30334
30457
  var marksOf = /* @__PURE__ */ __name(({ isBot, flagged, deleted, hasPhoto }) => ({
30335
30458
  ...isBot === void 0 ? {} : { bot: isBot },
@@ -30460,7 +30583,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
30460
30583
  lastCount: memberCountsOf(context, pk).at(-1) ?? null
30461
30584
  })), "trackedChats");
30462
30585
 
30463
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/roster.js
30586
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/roster.js
30464
30587
  var rosterStoreOver = /* @__PURE__ */ __name((context) => {
30465
30588
  const { database } = context;
30466
30589
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
@@ -30516,7 +30639,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
30516
30639
  };
30517
30640
  }, "rosterStoreOver");
30518
30641
 
30519
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
30642
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
30520
30643
  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");
30521
30644
  var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
30522
30645
  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 ?`);
@@ -30540,7 +30663,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
30540
30663
  }
30541
30664
  }, "backfillNormalized");
30542
30665
 
30543
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
30666
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
30544
30667
  var INDEX2 = "message_words";
30545
30668
  var searchIndexState2 = /* @__PURE__ */ __name((database) => {
30546
30669
  const row2 = indexRow(database, INDEX2);
@@ -30667,7 +30790,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
30667
30790
  });
30668
30791
  }, "resetSearchIndex");
30669
30792
 
30670
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
30793
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
30671
30794
  var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
30672
30795
  const filled2 = { stemmed: 0, drained: 0 };
30673
30796
  const before2 = stemsState(database);
@@ -30762,7 +30885,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
30762
30885
  return resetStems(database, { now: now2 });
30763
30886
  }, "followDefaultStemmers");
30764
30887
 
30765
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
30888
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
30766
30889
  var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
30767
30890
  var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
30768
30891
  const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
@@ -30784,7 +30907,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
30784
30907
  });
30785
30908
  }, "termCandidates");
30786
30909
 
30787
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/search-index.js
30910
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/search-index.js
30788
30911
  var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
30789
30912
  const { database } = context;
30790
30913
  const stemmerFor2 = stemmerCache();
@@ -30806,7 +30929,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
30806
30929
  };
30807
30930
  }, "searchIndexStoreOver");
30808
30931
 
30809
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
30932
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
30810
30933
  var HISTORY_KEPT = 1e3;
30811
30934
  var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
30812
30935
  var COLUMNS5 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
@@ -30875,7 +30998,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
30875
30998
  return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
30876
30999
  }, "clearHistory");
30877
31000
 
30878
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/searches.js
31001
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/searches.js
30879
31002
  var searchesStoreOver = /* @__PURE__ */ __name((context) => {
30880
31003
  const { database } = context;
30881
31004
  return {
@@ -30899,7 +31022,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
30899
31022
  };
30900
31023
  }, "searchesStoreOver");
30901
31024
 
30902
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
31025
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
30903
31026
  var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
30904
31027
  var ACTION_OUTCOMES = ["ok", "refused", "failed"];
30905
31028
  var CODE = /^[a-z][a-z0-9_]{0,63}$/;
@@ -30942,7 +31065,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
30942
31065
  };
30943
31066
  }, "agentActionsStoreOver");
30944
31067
 
30945
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
31068
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
30946
31069
  var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
30947
31070
  }) => {
30948
31071
  const { database, now: now2 } = context;
@@ -31001,7 +31124,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
31001
31124
  };
31002
31125
  }, "botUpdateStoreOver");
31003
31126
 
31004
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
31127
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
31005
31128
  var DAY4 = 864e5;
31006
31129
  var accountsOf = /* @__PURE__ */ __name((filter) => {
31007
31130
  if (filter.accountIds !== void 0 && filter.accountId !== void 0)
@@ -31110,7 +31233,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
31110
31233
  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);
31111
31234
  }, "listEvents");
31112
31235
 
31113
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
31236
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
31114
31237
  var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
31115
31238
  var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey: cursorKey2, now: now2 }, refresh) => {
31116
31239
  const unseenBefore = unreferenced(database, "identities");
@@ -31165,7 +31288,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
31165
31288
  return { entries: entryIds.length, events: goneEvents.length };
31166
31289
  }, "forgetCalendarRows");
31167
31290
 
31168
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
31291
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
31169
31292
  var calendarOf = /* @__PURE__ */ __name((row2) => ({
31170
31293
  id: Number(row2.id),
31171
31294
  accountId: Number(row2.account_id),
@@ -31752,7 +31875,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
31752
31875
  };
31753
31876
  }, "eventStoreOver");
31754
31877
 
31755
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
31878
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
31756
31879
  var CATALOG_QUERY = defineQuery({
31757
31880
  entity: "document",
31758
31881
  backend: "sql",
@@ -31994,7 +32117,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
31994
32117
  };
31995
32118
  }, "catalogStoreOver");
31996
32119
 
31997
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
32120
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
31998
32121
  var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
31999
32122
  var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
32000
32123
  CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
@@ -32007,7 +32130,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
32007
32130
  THEN 'source-modified' ELSE 'stored-update' END`;
32008
32131
  var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`;
32009
32132
 
32010
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
32133
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
32011
32134
  var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
32012
32135
  const { source: source2, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
32013
32136
  signal?.throwIfAborted();
@@ -32106,7 +32229,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
32106
32229
  });
32107
32230
  }, "readMeetingContextEvidence");
32108
32231
 
32109
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
32232
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
32110
32233
  var corpora = {
32111
32234
  message: {
32112
32235
  table: "messages",
@@ -32345,7 +32468,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
32345
32468
  }
32346
32469
  }), "contextRecordsOver");
32347
32470
 
32348
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
32471
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
32349
32472
  var NOTE_FIELDS = [
32350
32473
  "text",
32351
32474
  "exact",
@@ -32775,7 +32898,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
32775
32898
  };
32776
32899
  }, "noteSearchOver");
32777
32900
 
32778
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
32901
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
32779
32902
  var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
32780
32903
  var inEventAccounts = /* @__PURE__ */ __name((event) => searchableCopy(event, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
32781
32904
  var EVENT_CORPUS = {
@@ -32907,7 +33030,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
32907
33030
  };
32908
33031
  }, "eventSearchOver");
32909
33032
 
32910
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
33033
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
32911
33034
  var refuse2 = /* @__PURE__ */ __name((message2, reason, code = "validation_error") => {
32912
33035
  throw new CliError(code, message2, { reason });
32913
33036
  }, "refuse");
@@ -33342,7 +33465,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
33342
33465
  };
33343
33466
  }, "financeStoreOver");
33344
33467
 
33345
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
33468
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
33346
33469
  var refuse3 = /* @__PURE__ */ __name((message2, reason) => {
33347
33470
  throw new CliError("validation_error", message2, { reason });
33348
33471
  }, "refuse");
@@ -33420,7 +33543,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
33420
33543
  };
33421
33544
  }, "paymentEntriesOver");
33422
33545
 
33423
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
33546
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
33424
33547
  var EVIDENCE_FINDINGS_KIND = "evidence_findings";
33425
33548
  var reference = /* @__PURE__ */ __name((raw) => {
33426
33549
  if (/^(document|note):[1-9]\d*$/.test(raw))
@@ -33446,7 +33569,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
33446
33569
  return valid;
33447
33570
  }, "validateEvidenceFindings");
33448
33571
 
33449
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/moment.js
33572
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/moment.js
33450
33573
  var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
33451
33574
  try {
33452
33575
  return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
@@ -33458,7 +33581,7 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
33458
33581
  }
33459
33582
  }, "calendarMoment");
33460
33583
 
33461
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
33584
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
33462
33585
  var NAMED3 = "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";
33463
33586
  var iso9 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
33464
33587
  var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
@@ -33640,7 +33763,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
33640
33763
  };
33641
33764
  }, "factsStoreOver");
33642
33765
 
33643
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
33766
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
33644
33767
  var invalid4 = /* @__PURE__ */ __name((message2) => {
33645
33768
  throw new CliError("validation_error", message2);
33646
33769
  }, "invalid");
@@ -33742,10 +33865,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind4) => {
33742
33865
  return { snapshot: snapshot2, snapshotParts, previous, outcomes, create };
33743
33866
  }, "findingsCoreOver");
33744
33867
 
33745
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
33746
- var MAIL_FINDINGS_KIND = "mail_findings";
33747
-
33748
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
33868
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
33749
33869
  var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
33750
33870
  var PROPOSAL_VERDICTS = ["useful", "not_useful"];
33751
33871
  var iso10 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
@@ -33859,38 +33979,43 @@ var proposalOperationsOver = /* @__PURE__ */ __name((context) => {
33859
33979
  }, "judge")
33860
33980
  };
33861
33981
  }, "proposalOperationsOver");
33982
+ var DEDICATED_REVIEW = {
33983
+ [MEETING_FINDINGS_KIND]: { what: "meeting findings", reason: "meeting-findings.dedicated-review" },
33984
+ [EVIDENCE_FINDINGS_KIND]: { what: "evidence findings", reason: "evidence-findings.dedicated-review" },
33985
+ [MAIL_FINDINGS_KIND]: { what: "mail findings", reason: "mail-findings.dedicated-review" }
33986
+ };
33987
+ var assertGenericAction = /* @__PURE__ */ __name((kind4) => {
33988
+ const dedicated = DEDICATED_REVIEW[kind4];
33989
+ if (dedicated)
33990
+ throw new CliError("validation_error", `review ${dedicated.what} through the dedicated findings command`, {
33991
+ reason: dedicated.reason
33992
+ });
33993
+ }, "assertGenericAction");
33862
33994
  var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
33863
33995
  const operations = proposalOperationsOver(context);
33864
33996
  const generic = /* @__PURE__ */ __name((id2) => {
33865
- const kind4 = operations.get(id2).kind;
33866
- if (kind4 === MEETING_FINDINGS_KIND)
33867
- throw new CliError("validation_error", "review meeting findings through the dedicated findings command", {
33868
- reason: "meeting-findings.dedicated-review"
33869
- });
33870
- if (kind4 === EVIDENCE_FINDINGS_KIND)
33871
- throw new CliError("validation_error", "review evidence findings through the dedicated findings command", {
33872
- reason: "evidence-findings.dedicated-review"
33873
- });
33997
+ const { kind: kind4 } = operations.get(id2);
33998
+ assertGenericAction(kind4);
33999
+ return kind4;
33874
34000
  }, "generic");
33875
34001
  return {
33876
34002
  propose: /* @__PURE__ */ __name(async (input) => {
33877
- if (input.kind === MEETING_FINDINGS_KIND)
33878
- throw new CliError("validation_error", "stage meeting findings through the dedicated findings command");
33879
- if (input.kind === EVIDENCE_FINDINGS_KIND)
33880
- throw new CliError("validation_error", "stage evidence findings through the dedicated findings command");
34003
+ const dedicated = DEDICATED_REVIEW[input.kind];
34004
+ if (dedicated)
34005
+ throw new CliError("validation_error", `stage ${dedicated.what} through the dedicated findings command`);
33881
34006
  return operations.propose(input);
33882
34007
  }, "propose"),
33883
34008
  get: /* @__PURE__ */ __name(async (id2) => operations.get(id2), "get"),
33884
34009
  pending: /* @__PURE__ */ __name(async (options) => operations.pending(options), "pending"),
33885
34010
  list: /* @__PURE__ */ __name(async (options) => operations.list(options), "list"),
33886
34011
  approve: /* @__PURE__ */ __name(async (id2, by, result) => {
33887
- generic(id2);
33888
- assertMayDecide({ id: id2, proposedBy: operations.proposer(id2) }, by, context.decisions);
34012
+ const kind4 = generic(id2);
34013
+ assertMayDecide({ id: id2, kind: kind4, proposedBy: operations.proposer(id2) }, by, context.decisions);
33889
34014
  return operations.approve(id2, result, deciderAuthor(by));
33890
34015
  }, "approve"),
33891
34016
  reject: /* @__PURE__ */ __name(async (id2, by, reason) => {
33892
- generic(id2);
33893
- assertMayDecide({ id: id2, proposedBy: operations.proposer(id2) }, by, context.decisions);
34017
+ const kind4 = generic(id2);
34018
+ assertMayDecide({ id: id2, kind: kind4, proposedBy: operations.proposer(id2) }, by, context.decisions);
33894
34019
  return operations.reject(id2, deciderAuthor(by), reason?.trim() ? { reason: reason.trim() } : void 0);
33895
34020
  }, "reject"),
33896
34021
  executed: /* @__PURE__ */ __name(async (id2, result) => {
@@ -33905,7 +34030,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
33905
34030
  };
33906
34031
  }, "proposedActionsStoreOver");
33907
34032
 
33908
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
34033
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
33909
34034
  var stale = /* @__PURE__ */ __name(() => {
33910
34035
  throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
33911
34036
  reason: "evidence-findings.stale"
@@ -34086,7 +34211,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
34086
34211
  };
34087
34212
  }, "evidenceFindingsStoreOver");
34088
34213
 
34089
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
34214
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
34090
34215
  var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
34091
34216
  var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
34092
34217
  rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
@@ -34139,7 +34264,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
34139
34264
  }, "forPerson")
34140
34265
  }), "involvementStoreOver");
34141
34266
 
34142
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
34267
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
34143
34268
  import { createHash as createHash12 } from "node:crypto";
34144
34269
  var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
34145
34270
  var id = /* @__PURE__ */ __name((value) => {
@@ -34225,7 +34350,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
34225
34350
  };
34226
34351
  }, "meetingProjectsStoreOver");
34227
34352
 
34228
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
34353
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
34229
34354
  var relationOf = /* @__PURE__ */ __name((link3) => ({
34230
34355
  id: link3.id,
34231
34356
  from: link3.from,
@@ -34451,16 +34576,16 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
34451
34576
  provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
34452
34577
  }, "decidedOrigin");
34453
34578
 
34454
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
34579
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
34455
34580
  import { createHash as createHash15 } from "node:crypto";
34456
34581
 
34457
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
34582
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
34458
34583
  import { createHash as createHash14 } from "node:crypto";
34459
34584
 
34460
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
34585
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
34461
34586
  import { createHash as createHash13 } from "node:crypto";
34462
34587
 
34463
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
34588
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
34464
34589
  var consolidationId = /* @__PURE__ */ __name((value, field4) => {
34465
34590
  if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
34466
34591
  throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
@@ -34511,7 +34636,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
34511
34636
  return input;
34512
34637
  }, "consolidationApplyInput");
34513
34638
 
34514
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
34639
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
34515
34640
  var receiptOf = /* @__PURE__ */ __name((row2) => ({
34516
34641
  id: String(row2.id),
34517
34642
  sourceId: String(row2.source_id),
@@ -34586,7 +34711,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
34586
34711
  }, { beforeCommit: check3 });
34587
34712
  }, "applyTagConsolidation");
34588
34713
 
34589
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
34714
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
34590
34715
  var selections = [
34591
34716
  ["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
34592
34717
  ["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
@@ -34730,7 +34855,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
34730
34855
  };
34731
34856
  }, "previewRows");
34732
34857
 
34733
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
34858
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
34734
34859
  var kinds = ["project", "tag", "topic"];
34735
34860
  var cancelled2 = /* @__PURE__ */ __name((signal) => {
34736
34861
  if (signal?.aborted)
@@ -34994,7 +35119,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
34994
35119
  };
34995
35120
  }, "vocabularyStoreOver");
34996
35121
 
34997
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
35122
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
34998
35123
  var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
34999
35124
  var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
35000
35125
  var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
@@ -35551,7 +35676,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
35551
35676
  return key2.padEnd(3, "X");
35552
35677
  }, "projectKey");
35553
35678
 
35554
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
35679
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
35555
35680
  var DAY5 = 864e5;
35556
35681
  var SETTING4 = "logs_pruned_at";
35557
35682
  var LOG_RETENTION = { agentActionsMs: 90 * DAY5, botUpdatePayloadsMs: 30 * DAY5 };
@@ -35578,7 +35703,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
35578
35703
  };
35579
35704
  }, "logPruner");
35580
35705
 
35581
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/mail/findings.js
35706
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/mail/findings.js
35582
35707
  var MAIL_FINDINGS_PER_RUN = 30;
35583
35708
  var MAIL_FINDINGS_PER_SENDER = 5;
35584
35709
  var invalid6 = /* @__PURE__ */ __name((message2) => {
@@ -35704,7 +35829,7 @@ var validateMailFindings = /* @__PURE__ */ __name((input) => {
35704
35829
  }, "validateMailFindings");
35705
35830
  var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
35706
35831
 
35707
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
35832
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
35708
35833
  var stale2 = /* @__PURE__ */ __name(() => {
35709
35834
  throw new CliError("validation_error", "mail findings cite mail that changed since it was read; stage a new batch", {
35710
35835
  reason: "mail-findings.stale"
@@ -35954,7 +36079,7 @@ ${evidence.join("\n")}`, agent);
35954
36079
  return invalid7("accept only unique IDs shown in this batch");
35955
36080
  if (decision.by === void 0)
35956
36081
  return invalid7("a findings review names who decides: the owner");
35957
- assertMayDecide({ id: id2, proposedBy: proposals.proposer(id2), ownerOnly: true }, decision.by, context.decisions);
36082
+ assertMayDecide({ id: id2, kind: MAIL_FINDINGS_KIND, proposedBy: proposals.proposer(id2) }, decision.by, context.decisions);
35958
36083
  const accepted = [...decision.accept].sort();
35959
36084
  if (batch.receipt) {
35960
36085
  if (JSON.stringify(batch.receipt.accepted) !== JSON.stringify(accepted))
@@ -35994,7 +36119,7 @@ ${evidence.join("\n")}`, agent);
35994
36119
  };
35995
36120
  }, "mailFindingsStoreOver");
35996
36121
 
35997
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
36122
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
35998
36123
  var stale3 = /* @__PURE__ */ __name(() => {
35999
36124
  throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
36000
36125
  reason: "meeting-findings.stale"
@@ -36141,7 +36266,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
36141
36266
  const accepted = [...decision.accept].sort();
36142
36267
  if (decision.by === void 0)
36143
36268
  return invalid8("a findings review names who decides: the owner or an agent");
36144
- assertMayDecide({ id: id2, proposedBy: proposals.proposer(id2) }, decision.by, context.decisions);
36269
+ assertMayDecide({ id: id2, kind: MEETING_FINDINGS_KIND, proposedBy: proposals.proposer(id2) }, decision.by, context.decisions);
36145
36270
  if (batch.receipt) {
36146
36271
  if (JSON.stringify(batch.receipt.accepted) !== JSON.stringify(accepted))
36147
36272
  return invalid8("this findings batch was already reviewed with a different decision");
@@ -36162,7 +36287,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
36162
36287
  };
36163
36288
  }, "meetingFindingsStoreOver");
36164
36289
 
36165
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
36290
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
36166
36291
  var RANK_BATCH = 512;
36167
36292
  var LIVE3 = "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";
36168
36293
  var limitOf = /* @__PURE__ */ __name((value, name, max = 1e3) => {
@@ -36433,7 +36558,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
36433
36558
  }
36434
36559
  }), "meetingVectorsOver");
36435
36560
 
36436
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
36561
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
36437
36562
  var OTHER_SOURCES = ["document", "note", "email"];
36438
36563
  var TEXTS = {
36439
36564
  document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
@@ -36534,11 +36659,11 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
36534
36659
  };
36535
36660
  }, "sourceMentionStoreOver");
36536
36661
 
36537
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
36662
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
36538
36663
  import { mkdirSync, statSync, writeFileSync } from "node:fs";
36539
36664
  import { dirname } from "node:path";
36540
36665
 
36541
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
36666
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
36542
36667
  import { readFileSync as readFileSync3 } from "node:fs";
36543
36668
  var CLIENTS_SETTING = "clients";
36544
36669
  var coreVersion = (() => {
@@ -36596,7 +36721,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
36596
36721
  return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
36597
36722
  }, "refusalAdvice");
36598
36723
 
36599
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
36724
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
36600
36725
  var GENERATED = [
36601
36726
  {
36602
36727
  "name": "20261010184427_initial",
@@ -37563,7 +37688,7 @@ WHERE json_type(params, '$.selection') = 'object';`
37563
37688
  }
37564
37689
  ];
37565
37690
 
37566
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
37691
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
37567
37692
  var MANIFEST = [
37568
37693
  { name: "20261010184427_initial", version: 1, minCompatible: 1 },
37569
37694
  { name: "20261011035353_version-2-facts", version: 2, minCompatible: 1 },
@@ -37651,7 +37776,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
37651
37776
  return migrations;
37652
37777
  }, "generatedMigrations");
37653
37778
 
37654
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/migrations.js
37779
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/migrations.js
37655
37780
  var MIGRATIONS = generatedMigrations();
37656
37781
  var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
37657
37782
  version INTEGER PRIMARY KEY,
@@ -37704,7 +37829,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
37704
37829
  }
37705
37830
  }, "migrate");
37706
37831
 
37707
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
37832
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
37708
37833
  var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
37709
37834
  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 ?");
37710
37835
  if (pending.get(0, 1) === void 0)
@@ -37726,7 +37851,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
37726
37851
  }
37727
37852
  }, "fillJoinKeys");
37728
37853
 
37729
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
37854
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
37730
37855
  var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
37731
37856
  refuseOwnerStoreInTests(path);
37732
37857
  const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
@@ -37740,8 +37865,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
37740
37865
  }, "openSqlite");
37741
37866
  var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
37742
37867
  quietSqliteWarning();
37743
- const { drizzle } = await import("./node-QQXKQWNC.js");
37744
- const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-GJI2GMLW.js");
37868
+ const { drizzle } = await import("./node-TL2PBNKO.js");
37869
+ const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-64QIEQ37.js");
37745
37870
  const client = await nodeClient(path, { readOnly });
37746
37871
  try {
37747
37872
  return { database: cacheOverNodeSqlite(client), orm: drizzle({ client }) };
@@ -37751,8 +37876,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
37751
37876
  }
37752
37877
  }, "openUnderNode");
37753
37878
  var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
37754
- const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-S6KUSMTC.js");
37755
- const { drizzle } = await import("./bun-CKGKUKW5.js");
37879
+ const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-XUCC2PWC.js");
37880
+ const { drizzle } = await import("./bun-KF5QK2YN.js");
37756
37881
  const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
37757
37882
  try {
37758
37883
  return { database: cacheOverBunSqlite(client), orm: drizzle({ client }) };
@@ -37762,7 +37887,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
37762
37887
  }
37763
37888
  }, "openUnderBun");
37764
37889
 
37765
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
37890
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
37766
37891
  var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
37767
37892
  var paymentOf = /* @__PURE__ */ __name((metadata3) => {
37768
37893
  try {
@@ -37830,7 +37955,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
37830
37955
  });
37831
37956
  }, "movePaymentFacts");
37832
37957
 
37833
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
37958
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
37834
37959
  var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
37835
37960
  const ours = MIGRATIONS.at(-1)?.version ?? 0;
37836
37961
  if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
@@ -37845,7 +37970,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
37845
37970
  throw new CliError("configuration_error", `The store requires schema ${minCompatible}, but this tool supports ${ours}; ${refusalAdvice(storeClients(database), command, version)}`);
37846
37971
  }, "assertReadCompatible");
37847
37972
 
37848
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
37973
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
37849
37974
  var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
37850
37975
  var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
37851
37976
  if (provenance2?.startsWith("rule:"))
@@ -37891,7 +38016,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
37891
38016
  });
37892
38017
  }, "moveSuggestedLinks");
37893
38018
 
37894
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
38019
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
37895
38020
  var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
37896
38021
  var TEST_PROVIDER = "chat";
37897
38022
  var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
@@ -37912,7 +38037,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
37912
38037
  }
37913
38038
  }, "purgeTestAccounts");
37914
38039
 
37915
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
38040
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
37916
38041
  var BACKFILL_ON_OPEN = 5e3;
37917
38042
  var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
37918
38043
  var createWritable = /* @__PURE__ */ __name((file) => {
@@ -37977,10 +38102,10 @@ var openStoreContext = /* @__PURE__ */ __name(async ({ path, env, now: now2 = Da
37977
38102
  }
37978
38103
  }, "openStoreContext");
37979
38104
 
37980
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
38105
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
37981
38106
  import { createHash as createHash16 } from "node:crypto";
37982
38107
 
37983
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
38108
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
37984
38109
  var text4 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
37985
38110
  var ref = text4(2048);
37986
38111
  var timestamp2 = pipe(number(), safeInteger(), minValue(0));
@@ -38046,7 +38171,7 @@ var projectAnnotationsSchema = strictObject({
38046
38171
  }))
38047
38172
  });
38048
38173
 
38049
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
38174
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
38050
38175
  var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
38051
38176
  var invalid9 = /* @__PURE__ */ __name((field4) => {
38052
38177
  throw new CliError("validation_error", `invalid project annotations.${field4}`);
@@ -38150,7 +38275,7 @@ var validateProjectAnnotationsGraph = /* @__PURE__ */ __name((manifest, addition
38150
38275
  invalid9("external.unused");
38151
38276
  }, "validateProjectAnnotationsGraph");
38152
38277
 
38153
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
38278
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
38154
38279
  var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
38155
38280
  var ref2 = pipe(string(), minLength(1), maxLength(2048));
38156
38281
  var targetSchema = strictObject({
@@ -38256,7 +38381,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
38256
38381
  };
38257
38382
  }, "planBoundProjectAnnotations");
38258
38383
 
38259
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
38384
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
38260
38385
  import { createHash as createHash17 } from "node:crypto";
38261
38386
  var text5 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
38262
38387
  var timestamp3 = pipe(number(), safeInteger(), minValue(0));
@@ -38350,7 +38475,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
38350
38475
  })).digest("hex");
38351
38476
  }, "projectAnnotationSnapshotFingerprint");
38352
38477
 
38353
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
38478
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
38354
38479
  var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
38355
38480
  if (!request || typeof request !== "object" || Array.isArray(request))
38356
38481
  throw new CliError("validation_error", "project annotation request is required");
@@ -38367,7 +38492,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
38367
38492
  return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
38368
38493
  }, "projectAnnotationRequest");
38369
38494
 
38370
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
38495
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
38371
38496
  var SnapshotBudget = class {
38372
38497
  static {
38373
38498
  __name(this, "SnapshotBudget");
@@ -38393,13 +38518,13 @@ var SnapshotBudget = class {
38393
38518
  }
38394
38519
  };
38395
38520
 
38396
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
38521
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
38397
38522
  import { createHash as createHash19 } from "node:crypto";
38398
38523
 
38399
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
38524
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
38400
38525
  var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
38401
38526
 
38402
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
38527
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
38403
38528
  import { createHash as createHash18 } from "node:crypto";
38404
38529
  var invalid11 = /* @__PURE__ */ __name(() => {
38405
38530
  throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
@@ -38542,7 +38667,7 @@ var ProjectSnapshotSources = class {
38542
38667
  }
38543
38668
  };
38544
38669
 
38545
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
38670
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
38546
38671
  var unsupported = /* @__PURE__ */ __name(() => {
38547
38672
  throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
38548
38673
  }, "unsupported");
@@ -38713,7 +38838,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
38713
38838
  return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
38714
38839
  }), "projectAnnotationSnapshot");
38715
38840
 
38716
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
38841
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
38717
38842
  var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
38718
38843
  const current = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
38719
38844
  const sources = new ProjectSnapshotSources(database, budget);
@@ -38775,7 +38900,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
38775
38900
  };
38776
38901
  }), "previewAnnotationSnapshot");
38777
38902
 
38778
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
38903
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
38779
38904
  var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, snapshot2, bindings) => {
38780
38905
  const mappings = { ...bindings };
38781
38906
  const resolve = /* @__PURE__ */ __name((ref3) => {
@@ -38817,7 +38942,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
38817
38942
  return mappings;
38818
38943
  }, "restoreAnnotationRecords");
38819
38944
 
38820
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
38945
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
38821
38946
  var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
38822
38947
  async preview(request) {
38823
38948
  const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
@@ -38847,7 +38972,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
38847
38972
  }
38848
38973
  }), "projectAnnotationStoreOver");
38849
38974
 
38850
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/domain/records.js
38975
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/domain/records.js
38851
38976
  import { createHash as createHash20 } from "node:crypto";
38852
38977
  var RECORDS_SCHEMA_VERSION = 1;
38853
38978
  var RECORD_OPERATIONS = ["upsert", "delete"];
@@ -39063,7 +39188,7 @@ var envelopeOfJsonl = /* @__PURE__ */ __name((text6) => {
39063
39188
  return isObject2(header) ? { ...header, records: records2 } : header;
39064
39189
  }, "envelopeOfJsonl");
39065
39190
 
39066
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
39191
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
39067
39192
  var PROJECTED = {
39068
39193
  invoice: { roles: ["issuer", "counterparty", "project"], many: [] },
39069
39194
  payment: { roles: ["payer", "payee", "project", "settles"], many: ["settles"] }
@@ -39403,7 +39528,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
39403
39528
  };
39404
39529
  }, "recordStoreOver");
39405
39530
 
39406
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
39531
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
39407
39532
  var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
39408
39533
  const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
39409
39534
  let merged = { from: from2, to };
@@ -39416,7 +39541,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
39416
39541
  }, "markRange");
39417
39542
  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");
39418
39543
 
39419
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
39544
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
39420
39545
  var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
39421
39546
  var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
39422
39547
  chatId: String(row2.key).slice(prefix.length),
@@ -39437,7 +39562,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
39437
39562
  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);
39438
39563
  }, "setTaskAnalysisMark");
39439
39564
 
39440
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
39565
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
39441
39566
  var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
39442
39567
  var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
39443
39568
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf4(account));
@@ -39447,7 +39572,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
39447
39572
  database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(keyOf4(account), JSON.stringify(until), now2);
39448
39573
  }, "setTaskRulesStop");
39449
39574
 
39450
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sync.js
39575
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sync.js
39451
39576
  var syncStoreOver = /* @__PURE__ */ __name((context) => {
39452
39577
  const { database } = context;
39453
39578
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
@@ -39506,7 +39631,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
39506
39631
  };
39507
39632
  }, "syncStoreOver");
39508
39633
 
39509
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/tags.js
39634
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/tags.js
39510
39635
  var tagsStoreOver = /* @__PURE__ */ __name((context) => {
39511
39636
  const { database } = context;
39512
39637
  return {
@@ -39528,7 +39653,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
39528
39653
  };
39529
39654
  }, "tagsStoreOver");
39530
39655
 
39531
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
39656
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
39532
39657
  var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
39533
39658
  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
39534
39659
  WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
@@ -39655,7 +39780,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
39655
39780
  dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
39656
39781
  }, "savePictureChunks");
39657
39782
 
39658
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
39783
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
39659
39784
  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,
39660
39785
  EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
39661
39786
  FROM messages m
@@ -39744,7 +39869,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
39744
39869
  return plain2(best(found2));
39745
39870
  }, "nearestMessages");
39746
39871
 
39747
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/vectors.js
39872
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/vectors.js
39748
39873
  var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
39749
39874
  const { database } = context;
39750
39875
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -40002,7 +40127,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
40002
40127
  embeddedHashes: /* @__PURE__ */ __name(async (model, hashes) => embeddedHashes(context, model, hashes), "embeddedHashes")
40003
40128
  }), "vectorsStoreOver");
40004
40129
 
40005
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
40130
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
40006
40131
  import { existsSync, readFileSync as readFileSync4 } from "node:fs";
40007
40132
  import { dirname as dirname2, join as join2 } from "node:path";
40008
40133
  var BOOKKEEPING = ["schema_migrations", "store_settings"];
@@ -40090,10 +40215,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
40090
40215
  }
40091
40216
  }, "lastBackup");
40092
40217
 
40093
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/providers.js
40218
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/providers.js
40094
40219
  var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
40095
40220
 
40096
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
40221
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
40097
40222
  var COUNTED_TABLES = [
40098
40223
  "accounts",
40099
40224
  "chats",
@@ -40178,7 +40303,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
40178
40303
  };
40179
40304
  }, "storeContents");
40180
40305
 
40181
- // node_modules/.pnpm/@wirecat+cli-core@0.560.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5702f943a9224d209a94753f662cf36c/node_modules/@wirecat/cli-core/dist/store/store.js
40306
+ // node_modules/.pnpm/@wirecat+cli-core@0.563.0_@wirecat+cli-base@0.75.0_commander@15.0.0_esbuild@0.28.2_type_5d65fbd76a6eee16c9e760ce5c7a276b/node_modules/@wirecat/cli-core/dist/store/store.js
40182
40307
  var openStore = /* @__PURE__ */ __name(async (options = {}) => {
40183
40308
  const context = await openStoreContext(options);
40184
40309
  try {
@@ -40470,7 +40595,9 @@ export {
40470
40595
  DEFAULT_AGENT_CLOSE,
40471
40596
  certaintyOf,
40472
40597
  savedAgentClose,
40598
+ MAIL_FINDINGS_KIND,
40473
40599
  DEFAULT_DECISION_POLICY,
40600
+ isOwnerOnlyKind,
40474
40601
  mayDecide,
40475
40602
  assertMayDecide,
40476
40603
  minorUnits,
@@ -40503,6 +40630,8 @@ export {
40503
40630
  AUTHOR_MEASURES,
40504
40631
  rankingOptions,
40505
40632
  RANKING_TOKENIZER_VERSION,
40633
+ rankingQuestion,
40634
+ delayStats,
40506
40635
  rankingContextRange,
40507
40636
  calendarKey,
40508
40637
  pendingNormalization,
@@ -40514,9 +40643,9 @@ export {
40514
40643
  EVIDENCE_FINDINGS_KIND,
40515
40644
  validateEvidenceFindings,
40516
40645
  calendarMoment,
40517
- MAIL_FINDINGS_KIND,
40518
40646
  PROPOSAL_STATUSES,
40519
40647
  proposerOfAction,
40648
+ assertGenericAction,
40520
40649
  involvementStoreOver,
40521
40650
  ORGANIZATION_KINDS,
40522
40651
  PROJECT_TYPES,