@wirecat/drive-cli 0.59.0 → 0.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/dist/bin/drive.js +2 -2
  2. package/dist/bin/drive.js.map +1 -1
  3. package/dist/bundle/{all-profiles-CVISDGMF.js → all-profiles-537I27Z4.js} +11 -11
  4. package/dist/bundle/{anthropic-WLNQC23G.js → anthropic-X4NWVHDF.js} +7 -7
  5. package/dist/bundle/{app-server-P2VOONXF.js → app-server-KSHJKKS7.js} +47 -47
  6. package/dist/bundle/{bun-CDFBNTKV.js → bun-WTBGGCUC.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-MNZICITP.js → bun-sqlite-T7Y3JFFD.js} +6 -6
  8. package/dist/bundle/{chunk-YV4ABH6J.js → chunk-22ATLSNK.js} +3 -3
  9. package/dist/bundle/{chunk-CBM2XAEZ.js → chunk-246P2DCT.js} +3 -3
  10. package/dist/bundle/{chunk-H2BKXPBL.js → chunk-3TQHIHZI.js} +2 -2
  11. package/dist/bundle/{chunk-IGF6EXBR.js → chunk-4CBZEAQ7.js} +32 -32
  12. package/dist/bundle/{chunk-L5SE2XZP.js → chunk-4VHBDVY2.js} +1 -1
  13. package/dist/bundle/{chunk-IIP43FQJ.js → chunk-4XZXH2NM.js} +1 -1
  14. package/dist/bundle/{chunk-UWVNRPT7.js → chunk-57QVQGBE.js} +21 -21
  15. package/dist/bundle/{chunk-A6SLYOP2.js → chunk-5AMRCBMP.js} +67 -34
  16. package/dist/bundle/{chunk-ZSMCJKGP.js → chunk-5XHLQZAG.js} +27 -26
  17. package/dist/bundle/{chunk-YADXWQHV.js → chunk-67QXMO2G.js} +25 -25
  18. package/dist/bundle/{chunk-36B7AIGP.js → chunk-6HTKB4WC.js} +1 -1
  19. package/dist/bundle/{chunk-5C7K6XIT.js → chunk-73MNUSP3.js} +1 -1
  20. package/dist/bundle/{chunk-3KNZADHJ.js → chunk-73TTP6ET.js} +431 -187
  21. package/dist/bundle/{chunk-IBZ3IBO4.js → chunk-77C5XRH3.js} +5 -5
  22. package/dist/bundle/{chunk-PGKIOSN3.js → chunk-77YTRBL6.js} +10 -10
  23. package/dist/bundle/{chunk-TI55J3BA.js → chunk-ALWTUDZF.js} +3 -3
  24. package/dist/bundle/{chunk-HWLLVLAB.js → chunk-AXWXQNTC.js} +13 -10
  25. package/dist/bundle/{chunk-P7WPYKSB.js → chunk-CKGHRWVR.js} +2 -2
  26. package/dist/bundle/{chunk-JW2CVCUH.js → chunk-D6WIWOQC.js} +3 -3
  27. package/dist/bundle/{chunk-A6EG7ZDS.js → chunk-DMHGWL5D.js} +12 -12
  28. package/dist/bundle/{chunk-FICVPYE4.js → chunk-DQDKLZAK.js} +47 -47
  29. package/dist/bundle/{chunk-JSDVK3JA.js → chunk-EHAI773E.js} +1 -1
  30. package/dist/bundle/{chunk-UQPKAY6I.js → chunk-FO4TCH6P.js} +1 -1
  31. package/dist/bundle/{chunk-GJ4ZCIOP.js → chunk-FTZNUZO7.js} +3 -3
  32. package/dist/bundle/{chunk-6C6255U6.js → chunk-FZOCQQ66.js} +11 -11
  33. package/dist/bundle/{chunk-EHEZSV6I.js → chunk-GD6TQ6U4.js} +8 -8
  34. package/dist/bundle/{chunk-XCOCPXCM.js → chunk-GVRS5AIH.js} +2 -2
  35. package/dist/bundle/{chunk-DI5Z4SH5.js → chunk-HCJG7ENG.js} +2 -2
  36. package/dist/bundle/{chunk-AD62XJKO.js → chunk-HFGR33KD.js} +24 -24
  37. package/dist/bundle/{chunk-K4LXGZTE.js → chunk-HQVIK6PM.js} +36 -18
  38. package/dist/bundle/{chunk-YU3PTU3D.js → chunk-IRZ7OF3F.js} +1 -1
  39. package/dist/bundle/{chunk-LJ7E4HLQ.js → chunk-IXN7Y6JA.js} +1 -1
  40. package/dist/bundle/{chunk-7QTVIZII.js → chunk-JGUJJNGZ.js} +790 -325
  41. package/dist/bundle/{chunk-FVQCM7IQ.js → chunk-JQLIM6BH.js} +4 -4
  42. package/dist/bundle/{chunk-BSGOM3BD.js → chunk-K6XVRA6U.js} +1 -1
  43. package/dist/bundle/{chunk-3VSUT6BD.js → chunk-KEXTTZJM.js} +2 -2
  44. package/dist/bundle/{chunk-V36RIXFA.js → chunk-LJ77Y3TK.js} +1 -1
  45. package/dist/bundle/{chunk-II7LST64.js → chunk-LQSRVQ3V.js} +3 -2
  46. package/dist/bundle/{chunk-OKXSTWKW.js → chunk-MVNPE5FZ.js} +7 -7
  47. package/dist/bundle/{chunk-M6I2SQN7.js → chunk-MXP35VPO.js} +2 -2
  48. package/dist/bundle/{chunk-TJXPJ3A5.js → chunk-N7S2UPF3.js} +135 -60
  49. package/dist/bundle/{chunk-3KJTJDDT.js → chunk-O37ESNAP.js} +17 -17
  50. package/dist/bundle/{chunk-EVETU3TF.js → chunk-OMKUBCNN.js} +7 -7
  51. package/dist/bundle/{chunk-MUUHUHWC.js → chunk-OYNUBWD2.js} +1 -22
  52. package/dist/bundle/{chunk-PAEVBAM3.js → chunk-PDYHEWKG.js} +4 -4
  53. package/dist/bundle/{chunk-EORMZCVF.js → chunk-PETFPXLU.js} +2 -2
  54. package/dist/bundle/{chunk-GI5JBGXH.js → chunk-PPL5ASW2.js} +613 -372
  55. package/dist/bundle/{chunk-B5GBJ35N.js → chunk-QIJWSKZL.js} +2 -2
  56. package/dist/bundle/{chunk-OZH4ALTI.js → chunk-S36HRPNS.js} +1 -1
  57. package/dist/bundle/{chunk-KFZUODXB.js → chunk-SBHSNOU4.js} +34 -18
  58. package/dist/bundle/{chunk-F3FOL42A.js → chunk-SZXI4OXX.js} +1 -1
  59. package/dist/bundle/{chunk-3U22QTU6.js → chunk-TKW4QWCY.js} +12 -0
  60. package/dist/bundle/{chunk-6CQO2FIN.js → chunk-TVQDMP2F.js} +391 -282
  61. package/dist/bundle/{chunk-GT5KTGCN.js → chunk-TXMTMEHW.js} +4 -4
  62. package/dist/bundle/{chunk-IADOBOKB.js → chunk-UNJE63JK.js} +1 -1
  63. package/dist/bundle/{chunk-HIOJRPCT.js → chunk-UTFATA4K.js} +1 -1
  64. package/dist/bundle/{chunk-LPHMAQJQ.js → chunk-UVLSWLPZ.js} +15 -15
  65. package/dist/bundle/{chunk-KPRGTTJH.js → chunk-UVYVIHEA.js} +1 -1
  66. package/dist/bundle/{chunk-MKCNUI72.js → chunk-V2VMBM7O.js} +1 -1
  67. package/dist/bundle/{chunk-QTM7USFA.js → chunk-V7QMHMR3.js} +5 -5
  68. package/dist/bundle/{chunk-TFH5X46A.js → chunk-VRW6ZDTH.js} +18 -18
  69. package/dist/bundle/{chunk-OMMEQJOB.js → chunk-XDIEQ2CE.js} +2 -2
  70. package/dist/bundle/{chunk-MEAPA4EZ.js → chunk-XFXRGQXJ.js} +2 -2
  71. package/dist/bundle/{chunk-HMZAMHKN.js → chunk-YDN2RH5S.js} +1 -1
  72. package/dist/bundle/{chunk-P3ZTW2ZM.js → chunk-YGG7UA3C.js} +4 -4
  73. package/dist/bundle/{chunk-VT6GZAF4.js → chunk-YYHKVOVK.js} +4 -4
  74. package/dist/bundle/{chunk-V42KAPU3.js → chunk-ZPQS7XJA.js} +3 -3
  75. package/dist/bundle/command-contract-NUIWUVYB.js +39 -0
  76. package/dist/bundle/{decode-XTOMXMGN.js → decode-35N57AFW.js} +6 -6
  77. package/dist/bundle/{dispatch-T6TW2JJB.js → dispatch-CWXZW3PL.js} +1 -1
  78. package/dist/bundle/drive.js +10 -10
  79. package/dist/bundle/{echarts-RKKIOYVV.js → echarts-3P3QZWMU.js} +2 -2
  80. package/dist/bundle/{embed-STHKKA6G.js → embed-Q6Q5IOJQ.js} +7 -7
  81. package/dist/bundle/{embedder-3XZEWHRO.js → embedder-D44JDTAA.js} +10 -10
  82. package/dist/bundle/{entry-CNOYSSSD.js → entry-ZHCNI7XO.js} +9 -9
  83. package/dist/bundle/{failure-DNQYXP2T.js → failure-GRMMSDCZ.js} +2 -2
  84. package/dist/bundle/{first-run-F2SI24PK.js → first-run-3DC2SDWM.js} +10 -10
  85. package/dist/bundle/first-screen-YJF4YODC.js +37 -0
  86. package/dist/bundle/{google-BYNSAIQI.js → google-6ZZDKFBN.js} +10 -10
  87. package/dist/bundle/{google-api-4VTZH7OP.js → google-api-E6MOJ4ZD.js} +52 -52
  88. package/dist/bundle/grants-GWXDH5GM.js +105 -0
  89. package/dist/bundle/{identity-ARDPFYV5.js → identity-TID7S5NE.js} +4 -4
  90. package/dist/bundle/{instructions-N3OH5X2Y.js → instructions-ANJN4HV3.js} +1 -1
  91. package/dist/bundle/{login-4VQEC7VI.js → login-BGMK2ABH.js} +59 -61
  92. package/dist/bundle/{node-YU5JBNAA.js → node-VOB45ES2.js} +2 -2
  93. package/dist/bundle/{node-sqlite-3C6PSBIW.js → node-sqlite-TSX6XQY2.js} +7 -7
  94. package/dist/bundle/{oauth-D6NJFPYU.js → oauth-CEOYXW6C.js} +8 -8
  95. package/dist/bundle/{open-M2V2VYXO.js → open-3USWHGNR.js} +6 -6
  96. package/dist/bundle/{openai-ST2IWNUX.js → openai-YZ5VGPIP.js} +14 -14
  97. package/dist/bundle/{process-PYNNBBTV.js → process-44JS2W7L.js} +1 -1
  98. package/dist/bundle/{program-Q4VWV2MR.js → program-TZLAFKJV.js} +99 -82
  99. package/dist/bundle/{prompt-MFIOJMAF.js → prompt-SG7LAOXW.js} +6 -6
  100. package/dist/bundle/{reasons-LOQ5J73F.js → reasons-ZK3U3CIN.js} +3 -3
  101. package/dist/bundle/{recognize-FBLMWXNE.js → recognize-OFW7HWTM.js} +5 -5
  102. package/dist/bundle/{remote-XC3OXE4T.js → remote-YBDRZQZ5.js} +8 -8
  103. package/dist/bundle/{rerank-2XMKKF4S.js → rerank-TQQNS5FJ.js} +8 -8
  104. package/dist/bundle/{serve-Q2BQHNZB.js → serve-OPZXMVLH.js} +10 -10
  105. package/dist/bundle/{server-42HPV3AH.js → server-2D6DDIK5.js} +39 -39
  106. package/dist/bundle/server-R6G2O772.js +70 -0
  107. package/dist/bundle/{services-WU22S2MU.js → services-34WKT3NN.js} +29 -27
  108. package/dist/bundle/{sqlite-runtime-CSO6K6B2.js → sqlite-runtime-WPUMKLUV.js} +7 -7
  109. package/dist/bundle/{start-TZWKM4AH.js → start-ZXUJZ4JV.js} +1 -1
  110. package/dist/bundle/{state-FLUT7U7R.js → state-AV2RB3AQ.js} +7 -7
  111. package/dist/bundle/{store-TG6622NG.js → store-3M7N2Q5T.js} +15 -15
  112. package/dist/bundle/{store-HDWMJ44E.js → store-YKV4GAMS.js} +25 -19
  113. package/dist/bundle/store-maintenance-command-WDXNY4ZF.js +60 -0
  114. package/dist/bundle/tokens-F63RXXEF.js +103 -0
  115. package/dist/commands/config.d.ts.map +1 -1
  116. package/dist/commands/config.js +14 -5
  117. package/dist/commands/config.js.map +1 -1
  118. package/dist/commands/context.d.ts +4 -2
  119. package/dist/commands/context.d.ts.map +1 -1
  120. package/dist/commands/context.js.map +1 -1
  121. package/dist/commands/session.d.ts.map +1 -1
  122. package/dist/commands/session.js +5 -2
  123. package/dist/commands/session.js.map +1 -1
  124. package/dist/config.d.ts +7 -0
  125. package/dist/config.d.ts.map +1 -1
  126. package/dist/config.js +22 -3
  127. package/dist/config.js.map +1 -1
  128. package/dist/errors.js +4 -4
  129. package/dist/errors.js.map +1 -1
  130. package/dist/login.d.ts.map +1 -1
  131. package/dist/login.js +3 -5
  132. package/dist/login.js.map +1 -1
  133. package/dist/program.d.ts.map +1 -1
  134. package/dist/program.js +5 -1
  135. package/dist/program.js.map +1 -1
  136. package/dist/reasons.d.ts +1 -1
  137. package/dist/reasons.d.ts.map +1 -1
  138. package/dist/reasons.js +1 -22
  139. package/dist/reasons.js.map +1 -1
  140. package/dist/registry.d.ts +1 -1
  141. package/dist/registry.d.ts.map +1 -1
  142. package/dist/registry.js +2 -1
  143. package/dist/registry.js.map +1 -1
  144. package/dist/tokens.js +5 -5
  145. package/dist/tokens.js.map +1 -1
  146. package/dist/upload.js +1 -1
  147. package/dist/upload.js.map +1 -1
  148. package/dist/version.d.ts +1 -1
  149. package/dist/version.js +1 -1
  150. package/package.json +2 -2
  151. package/dist/bundle/command-contract-LQDNHZJU.js +0 -39
  152. package/dist/bundle/first-screen-TYYF6VXY.js +0 -37
  153. package/dist/bundle/grants-EUQXSICG.js +0 -105
  154. package/dist/bundle/server-EWZYN323.js +0 -70
  155. package/dist/bundle/store-maintenance-command-RHWRUREJ.js +0 -60
  156. package/dist/bundle/tokens-TXYURU4S.js +0 -103
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  MAX_TEXT_CHARS
5
- } from "./chunk-IADOBOKB.js";
5
+ } from "./chunk-UNJE63JK.js";
6
6
  import {
7
7
  CHAT_MESSAGES_READ,
8
8
  FACT_STATUSES,
@@ -22,6 +22,7 @@ import {
22
22
  TASK_TYPES,
23
23
  TASK_VERDICTS,
24
24
  WORK_TASK_TYPES,
25
+ aggregateMeetingCounts,
25
26
  aggregateMeetingStats,
26
27
  calendarText,
27
28
  canonicalMeetingReference,
@@ -62,7 +63,7 @@ import {
62
63
  validateMeetingRelatedHistory,
63
64
  validateMeetingSeriesHistory,
64
65
  validatePayment
65
- } from "./chunk-TJXPJ3A5.js";
66
+ } from "./chunk-N7S2UPF3.js";
66
67
  import {
67
68
  OPERATORS_BY_TYPE,
68
69
  QUERY_LIMITS,
@@ -75,11 +76,11 @@ import {
75
76
  validateQuery,
76
77
  walkQuery,
77
78
  zonedMoment
78
- } from "./chunk-L5SE2XZP.js";
79
+ } from "./chunk-4VHBDVY2.js";
79
80
  import {
80
81
  holdsCredential,
81
82
  secretNamed
82
- } from "./chunk-HIOJRPCT.js";
83
+ } from "./chunk-UTFATA4K.js";
83
84
  import {
84
85
  DEFAULT_STEMMERS,
85
86
  DEFAULT_STEMMERS_VERSION,
@@ -92,21 +93,21 @@ import {
92
93
  fold,
93
94
  normalize,
94
95
  parseStemmers
95
- } from "./chunk-OKXSTWKW.js";
96
+ } from "./chunk-MVNPE5FZ.js";
96
97
  import {
97
98
  DEFAULT_TASK_CATEGORIES,
98
99
  sharedConfigPath,
99
100
  storedTaskCategories,
100
101
  taskCategoriesReader
101
- } from "./chunk-IBZ3IBO4.js";
102
+ } from "./chunk-77C5XRH3.js";
102
103
  import {
103
104
  refuseOwnerStoreInTests,
104
105
  storePath
105
- } from "./chunk-3VSUT6BD.js";
106
+ } from "./chunk-KEXTTZJM.js";
106
107
  import {
107
108
  quietSqliteWarning,
108
109
  storeCapable
109
- } from "./chunk-QTM7USFA.js";
110
+ } from "./chunk-V7QMHMR3.js";
110
111
  import {
111
112
  SQLiteTable,
112
113
  TableAliasProxyHandler,
@@ -131,12 +132,12 @@ import {
131
132
  sql,
132
133
  sqliteTable,
133
134
  text
134
- } from "./chunk-BSGOM3BD.js";
135
+ } from "./chunk-K6XVRA6U.js";
135
136
  import {
136
137
  PRAGMAS,
137
138
  TIME_LIMIT_FUNCTION,
138
139
  TimeLimitReached
139
- } from "./chunk-KPRGTTJH.js";
140
+ } from "./chunk-UVYVIHEA.js";
140
141
  import {
141
142
  resolveFrom
142
143
  } from "./chunk-Y5E2WNWB.js";
@@ -159,7 +160,7 @@ import {
159
160
  safeParse,
160
161
  strictObject,
161
162
  string
162
- } from "./chunk-3U22QTU6.js";
163
+ } from "./chunk-TKW4QWCY.js";
163
164
  import {
164
165
  CliError,
165
166
  isCliError
@@ -168,7 +169,7 @@ import {
168
169
  __name
169
170
  } from "./chunk-ZVVMGPBJ.js";
170
171
 
171
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/account-store.js
172
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/account-store.js
172
173
  var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
173
174
  const methods = whole;
174
175
  return Object.fromEntries(Object.keys(keyed).map((name) => [
@@ -296,7 +297,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
296
297
  };
297
298
  }, "bindAccount");
298
299
 
299
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/locator.js
300
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/locator.js
300
301
  var SCHEME = "msg:";
301
302
  var formatLocator = /* @__PURE__ */ __name(({ provider, account, chat: chat2, message: message2 }) => SCHEME + [provider, account, chat2, message2].map(encodeURIComponent).join("/"), "formatLocator");
302
303
  var isLocator = /* @__PURE__ */ __name((reference2) => reference2.trim().startsWith(SCHEME), "isLocator");
@@ -310,7 +311,7 @@ var parseLocator = /* @__PURE__ */ __name((reference2) => {
310
311
  return { provider, account, chat: chat2, message: message2 };
311
312
  }, "parseLocator");
312
313
 
313
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/references.js
314
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/references.js
314
315
  var SIMPLE_REFERENCES = [
315
316
  "note",
316
317
  "document",
@@ -457,7 +458,7 @@ var looksLikeReference = /* @__PURE__ */ __name((text6) => {
457
458
  return match !== null && byPrefix.has(match[1]);
458
459
  }, "looksLikeReference");
459
460
 
460
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/providers.js
461
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/providers.js
461
462
  var KINDS = ["messages", "mail", "notes", "documents", "meetings", "events"];
462
463
  var MESSENGER_OPENS = { chat: "messages list", message: "messages show", contact: "contacts show" };
463
464
  var PROVIDERS = [
@@ -573,7 +574,7 @@ var providerNamed = /* @__PURE__ */ __name((word) => {
573
574
  var kindIn = /* @__PURE__ */ __name((provider) => isFolderProvider(provider) ? "notes" : registry.find(({ name }) => name === provider)?.kind, "kindIn");
574
575
  var kindOf = /* @__PURE__ */ __name((provider) => kindIn(provider) ?? "messages", "kindOf");
575
576
 
576
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/search/query.js
577
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/search/query.js
577
578
  var isBotProvider = /* @__PURE__ */ __name((provider) => provider.endsWith("-bot"), "isBotProvider");
578
579
  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");
579
580
  var fail = /* @__PURE__ */ __name((message2) => {
@@ -596,7 +597,7 @@ var sourceOf = /* @__PURE__ */ __name((name, value, providers2) => {
596
597
  return fail(`${name} takes ${[...sources, "messages", "mail"].join(", ")} \u2014 not "${value}"`);
597
598
  }, "sourceOf");
598
599
 
599
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/search/account-list.js
600
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/search/account-list.js
600
601
  var ACCOUNT_GROUPS = "accountGroups";
601
602
  var ACCOUNT_GROUPS_SETTING = "account_groups";
602
603
  var GROUP_NAME = /^[a-z0-9][a-z0-9_-]*$/i;
@@ -783,7 +784,7 @@ var fitting = /* @__PURE__ */ __name((entries, kinds2, what, reasonOf2 = (kind4)
783
784
  return { accounts: [...chosen.values()], skipped };
784
785
  }, "fitting");
785
786
 
786
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
787
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
787
788
  var IndexBuilderOn = class {
788
789
  static {
789
790
  __name(this, "IndexBuilderOn");
@@ -978,7 +979,7 @@ function alias(table, alias2) {
978
979
  }
979
980
  __name(alias, "alias");
980
981
 
981
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
982
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
982
983
  var ENTITY_TABLES = {
983
984
  account: "accounts",
984
985
  attachment: "attachments",
@@ -1020,7 +1021,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
1020
1021
  return { table, pointer, type, count, known: known2 };
1021
1022
  }).filter(({ count }) => count > 0)), "orphanPointers");
1022
1023
 
1023
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
1024
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
1024
1025
  var canonicalTags = sqliteTable("canonical_tags", {
1025
1026
  id: integer("id").primaryKey(),
1026
1027
  name: text("name").notNull().unique(),
@@ -1029,7 +1030,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
1029
1030
  updatedAt: integer("updated_at").notNull()
1030
1031
  });
1031
1032
 
1032
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
1033
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
1033
1034
  var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
1034
1035
  sourceKey: text("source_key").notNull(),
1035
1036
  collection: text("collection").notNull(),
@@ -1039,13 +1040,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
1039
1040
  createdAt: integer("created_at").notNull()
1040
1041
  }, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
1041
1042
 
1042
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
1043
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
1043
1044
  var documentIndexPending = sqliteTable("document_index_pending", {
1044
1045
  id: integer("id").notNull(),
1045
1046
  indexableType: text("indexable_type").notNull()
1046
1047
  }, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
1047
1048
 
1048
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
1049
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
1049
1050
  var tagRedirects = sqliteTable("tag_redirects", {
1050
1051
  sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
1051
1052
  survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
@@ -1071,7 +1072,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
1071
1072
  index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
1072
1073
  ]);
1073
1074
 
1074
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
1075
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
1075
1076
  var accounts = sqliteTable("accounts", {
1076
1077
  id: integer("id").primaryKey(),
1077
1078
  provider: text("provider").notNull(),
@@ -2694,7 +2695,7 @@ var storeSettings = sqliteTable("store_settings", {
2694
2695
  at: integer("at").notNull()
2695
2696
  });
2696
2697
 
2697
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
2698
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
2698
2699
  var ARMS = [
2699
2700
  [
2700
2701
  "message",
@@ -2821,7 +2822,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
2821
2822
  return recomputed;
2822
2823
  }, "drainInvolvementQueue");
2823
2824
 
2824
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/mentions.js
2825
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/mentions.js
2825
2826
  import { domainToUnicode } from "node:url";
2826
2827
 
2827
2828
  // node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
@@ -12843,7 +12844,7 @@ var oa = /* @__PURE__ */ __name((e) => {
12843
12844
  }, "oa");
12844
12845
  var na = { parse: O, get: aa, isValid: oa };
12845
12846
 
12846
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
12847
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
12847
12848
  var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
12848
12849
  var ID = /^[\w-]{10,}$/;
12849
12850
  var trimUrl = /* @__PURE__ */ __name((url) => {
@@ -12884,7 +12885,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text6) => [...text6.matchAll(L
12884
12885
  return { url, documentId: googleDocumentId(url) };
12885
12886
  }), "googleDocumentLinks");
12886
12887
 
12887
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
12888
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
12888
12889
  var PHONE_PLANS = [
12889
12890
  {
12890
12891
  country: "us",
@@ -13264,7 +13265,7 @@ var PHONE_PLANS = [
13264
13265
  }
13265
13266
  ];
13266
13267
 
13267
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/phones.js
13268
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/phones.js
13268
13269
  var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
13269
13270
  var DEFAULT_PHONE_COUNTRIES = ["ru"];
13270
13271
  var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
@@ -13305,7 +13306,7 @@ var nationalPhone = /* @__PURE__ */ __name((digits, countries, { anyType }) => {
13305
13306
  return void 0;
13306
13307
  }, "nationalPhone");
13307
13308
 
13308
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/places.js
13309
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/places.js
13309
13310
  var BEFORE = [
13310
13311
  [/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
13311
13312
  [/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
@@ -13565,7 +13566,7 @@ var findPlaces = /* @__PURE__ */ __name((text6) => {
13565
13566
  return found2.sort((a, b) => a.start - b.start);
13566
13567
  }, "findPlaces");
13567
13568
 
13568
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/mentions.js
13569
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/mentions.js
13569
13570
  var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
13570
13571
  var MENTION_VERSIONS = {
13571
13572
  phone: 1,
@@ -13755,7 +13756,7 @@ var typedPhone = /* @__PURE__ */ __name((typed, { phoneCountries = DEFAULT_PHONE
13755
13756
  };
13756
13757
  }, "typedPhone");
13757
13758
 
13758
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/first-names.js
13759
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/first-names.js
13759
13760
  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";
13760
13761
  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";
13761
13762
  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";
@@ -13763,7 +13764,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
13763
13764
  var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
13764
13765
  var NAME_WORDS = WORDS.split(" ");
13765
13766
 
13766
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/person-names.js
13767
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/person-names.js
13767
13768
  var LATIN_TO_CYRILLIC = {
13768
13769
  shch: "\u0449",
13769
13770
  sch: "\u0449",
@@ -13971,7 +13972,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text6, stem, taken) => {
13971
13972
  return found2;
13972
13973
  }, "findUnknownNames");
13973
13974
 
13974
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/attachments.js
13975
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/attachments.js
13975
13976
  var NOT_FILES = /* @__PURE__ */ new Set([
13976
13977
  "webpage",
13977
13978
  "share",
@@ -14011,7 +14012,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored3, files2) => {
14011
14012
  });
14012
14013
  }, "matchDownloads");
14013
14014
 
14014
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
14015
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
14015
14016
  var QUERY_VERSION = 1;
14016
14017
  var QUERY_LIMITS2 = {
14017
14018
  ...QUERY_LIMITS,
@@ -14047,7 +14048,7 @@ function exhausted(budget) {
14047
14048
  }
14048
14049
  __name(exhausted, "exhausted");
14049
14050
 
14050
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
14051
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
14051
14052
  var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
14052
14053
  var literal2 = /* @__PURE__ */ __name((c) => ({
14053
14054
  kind: "char",
@@ -14447,7 +14448,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
14447
14448
  return out;
14448
14449
  }, "foldRegex");
14449
14450
 
14450
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
14451
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
14451
14452
  var PRESET_VERSION = 1;
14452
14453
  var PRESETS = {
14453
14454
  password: {
@@ -14501,7 +14502,7 @@ var PRESETS = {
14501
14502
  }
14502
14503
  };
14503
14504
 
14504
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
14505
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/search/lucene/registry.js
14505
14506
  var FIELD_VERSION = 2;
14506
14507
  var UNITS = {
14507
14508
  "": 1,
@@ -14691,7 +14692,7 @@ var QUERY_FIELDS = [
14691
14692
  {
14692
14693
  name: "has",
14693
14694
  example: "has:file",
14694
- index: "attachments / messages_fts links",
14695
+ index: "attachments / messages_fts links / message_transcripts",
14695
14696
  aliases: [],
14696
14697
  type: "enum",
14697
14698
  operators: terms,
@@ -14710,7 +14711,8 @@ var QUERY_FIELDS = [
14710
14711
  "sticker",
14711
14712
  "contact",
14712
14713
  "location",
14713
- "poll"
14714
+ "poll",
14715
+ "transcript"
14714
14716
  ]
14715
14717
  },
14716
14718
  {
@@ -15012,12 +15014,12 @@ var QUERY_OPERATORS = [
15012
15014
  { name: "boost / minimum / intervals", example: "invoice^2", semantics: "query.unsupported-operator" }
15013
15015
  ];
15014
15016
 
15015
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
15017
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
15016
15018
  var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
15017
15019
  var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
15018
15020
  var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
15019
15021
 
15020
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
15022
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
15021
15023
  var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
15022
15024
  var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
15023
15025
  var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
@@ -15041,7 +15043,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
15041
15043
  };
15042
15044
  }, "linkMatch");
15043
15045
 
15044
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
15046
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
15045
15047
  var SETTING = "phoneCountries";
15046
15048
  var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
15047
15049
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
@@ -15072,7 +15074,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
15072
15074
  return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
15073
15075
  }, "valueMatch");
15074
15076
 
15075
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
15077
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
15076
15078
  var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
15077
15079
  if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
15078
15080
  throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
@@ -15100,7 +15102,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
15100
15102
  return 2 * intersection2 / (aa2.size + bb.size);
15101
15103
  }, "vocabularySimilarity");
15102
15104
 
15103
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
15105
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
15104
15106
  import { createHash } from "node:crypto";
15105
15107
  var folded2 = /* @__PURE__ */ __name((name) => {
15106
15108
  try {
@@ -15166,7 +15168,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind4, by, options
15166
15168
  });
15167
15169
  }, "guardTagCreation");
15168
15170
 
15169
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
15171
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
15170
15172
  var invalid2 = /* @__PURE__ */ __name((message2) => {
15171
15173
  throw new CliError("validation_error", message2);
15172
15174
  }, "invalid");
@@ -15243,7 +15245,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
15243
15245
  };
15244
15246
  }, "createTagRedirectIndex");
15245
15247
 
15246
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
15248
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
15247
15249
  var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
15248
15250
  const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
15249
15251
  if (!row2)
@@ -15271,7 +15273,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
15271
15273
  return snapshot2;
15272
15274
  }, "tagRedirectSnapshot");
15273
15275
 
15274
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
15276
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
15275
15277
  import { createHash as createHash2 } from "node:crypto";
15276
15278
  var TASK_KEY_PREFIXES = {
15277
15279
  question: "Q",
@@ -15299,7 +15301,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
15299
15301
  return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
15300
15302
  }, "taskAccountOf");
15301
15303
 
15302
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
15304
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
15303
15305
  var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
15304
15306
  var REFERABLE = {
15305
15307
  note: { tombstone: true },
@@ -15463,7 +15465,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
15463
15465
  return row2 ? String(row2.id ?? row2.key) : void 0;
15464
15466
  }, "taskIdOf");
15465
15467
 
15466
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
15468
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
15467
15469
  var toMs = /* @__PURE__ */ __name((iso13) => {
15468
15470
  if (iso13 === null || iso13 === void 0)
15469
15471
  return null;
@@ -15477,7 +15479,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
15477
15479
  var DELIVERY = { delivered: 1, read: 2 };
15478
15480
  var deliveryOf = /* @__PURE__ */ __name((stored3) => stored3 === DELIVERY.read ? "read" : stored3 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
15479
15481
 
15480
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
15482
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
15481
15483
  var TAG_KINDS = ["tag", "topic"];
15482
15484
  var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
15483
15485
  var TAG_TYPE = {
@@ -15680,7 +15682,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
15680
15682
  return result;
15681
15683
  }, "tagsOf");
15682
15684
 
15683
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
15685
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
15684
15686
  var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
15685
15687
  var SPEECH = speech("att");
15686
15688
  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");
@@ -15954,9 +15956,12 @@ var messengerOnly = /* @__PURE__ */ __name((compile2) => (node, scope3) => {
15954
15956
  return compile2(node, scope3);
15955
15957
  }, "messengerOnly");
15956
15958
  var topic = messengerOnly(({ value }) => always(bound("m.thread_external_id = ?", value)));
15957
- 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())));
15959
+ 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";
15960
+ var kind2 = messengerOnly(({ value }) => always(bound(`${PEER_KIND} = ?`, value.toLowerCase())));
15958
15961
  var has = /* @__PURE__ */ __name(({ value }, { corpus, mail }) => {
15959
15962
  const wanted = value.toLowerCase();
15963
+ if (wanted === "transcript")
15964
+ return always(bound(mail ? "0" : "EXISTS (SELECT 1 FROM message_transcripts t WHERE t.message_id = m.id)"));
15960
15965
  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)));
15961
15966
  }, "has");
15962
15967
  var inSourceField = /* @__PURE__ */ __name(({ value }, { execution }) => {
@@ -16041,7 +16046,7 @@ var FIELD_COMPILERS = {
16041
16046
  subject
16042
16047
  };
16043
16048
 
16044
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
16049
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
16045
16050
  var placeOf = /* @__PURE__ */ __name((database) => {
16046
16051
  const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
16047
16052
  const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
@@ -16057,7 +16062,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
16057
16062
  };
16058
16063
  }, "placeOf");
16059
16064
 
16060
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
16065
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
16061
16066
  var DRAIN_ON_WRITE = 500;
16062
16067
  var METHOD = "rules";
16063
16068
  var telegramLink = /* @__PURE__ */ __name((database) => {
@@ -16220,7 +16225,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
16220
16225
  return queued.length;
16221
16226
  }, "drainMentions");
16222
16227
 
16223
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
16228
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
16224
16229
  var indexRow = /* @__PURE__ */ __name((database, name) => {
16225
16230
  const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
16226
16231
  if (!exists2)
@@ -16228,7 +16233,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
16228
16233
  return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
16229
16234
  }, "indexRow");
16230
16235
 
16231
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
16236
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
16232
16237
  var INDEX = "message_stems";
16233
16238
  var SETTING2 = "searchStemmers";
16234
16239
  var DRAIN_ON_WRITE2 = 500;
@@ -16350,7 +16355,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
16350
16355
  };
16351
16356
  }, "stemmerCache");
16352
16357
 
16353
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
16358
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
16354
16359
  var SQLITE_BUSY = 5;
16355
16360
  var pause = new Int32Array(new SharedArrayBuffer(4));
16356
16361
  var isBusy = /* @__PURE__ */ __name((error) => {
@@ -16445,7 +16450,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
16445
16450
  }
16446
16451
  }, "read");
16447
16452
 
16448
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
16453
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
16449
16454
  var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
16450
16455
  coalesce(CASE k.chunkable_type
16451
16456
  WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
@@ -16587,7 +16592,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
16587
16592
  }, "dropUnusedVectors");
16588
16593
  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");
16589
16594
 
16590
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
16595
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
16591
16596
  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({
16592
16597
  target: [accounts.provider, accounts.externalId],
16593
16598
  set: {
@@ -16696,7 +16701,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
16696
16701
  AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
16697
16702
  }, "dropOrphanPeople");
16698
16703
 
16699
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
16704
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
16700
16705
  var FOLDED = [
16701
16706
  { table: "tasks", column: "title" },
16702
16707
  { table: "tasks", column: "close_reason" },
@@ -16733,7 +16738,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
16733
16738
  return filled2;
16734
16739
  }, "fillFolded");
16735
16740
 
16736
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
16741
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
16737
16742
  var HISTORY_KEY = "$history";
16738
16743
  var objectOf = /* @__PURE__ */ __name((text6) => {
16739
16744
  if (typeof text6 !== "string")
@@ -16809,7 +16814,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
16809
16814
  return rest;
16810
16815
  }, "withoutHistory");
16811
16816
 
16812
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
16817
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
16813
16818
  import { createHash as createHash3 } from "node:crypto";
16814
16819
  var CHUNK_CHARS = 1200;
16815
16820
  var CHUNK_OVERLAP = 150;
@@ -16914,7 +16919,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
16914
16919
  return chunks2;
16915
16920
  }, "cutChunks");
16916
16921
 
16917
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/search/task-signature.js
16922
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/search/task-signature.js
16918
16923
  var DAY = 864e5;
16919
16924
  var CURRENCY = [
16920
16925
  [/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
@@ -17040,7 +17045,7 @@ var dueDayOf = /* @__PURE__ */ __name((text6, createdMs) => {
17040
17045
  return best?.day ?? null;
17041
17046
  }, "dueDayOf");
17042
17047
 
17043
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
17048
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
17044
17049
  var DAY2 = 864e5;
17045
17050
  var STOP_WORDS = new Set([
17046
17051
  // Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
@@ -17195,7 +17200,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
17195
17200
  ...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
17196
17201
  })).sort((a, b) => b.score - a.score), "rankCandidates");
17197
17202
 
17198
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
17203
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
17199
17204
  var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
17200
17205
  r.last_message_id, r.text_start, r.text_end FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
17201
17206
  JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
@@ -17466,7 +17471,7 @@ var readiness = /* @__PURE__ */ __name(({ orm }, chatKey, model) => {
17466
17471
  };
17467
17472
  }, "readiness");
17468
17473
 
17469
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
17474
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
17470
17475
  var DOCUMENT_PICTURE = "document_picture";
17471
17476
  var SCAN_PAGE2 = 5e3;
17472
17477
  var idOf = /* @__PURE__ */ __name((ref3) => {
@@ -17529,7 +17534,7 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
17529
17534
  }, "nearestPictures")
17530
17535
  }), "documentPicturesOver");
17531
17536
 
17532
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
17537
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
17533
17538
  var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
17534
17539
  const literal4 = escaped2 ?? plain2 ?? "";
17535
17540
  return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
@@ -17594,7 +17599,7 @@ var compile = /* @__PURE__ */ __name((node, columns, options) => {
17594
17599
  var queryFilter = /* @__PURE__ */ __name((ast, columns, options = {}) => compile(ast.root, columns, options), "queryFilter");
17595
17600
  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");
17596
17601
 
17597
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
17602
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
17598
17603
  var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
17599
17604
  var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
17600
17605
  var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
@@ -17684,7 +17689,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
17684
17689
  });
17685
17690
  }, "linkMeeting");
17686
17691
 
17687
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
17692
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
17688
17693
  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), ''))";
17689
17694
  var UNSEARCHED_EVENT_TYPES = [
17690
17695
  "working-location",
@@ -17914,7 +17919,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
17914
17919
  return true;
17915
17920
  }, "resetNoteIndex");
17916
17921
 
17917
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
17922
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
17918
17923
  var keyOf3 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
17919
17924
  var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
17920
17925
  for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf3))) {
@@ -17933,7 +17938,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
17933
17938
  }
17934
17939
  }, "resolvePersonLinks");
17935
17940
 
17936
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
17941
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
17937
17942
  var flag2 = /* @__PURE__ */ __name((value) => value === void 0 || value === null ? null : Number(value), "flag");
17938
17943
  var prepare = /* @__PURE__ */ __name((orm) => ({
17939
17944
  find: orm.select({
@@ -18158,7 +18163,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
18158
18163
  }, "meetingIdentityPk");
18159
18164
  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");
18160
18165
 
18161
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
18166
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
18162
18167
  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");
18163
18168
  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");
18164
18169
  var chatPkFor = /* @__PURE__ */ __name((context, accountKey, chatId) => findChatPk(context, accountKey, chatId) ?? Number(context.orm.insert(chats).values({
@@ -18438,7 +18443,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
18438
18443
  }
18439
18444
  }, "replaceAutoTags");
18440
18445
 
18441
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/counters.js
18446
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/counters.js
18442
18447
  var COUNTER_FIELDS = ["views", "reactions", "comments"];
18443
18448
  var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
18444
18449
  var counterObservationTime = /* @__PURE__ */ __name((observation, now2) => {
@@ -18457,7 +18462,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
18457
18462
  return states.some((one2) => one2.freshness === "stale") ? "stale" : "fresh";
18458
18463
  }, "counterFreshness");
18459
18464
 
18460
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/context/evidence.js
18465
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/context/evidence.js
18461
18466
  import { createHash as createHash4 } from "node:crypto";
18462
18467
  var CONTEXT_MAX_READ_BYTES = 262144;
18463
18468
  var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
@@ -18555,7 +18560,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
18555
18560
  return { source: source2, query, chat: chat2, senders, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
18556
18561
  }, "contextEvidenceRequest");
18557
18562
 
18558
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
18563
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
18559
18564
  var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
18560
18565
  var ACTIVITY = `
18561
18566
  SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
@@ -18671,7 +18676,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
18671
18676
  threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
18672
18677
  }), "mailActivity");
18673
18678
 
18674
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
18679
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
18675
18680
  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");
18676
18681
  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;
18677
18682
  var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
@@ -18752,7 +18757,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
18752
18757
  return withoutSignOff(withoutGreeting(kept)).join("\n").trim();
18753
18758
  }, "mailCore");
18754
18759
 
18755
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
18760
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
18756
18761
  var titleOf = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
18757
18762
  var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
18758
18763
  k.start_offset, k.end_offset, k.account_id, k.occurred_at, a.attachable_id AS email_id,
@@ -18862,7 +18867,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
18862
18867
  return emails3 + threads;
18863
18868
  }, "drainEmailIndex");
18864
18869
 
18865
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
18870
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
18866
18871
  var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
18867
18872
  SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
18868
18873
  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,
@@ -18881,6 +18886,17 @@ var folderEmails = /* @__PURE__ */ __name((database, accountId, folder, uidvalid
18881
18886
  locations: Number(row2.locations),
18882
18887
  folders: Number(row2.folders)
18883
18888
  })), "folderEmails");
18889
+ var placed = /* @__PURE__ */ __name((row2) => ({
18890
+ externalId: String(row2.external_id),
18891
+ threadExternalId: String(row2.thread),
18892
+ receivedAt: row2.at === null ? null : Number(row2.at),
18893
+ metadata: fromJson(row2.metadata),
18894
+ locations: JSON.parse(String(row2.places)).map((place) => ({
18895
+ folder: String(place.folder),
18896
+ uidvalidity: String(place.uidvalidity),
18897
+ uid: Number(place.uid)
18898
+ }))
18899
+ }), "placed");
18884
18900
  var partialEmails = /* @__PURE__ */ __name((database, accountId, limit) => {
18885
18901
  const rows = database.prepare(`SELECT e.external_id, t.external_id AS thread, coalesce(e.received_at, e.sent_at) AS at, e.metadata,
18886
18902
  count(*) OVER () AS total,
@@ -18897,23 +18913,24 @@ var partialEmails = /* @__PURE__ */ __name((database, accountId, limit) => {
18897
18913
  return {
18898
18914
  total: rows.length ? Number(rows[0]?.total) : 0,
18899
18915
  stuck: Number(stuck?.n ?? 0),
18900
- emails: rows.map((row2) => ({
18901
- externalId: String(row2.external_id),
18902
- threadExternalId: String(row2.thread),
18903
- receivedAt: row2.at === null ? null : Number(row2.at),
18904
- metadata: fromJson(row2.metadata),
18905
- locations: JSON.parse(String(row2.places)).map((place) => ({
18906
- folder: String(place.folder),
18907
- uidvalidity: String(place.uidvalidity),
18908
- uid: Number(place.uid)
18909
- }))
18910
- }))
18916
+ emails: rows.map(placed)
18911
18917
  };
18912
18918
  }, "partialEmails");
18919
+ var emailPlace = /* @__PURE__ */ __name((database, accountId, externalId) => {
18920
+ const row2 = database.prepare(`SELECT e.external_id, t.external_id AS thread, coalesce(e.received_at, e.sent_at) AS at, e.metadata,
18921
+ (SELECT json_group_array(json_object('folder', folder, 'uidvalidity', uidvalidity, 'uid', uid))
18922
+ FROM (SELECT b.external_id AS folder, l.uidvalidity, l.uid
18923
+ FROM email_locations l JOIN mailboxes b ON b.id = l.mailbox_id
18924
+ WHERE l.email_id = e.id ORDER BY l.rowid DESC)) AS places
18925
+ FROM emails e JOIN email_threads t ON t.id = e.email_thread_id
18926
+ WHERE e.account_id = ? AND e.external_id = ? AND e.deleted_at IS NULL`).get(accountId, externalId);
18927
+ return row2 ? placed(row2) : null;
18928
+ }, "emailPlace");
18913
18929
  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 = ?
18914
18930
  AND json_extract(metadata, '$.partial') IS NOT NULL`).run(JSON.stringify(mark), accountId, externalId), "markPartial");
18915
18931
  var partialMail = /* @__PURE__ */ __name((database) => ({
18916
18932
  partialEmails: /* @__PURE__ */ __name(async (accountId, limit) => partialEmails(database, accountId, limit), "partialEmails"),
18933
+ emailPlace: /* @__PURE__ */ __name(async (accountId, externalId) => emailPlace(database, accountId, externalId), "emailPlace"),
18917
18934
  markPartial: /* @__PURE__ */ __name(async (accountId, externalId, mark) => {
18918
18935
  write(database, () => markPartial(database, accountId, externalId, mark));
18919
18936
  }, "markPartial")
@@ -18948,7 +18965,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
18948
18965
  var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
18949
18966
  SELECT id FROM emails WHERE account_id = ? AND sent_at IS NULL AND received_at IS NOT NULL LIMIT ?)`).run(accountId, limit).changes), "backfillSentAt");
18950
18967
 
18951
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
18968
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
18952
18969
  var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
18953
18970
  emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
18954
18971
  last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
@@ -18998,7 +19015,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
18998
19015
  return threads.length;
18999
19016
  }, "markEmailsRestored");
19000
19017
 
19001
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
19018
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
19002
19019
  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");
19003
19020
  var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
19004
19021
  var ruleOf = /* @__PURE__ */ __name((row2) => ({
@@ -19065,7 +19082,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
19065
19082
  }
19066
19083
  }), "mailRulesOver");
19067
19084
 
19068
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
19085
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
19069
19086
  var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
19070
19087
  database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
19071
19088
  VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
@@ -19073,7 +19090,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
19073
19090
  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);
19074
19091
  }, "reviewLink");
19075
19092
 
19076
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
19093
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
19077
19094
  function checkMeetingCancelled(signal) {
19078
19095
  if (!signal?.aborted)
19079
19096
  return;
@@ -19084,7 +19101,7 @@ function checkMeetingCancelled(signal) {
19084
19101
  }
19085
19102
  __name(checkMeetingCancelled, "checkMeetingCancelled");
19086
19103
 
19087
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
19104
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
19088
19105
  var meetingOf = /* @__PURE__ */ __name((row2) => ({
19089
19106
  id: Number(row2.id),
19090
19107
  accountId: Number(row2.account_id),
@@ -19134,7 +19151,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
19134
19151
  createdAt: Number(row2.created_at)
19135
19152
  }), "transcriptRowOf");
19136
19153
 
19137
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
19154
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
19138
19155
  var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
19139
19156
  var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
19140
19157
  var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
@@ -19301,7 +19318,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
19301
19318
  }
19302
19319
  }), "meetingReadsOver");
19303
19320
 
19304
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
19321
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
19305
19322
  var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
19306
19323
  const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
19307
19324
  const params = [input.accountId];
@@ -19344,7 +19361,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
19344
19361
  return { clauses, params };
19345
19362
  }, "meetingSelectionSql");
19346
19363
 
19347
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
19364
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
19348
19365
  var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
19349
19366
  async meetingChatLines(input) {
19350
19367
  checkMeetingCancelled(input.signal);
@@ -19372,7 +19389,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
19372
19389
  }
19373
19390
  }), "meetingChatLinesOver");
19374
19391
 
19375
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
19392
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
19376
19393
  var MESSAGE_FIELDS = {
19377
19394
  pk: messages.id,
19378
19395
  nativeId: messages.externalId,
@@ -19543,7 +19560,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
19543
19560
  storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
19544
19561
  }), "chatActivity");
19545
19562
 
19546
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
19563
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
19547
19564
  var HIT_FIELDS = {
19548
19565
  ...MESSAGE_FIELDS,
19549
19566
  chatTitle: sql`${chats.title}`.as("chat_title"),
@@ -19642,7 +19659,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
19642
19659
  };
19643
19660
  }, "directReplies");
19644
19661
 
19645
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
19662
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
19646
19663
  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");
19647
19664
  var required = /* @__PURE__ */ __name((context, ref3) => {
19648
19665
  const found2 = identityRow(context, ref3);
@@ -19773,7 +19790,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
19773
19790
  }, "mentioning");
19774
19791
  var escaped = /* @__PURE__ */ __name((text6) => text6.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
19775
19792
 
19776
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
19793
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
19777
19794
  var missing2 = /* @__PURE__ */ __name(() => {
19778
19795
  throw new CliError("not_found", "Meeting, participant or selected target not found");
19779
19796
  }, "missing");
@@ -19895,7 +19912,7 @@ function meetingContextLinksOver(context) {
19895
19912
  }
19896
19913
  __name(meetingContextLinksOver, "meetingContextLinksOver");
19897
19914
 
19898
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
19915
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
19899
19916
  var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
19900
19917
  var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
19901
19918
  var summaryOf = /* @__PURE__ */ __name((row2) => ({
@@ -19924,7 +19941,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
19924
19941
  return row2 ? summaryText(summaryOf(row2)) : null;
19925
19942
  }, "indexedText");
19926
19943
 
19927
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
19944
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
19928
19945
  var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
19929
19946
  var meetingCurrentIndexRows = `
19930
19947
  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
@@ -19955,7 +19972,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
19955
19972
  }, "invalidateMeetingStems");
19956
19973
  var meetingStemmableText = /* @__PURE__ */ __name((text6) => text6.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
19957
19974
 
19958
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
19975
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
19959
19976
  function meetingHitIndexOver({ database, now: now2 }) {
19960
19977
  return {
19961
19978
  async indexSearch(original) {
@@ -20023,10 +20040,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
20023
20040
  }
20024
20041
  __name(meetingHitIndexOver, "meetingHitIndexOver");
20025
20042
 
20026
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
20043
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
20027
20044
  import { createHash as createHash5 } from "node:crypto";
20028
20045
 
20029
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/search/trigrams.js
20046
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/search/trigrams.js
20030
20047
  var trigrams = /* @__PURE__ */ __name((term) => {
20031
20048
  const padded = ` ${term} `;
20032
20049
  const pieces = /* @__PURE__ */ new Set();
@@ -20035,7 +20052,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
20035
20052
  return [...pieces];
20036
20053
  }, "trigrams");
20037
20054
 
20038
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/search/correct.js
20055
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/search/correct.js
20039
20056
  var SHORTEST_CORRECTION = 3;
20040
20057
  var maxEdits = /* @__PURE__ */ __name((word) => word.length <= 4 ? 1 : 2, "maxEdits");
20041
20058
  var editDistance = /* @__PURE__ */ __name((a, b, max) => {
@@ -20082,7 +20099,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words3) => {
20082
20099
  return corrections;
20083
20100
  }, "correctWords");
20084
20101
 
20085
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/search/garbled.js
20102
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/search/garbled.js
20086
20103
  var SHORTEST_GARBLED = 4;
20087
20104
  var MOST_WIDENED = 64;
20088
20105
  var plain = /* @__PURE__ */ __name((word) => word.replaceAll("\u044D", "\u0435"), "plain");
@@ -20174,7 +20191,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
20174
20191
  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));
20175
20192
  }, "widenWords");
20176
20193
 
20177
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
20194
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
20178
20195
  import { readFileSync } from "node:fs";
20179
20196
  var loaded;
20180
20197
  var dictionary = /* @__PURE__ */ __name(() => {
@@ -20233,7 +20250,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word) => {
20233
20250
  return false;
20234
20251
  }, "knownRussianWord");
20235
20252
 
20236
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
20253
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
20237
20254
  var WORD3 = /[\p{L}\p{N}\p{M}]+/gu;
20238
20255
  var MOST_WORDS = 128;
20239
20256
  var quote = /* @__PURE__ */ __name((word) => `"${word.replaceAll('"', '""')}"`, "quote");
@@ -20460,7 +20477,7 @@ var matchMeetingText = /* @__PURE__ */ __name((tree, text6, stemmer) => {
20460
20477
  return check3(tree);
20461
20478
  }, "matchMeetingText");
20462
20479
 
20463
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
20480
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
20464
20481
  var fail3 = /* @__PURE__ */ __name((message2) => {
20465
20482
  throw new CliError("validation_error", message2);
20466
20483
  }, "fail");
@@ -20642,7 +20659,7 @@ function meetingHitSearchOver({ database }) {
20642
20659
  }
20643
20660
  __name(meetingHitSearchOver, "meetingHitSearchOver");
20644
20661
 
20645
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
20662
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
20646
20663
  var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
20647
20664
  async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
20648
20665
  positiveReadInteger(accountId, "accountId");
@@ -20674,7 +20691,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
20674
20691
  }
20675
20692
  }), "meetingLanguagesOver");
20676
20693
 
20677
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
20694
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
20678
20695
  import { createHash as createHash6 } from "node:crypto";
20679
20696
  var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
20680
20697
  if (value === void 0)
@@ -20764,7 +20781,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
20764
20781
  }
20765
20782
  }), "meetingParticipantSearchOver");
20766
20783
 
20767
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
20784
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
20768
20785
  var preparationQueries = {
20769
20786
  participants: {
20770
20787
  fields: "p.id, p.identity_id, p.display_name, l.person_id",
@@ -20814,7 +20831,7 @@ var preparationQueries = {
20814
20831
  }
20815
20832
  };
20816
20833
 
20817
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
20834
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
20818
20835
  var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
20819
20836
  async preparationContext(original) {
20820
20837
  const input = validateMeetingPreparationContext(original);
@@ -20855,7 +20872,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
20855
20872
  }
20856
20873
  }), "meetingPreparationContextOver");
20857
20874
 
20858
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
20875
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
20859
20876
  var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
20860
20877
  SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
20861
20878
  WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
@@ -20869,7 +20886,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
20869
20886
  JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
20870
20887
  )`, "preparationSubjects");
20871
20888
 
20872
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
20889
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
20873
20890
  var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
20874
20891
  async preparationKnowledge(original) {
20875
20892
  const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
@@ -20914,7 +20931,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
20914
20931
  }
20915
20932
  }), "meetingPreparationKnowledgeOver");
20916
20933
 
20917
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
20934
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
20918
20935
  var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
20919
20936
  async preparationNotes(original) {
20920
20937
  const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
@@ -20967,7 +20984,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
20967
20984
  }
20968
20985
  }), "meetingPreparationNotesOver");
20969
20986
 
20970
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
20987
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
20971
20988
  var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
20972
20989
  async relatedHistory(original) {
20973
20990
  const input = validateMeetingRelatedHistory(original);
@@ -21038,7 +21055,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
21038
21055
  }
21039
21056
  }), "meetingRelatedHistoryOver");
21040
21057
 
21041
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
21058
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
21042
21059
  var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
21043
21060
  var text2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
21044
21061
  var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
@@ -21119,7 +21136,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
21119
21136
  }
21120
21137
  }), "meetingReviewOver");
21121
21138
 
21122
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
21139
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
21123
21140
  var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
21124
21141
  var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
21125
21142
  if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
@@ -21173,8 +21190,14 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
21173
21190
  }
21174
21191
  }), "meetingSeriesHistoryOver");
21175
21192
 
21176
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
21193
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
21177
21194
  var MOST_ROWS = 5e5;
21195
+ var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
21196
+ EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
21197
+ AND t.superseded_at IS NULL) AS transcribed,
21198
+ s.external_id AS series_key, CASE WHEN s.id IS NULL THEN NULL ELSE coalesce(s.title, m.title) END AS series_title
21199
+ FROM meetings m LEFT JOIN meeting_series s ON s.id = m.meeting_series_id
21200
+ WHERE ${where} ORDER BY m.started_at DESC`, "meetingCountsSql");
21178
21201
  var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
21179
21202
  async meetingStats(input) {
21180
21203
  checkMeetingCancelled(input.signal);
@@ -21217,10 +21240,26 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
21217
21240
  speakerName: text6(row2.speaker_name)
21218
21241
  })), input.timeZone);
21219
21242
  });
21243
+ },
21244
+ async meetingCounts(input) {
21245
+ checkMeetingCancelled(input.signal);
21246
+ positiveReadInteger(input.accountId, "accountId");
21247
+ return read(database, () => {
21248
+ const { clauses, params } = meetingSelectionSql(input);
21249
+ const meetings2 = database.prepare(meetingCountsSql(clauses.join(" AND "))).all(...params).map((row2) => ({
21250
+ startedAt: row2.started_at === null ? null : Number(row2.started_at),
21251
+ durationMs: row2.duration_ms === null ? null : Number(row2.duration_ms),
21252
+ transcribed: Number(row2.transcribed) === 1,
21253
+ seriesKey: row2.series_key === null ? null : String(row2.series_key),
21254
+ seriesTitle: row2.series_title === null ? null : String(row2.series_title)
21255
+ }));
21256
+ checkMeetingCancelled(input.signal);
21257
+ return aggregateMeetingCounts(meetings2, input.by, input.timeZone, input.limit);
21258
+ });
21220
21259
  }
21221
21260
  }), "meetingStatsOver");
21222
21261
 
21223
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
21262
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
21224
21263
  var CURSOR_KEY = "meetings";
21225
21264
  var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
21226
21265
  id: Number(row2.id),
@@ -21789,7 +21828,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
21789
21828
  };
21790
21829
  }, "meetingStoreOver");
21791
21830
 
21792
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
21831
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
21793
21832
  var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
21794
21833
  const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
21795
21834
  return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
@@ -21815,7 +21854,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder) => {
21815
21854
  orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder))).run();
21816
21855
  }, "release");
21817
21856
 
21818
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
21857
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
21819
21858
  var THREAD_COLUMNS = {
21820
21859
  subject: {
21821
21860
  where: /* @__PURE__ */ __name(({ value }) => ({
@@ -21832,7 +21871,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
21832
21871
  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);
21833
21872
  }, "threadRows");
21834
21873
 
21835
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
21874
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
21836
21875
  var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
21837
21876
  id: `email:${place.emailId}`,
21838
21877
  chatId: place.threadExternalId,
@@ -22388,7 +22427,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
22388
22427
  }
22389
22428
  }), "mailStoreOver");
22390
22429
 
22391
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/search/dictionary.js
22430
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/search/dictionary.js
22392
22431
  import { readFileSync as readFileSync2 } from "node:fs";
22393
22432
  var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
22394
22433
  var folded4 = /* @__PURE__ */ __name((word) => /^[а-яё'-]*$/.test(word) ? word.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word), "folded");
@@ -22478,7 +22517,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
22478
22517
  }, "knownWord");
22479
22518
  var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
22480
22519
 
22481
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
22520
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
22482
22521
  var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
22483
22522
  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");
22484
22523
  var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
@@ -22564,7 +22603,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
22564
22603
  return found2;
22565
22604
  }, "spokenTranscripts");
22566
22605
 
22567
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
22606
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
22568
22607
  var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, found2, pks) => {
22569
22608
  const placeLeaves = leaves.filter(({ node }) => (node.operator === "term" || node.operator === "phrase") && (node.implicit || node.field === "content" || node.field === "transcript"));
22570
22609
  if (!placeLeaves.length || !pks.length || found2.length !== pks.length)
@@ -22611,7 +22650,29 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
22611
22650
  });
22612
22651
  }, "placeHits");
22613
22652
 
22614
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
22653
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
22654
+ var GROUPS = {
22655
+ chat: {
22656
+ key: "m.chat_id",
22657
+ select: "ac.provider AS provider, ac.external_id AS account, c.external_id AS id, c.title AS name"
22658
+ },
22659
+ sender: {
22660
+ key: "coalesce(m.sender_identity_id, -m.account_id)",
22661
+ select: "ac.provider AS provider, ac.external_id AS account, i.external_id AS id, i.name AS name, max(m.outgoing) AS outgoing"
22662
+ },
22663
+ // Quarter hours, so a calendar day or hour in any zone (+05:30, +05:45) is a whole number of buckets.
22664
+ time: { key: "m.sent_at / 900000", select: "CAST(min(m.sent_at / 900000) * 900000 AS TEXT) AS id, NULL AS name" },
22665
+ sender_direction: {
22666
+ key: "coalesce(m.sender_identity_id, -m.account_id), coalesce(m.outgoing, 0)",
22667
+ select: "ac.provider AS provider, ac.external_id AS account, i.external_id AS id, i.name AS name, coalesce(m.outgoing, 0) AS outgoing"
22668
+ },
22669
+ time_direction: {
22670
+ key: "m.sent_at / 900000, coalesce(m.outgoing, 0)",
22671
+ select: "CAST(min(m.sent_at / 900000) * 900000 AS TEXT) AS id, NULL AS name, coalesce(m.outgoing, 0) AS outgoing"
22672
+ }
22673
+ };
22674
+
22675
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
22615
22676
  var MESSAGES2 = {
22616
22677
  rows: "messages",
22617
22678
  threads: "chats",
@@ -22632,18 +22693,6 @@ var MAIL = {
22632
22693
  item: "email",
22633
22694
  thread: "email_thread"
22634
22695
  };
22635
- var GROUPS = {
22636
- chat: {
22637
- key: "m.chat_id",
22638
- select: "ac.provider AS provider, ac.external_id AS account, c.external_id AS id, c.title AS name"
22639
- },
22640
- sender: {
22641
- key: "coalesce(m.sender_identity_id, -m.account_id)",
22642
- select: "ac.provider AS provider, ac.external_id AS account, i.external_id AS id, i.name AS name, max(m.outgoing) AS outgoing"
22643
- },
22644
- // Quarter hours, so a calendar day or hour in any zone (+05:30, +05:45) is a whole number of buckets.
22645
- time: { key: "m.sent_at / 900000", select: "CAST(min(m.sent_at / 900000) * 900000 AS TEXT) AS id, NULL AS name" }
22646
- };
22647
22696
  var matchQuery = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution), "matchQuery");
22648
22697
  var countQuery = /* @__PURE__ */ __name((context, execution, by) => runQuery(context, execution, by), "countQuery");
22649
22698
  var queryMessagePks = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution, "pks"), "queryMessagePks");
@@ -22941,8 +22990,8 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
22941
22990
  count: Number(row2.count)
22942
22991
  }));
22943
22992
  }, "grouped");
22944
- const placed = /* @__PURE__ */ __name((found2, pks) => placeHits(database, corpus, [...fragments.values()], transcripts, found2, pks), "placed");
22945
- const hits = /* @__PURE__ */ __name((pks) => placed(mail ? emailHitsByPk(database, pks) : hitsByPk(context, pks), pks), "hits");
22993
+ const placed2 = /* @__PURE__ */ __name((found2, pks) => placeHits(database, corpus, [...fragments.values()], transcripts, found2, pks), "placed");
22994
+ const hits = /* @__PURE__ */ __name((pks) => placed2(mail ? emailHitsByPk(database, pks) : hitsByPk(context, pks), pks), "hits");
22946
22995
  return {
22947
22996
  corpus,
22948
22997
  rowsFrom,
@@ -23106,7 +23155,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
23106
23155
  };
23107
23156
  }, "runCompiled");
23108
23157
 
23109
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
23158
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
23110
23159
  function invalidMetadata() {
23111
23160
  throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
23112
23161
  }
@@ -23208,7 +23257,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
23208
23257
  };
23209
23258
  }), "counterTargets");
23210
23259
 
23211
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
23260
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
23212
23261
  var NOT_FILE_LIST = [...NOT_FILES].map((kind4) => `'${kind4}'`).join(",");
23213
23262
  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,
23214
23263
  att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
@@ -23327,7 +23376,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
23327
23376
  }));
23328
23377
  }, "attachmentViews");
23329
23378
 
23330
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
23379
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
23331
23380
  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");
23332
23381
  var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text6, source2) => {
23333
23382
  const { orm, database, now: now2 } = context;
@@ -23365,7 +23414,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
23365
23414
  keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
23366
23415
  }, "intoVoiceAttachment");
23367
23416
 
23368
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
23417
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
23369
23418
  var FIELDS = [
23370
23419
  "threadExternalId",
23371
23420
  "senderIdentityId",
@@ -23682,7 +23731,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
23682
23731
  reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
23683
23732
  }, "writeDerivedReactions");
23684
23733
 
23685
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/keys.js
23734
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/keys.js
23686
23735
  var keysOver = /* @__PURE__ */ __name((context) => {
23687
23736
  const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
23688
23737
  const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
@@ -23703,7 +23752,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
23703
23752
  };
23704
23753
  }, "keysOver");
23705
23754
 
23706
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
23755
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
23707
23756
  var accountGroupsOf = /* @__PURE__ */ __name((database) => {
23708
23757
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
23709
23758
  if (!row2)
@@ -23738,7 +23787,7 @@ var saveProfile = /* @__PURE__ */ __name((database, app, profile, key2, now2) =>
23738
23787
  database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
23739
23788
  }, "saveProfile");
23740
23789
 
23741
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
23790
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
23742
23791
  var BOT_KINDS = ["agent", "rule", "script", "integration"];
23743
23792
  var ownerPerson = /* @__PURE__ */ __name((database) => {
23744
23793
  const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
@@ -23795,7 +23844,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
23795
23844
  return { sql: bot("pb.name = ?"), params: [by.bot] };
23796
23845
  }, "proposedBySql");
23797
23846
 
23798
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
23847
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
23799
23848
  var linkOwnIdentities = /* @__PURE__ */ __name((context) => {
23800
23849
  const owner = ownerPerson(context.database).id;
23801
23850
  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);
@@ -23816,7 +23865,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
23816
23865
  return personOf(context, ref3);
23817
23866
  }, "linkToOwner");
23818
23867
 
23819
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
23868
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
23820
23869
  var PROVIDERS_SETTING = "providers";
23821
23870
  var storedProvidersOf = /* @__PURE__ */ __name((database) => {
23822
23871
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
@@ -23851,7 +23900,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
23851
23900
  });
23852
23901
  }, "registerProvider");
23853
23902
 
23854
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
23903
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
23855
23904
  var DAY3 = 864e5;
23856
23905
  var RECENTLY_CLOSED_MS = 14 * DAY3;
23857
23906
  var TEXT_LIMIT = 20;
@@ -24050,7 +24099,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
24050
24099
  };
24051
24100
  }, "taskSimilarityOver");
24052
24101
 
24053
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
24102
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
24054
24103
  var SETTING3 = "taskCategories";
24055
24104
  var savedTaskCategories = /* @__PURE__ */ __name((database) => {
24056
24105
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
@@ -24069,7 +24118,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
24069
24118
  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);
24070
24119
  }, "saveTaskCategories");
24071
24120
 
24072
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
24121
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
24073
24122
  var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
24074
24123
  var ALLOWED = "taskAgentClose";
24075
24124
  var MIN = "taskAgentCloseMin";
@@ -24125,8 +24174,13 @@ var SUGGESTION_COLUMNS = [
24125
24174
  ];
24126
24175
  var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
24127
24176
 
24128
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/decisions.js
24177
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
24178
+ var MAIL_FINDINGS_KIND = "mail_findings";
24179
+
24180
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/decisions.js
24181
+ var TASK_CLOSE_KIND = "task_close";
24129
24182
  var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
24183
+ var isOwnerOnlyKind = /* @__PURE__ */ __name((kind4) => kind4 === MAIL_FINDINGS_KIND || kind4 === MEETING_FINDINGS_KIND || kind4 === TASK_CLOSE_KIND, "isOwnerOnlyKind");
24130
24184
  var mayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISION_POLICY) => {
24131
24185
  if (by === "owner")
24132
24186
  return null;
@@ -24136,7 +24190,7 @@ var mayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISION_POLI
24136
24190
  reason,
24137
24191
  message: message2
24138
24192
  }), "refuse");
24139
- if (row2.ownerOnly)
24193
+ if (row2.ownerOnly || isOwnerOnlyKind(row2.kind))
24140
24194
  return refuse4("permission_error", "proposal.owner-only", `only the owner decides ${row2.id}`);
24141
24195
  if (!policy.agentDecisions)
24142
24196
  return refuse4("permission_error", "proposals.agent-decisions-off", "agent decisions are turned off; the owner decides");
@@ -24171,7 +24225,7 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
24171
24225
  }, "assertMayDecide");
24172
24226
  var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
24173
24227
 
24174
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/money.js
24228
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/money.js
24175
24229
  var CURRENCY_SCALES = {
24176
24230
  AED: 2,
24177
24231
  AMD: 2,
@@ -24256,7 +24310,7 @@ var quantityOf = /* @__PURE__ */ __name((text6) => {
24256
24310
  }, "quantityOf");
24257
24311
  var lineUnits = /* @__PURE__ */ __name((thousandths, unitPrice) => Number((thousandths * BigInt(unitPrice) + 500n) / 1000n), "lineUnits");
24258
24312
 
24259
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/finance.js
24313
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/finance.js
24260
24314
  var INVOICE_DIRECTIONS = ["receivable", "payable"];
24261
24315
  var INVOICE_STATUSES = ["draft", "issued", "partly_paid", "paid", "void"];
24262
24316
  var MONEY_DIRECTIONS = ["in", "out"];
@@ -24285,10 +24339,10 @@ var paymentLine = /* @__PURE__ */ __name((payment) => {
24285
24339
  var invoiceTitle = /* @__PURE__ */ __name((invoice) => `Invoice ${invoiceLine(invoice)}`, "invoiceTitle");
24286
24340
  var paymentEntryTitle = /* @__PURE__ */ __name((payment) => `Payment \xB7 ${paymentLine(payment)}`, "paymentEntryTitle");
24287
24341
 
24288
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
24342
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
24289
24343
  var oneLine = /* @__PURE__ */ __name((text6) => singleLine(text6.replace(/\s+/g, " ").trim()), "oneLine");
24290
24344
 
24291
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
24345
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
24292
24346
  var EXCERPT_CHARS = 280;
24293
24347
  var TITLE_CHARS = 120;
24294
24348
  var MEMORY_TITLE_CHARS = 80;
@@ -24641,7 +24695,7 @@ var refReadsOf = /* @__PURE__ */ __name((database, texts2, { excerpt = false } =
24641
24695
  var summaryOf2 = /* @__PURE__ */ __name(({ sender, excerpt, ...summary }, withExcerpt) => withExcerpt ? { ...summary, excerpt } : summary, "summaryOf");
24642
24696
  var refSummariesOf = /* @__PURE__ */ __name((database, texts2, options = {}) => new Map([...refReadsOf(database, texts2, options)].map(([text6, read2]) => [text6, summaryOf2(read2, options.excerpt === true)])), "refSummariesOf");
24643
24697
 
24644
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
24698
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
24645
24699
  var sourceOf3 = /* @__PURE__ */ __name((read2, ref3) => ({
24646
24700
  ref: ref3,
24647
24701
  kind: read2.kind,
@@ -24677,7 +24731,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
24677
24731
  });
24678
24732
  }, "evidenceSourcesOf");
24679
24733
 
24680
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/ulid.js
24734
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/ulid.js
24681
24735
  import { randomBytes } from "node:crypto";
24682
24736
  var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
24683
24737
  var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
@@ -24690,7 +24744,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
24690
24744
  return time3 + random;
24691
24745
  }, "ulid");
24692
24746
 
24693
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
24747
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
24694
24748
  var FOLDED_FIELDS = ["title", "site", "language", "author"];
24695
24749
  var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
24696
24750
  if (!meta && !sections?.length)
@@ -24711,7 +24765,7 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
24711
24765
  return typeof language === "string" && language !== "" ? language : null;
24712
24766
  }, "languageOf");
24713
24767
 
24714
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
24768
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
24715
24769
  var isObject = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
24716
24770
  var objectOf2 = /* @__PURE__ */ __name((value) => {
24717
24771
  if (isObject(value))
@@ -24822,13 +24876,13 @@ var syncFile = /* @__PURE__ */ __name((database, now2, documentId, { seen = true
24822
24876
  if (!existing) {
24823
24877
  const columns = Object.keys(values);
24824
24878
  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);
24825
- const placed = { id: Number(row2?.id), path };
24826
- logFileLink(database, now2, placed.id, null, documentId, method);
24879
+ const placed2 = { id: Number(row2?.id), path };
24880
+ logFileLink(database, now2, placed2.id, null, documentId, method);
24827
24881
  if (remote)
24828
24882
  linkAttached(database, now2, externalId);
24829
24883
  if (remote && kind4 === "folder")
24830
24884
  placeChildren(database, now2, accountId, String(doc.external_id), depth);
24831
- return placed;
24885
+ return placed2;
24832
24886
  }
24833
24887
  const id2 = Number(existing.id);
24834
24888
  if (existing.document_id !== documentId)
@@ -24954,7 +25008,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
24954
25008
  };
24955
25009
  }, "filesStoreOver");
24956
25010
 
24957
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
25011
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
24958
25012
  var IMPORTED_DOCUMENT_QUERY = defineQuery({
24959
25013
  entity: "document",
24960
25014
  backend: "sql",
@@ -25000,7 +25054,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
25000
25054
  return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns);
25001
25055
  }, "importedDocumentWhere");
25002
25056
 
25003
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
25057
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
25004
25058
  var NOTE_FORMATS = ["obsidian", "markdown"];
25005
25059
  var iso2 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
25006
25060
  var optionalIso = /* @__PURE__ */ __name((value) => value == null ? null : iso2(value), "optionalIso");
@@ -25526,7 +25580,7 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
25526
25580
  };
25527
25581
  }, "notesStoreOver");
25528
25582
 
25529
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
25583
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
25530
25584
  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";
25531
25585
  var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
25532
25586
  var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
@@ -25748,7 +25802,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
25748
25802
  };
25749
25803
  }, "memoriesStoreOver");
25750
25804
 
25751
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
25805
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
25752
25806
  var DEFAULT_FIRST_PASS_PER_CHAT = 0;
25753
25807
  var KEY = "taskFirstPassPerChat";
25754
25808
  var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
@@ -25768,7 +25822,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
25768
25822
  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);
25769
25823
  }, "saveFirstPassPerChat");
25770
25824
 
25771
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
25825
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
25772
25826
  var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
25773
25827
  var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
25774
25828
  name,
@@ -25800,6 +25854,7 @@ var PROJECT_TASK_FIELDS = [
25800
25854
  values: ["overdue", "today", "upcoming", "later", "none"],
25801
25855
  relation: "the due date as a board groups it: overdue (open work due before today), today, upcoming (the next 7 days after today), later, or none"
25802
25856
  }),
25857
+ field("created", "time", "created:>=30d", { relation: "when it was opened" }),
25803
25858
  field("closed", "time", "closed:>=14d", { relation: "when it was done or dismissed" }),
25804
25859
  field("ready", "bool", "ready:true", { relation: "open work whose blocked-by tasks are all done" }),
25805
25860
  field("text", "txt", "text:invoice", { relation: "words of the title and description; a bare word means this" })
@@ -25933,6 +25988,7 @@ var projectTaskColumns = /* @__PURE__ */ __name((now2, zone) => ({
25933
25988
  agent: { where: agentWhere },
25934
25989
  parent: { where: parentWhere },
25935
25990
  due: { type: "time", sql: "t.due_at" },
25991
+ created: { type: "time", sql: "t.created_at" },
25936
25992
  closed: { type: "time", sql: "t.closed_at" },
25937
25993
  overdue: { where: /* @__PURE__ */ __name((node) => truth(node, dueGroups(now2, zone).overdue), "where") },
25938
25994
  when: {
@@ -25989,7 +26045,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
25989
26045
  return root === void 0 ? void 0 : { ...query, root };
25990
26046
  }, "withoutField");
25991
26047
 
25992
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
26048
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
25993
26049
  var authorNamed = /* @__PURE__ */ __name((database, row2) => {
25994
26050
  if (row2.author_type == null)
25995
26051
  return null;
@@ -26017,7 +26073,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
26017
26073
  return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
26018
26074
  }, "addComment");
26019
26075
 
26020
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
26076
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
26021
26077
  var TASK_RELATION_KINDS = [
26022
26078
  "blocked-by",
26023
26079
  "follow-up-of",
@@ -26147,7 +26203,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record4) => {
26147
26203
  };
26148
26204
  }, "taskRelationsStoreOver");
26149
26205
 
26150
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
26206
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
26151
26207
  var TASK_ROLES = ["assignee", "reviewer", "watcher"];
26152
26208
  var TASK_EVENT_KINDS = [
26153
26209
  "created",
@@ -26290,7 +26346,7 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
26290
26346
  const onBoard = /* @__PURE__ */ __name((task) => Boolean(database.prepare(`SELECT 1 FROM tasks t WHERE t.id = ? AND ${BOARD_SCOPE}`).get(task)), "onBoard");
26291
26347
  const moveToProject = /* @__PURE__ */ __name((task, before2, target, actor, at, detach) => {
26292
26348
  if (target === Number(before2.project_id))
26293
- return;
26349
+ return [];
26294
26350
  if (!onBoard(task))
26295
26351
  throw new CliError("validation_error", "only a project task moves to another project");
26296
26352
  const targetRow = database.prepare("SELECT key FROM projects WHERE id = ?").get(target);
@@ -26300,18 +26356,28 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
26300
26356
  const parent2 = taskIdOf(database, Number(before2.parent_id));
26301
26357
  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 });
26302
26358
  }
26303
- 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));
26304
- if (children.length)
26305
- throw new CliError("validation_error", `${String(before2.key)} has subtasks (${children.join(", ")}); move or detach them first`, { reason: "task.has-subtasks", subtasks: children });
26306
- const counted = database.prepare("UPDATE projects SET tasks_count = tasks_count + 1, updated_at = ? WHERE id = ? RETURNING key, tasks_count").get(at, target);
26307
- const number3 = Number(counted.tasks_count);
26308
- const key2 = `${String(counted.key)}-${number3}`;
26309
- database.prepare("UPDATE tasks SET project_id = ?, number = ?, key = ?, parent_id = NULL, updated_at = ? WHERE id = ?").run(target, number3, key2, at, task);
26310
- recordTaskEvent(database, task, actor, "project", {
26311
- project: [`project:${before2.project_id}`, `project:${target}`],
26312
- key: [String(before2.key), key2],
26313
- ...before2.parent_id == null ? {} : { parent: [`task:${taskIdOf(database, Number(before2.parent_id))}`, null] }
26314
- }, at);
26359
+ const renumber = /* @__PURE__ */ __name((row2, parent2) => {
26360
+ const counted = database.prepare("UPDATE projects SET tasks_count = tasks_count + 1, updated_at = ? WHERE id = ? RETURNING key, tasks_count").get(at, target);
26361
+ const number3 = Number(counted.tasks_count);
26362
+ const key2 = `${String(counted.key)}-${number3}`;
26363
+ database.prepare("UPDATE tasks SET project_id = ?, number = ?, key = ?, parent_id = ?, updated_at = ? WHERE id = ?").run(target, number3, key2, parent2, at, Number(row2.id));
26364
+ recordTaskEvent(database, Number(row2.id), actor, "project", {
26365
+ project: [`project:${row2.project_id}`, `project:${target}`],
26366
+ key: [String(row2.key), key2],
26367
+ ...row2.parent_id === parent2 ? {} : { parent: [`task:${taskIdOf(database, Number(row2.parent_id))}`, null] }
26368
+ }, at);
26369
+ return key2;
26370
+ }, "renumber");
26371
+ renumber(before2, null);
26372
+ const moved = [];
26373
+ const childrenOf = database.prepare("SELECT * FROM tasks WHERE parent_id = ? AND deleted_at IS NULL ORDER BY id");
26374
+ for (const queue = [task]; queue.length > 0; ) {
26375
+ for (const child of childrenOf.all(queue.shift())) {
26376
+ moved.push({ from: String(child.key), to: renumber(child, child.parent_id) });
26377
+ queue.push(Number(child.id));
26378
+ }
26379
+ }
26380
+ return moved;
26315
26381
  }, "moveToProject");
26316
26382
  const edit = /* @__PURE__ */ __name((task, fields4, actor, created = false) => {
26317
26383
  const before2 = rowById(task);
@@ -26389,16 +26455,16 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
26389
26455
  change("type", fields4.type, "type");
26390
26456
  bump = true;
26391
26457
  }
26392
- if (fields4.project !== void 0)
26393
- moveToProject(task, before2, projectOf2(fields4.project), actor, at, fields4.parent === null);
26458
+ const moved = fields4.project === void 0 ? [] : moveToProject(task, before2, projectOf2(fields4.project), actor, at, fields4.parent === null);
26394
26459
  if (set.length === 0) {
26395
26460
  if (bump)
26396
26461
  database.prepare("UPDATE tasks SET revision = revision + 1 WHERE id = ?").run(task);
26397
- return;
26462
+ return moved;
26398
26463
  }
26399
26464
  if (bump)
26400
26465
  set.push("revision = revision + 1");
26401
26466
  database.prepare(`UPDATE tasks SET ${set.join(", ")}, updated_at = ? WHERE id = ?`).run(...values, at, task);
26467
+ return moved;
26402
26468
  }, "edit");
26403
26469
  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");
26404
26470
  const moveTask = /* @__PURE__ */ __name((task, row2, move2, actor) => {
@@ -26481,11 +26547,11 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
26481
26547
  }, "create"),
26482
26548
  edit: /* @__PURE__ */ __name(async (id2, fields4, by, check3 = {}) => {
26483
26549
  const task = required3(id2);
26484
- write(database, () => {
26550
+ const moved = write(database, () => {
26485
26551
  checkRevision(rowById(task), check3.revision);
26486
- edit(task, fields4, authorActor(context, by).actor);
26552
+ return edit(task, fields4, authorActor(context, by).actor);
26487
26553
  });
26488
- return details2(task);
26554
+ return moved.length > 0 ? { ...details2(task), movedSubtasks: moved } : details2(task);
26489
26555
  }, "edit"),
26490
26556
  /** `edit` inside the caller's write, so a decision that edits a task rolls back with it. */
26491
26557
  editNow: /* @__PURE__ */ __name((id2, fields4, by) => {
@@ -26682,7 +26748,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
26682
26748
  };
26683
26749
  }, "workTasksOver");
26684
26750
 
26685
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
26751
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
26686
26752
  var taskCloseOver = /* @__PURE__ */ __name((context) => {
26687
26753
  const { database, now: now2 } = context;
26688
26754
  const liveRow = /* @__PURE__ */ __name((id2) => {
@@ -26731,7 +26797,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
26731
26797
  };
26732
26798
  }, "taskCloseOver");
26733
26799
 
26734
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
26800
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
26735
26801
  var TASK_PAIR_DECISIONS = ["review", "unsure", "merged", "rejected", "unmerged", "attached", "new"];
26736
26802
  var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
26737
26803
  const { database, now: now2 } = context;
@@ -26950,7 +27016,46 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
26950
27016
  };
26951
27017
  }, "taskPairsOver");
26952
27018
 
26953
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
27019
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
27020
+ var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
27021
+ var TASK_STATS_SQL = {
27022
+ rows: /* @__PURE__ */ __name((board, filter) => `SELECT t.source_group, t.source_kind, t.project_id, t.status, t.created_at, t.closed_at FROM tasks t WHERE ${board ? BOARD_SCOPE : ACCOUNT_SCOPE}${filter} ORDER BY t.created_at, t.id`, "rows"),
27023
+ chat: "SELECT c.external_id AS id, c.title AS name FROM chats c JOIN accounts a ON a.id = c.account_id WHERE a.provider = ? AND a.external_id = ? AND c.external_id IN (SELECT value FROM json_each(?))",
27024
+ meeting: "SELECT CAST(id AS TEXT) AS id, title AS name FROM meetings WHERE id IN (SELECT value FROM json_each(?))",
27025
+ project: "SELECT CAST(id AS TEXT) AS id, name FROM projects WHERE id IN (SELECT value FROM json_each(?))"
27026
+ };
27027
+ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
27028
+ statRows: /* @__PURE__ */ __name(async (scope3, where) => {
27029
+ const filter = where === void 0 ? "" : ` AND (${where.sql})`;
27030
+ const board = !("account" in scope3);
27031
+ const project = board ? void 0 : inbox(scope3.account);
27032
+ if (!board && project === void 0)
27033
+ return [];
27034
+ return database.prepare(TASK_STATS_SQL.rows(board, filter)).all(...project === void 0 ? [] : [project], ...where?.params ?? []).map((row2) => ({
27035
+ group: row2.source_group == null ? null : String(row2.source_group),
27036
+ sourceKind: row2.source_kind == null ? null : String(row2.source_kind),
27037
+ projectId: Number(row2.project_id),
27038
+ state: String(row2.status),
27039
+ createdAt: Number(row2.created_at),
27040
+ closedAt: row2.closed_at == null ? null : Number(row2.closed_at)
27041
+ }));
27042
+ }, "statRows"),
27043
+ statNames: /* @__PURE__ */ __name(async (kind4, ids, account) => {
27044
+ if (ids.length === 0)
27045
+ return /* @__PURE__ */ new Map();
27046
+ let params = [JSON.stringify(ids.map(Number))];
27047
+ if (kind4 === "chat") {
27048
+ if (account === void 0)
27049
+ return /* @__PURE__ */ new Map();
27050
+ const at = account.indexOf(":");
27051
+ params = [account.slice(0, at), account.slice(at + 1), JSON.stringify(ids)];
27052
+ }
27053
+ const rows = database.prepare(TASK_STATS_SQL[kind4]).all(...params);
27054
+ return new Map(rows.filter((row2) => row2.name != null).map((row2) => [String(row2.id), String(row2.name)]));
27055
+ }, "statNames")
27056
+ }), "taskStatsOver");
27057
+
27058
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
26954
27059
  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";
26955
27060
  var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
26956
27061
  const key2 = inboxKey(account);
@@ -27015,6 +27120,7 @@ var taskStoreOver = /* @__PURE__ */ __name((context) => {
27015
27120
  ...workTasksOver(context),
27016
27121
  ...similarity,
27017
27122
  ...taskPairsOver(context, similarity),
27123
+ ...taskStatsOver(context, (account) => inbox(account, false)),
27018
27124
  ...taskCloseOver(context),
27019
27125
  rowOf: /* @__PURE__ */ __name((id2) => taskRowOf(database, id2), "rowOf"),
27020
27126
  categories: /* @__PURE__ */ __name(async () => listOf(), "categories"),
@@ -27156,7 +27262,7 @@ var oneOf3 = /* @__PURE__ */ __name((values, value, column2) => {
27156
27262
  throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
27157
27263
  }, "oneOf");
27158
27264
 
27159
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/accounts.js
27265
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/accounts.js
27160
27266
  var accountAccountsOver = /* @__PURE__ */ __name((context) => {
27161
27267
  const { database } = context;
27162
27268
  const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
@@ -27201,7 +27307,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
27201
27307
  };
27202
27308
  }, "accountsStoreOver");
27203
27309
 
27204
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
27310
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
27205
27311
  var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
27206
27312
  var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
27207
27313
  const message2 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
@@ -27225,7 +27331,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
27225
27331
  })), "keepDownloads");
27226
27332
  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");
27227
27333
 
27228
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/attachments.js
27334
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/attachments.js
27229
27335
  var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
27230
27336
  const { database } = context;
27231
27337
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -27282,7 +27388,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
27282
27388
  }, "keepAttachmentText")
27283
27389
  }), "attachmentsStoreOver");
27284
27390
 
27285
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
27391
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
27286
27392
  var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
27287
27393
  var pointerMover = /* @__PURE__ */ __name((context, type) => {
27288
27394
  const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
@@ -27462,7 +27568,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
27462
27568
  return done;
27463
27569
  }, "rekeyChats");
27464
27570
 
27465
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
27571
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
27466
27572
  var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
27467
27573
  var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
27468
27574
  var CHAT_LIST_KEY = "chat_list_complete";
@@ -27478,23 +27584,49 @@ var chatCompleteness = /* @__PURE__ */ __name(({ database }, accountKey, chatIds
27478
27584
  (SELECT s.updated_at FROM sync_cursors s WHERE s.account_id = c.account_id AND s.key = 'fetched:' || c.external_id)
27479
27585
  AS fetched
27480
27586
  FROM chats c WHERE c.account_id = ? AND c.external_id IN (SELECT value FROM json_each(?))`).all(accountKey, JSON.stringify(chatIds)).map((row2) => {
27481
- const stretches = Number(row2.stretches);
27482
- const reachesStart = Number(row2.start) === 1;
27483
- const upToDate = row2.newest === null ? null : row2.held !== null && Number(row2.held) >= Number(row2.newest);
27484
- const gaps = stretches > 1;
27485
- const fetched = stretches > 0 || reachesStart;
27486
- return {
27487
- chatId: String(row2.chat),
27488
- state: !fetched ? "unknown" : upToDate !== false && !gaps && reachesStart ? "complete" : "partial",
27489
- upToDate,
27490
- gaps,
27491
- reachesStart,
27492
- fetchedAt: toIso(row2.fetched)
27493
- };
27587
+ const facts2 = factsOf(row2);
27588
+ return { chatId: String(row2.chat), ...facts2, fetchedAt: toIso(row2.fetched) };
27494
27589
  });
27495
27590
  }, "chatCompleteness");
27591
+ var factsOf = /* @__PURE__ */ __name((row2) => {
27592
+ const stretches = Number(row2.stretches);
27593
+ const reachesStart = Number(row2.start) === 1;
27594
+ const upToDate = row2.newest === null ? null : row2.held !== null && Number(row2.held) >= Number(row2.newest);
27595
+ const gaps = stretches > 1;
27596
+ const fetched = stretches > 0 || reachesStart;
27597
+ const state = !fetched ? "unknown" : upToDate !== false && !gaps && reachesStart ? "complete" : "partial";
27598
+ return { state, upToDate, gaps, reachesStart };
27599
+ }, "factsOf");
27600
+ var COVERAGE_SQL = `SELECT c.last_message_at AS newest, c.message_count AS messages,
27601
+ (SELECT m.sent_at FROM messages m WHERE m.chat_id = c.id AND m.deleted_at IS NULL
27602
+ ORDER BY m.sent_at DESC LIMIT 1) AS held,
27603
+ (SELECT m.sent_at FROM messages m WHERE m.chat_id = c.id AND m.deleted_at IS NULL
27604
+ ORDER BY m.sent_at ASC LIMIT 1) AS oldest,
27605
+ (SELECT count(*) FROM sync_ranges r WHERE r.chat_id = c.id) AS stretches,
27606
+ EXISTS (SELECT 1 FROM sync_cursors s WHERE s.account_id = c.account_id AND s.key = 'history_start:' || c.external_id
27607
+ AND NOT EXISTS (SELECT 1 FROM sync_ranges r WHERE r.chat_id = c.id AND r.from_key < CAST(s.value AS INTEGER)))
27608
+ AS start,
27609
+ EXISTS (SELECT 1 FROM sync_cursors s WHERE s.account_id = c.account_id
27610
+ AND s.key IN ('history_start:' || c.external_id, 'fetched:' || c.external_id)) AS recorded
27611
+ FROM chats c WHERE c.account_id = ? AND c.searchable = 1`;
27612
+ var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
27613
+ const rows = database.prepare(COVERAGE_SQL).all(accountKey);
27614
+ const coverage = { chats: rows.length, fetched: 0, partial: 0, never: 0, oldestMessageAt: null };
27615
+ let oldest = null;
27616
+ for (const row2 of rows) {
27617
+ if (row2.oldest !== null && (oldest === null || Number(row2.oldest) < oldest))
27618
+ oldest = Number(row2.oldest);
27619
+ if (factsOf(row2).state === "complete")
27620
+ coverage.fetched += 1;
27621
+ else if (Number(row2.stretches) === 0 && Number(row2.recorded) === 0 && Number(row2.messages) === 0)
27622
+ coverage.never += 1;
27623
+ else
27624
+ coverage.partial += 1;
27625
+ }
27626
+ return { ...coverage, oldestMessageAt: toIso(oldest) };
27627
+ }, "chatCoverage");
27496
27628
 
27497
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/chats.js
27629
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/chats.js
27498
27630
  var chatsStoreOver = /* @__PURE__ */ __name((context) => {
27499
27631
  const { database } = context;
27500
27632
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
@@ -27563,6 +27695,10 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
27563
27695
  const accountKey = findAccountPk2(key2);
27564
27696
  return accountKey === void 0 ? [] : chatCompleteness(context, accountKey, chatIds);
27565
27697
  }, "chatCompleteness"),
27698
+ chatCoverage: /* @__PURE__ */ __name(async (key2) => {
27699
+ const accountKey = findAccountPk2(key2);
27700
+ return accountKey === void 0 ? { chats: 0, fetched: 0, partial: 0, never: 0, oldestMessageAt: null } : chatCoverage(context, accountKey);
27701
+ }, "chatCoverage"),
27566
27702
  chatStats: /* @__PURE__ */ __name(async (key2, chatId) => {
27567
27703
  const accountKey = findAccountPk2(key2);
27568
27704
  return accountKey === void 0 ? [] : chatStats(context, accountKey, chatId);
@@ -27625,7 +27761,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
27625
27761
  };
27626
27762
  }, "chatsStoreOver");
27627
27763
 
27628
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
27764
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
27629
27765
  import { createHash as createHash7 } from "node:crypto";
27630
27766
  var BATCH_CONTEXT = 50;
27631
27767
  var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
@@ -27763,7 +27899,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
27763
27899
  var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
27764
27900
  ${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
27765
27901
 
27766
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
27902
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
27767
27903
  import { setTimeout } from "node:timers/promises";
27768
27904
  var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
27769
27905
  var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
@@ -28075,7 +28211,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
28075
28211
  AND NOT EXISTS (SELECT 1 FROM messages d
28076
28212
  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");
28077
28213
 
28078
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/conversations.js
28214
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/conversations.js
28079
28215
  var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
28080
28216
  const { database } = context;
28081
28217
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -28182,7 +28318,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
28182
28318
  };
28183
28319
  }, "conversationsStoreOver");
28184
28320
 
28185
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/counters.js
28321
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/counters.js
28186
28322
  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";
28187
28323
  var accountCountersOver = /* @__PURE__ */ __name((context) => {
28188
28324
  const { database } = context;
@@ -28207,7 +28343,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
28207
28343
  counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
28208
28344
  }), "countersStoreOver");
28209
28345
 
28210
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
28346
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
28211
28347
  var MENTION_STATUSES = ["found", "linked", "dismissed"];
28212
28348
  var MENTION_QUERY = defineQuery({
28213
28349
  entity: "mention",
@@ -28423,7 +28559,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
28423
28559
  return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
28424
28560
  }, "listPlaces");
28425
28561
 
28426
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/mentions.js
28562
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/mentions.js
28427
28563
  var accountMentionsOver = /* @__PURE__ */ __name((context) => {
28428
28564
  const { database } = context;
28429
28565
  const { findAccountPk: findAccountPk2 } = keysOver(context);
@@ -28458,7 +28594,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
28458
28594
  places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
28459
28595
  }), "mentionsStoreOver");
28460
28596
 
28461
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
28597
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
28462
28598
  var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
28463
28599
  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");
28464
28600
  const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
@@ -28473,7 +28609,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
28473
28609
  }));
28474
28610
  }, "documentLinkMessages");
28475
28611
 
28476
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
28612
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
28477
28613
  var stemmerFor = stemmerCache();
28478
28614
  var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
28479
28615
  if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
@@ -28517,7 +28653,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
28517
28653
  });
28518
28654
  }, "laterSharingRare");
28519
28655
 
28520
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/messages.js
28656
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/messages.js
28521
28657
  var accountMessagesOver = /* @__PURE__ */ __name((context) => {
28522
28658
  const { database } = context;
28523
28659
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
@@ -28652,7 +28788,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
28652
28788
  laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
28653
28789
  }), "messagesStoreOver");
28654
28790
 
28655
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
28791
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
28656
28792
  var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
28657
28793
  var iso5 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
28658
28794
  var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: accounts2, limit }) => {
@@ -28709,7 +28845,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database }, uid, { accounts: a
28709
28845
  });
28710
28846
  }, "personPreparation");
28711
28847
 
28712
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
28848
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
28713
28849
  var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
28714
28850
  const id2 = Number(uid);
28715
28851
  if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
@@ -28717,7 +28853,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
28717
28853
  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)));
28718
28854
  }, "personSeenInAccounts");
28719
28855
 
28720
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
28856
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
28721
28857
  var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
28722
28858
  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);
28723
28859
  if (!row2)
@@ -28783,7 +28919,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
28783
28919
  return { id: id2, personId, removed: true };
28784
28920
  }, "removeNote");
28785
28921
 
28786
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/people.js
28922
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/people.js
28787
28923
  var accountPeopleOver = /* @__PURE__ */ __name((context) => {
28788
28924
  const { database } = context;
28789
28925
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
@@ -28868,13 +29004,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
28868
29004
  };
28869
29005
  }, "peopleStoreOver");
28870
29006
 
28871
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
29007
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
28872
29008
  import { createHash as createHash9 } from "node:crypto";
28873
29009
 
28874
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
29010
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
28875
29011
  import { createHash as createHash8 } from "node:crypto";
28876
29012
 
28877
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
29013
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
28878
29014
  var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
28879
29015
  var AUTHOR_MEASURES = [
28880
29016
  "messages",
@@ -29014,7 +29150,7 @@ var withoutUrls = /* @__PURE__ */ __name((text6) => text6.replace(/\S+/gu, (toke
29014
29150
  var rankingWords = /* @__PURE__ */ __name((text6) => withoutUrls(text6).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
29015
29151
  var rankingQuestion = /* @__PURE__ */ __name((text6) => withoutUrls(text6).includes("?"), "rankingQuestion");
29016
29152
 
29017
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
29153
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
29018
29154
  var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
29019
29155
  var exhausted2 = /* @__PURE__ */ __name((budget) => {
29020
29156
  throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
@@ -29236,18 +29372,18 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
29236
29372
  };
29237
29373
  }, "rankReplyGraph");
29238
29374
 
29239
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
29375
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
29240
29376
  var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
29241
29377
  var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
29242
29378
  var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
29243
- var stats = /* @__PURE__ */ __name((delays) => {
29379
+ var delayStats = /* @__PURE__ */ __name((delays) => {
29244
29380
  const sorted2 = delays.toSorted((a, b) => a - b);
29245
29381
  const middle = Math.floor(sorted2.length / 2);
29246
29382
  return {
29247
29383
  medianMilliseconds: sorted2.length ? sorted2.length % 2 ? sorted2[middle] : (sorted2[middle - 1] + sorted2[middle]) / 2 : null,
29248
29384
  p90Milliseconds: sorted2.length ? sorted2[Math.ceil(sorted2.length * 0.9) - 1] : null
29249
29385
  };
29250
- }, "stats");
29386
+ }, "delayStats");
29251
29387
  var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, inspect) => {
29252
29388
  let work = 0;
29253
29389
  const check3 = /* @__PURE__ */ __name(() => {
@@ -29325,7 +29461,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
29325
29461
  account: { provider: person2.provider, account: person2.account },
29326
29462
  questions: eligible.filter((node) => node.account.provider === person2.provider && node.account.account === person2.account).length,
29327
29463
  answered: rows.length,
29328
- ...stats(rows.map((row2) => row2.contribution)),
29464
+ ...delayStats(rows.map((row2) => row2.contribution)),
29329
29465
  status: "observed"
29330
29466
  }, rows);
29331
29467
  }
@@ -29370,7 +29506,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
29370
29506
  pending: end > options.cutoff,
29371
29507
  questions: held.length,
29372
29508
  answered: delays.length,
29373
- ...stats(delays),
29509
+ ...delayStats(delays),
29374
29510
  status: "partial"
29375
29511
  }, contributions);
29376
29512
  }
@@ -29410,7 +29546,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
29410
29546
  return { items, evidence, summary, graph: graph.quality };
29411
29547
  }, "calculateAdminStatistics");
29412
29548
 
29413
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
29549
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
29414
29550
  var rankingContextRange = /* @__PURE__ */ __name((root) => {
29415
29551
  const dates = [];
29416
29552
  const visit = /* @__PURE__ */ __name((node, required3) => {
@@ -29432,7 +29568,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
29432
29568
  return dates[0].node.resolution.date;
29433
29569
  }, "rankingContextRange");
29434
29570
 
29435
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
29571
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
29436
29572
  var reactionCounts = /* @__PURE__ */ __name((stored3) => {
29437
29573
  let counts;
29438
29574
  try {
@@ -29727,7 +29863,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
29727
29863
  });
29728
29864
  }, "rankQuery");
29729
29865
 
29730
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
29866
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
29731
29867
  function fail4(message2, reason = "query.too-large") {
29732
29868
  throw new CliError("validation_error", message2, { reason, complete: false });
29733
29869
  }
@@ -29904,7 +30040,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
29904
30040
  return result;
29905
30041
  }), "adminStatisticsQuery");
29906
30042
 
29907
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
30043
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
29908
30044
  var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
29909
30045
  if (!execution.accounts.length)
29910
30046
  return { conversations: [], chats: [] };
@@ -29922,7 +30058,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
29922
30058
  return { conversations: conversations2, chats: chats2 };
29923
30059
  }, "conversationEligibility");
29924
30060
 
29925
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
30061
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
29926
30062
  import { createHash as createHash10 } from "node:crypto";
29927
30063
  var EVIDENCE_BYTES = 64 * 1024;
29928
30064
  var FINGERPRINT_BYTES = 8 * 1024 * 1024;
@@ -30072,7 +30208,101 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
30072
30208
  return result;
30073
30209
  }, "rankingEvidence");
30074
30210
 
30075
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/queries.js
30211
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
30212
+ var FAR = Number.MAX_SAFE_INTEGER;
30213
+ var chatsIn = /* @__PURE__ */ __name((scope3, kinds2) => {
30214
+ const params = [...scope3.accounts.flatMap(({ provider, account }) => [provider, account]), ...kinds2];
30215
+ const parts2 = [
30216
+ `(${scope3.accounts.map(() => "(ac.provider=? AND ac.external_id=?)").join(" OR ") || "0"})`,
30217
+ `${PEER_KIND} IN (${kinds2.map(() => "?").join(",")})`
30218
+ ];
30219
+ for (const { account, chatId } of scope3.chats) {
30220
+ parts2.push("ac.provider=? AND ac.external_id=? AND c.external_id=?");
30221
+ params.push(account.provider, account.account, chatId);
30222
+ }
30223
+ for (const kind4 of scope3.kinds) {
30224
+ parts2.push(`${PEER_KIND}=?`);
30225
+ params.push(kind4);
30226
+ }
30227
+ if (scope3.chats.length === 0)
30228
+ parts2.push("c.searchable=1");
30229
+ return { sql: parts2.join(" AND "), params };
30230
+ }, "chatsIn");
30231
+ var replyDelaysQuery = /* @__PURE__ */ __name((scope3, who) => {
30232
+ const since = scope3.since ?? -FAR;
30233
+ const until = scope3.until ?? FAR;
30234
+ const chats2 = chatsIn(scope3, ["private"]);
30235
+ return {
30236
+ sql: `WITH scoped AS MATERIALIZED (
30237
+ SELECT c.id AS chat_id, coalesce((
30238
+ SELECT p.sent_at FROM messages p WHERE p.chat_id=c.id AND p.sent_at<? AND p.deleted_at IS NULL
30239
+ AND coalesce(p.outgoing,0)<>(SELECT coalesce(l.outgoing,0) FROM messages l
30240
+ WHERE l.chat_id=c.id AND l.sent_at<? AND l.deleted_at IS NULL ORDER BY l.sent_at DESC LIMIT 1)
30241
+ ORDER BY p.sent_at DESC LIMIT 1), ?) AS since
30242
+ FROM chats c JOIN accounts ac ON ac.id=c.account_id WHERE ${chats2.sql}
30243
+ ), sides AS (
30244
+ SELECT m.chat_id, m.id, m.sent_at, coalesce(m.outgoing,0) AS mine,
30245
+ lag(coalesce(m.outgoing,0)) OVER (PARTITION BY m.chat_id ORDER BY m.sent_at, m.id) AS before
30246
+ FROM scoped s JOIN messages m ON m.chat_id=s.chat_id AND m.sent_at>=s.since AND m.sent_at<=?
30247
+ WHERE m.deleted_at IS NULL
30248
+ ), runs AS (
30249
+ SELECT sent_at, mine, lag(sent_at) OVER (PARTITION BY chat_id ORDER BY sent_at, id) AS asked_at
30250
+ FROM sides WHERE before IS NULL OR before<>mine
30251
+ )
30252
+ SELECT sent_at AS replied_at, sent_at-asked_at AS delay_ms FROM runs
30253
+ WHERE asked_at IS NOT NULL AND mine=? AND sent_at>=? AND sent_at<=?`,
30254
+ params: [since, since, -FAR, ...chats2.params, until, who === "me" ? 1 : 0, since, until]
30255
+ };
30256
+ }, "replyDelaysQuery");
30257
+ var replyDelays = /* @__PURE__ */ __name((context, scope3, who) => {
30258
+ const { sql: sql2, params } = replyDelaysQuery(scope3, who);
30259
+ return read(context.database, () => context.database.prepare(sql2).all(...params).map((row2) => ({ repliedAt: Number(row2.replied_at), delayMs: Number(row2.delay_ms) })));
30260
+ }, "replyDelays");
30261
+ var newestMessagesQuery = /* @__PURE__ */ __name((scope3, now2) => {
30262
+ const chats2 = chatsIn(scope3, ["private", "group"]);
30263
+ return {
30264
+ sql: `SELECT c.id AS chat_id, ${PEER_KIND} AS kind, m.sent_at, coalesce(m.outgoing,0) AS mine, m.text,
30265
+ (EXISTS (SELECT 1 FROM json_each(CASE WHEN json_valid(m.mentions) THEN m.mentions ELSE '[]' END) WHERE value=ac.external_id)
30266
+ OR coalesce(json_extract(CASE WHEN json_valid(m.reply_to) THEN m.reply_to ELSE '{}' END,'$.outgoing'),0)=1
30267
+ 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)
30268
+ ) AS addressed,
30269
+ (SELECT i.username FROM identities i WHERE i.provider=ac.provider AND i.external_id=ac.external_id) AS owner_username,
30270
+ ((coalesce(c.muted,0)=1 AND (c.muted_until IS NULL OR c.muted_until>?)) OR coalesce(c.archived,0)=1)
30271
+ AND coalesce(c.marked_unread,0)=0 AS quiet
30272
+ FROM chats c JOIN accounts ac ON ac.id=c.account_id
30273
+ 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)
30274
+ WHERE ${chats2.sql} AND m.sent_at>=? AND m.sent_at<=?`,
30275
+ params: [now2, ...chats2.params, scope3.since ?? -FAR, scope3.until ?? FAR]
30276
+ };
30277
+ }, "newestMessagesQuery");
30278
+ 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 ?";
30279
+ var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
30280
+ const { sql: sql2, params } = newestMessagesQuery(scope3, context.now());
30281
+ const { database } = context;
30282
+ return read(database, () => {
30283
+ const tail = database.prepare(TAIL_SQL);
30284
+ return database.prepare(sql2).all(...params).map((row2) => ({
30285
+ chatId: Number(row2.chat_id),
30286
+ kind: String(row2.kind),
30287
+ sentAt: Number(row2.sent_at),
30288
+ mine: Number(row2.mine) === 1,
30289
+ text: String(row2.text),
30290
+ addressed: Number(row2.addressed) === 1,
30291
+ ownerUsername: row2.owner_username === null ? null : String(row2.owner_username),
30292
+ quiet: Number(row2.quiet) === 1
30293
+ })).filter(waits).map(({ chatId, kind: kind4 }) => {
30294
+ const unanswered = [];
30295
+ for (const row2 of tail.all(chatId, cap)) {
30296
+ if (Number(row2.mine) === 1)
30297
+ break;
30298
+ unanswered.push(Number(row2.sent_at));
30299
+ }
30300
+ return { kind: kind4, unanswered };
30301
+ });
30302
+ });
30303
+ }, "waitingChats");
30304
+
30305
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/queries.js
30076
30306
  var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
30077
30307
  const mailIndexed = /* @__PURE__ */ __name((execution) => {
30078
30308
  if (execution.corpus === "mail")
@@ -30087,11 +30317,13 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
30087
30317
  conversationEligibility: /* @__PURE__ */ __name(async (execution) => conversationEligibility(context, execution), "conversationEligibility"),
30088
30318
  rankQuery: /* @__PURE__ */ __name(async (execution, request) => rankQuery(context, execution, request), "rankQuery"),
30089
30319
  rankingEvidence: /* @__PURE__ */ __name(async (execution, request) => rankingEvidence(context, execution, request), "rankingEvidence"),
30090
- adminStatisticsQuery: /* @__PURE__ */ __name(async (execution, request) => adminStatisticsQuery(context, execution, request), "adminStatisticsQuery")
30320
+ adminStatisticsQuery: /* @__PURE__ */ __name(async (execution, request) => adminStatisticsQuery(context, execution, request), "adminStatisticsQuery"),
30321
+ replyDelays: /* @__PURE__ */ __name(async (scope3, who) => replyDelays(context, scope3, who), "replyDelays"),
30322
+ waitingChats: /* @__PURE__ */ __name(async (scope3, waits, cap) => waitingChats(context, scope3, waits, cap), "waitingChats")
30091
30323
  };
30092
30324
  }, "queriesStoreOver");
30093
30325
 
30094
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
30326
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
30095
30327
  var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
30096
30328
  const { database, now: now2 } = context;
30097
30329
  const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
@@ -30130,10 +30362,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
30130
30362
  }));
30131
30363
  }, "chatEventsOf");
30132
30364
 
30133
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
30365
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
30134
30366
  import { createHash as createHash11 } from "node:crypto";
30135
30367
 
30136
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/calendar.js
30368
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/calendar.js
30137
30369
  var calendarKey = /* @__PURE__ */ __name((zone, by) => {
30138
30370
  const format = new Intl.DateTimeFormat("en-CA", {
30139
30371
  timeZone: zone,
@@ -30147,8 +30379,13 @@ var calendarKey = /* @__PURE__ */ __name((zone, by) => {
30147
30379
  return `${part.year}-${part.month}-${part.day}${by === "hour" ? `T${part.hour}` : ""}`;
30148
30380
  };
30149
30381
  }, "calendarKey");
30382
+ var weekKey = /* @__PURE__ */ __name((day) => {
30383
+ const date3 = /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
30384
+ date3.setUTCDate(date3.getUTCDate() - (date3.getUTCDay() + 6) % 7);
30385
+ return date3.toISOString().slice(0, 10);
30386
+ }, "weekKey");
30150
30387
 
30151
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/retention.js
30388
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/retention.js
30152
30389
  var RETENTION_TOLERANCE = 864e5;
30153
30390
  var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
30154
30391
  const { since, until, cutoff, checkpoints, within, limit, by } = options;
@@ -30202,13 +30439,8 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
30202
30439
  return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
30203
30440
  }, "retentionCohorts");
30204
30441
 
30205
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
30442
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
30206
30443
  var iso6 = /* @__PURE__ */ __name((at) => new Date(at).toISOString(), "iso");
30207
- var week = /* @__PURE__ */ __name((day) => {
30208
- const date3 = /* @__PURE__ */ new Date(`${day}T00:00:00Z`);
30209
- date3.setUTCDate(date3.getUTCDate() - (date3.getUTCDay() + 6) % 7);
30210
- return date3.toISOString().slice(0, 10);
30211
- }, "week");
30212
30444
  var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
30213
30445
  validateRetentionOptions(options);
30214
30446
  if (options.cutoff > context.now())
@@ -30229,7 +30461,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
30229
30461
  const activityStatement = database.prepare(`SELECT min(sent_at) AS at FROM messages WHERE chat_id=? AND sender_identity_id=? AND deleted_at IS NULL AND sent_at >= ? AND sent_at < ?`);
30230
30462
  const stays = raw.map((row2) => {
30231
30463
  const joinedAt = Number(row2.joined_at), pk = Number(row2.pk), end = joinedAt + options.within;
30232
- const day = dayOf2(joinedAt), cohort = options.by === "week" ? week(day) : day;
30464
+ const day = dayOf2(joinedAt), cohort = options.by === "week" ? weekKey(day) : day;
30233
30465
  const absence = departureStatement.get(chatPk, Math.max(joinedAt, Number(row2.first_seen_at)), options.cutoff, pk);
30234
30466
  const upper = absence ? Number(absence.observed_at) : null;
30235
30467
  const positive = lastPositiveStatement.get(pk, upper ?? options.cutoff + 1);
@@ -30338,7 +30570,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
30338
30570
  };
30339
30571
  }, "retentionQuery");
30340
30572
 
30341
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
30573
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
30342
30574
  var iso7 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
30343
30575
  var marksOf = /* @__PURE__ */ __name(({ isBot, flagged, deleted, hasPhoto }) => ({
30344
30576
  ...isBot === void 0 ? {} : { bot: isBot },
@@ -30469,7 +30701,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
30469
30701
  lastCount: memberCountsOf(context, pk).at(-1) ?? null
30470
30702
  })), "trackedChats");
30471
30703
 
30472
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/roster.js
30704
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/roster.js
30473
30705
  var rosterStoreOver = /* @__PURE__ */ __name((context) => {
30474
30706
  const { database } = context;
30475
30707
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
@@ -30525,7 +30757,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
30525
30757
  };
30526
30758
  }, "rosterStoreOver");
30527
30759
 
30528
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
30760
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
30529
30761
  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");
30530
30762
  var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
30531
30763
  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 ?`);
@@ -30549,7 +30781,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
30549
30781
  }
30550
30782
  }, "backfillNormalized");
30551
30783
 
30552
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
30784
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
30553
30785
  var INDEX2 = "message_words";
30554
30786
  var searchIndexState2 = /* @__PURE__ */ __name((database) => {
30555
30787
  const row2 = indexRow(database, INDEX2);
@@ -30676,7 +30908,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
30676
30908
  });
30677
30909
  }, "resetSearchIndex");
30678
30910
 
30679
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
30911
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
30680
30912
  var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
30681
30913
  const filled2 = { stemmed: 0, drained: 0 };
30682
30914
  const before2 = stemsState(database);
@@ -30771,7 +31003,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
30771
31003
  return resetStems(database, { now: now2 });
30772
31004
  }, "followDefaultStemmers");
30773
31005
 
30774
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
31006
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
30775
31007
  var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
30776
31008
  var knownTerms = /* @__PURE__ */ __name(({ database }, terms2) => {
30777
31009
  const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
@@ -30793,7 +31025,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
30793
31025
  });
30794
31026
  }, "termCandidates");
30795
31027
 
30796
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/search-index.js
31028
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/search-index.js
30797
31029
  var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
30798
31030
  const { database } = context;
30799
31031
  const stemmerFor2 = stemmerCache();
@@ -30815,7 +31047,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
30815
31047
  };
30816
31048
  }, "searchIndexStoreOver");
30817
31049
 
30818
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
31050
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
30819
31051
  var HISTORY_KEPT = 1e3;
30820
31052
  var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
30821
31053
  var COLUMNS5 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
@@ -30884,7 +31116,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
30884
31116
  return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
30885
31117
  }, "clearHistory");
30886
31118
 
30887
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/searches.js
31119
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/searches.js
30888
31120
  var searchesStoreOver = /* @__PURE__ */ __name((context) => {
30889
31121
  const { database } = context;
30890
31122
  return {
@@ -30908,7 +31140,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
30908
31140
  };
30909
31141
  }, "searchesStoreOver");
30910
31142
 
30911
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
31143
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
30912
31144
  var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
30913
31145
  var ACTION_OUTCOMES = ["ok", "refused", "failed"];
30914
31146
  var CODE = /^[a-z][a-z0-9_]{0,63}$/;
@@ -30951,7 +31183,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
30951
31183
  };
30952
31184
  }, "agentActionsStoreOver");
30953
31185
 
30954
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
31186
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
30955
31187
  var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
30956
31188
  }) => {
30957
31189
  const { database, now: now2 } = context;
@@ -31010,7 +31242,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
31010
31242
  };
31011
31243
  }, "botUpdateStoreOver");
31012
31244
 
31013
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
31245
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
31014
31246
  var DAY4 = 864e5;
31015
31247
  var accountsOf = /* @__PURE__ */ __name((filter) => {
31016
31248
  if (filter.accountIds !== void 0 && filter.accountId !== void 0)
@@ -31119,7 +31351,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
31119
31351
  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);
31120
31352
  }, "listEvents");
31121
31353
 
31122
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
31354
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
31123
31355
  var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
31124
31356
  var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey: cursorKey2, now: now2 }, refresh) => {
31125
31357
  const unseenBefore = unreferenced(database, "identities");
@@ -31174,7 +31406,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
31174
31406
  return { entries: entryIds.length, events: goneEvents.length };
31175
31407
  }, "forgetCalendarRows");
31176
31408
 
31177
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
31409
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
31178
31410
  var calendarOf = /* @__PURE__ */ __name((row2) => ({
31179
31411
  id: Number(row2.id),
31180
31412
  accountId: Number(row2.account_id),
@@ -31761,7 +31993,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
31761
31993
  };
31762
31994
  }, "eventStoreOver");
31763
31995
 
31764
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
31996
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
31765
31997
  var CATALOG_QUERY = defineQuery({
31766
31998
  entity: "document",
31767
31999
  backend: "sql",
@@ -32003,7 +32235,7 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
32003
32235
  };
32004
32236
  }, "catalogStoreOver");
32005
32237
 
32006
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
32238
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
32007
32239
  var drive = "CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source')='google-drive' ELSE 0 END";
32008
32240
  var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${drive}) THEN
32009
32241
  CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
@@ -32016,7 +32248,7 @@ var contextDocumentTimeKind = `CASE WHEN (${remoteTime}) IS NOT NULL
32016
32248
  THEN 'source-modified' ELSE 'stored-update' END`;
32017
32249
  var contextDocumentUrl = `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`;
32018
32250
 
32019
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
32251
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
32020
32252
  var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
32021
32253
  const { source: source2, words: words3, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
32022
32254
  signal?.throwIfAborted();
@@ -32115,7 +32347,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
32115
32347
  });
32116
32348
  }, "readMeetingContextEvidence");
32117
32349
 
32118
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
32350
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
32119
32351
  var corpora = {
32120
32352
  message: {
32121
32353
  table: "messages",
@@ -32354,7 +32586,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
32354
32586
  }
32355
32587
  }), "contextRecordsOver");
32356
32588
 
32357
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
32589
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
32358
32590
  var NOTE_FIELDS = [
32359
32591
  "text",
32360
32592
  "exact",
@@ -32784,7 +33016,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
32784
33016
  };
32785
33017
  }, "noteSearchOver");
32786
33018
 
32787
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
33019
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
32788
33020
  var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
32789
33021
  var inEventAccounts = /* @__PURE__ */ __name((event) => searchableCopy(event, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
32790
33022
  var EVENT_CORPUS = {
@@ -32916,7 +33148,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
32916
33148
  };
32917
33149
  }, "eventSearchOver");
32918
33150
 
32919
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
33151
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
32920
33152
  var refuse2 = /* @__PURE__ */ __name((message2, reason, code = "validation_error") => {
32921
33153
  throw new CliError(code, message2, { reason });
32922
33154
  }, "refuse");
@@ -33351,7 +33583,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
33351
33583
  };
33352
33584
  }, "financeStoreOver");
33353
33585
 
33354
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
33586
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
33355
33587
  var refuse3 = /* @__PURE__ */ __name((message2, reason) => {
33356
33588
  throw new CliError("validation_error", message2, { reason });
33357
33589
  }, "refuse");
@@ -33429,7 +33661,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
33429
33661
  };
33430
33662
  }, "paymentEntriesOver");
33431
33663
 
33432
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
33664
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
33433
33665
  var EVIDENCE_FINDINGS_KIND = "evidence_findings";
33434
33666
  var reference = /* @__PURE__ */ __name((raw) => {
33435
33667
  if (/^(document|note):[1-9]\d*$/.test(raw))
@@ -33455,7 +33687,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
33455
33687
  return valid;
33456
33688
  }, "validateEvidenceFindings");
33457
33689
 
33458
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/moment.js
33690
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/moment.js
33459
33691
  var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false } = {}) => {
33460
33692
  try {
33461
33693
  return zonedMoment(wanted, timezoneOf(zone), { start: 0, end: wanted.length }, { end });
@@ -33467,7 +33699,7 @@ var calendarMoment = /* @__PURE__ */ __name((wanted, flag6, { zone, end = false
33467
33699
  }
33468
33700
  }, "calendarMoment");
33469
33701
 
33470
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
33702
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
33471
33703
  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";
33472
33704
  var iso9 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
33473
33705
  var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
@@ -33649,7 +33881,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
33649
33881
  };
33650
33882
  }, "factsStoreOver");
33651
33883
 
33652
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
33884
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
33653
33885
  var invalid4 = /* @__PURE__ */ __name((message2) => {
33654
33886
  throw new CliError("validation_error", message2);
33655
33887
  }, "invalid");
@@ -33751,10 +33983,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind4) => {
33751
33983
  return { snapshot: snapshot2, snapshotParts, previous, outcomes, create };
33752
33984
  }, "findingsCoreOver");
33753
33985
 
33754
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
33755
- var MAIL_FINDINGS_KIND = "mail_findings";
33756
-
33757
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
33986
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
33758
33987
  var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
33759
33988
  var PROPOSAL_VERDICTS = ["useful", "not_useful"];
33760
33989
  var iso10 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
@@ -33868,38 +34097,43 @@ var proposalOperationsOver = /* @__PURE__ */ __name((context) => {
33868
34097
  }, "judge")
33869
34098
  };
33870
34099
  }, "proposalOperationsOver");
34100
+ var DEDICATED_REVIEW = {
34101
+ [MEETING_FINDINGS_KIND]: { what: "meeting findings", reason: "meeting-findings.dedicated-review" },
34102
+ [EVIDENCE_FINDINGS_KIND]: { what: "evidence findings", reason: "evidence-findings.dedicated-review" },
34103
+ [MAIL_FINDINGS_KIND]: { what: "mail findings", reason: "mail-findings.dedicated-review" }
34104
+ };
34105
+ var assertGenericAction = /* @__PURE__ */ __name((kind4) => {
34106
+ const dedicated = DEDICATED_REVIEW[kind4];
34107
+ if (dedicated)
34108
+ throw new CliError("validation_error", `review ${dedicated.what} through the dedicated findings command`, {
34109
+ reason: dedicated.reason
34110
+ });
34111
+ }, "assertGenericAction");
33871
34112
  var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
33872
34113
  const operations = proposalOperationsOver(context);
33873
34114
  const generic = /* @__PURE__ */ __name((id2) => {
33874
- const kind4 = operations.get(id2).kind;
33875
- if (kind4 === MEETING_FINDINGS_KIND)
33876
- throw new CliError("validation_error", "review meeting findings through the dedicated findings command", {
33877
- reason: "meeting-findings.dedicated-review"
33878
- });
33879
- if (kind4 === EVIDENCE_FINDINGS_KIND)
33880
- throw new CliError("validation_error", "review evidence findings through the dedicated findings command", {
33881
- reason: "evidence-findings.dedicated-review"
33882
- });
34115
+ const { kind: kind4 } = operations.get(id2);
34116
+ assertGenericAction(kind4);
34117
+ return kind4;
33883
34118
  }, "generic");
33884
34119
  return {
33885
34120
  propose: /* @__PURE__ */ __name(async (input) => {
33886
- if (input.kind === MEETING_FINDINGS_KIND)
33887
- throw new CliError("validation_error", "stage meeting findings through the dedicated findings command");
33888
- if (input.kind === EVIDENCE_FINDINGS_KIND)
33889
- throw new CliError("validation_error", "stage evidence findings through the dedicated findings command");
34121
+ const dedicated = DEDICATED_REVIEW[input.kind];
34122
+ if (dedicated)
34123
+ throw new CliError("validation_error", `stage ${dedicated.what} through the dedicated findings command`);
33890
34124
  return operations.propose(input);
33891
34125
  }, "propose"),
33892
34126
  get: /* @__PURE__ */ __name(async (id2) => operations.get(id2), "get"),
33893
34127
  pending: /* @__PURE__ */ __name(async (options) => operations.pending(options), "pending"),
33894
34128
  list: /* @__PURE__ */ __name(async (options) => operations.list(options), "list"),
33895
34129
  approve: /* @__PURE__ */ __name(async (id2, by, result) => {
33896
- generic(id2);
33897
- assertMayDecide({ id: id2, proposedBy: operations.proposer(id2) }, by, context.decisions);
34130
+ const kind4 = generic(id2);
34131
+ assertMayDecide({ id: id2, kind: kind4, proposedBy: operations.proposer(id2) }, by, context.decisions);
33898
34132
  return operations.approve(id2, result, deciderAuthor(by));
33899
34133
  }, "approve"),
33900
34134
  reject: /* @__PURE__ */ __name(async (id2, by, reason) => {
33901
- generic(id2);
33902
- assertMayDecide({ id: id2, proposedBy: operations.proposer(id2) }, by, context.decisions);
34135
+ const kind4 = generic(id2);
34136
+ assertMayDecide({ id: id2, kind: kind4, proposedBy: operations.proposer(id2) }, by, context.decisions);
33903
34137
  return operations.reject(id2, deciderAuthor(by), reason?.trim() ? { reason: reason.trim() } : void 0);
33904
34138
  }, "reject"),
33905
34139
  executed: /* @__PURE__ */ __name(async (id2, result) => {
@@ -33914,7 +34148,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
33914
34148
  };
33915
34149
  }, "proposedActionsStoreOver");
33916
34150
 
33917
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
34151
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
33918
34152
  var stale = /* @__PURE__ */ __name(() => {
33919
34153
  throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
33920
34154
  reason: "evidence-findings.stale"
@@ -34095,7 +34329,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
34095
34329
  };
34096
34330
  }, "evidenceFindingsStoreOver");
34097
34331
 
34098
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
34332
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
34099
34333
  var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
34100
34334
  var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
34101
34335
  rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
@@ -34148,7 +34382,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
34148
34382
  }, "forPerson")
34149
34383
  }), "involvementStoreOver");
34150
34384
 
34151
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
34385
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
34152
34386
  import { createHash as createHash12 } from "node:crypto";
34153
34387
  var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
34154
34388
  var id = /* @__PURE__ */ __name((value) => {
@@ -34234,7 +34468,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
34234
34468
  };
34235
34469
  }, "meetingProjectsStoreOver");
34236
34470
 
34237
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
34471
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
34238
34472
  var relationOf = /* @__PURE__ */ __name((link3) => ({
34239
34473
  id: link3.id,
34240
34474
  from: link3.from,
@@ -34460,16 +34694,16 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
34460
34694
  provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
34461
34695
  }, "decidedOrigin");
34462
34696
 
34463
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
34697
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
34464
34698
  import { createHash as createHash15 } from "node:crypto";
34465
34699
 
34466
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
34700
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
34467
34701
  import { createHash as createHash14 } from "node:crypto";
34468
34702
 
34469
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
34703
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
34470
34704
  import { createHash as createHash13 } from "node:crypto";
34471
34705
 
34472
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
34706
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
34473
34707
  var consolidationId = /* @__PURE__ */ __name((value, field4) => {
34474
34708
  if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
34475
34709
  throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
@@ -34520,7 +34754,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
34520
34754
  return input;
34521
34755
  }, "consolidationApplyInput");
34522
34756
 
34523
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
34757
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
34524
34758
  var receiptOf = /* @__PURE__ */ __name((row2) => ({
34525
34759
  id: String(row2.id),
34526
34760
  sourceId: String(row2.source_id),
@@ -34595,7 +34829,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
34595
34829
  }, { beforeCommit: check3 });
34596
34830
  }, "applyTagConsolidation");
34597
34831
 
34598
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
34832
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
34599
34833
  var selections = [
34600
34834
  ["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
34601
34835
  ["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
@@ -34739,7 +34973,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
34739
34973
  };
34740
34974
  }, "previewRows");
34741
34975
 
34742
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
34976
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
34743
34977
  var kinds = ["project", "tag", "topic"];
34744
34978
  var cancelled2 = /* @__PURE__ */ __name((signal) => {
34745
34979
  if (signal?.aborted)
@@ -35003,7 +35237,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
35003
35237
  };
35004
35238
  }, "vocabularyStoreOver");
35005
35239
 
35006
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
35240
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
35007
35241
  var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
35008
35242
  var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
35009
35243
  var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
@@ -35560,7 +35794,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
35560
35794
  return key2.padEnd(3, "X");
35561
35795
  }, "projectKey");
35562
35796
 
35563
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
35797
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
35564
35798
  var DAY5 = 864e5;
35565
35799
  var SETTING4 = "logs_pruned_at";
35566
35800
  var LOG_RETENTION = { agentActionsMs: 90 * DAY5, botUpdatePayloadsMs: 30 * DAY5 };
@@ -35587,7 +35821,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
35587
35821
  };
35588
35822
  }, "logPruner");
35589
35823
 
35590
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/mail/findings.js
35824
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/mail/findings.js
35591
35825
  var MAIL_FINDINGS_PER_RUN = 30;
35592
35826
  var MAIL_FINDINGS_PER_SENDER = 5;
35593
35827
  var invalid6 = /* @__PURE__ */ __name((message2) => {
@@ -35713,7 +35947,7 @@ var validateMailFindings = /* @__PURE__ */ __name((input) => {
35713
35947
  }, "validateMailFindings");
35714
35948
  var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
35715
35949
 
35716
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
35950
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
35717
35951
  var stale2 = /* @__PURE__ */ __name(() => {
35718
35952
  throw new CliError("validation_error", "mail findings cite mail that changed since it was read; stage a new batch", {
35719
35953
  reason: "mail-findings.stale"
@@ -35963,7 +36197,7 @@ ${evidence.join("\n")}`, agent);
35963
36197
  return invalid7("accept only unique IDs shown in this batch");
35964
36198
  if (decision.by === void 0)
35965
36199
  return invalid7("a findings review names who decides: the owner");
35966
- assertMayDecide({ id: id2, proposedBy: proposals.proposer(id2), ownerOnly: true }, decision.by, context.decisions);
36200
+ assertMayDecide({ id: id2, kind: MAIL_FINDINGS_KIND, proposedBy: proposals.proposer(id2) }, decision.by, context.decisions);
35967
36201
  const accepted = [...decision.accept].sort();
35968
36202
  if (batch.receipt) {
35969
36203
  if (JSON.stringify(batch.receipt.accepted) !== JSON.stringify(accepted))
@@ -36003,7 +36237,7 @@ ${evidence.join("\n")}`, agent);
36003
36237
  };
36004
36238
  }, "mailFindingsStoreOver");
36005
36239
 
36006
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
36240
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
36007
36241
  var stale3 = /* @__PURE__ */ __name(() => {
36008
36242
  throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
36009
36243
  reason: "meeting-findings.stale"
@@ -36150,7 +36384,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
36150
36384
  const accepted = [...decision.accept].sort();
36151
36385
  if (decision.by === void 0)
36152
36386
  return invalid8("a findings review names who decides: the owner or an agent");
36153
- assertMayDecide({ id: id2, proposedBy: proposals.proposer(id2) }, decision.by, context.decisions);
36387
+ assertMayDecide({ id: id2, kind: MEETING_FINDINGS_KIND, proposedBy: proposals.proposer(id2) }, decision.by, context.decisions);
36154
36388
  if (batch.receipt) {
36155
36389
  if (JSON.stringify(batch.receipt.accepted) !== JSON.stringify(accepted))
36156
36390
  return invalid8("this findings batch was already reviewed with a different decision");
@@ -36171,7 +36405,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
36171
36405
  };
36172
36406
  }, "meetingFindingsStoreOver");
36173
36407
 
36174
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
36408
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
36175
36409
  var RANK_BATCH = 512;
36176
36410
  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";
36177
36411
  var limitOf = /* @__PURE__ */ __name((value, name, max = 1e3) => {
@@ -36442,7 +36676,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
36442
36676
  }
36443
36677
  }), "meetingVectorsOver");
36444
36678
 
36445
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
36679
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
36446
36680
  var OTHER_SOURCES = ["document", "note", "email"];
36447
36681
  var TEXTS = {
36448
36682
  document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
@@ -36543,11 +36777,11 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
36543
36777
  };
36544
36778
  }, "sourceMentionStoreOver");
36545
36779
 
36546
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
36780
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
36547
36781
  import { mkdirSync, statSync, writeFileSync } from "node:fs";
36548
36782
  import { dirname } from "node:path";
36549
36783
 
36550
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
36784
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
36551
36785
  import { readFileSync as readFileSync3 } from "node:fs";
36552
36786
  var CLIENTS_SETTING = "clients";
36553
36787
  var coreVersion = (() => {
@@ -36605,7 +36839,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
36605
36839
  return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
36606
36840
  }, "refusalAdvice");
36607
36841
 
36608
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
36842
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
36609
36843
  var GENERATED = [
36610
36844
  {
36611
36845
  "name": "20261010184427_initial",
@@ -37572,7 +37806,7 @@ WHERE json_type(params, '$.selection') = 'object';`
37572
37806
  }
37573
37807
  ];
37574
37808
 
37575
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
37809
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
37576
37810
  var MANIFEST = [
37577
37811
  { name: "20261010184427_initial", version: 1, minCompatible: 1 },
37578
37812
  { name: "20261011035353_version-2-facts", version: 2, minCompatible: 1 },
@@ -37660,7 +37894,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
37660
37894
  return migrations;
37661
37895
  }, "generatedMigrations");
37662
37896
 
37663
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/migrations.js
37897
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/migrations.js
37664
37898
  var MIGRATIONS = generatedMigrations();
37665
37899
  var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
37666
37900
  version INTEGER PRIMARY KEY,
@@ -37713,7 +37947,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
37713
37947
  }
37714
37948
  }, "migrate");
37715
37949
 
37716
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
37950
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
37717
37951
  var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
37718
37952
  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 ?");
37719
37953
  if (pending.get(0, 1) === void 0)
@@ -37735,7 +37969,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
37735
37969
  }
37736
37970
  }, "fillJoinKeys");
37737
37971
 
37738
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
37972
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
37739
37973
  var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
37740
37974
  refuseOwnerStoreInTests(path);
37741
37975
  const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
@@ -37749,8 +37983,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
37749
37983
  }, "openSqlite");
37750
37984
  var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
37751
37985
  quietSqliteWarning();
37752
- const { drizzle } = await import("./node-YU5JBNAA.js");
37753
- const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-3C6PSBIW.js");
37986
+ const { drizzle } = await import("./node-VOB45ES2.js");
37987
+ const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-TSX6XQY2.js");
37754
37988
  const client = await nodeClient(path, { readOnly });
37755
37989
  try {
37756
37990
  return { database: cacheOverNodeSqlite(client), orm: drizzle({ client }) };
@@ -37760,8 +37994,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
37760
37994
  }
37761
37995
  }, "openUnderNode");
37762
37996
  var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
37763
- const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-MNZICITP.js");
37764
- const { drizzle } = await import("./bun-CDFBNTKV.js");
37997
+ const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-T7Y3JFFD.js");
37998
+ const { drizzle } = await import("./bun-WTBGGCUC.js");
37765
37999
  const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
37766
38000
  try {
37767
38001
  return { database: cacheOverBunSqlite(client), orm: drizzle({ client }) };
@@ -37771,7 +38005,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
37771
38005
  }
37772
38006
  }, "openUnderBun");
37773
38007
 
37774
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
38008
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
37775
38009
  var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
37776
38010
  var paymentOf = /* @__PURE__ */ __name((metadata3) => {
37777
38011
  try {
@@ -37839,7 +38073,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
37839
38073
  });
37840
38074
  }, "movePaymentFacts");
37841
38075
 
37842
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
38076
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
37843
38077
  var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
37844
38078
  const ours = MIGRATIONS.at(-1)?.version ?? 0;
37845
38079
  if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
@@ -37854,7 +38088,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
37854
38088
  throw new CliError("configuration_error", `The store requires schema ${minCompatible}, but this tool supports ${ours}; ${refusalAdvice(storeClients(database), command, version)}`);
37855
38089
  }, "assertReadCompatible");
37856
38090
 
37857
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
38091
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
37858
38092
  var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
37859
38093
  var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
37860
38094
  if (provenance2?.startsWith("rule:"))
@@ -37900,7 +38134,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
37900
38134
  });
37901
38135
  }, "moveSuggestedLinks");
37902
38136
 
37903
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
38137
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
37904
38138
  var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
37905
38139
  var TEST_PROVIDER = "chat";
37906
38140
  var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
@@ -37921,7 +38155,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
37921
38155
  }
37922
38156
  }, "purgeTestAccounts");
37923
38157
 
37924
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
38158
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
37925
38159
  var BACKFILL_ON_OPEN = 5e3;
37926
38160
  var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
37927
38161
  var createWritable = /* @__PURE__ */ __name((file) => {
@@ -37986,13 +38220,13 @@ var openStoreContext = /* @__PURE__ */ __name(async ({ path, env, now: now2 = Da
37986
38220
  }
37987
38221
  }, "openStoreContext");
37988
38222
 
37989
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
38223
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
37990
38224
  import { createHash as createHash17 } from "node:crypto";
37991
38225
 
37992
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
38226
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
37993
38227
  import { createHash as createHash16 } from "node:crypto";
37994
38228
 
37995
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
38229
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
37996
38230
  var text4 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
37997
38231
  var ref = text4(2048);
37998
38232
  var timestamp2 = pipe(number(), safeInteger(), minValue(0));
@@ -38058,7 +38292,7 @@ var projectAnnotationsSchema = strictObject({
38058
38292
  }))
38059
38293
  });
38060
38294
 
38061
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
38295
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
38062
38296
  var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
38063
38297
  var invalid9 = /* @__PURE__ */ __name((field4) => {
38064
38298
  throw new CliError("validation_error", `invalid project annotations.${field4}`);
@@ -38191,7 +38425,7 @@ var projectAnnotationsFingerprint = /* @__PURE__ */ __name((json3) => {
38191
38425
  return createHash16("sha256").update(JSON.stringify(normalized)).digest("hex");
38192
38426
  }, "projectAnnotationsFingerprint");
38193
38427
 
38194
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
38428
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
38195
38429
  var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
38196
38430
  var ref2 = pipe(string(), minLength(1), maxLength(2048));
38197
38431
  var targetSchema = strictObject({
@@ -38298,7 +38532,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
38298
38532
  }, "planBoundProjectAnnotations");
38299
38533
  var planProjectAnnotations = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotations(json3), projectAnnotationsFingerprint(json3), target, bindings), "planProjectAnnotations");
38300
38534
 
38301
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
38535
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
38302
38536
  import { createHash as createHash18 } from "node:crypto";
38303
38537
  var text5 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
38304
38538
  var timestamp3 = pipe(number(), safeInteger(), minValue(0));
@@ -38392,7 +38626,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
38392
38626
  })).digest("hex");
38393
38627
  }, "projectAnnotationSnapshotFingerprint");
38394
38628
 
38395
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
38629
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
38396
38630
  var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
38397
38631
  if (!request || typeof request !== "object" || Array.isArray(request))
38398
38632
  throw new CliError("validation_error", "project annotation request is required");
@@ -38409,7 +38643,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
38409
38643
  return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
38410
38644
  }, "projectAnnotationRequest");
38411
38645
 
38412
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
38646
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
38413
38647
  var SnapshotBudget = class {
38414
38648
  static {
38415
38649
  __name(this, "SnapshotBudget");
@@ -38435,13 +38669,13 @@ var SnapshotBudget = class {
38435
38669
  }
38436
38670
  };
38437
38671
 
38438
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
38672
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
38439
38673
  import { createHash as createHash20 } from "node:crypto";
38440
38674
 
38441
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
38675
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
38442
38676
  var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
38443
38677
 
38444
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
38678
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
38445
38679
  import { createHash as createHash19 } from "node:crypto";
38446
38680
  var invalid11 = /* @__PURE__ */ __name(() => {
38447
38681
  throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
@@ -38584,7 +38818,7 @@ var ProjectSnapshotSources = class {
38584
38818
  }
38585
38819
  };
38586
38820
 
38587
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
38821
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
38588
38822
  var unsupported = /* @__PURE__ */ __name(() => {
38589
38823
  throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
38590
38824
  }, "unsupported");
@@ -38755,7 +38989,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
38755
38989
  return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
38756
38990
  }), "projectAnnotationSnapshot");
38757
38991
 
38758
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
38992
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
38759
38993
  var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
38760
38994
  const current = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
38761
38995
  const sources = new ProjectSnapshotSources(database, budget);
@@ -38817,7 +39051,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
38817
39051
  };
38818
39052
  }), "previewAnnotationSnapshot");
38819
39053
 
38820
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
39054
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
38821
39055
  var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, snapshot2, bindings) => {
38822
39056
  const mappings = { ...bindings };
38823
39057
  const resolve = /* @__PURE__ */ __name((ref3) => {
@@ -38859,7 +39093,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
38859
39093
  return mappings;
38860
39094
  }, "restoreAnnotationRecords");
38861
39095
 
38862
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
39096
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
38863
39097
  var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
38864
39098
  async preview(request) {
38865
39099
  const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
@@ -38889,7 +39123,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
38889
39123
  }
38890
39124
  }), "projectAnnotationStoreOver");
38891
39125
 
38892
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/domain/records.js
39126
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/domain/records.js
38893
39127
  import { createHash as createHash21 } from "node:crypto";
38894
39128
  var RECORDS_SCHEMA_VERSION = 1;
38895
39129
  var RECORD_OPERATIONS = ["upsert", "delete"];
@@ -39084,7 +39318,7 @@ var recordFingerprint = /* @__PURE__ */ __name((fields4, relations) => createHas
39084
39318
  relations: relations.map((relation) => [relation.role, relation.type, relation.external_id]).sort((a, b) => a.join("\0").localeCompare(b.join("\0")))
39085
39319
  }))).digest("hex"), "recordFingerprint");
39086
39320
 
39087
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
39321
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
39088
39322
  var PROJECTED = {
39089
39323
  invoice: { roles: ["issuer", "counterparty", "project"], many: [] },
39090
39324
  payment: { roles: ["payer", "payee", "project", "settles"], many: ["settles"] }
@@ -39424,7 +39658,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
39424
39658
  };
39425
39659
  }, "recordStoreOver");
39426
39660
 
39427
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
39661
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
39428
39662
  var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
39429
39663
  const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
39430
39664
  let merged = { from: from2, to };
@@ -39437,7 +39671,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
39437
39671
  }, "markRange");
39438
39672
  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");
39439
39673
 
39440
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
39674
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
39441
39675
  var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
39442
39676
  var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
39443
39677
  chatId: String(row2.key).slice(prefix.length),
@@ -39458,7 +39692,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
39458
39692
  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);
39459
39693
  }, "setTaskAnalysisMark");
39460
39694
 
39461
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
39695
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
39462
39696
  var keyOf4 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
39463
39697
  var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
39464
39698
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf4(account));
@@ -39468,7 +39702,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
39468
39702
  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);
39469
39703
  }, "setTaskRulesStop");
39470
39704
 
39471
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sync.js
39705
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sync.js
39472
39706
  var syncStoreOver = /* @__PURE__ */ __name((context) => {
39473
39707
  const { database } = context;
39474
39708
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
@@ -39527,7 +39761,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
39527
39761
  };
39528
39762
  }, "syncStoreOver");
39529
39763
 
39530
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/tags.js
39764
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/tags.js
39531
39765
  var tagsStoreOver = /* @__PURE__ */ __name((context) => {
39532
39766
  const { database } = context;
39533
39767
  return {
@@ -39549,7 +39783,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
39549
39783
  };
39550
39784
  }, "tagsStoreOver");
39551
39785
 
39552
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
39786
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
39553
39787
  var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
39554
39788
  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
39555
39789
  WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
@@ -39676,7 +39910,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
39676
39910
  dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
39677
39911
  }, "savePictureChunks");
39678
39912
 
39679
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
39913
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
39680
39914
  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,
39681
39915
  EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
39682
39916
  FROM messages m
@@ -39765,7 +39999,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
39765
39999
  return plain2(best(found2));
39766
40000
  }, "nearestMessages");
39767
40001
 
39768
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/vectors.js
40002
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/vectors.js
39769
40003
  var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
39770
40004
  const { database } = context;
39771
40005
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -40023,7 +40257,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
40023
40257
  embeddedHashes: /* @__PURE__ */ __name(async (model, hashes) => embeddedHashes(context, model, hashes), "embeddedHashes")
40024
40258
  }), "vectorsStoreOver");
40025
40259
 
40026
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
40260
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
40027
40261
  import { existsSync, readFileSync as readFileSync4 } from "node:fs";
40028
40262
  import { dirname as dirname2, join as join2 } from "node:path";
40029
40263
  var BOOKKEEPING = ["schema_migrations", "store_settings"];
@@ -40111,10 +40345,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
40111
40345
  }
40112
40346
  }, "lastBackup");
40113
40347
 
40114
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/providers.js
40348
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/providers.js
40115
40349
  var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
40116
40350
 
40117
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
40351
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
40118
40352
  var COUNTED_TABLES = [
40119
40353
  "accounts",
40120
40354
  "chats",
@@ -40199,7 +40433,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
40199
40433
  };
40200
40434
  }, "storeContents");
40201
40435
 
40202
- // node_modules/.pnpm/@wirecat+cli-core@0.561.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ef328e5cd047e3c19bb2231542618c08/node_modules/@wirecat/cli-core/dist/store/store.js
40436
+ // node_modules/.pnpm/@wirecat+cli-core@0.565.0_@wirecat+cli-base@0.75.2_commander@15.0.0_esbuild@0.28.2_type_ff8e334310c9524b6cc272472a342b2f/node_modules/@wirecat/cli-core/dist/store/store.js
40203
40437
  var openStore = /* @__PURE__ */ __name(async (options = {}) => {
40204
40438
  const context = await openStoreContext(options);
40205
40439
  try {
@@ -40509,9 +40743,13 @@ export {
40509
40743
  DEFAULT_AGENT_CLOSE,
40510
40744
  certaintyOf,
40511
40745
  savedAgentClose,
40746
+ MAIL_FINDINGS_KIND,
40747
+ TASK_CLOSE_KIND,
40512
40748
  DEFAULT_DECISION_POLICY,
40749
+ isOwnerOnlyKind,
40513
40750
  mayDecide,
40514
40751
  assertMayDecide,
40752
+ deciderAuthor,
40515
40753
  syncFile,
40516
40754
  IMPORTED_DOCUMENT_QUERY,
40517
40755
  DEFAULT_FIRST_PASS_PER_CHAT,
@@ -40519,6 +40757,7 @@ export {
40519
40757
  savedFirstPassPerChat,
40520
40758
  TASK_SORTS,
40521
40759
  PROJECT_TASK_FIELDS,
40760
+ withoutField,
40522
40761
  TASK_RELATION_KINDS,
40523
40762
  TASK_ROLES,
40524
40763
  TASK_EVENT_KINDS,
@@ -40533,6 +40772,8 @@ export {
40533
40772
  AUTHOR_MEASURES,
40534
40773
  rankingOptions,
40535
40774
  RANKING_TOKENIZER_VERSION,
40775
+ rankingQuestion,
40776
+ delayStats,
40536
40777
  rankingContextRange,
40537
40778
  calendarKey,
40538
40779
  pendingNormalization,
@@ -40548,9 +40789,9 @@ export {
40548
40789
  EVIDENCE_FINDINGS_KIND,
40549
40790
  validateEvidenceFindings,
40550
40791
  calendarMoment,
40551
- MAIL_FINDINGS_KIND,
40552
40792
  PROPOSAL_STATUSES,
40553
40793
  proposerOfAction,
40794
+ assertGenericAction,
40554
40795
  involvementStoreOver,
40555
40796
  ORGANIZATION_KINDS,
40556
40797
  PROJECT_TYPES,