@wirecat/notion-cli 0.6.0 → 0.7.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 (186) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/bin/notion.js +2 -2
  3. package/dist/bundle/agent-AILW4JPO.js +42 -0
  4. package/dist/bundle/{all-profiles-AELHUTFU.js → all-profiles-CKOACXTW.js} +11 -11
  5. package/dist/bundle/{anthropic-3CCYAGO3.js → anthropic-DWBBVTU3.js} +5 -5
  6. package/dist/bundle/{app-server-DJ6P4NY4.js → app-server-BHFYNCDE.js} +72 -72
  7. package/dist/bundle/{bun-2FLR4IV4.js → bun-ICK2XT7J.js} +2 -2
  8. package/dist/bundle/{bun-sqlite-QB6CU6TH.js → bun-sqlite-LU5V5Y4A.js} +6 -6
  9. package/dist/bundle/{chunk-4RFR4J2O.js → chunk-2OZVCNU5.js} +2 -2
  10. package/dist/bundle/{chunk-6EJCI47L.js → chunk-2RNJ2JP3.js} +4 -4
  11. package/dist/bundle/{chunk-F5ZAN7OC.js → chunk-364ET7LV.js} +1 -1
  12. package/dist/bundle/{chunk-WAGADES3.js → chunk-3AKMIKND.js} +17 -17
  13. package/dist/bundle/{chunk-HVXOA4FO.js → chunk-3DGHBXH2.js} +1 -1
  14. package/dist/bundle/{chunk-VH7526NL.js → chunk-3KOJNZH3.js} +3 -3
  15. package/dist/bundle/{chunk-T37TAXVL.js → chunk-3T3OAYL4.js} +2 -2
  16. package/dist/bundle/{chunk-XYQVVW4R.js → chunk-3YXYA6HB.js} +1 -1
  17. package/dist/bundle/{chunk-3MYN2RMG.js → chunk-3ZSUVFR7.js} +8 -8
  18. package/dist/bundle/{chunk-STTO2MSY.js → chunk-46JBCXLI.js} +6 -6
  19. package/dist/bundle/{chunk-HM6AMYHR.js → chunk-4FHKSSXQ.js} +2 -2
  20. package/dist/bundle/{chunk-RD7BKTWV.js → chunk-5NFIUY2P.js} +4 -4
  21. package/dist/bundle/{chunk-3UX4VJWD.js → chunk-63SW4UXG.js} +3 -4
  22. package/dist/bundle/{chunk-2XUV7HNE.js → chunk-64IK7JFO.js} +2 -2
  23. package/dist/bundle/{chunk-2Z7UOXFC.js → chunk-6MQSBWWF.js} +1 -1
  24. package/dist/bundle/{chunk-SAPP2LEH.js → chunk-6UZ5D2WP.js} +7 -7
  25. package/dist/bundle/{chunk-CL3YNUCC.js → chunk-7COTHS6G.js} +6 -6
  26. package/dist/bundle/{chunk-3LMW7U7F.js → chunk-A3RJ6FD5.js} +21 -8
  27. package/dist/bundle/{chunk-ZDYEOE7L.js → chunk-ADCAWRRX.js} +48 -48
  28. package/dist/bundle/{chunk-IJVTN5L3.js → chunk-ALAPDLCP.js} +2 -2
  29. package/dist/bundle/{chunk-DGMTSDKB.js → chunk-B6DJQBZI.js} +5 -5
  30. package/dist/bundle/{chunk-BAXNAOOL.js → chunk-BFCRGLOF.js} +3 -3
  31. package/dist/bundle/{chunk-YYQ5GKAI.js → chunk-BFHPT67P.js} +655 -565
  32. package/dist/bundle/{chunk-6YOMPW7Y.js → chunk-BQ6CXCLP.js} +8 -8
  33. package/dist/bundle/{chunk-BEV5LO4D.js → chunk-BXXHUO7Y.js} +13 -13
  34. package/dist/bundle/{chunk-W2VQDIU5.js → chunk-DCSPCOPB.js} +9 -9
  35. package/dist/bundle/{chunk-KB35BVTG.js → chunk-EMIJVLOA.js} +2 -2
  36. package/dist/bundle/{chunk-FMMYBVCH.js → chunk-EUF5JNPG.js} +1 -1
  37. package/dist/bundle/{chunk-Q7EIL6VU.js → chunk-EWXMIKZN.js} +28 -28
  38. package/dist/bundle/{chunk-LC6WE6JS.js → chunk-FHYV4VWY.js} +14 -7
  39. package/dist/bundle/{chunk-GPRJXJC7.js → chunk-FNESLLZS.js} +15 -1
  40. package/dist/bundle/{chunk-JFSVAOA7.js → chunk-FO3XY2Y2.js} +2 -2
  41. package/dist/bundle/{chunk-7L2XOKDZ.js → chunk-HJDQTM3T.js} +8 -8
  42. package/dist/bundle/{chunk-FV4WTZCU.js → chunk-HOO53OYK.js} +16 -16
  43. package/dist/bundle/{chunk-T6XIBULH.js → chunk-HSVKU4OJ.js} +45 -31
  44. package/dist/bundle/{chunk-OEQNP56V.js → chunk-IEY7KS6Q.js} +1 -1
  45. package/dist/bundle/{chunk-QGGRFRMP.js → chunk-ITW26OBI.js} +38 -38
  46. package/dist/bundle/{chunk-IURYZSG3.js → chunk-ITWINZ6R.js} +12 -12
  47. package/dist/bundle/{chunk-WAU5LSHP.js → chunk-IYZWHCZJ.js} +90 -11
  48. package/dist/bundle/{chunk-YUDVRFXN.js → chunk-J3DZVB67.js} +1 -1
  49. package/dist/bundle/{chunk-GCAJW4SR.js → chunk-JEZJFQQW.js} +1 -1
  50. package/dist/bundle/{chunk-AE4VW4NB.js → chunk-JPGN473W.js} +3 -3
  51. package/dist/bundle/{chunk-NSR43UEW.js → chunk-JVRBW5LH.js} +5 -5
  52. package/dist/bundle/{chunk-DIU2QJJF.js → chunk-KBY42GKW.js} +23 -23
  53. package/dist/bundle/{chunk-WGZH2M64.js → chunk-KWBLDSRV.js} +16 -3
  54. package/dist/bundle/{chunk-P27NDZQR.js → chunk-LBRTLZHI.js} +171 -157
  55. package/dist/bundle/{chunk-WB2KSQIP.js → chunk-LEPPRULN.js} +20 -6
  56. package/dist/bundle/{chunk-ERN53B3Z.js → chunk-LVAFTQ45.js} +18 -18
  57. package/dist/bundle/{chunk-PHKED7AG.js → chunk-MB4HXDBT.js} +5 -5
  58. package/dist/bundle/{chunk-BQBC2WIG.js → chunk-N3NJPHZB.js} +1 -1
  59. package/dist/bundle/{chunk-DHVVXQEL.js → chunk-NCCRLAAI.js} +3 -3
  60. package/dist/bundle/{chunk-HOVHE3A3.js → chunk-NV7NNL5T.js} +7 -7
  61. package/dist/bundle/{chunk-TFT4FVRU.js → chunk-OALFRUMI.js} +2 -2
  62. package/dist/bundle/{chunk-CFQQTDSA.js → chunk-OCGNOJYD.js} +1 -1
  63. package/dist/bundle/{chunk-2CMLY2X3.js → chunk-OFMCU3BH.js} +5 -5
  64. package/dist/bundle/{chunk-FRB2L7OE.js → chunk-OP2BH55P.js} +3 -3
  65. package/dist/bundle/{chunk-7JVKQ6NM.js → chunk-OS4WPXPZ.js} +4 -4
  66. package/dist/bundle/{chunk-ESZHGC4Q.js → chunk-OW5HW3TD.js} +6 -6
  67. package/dist/bundle/{chunk-5OJLUUOJ.js → chunk-PDVXG3T3.js} +6 -6
  68. package/dist/bundle/{chunk-4VXXOJ2F.js → chunk-PSMRUOII.js} +3 -3
  69. package/dist/bundle/{chunk-EHW45LLT.js → chunk-QK52ARAU.js} +3 -3
  70. package/dist/bundle/{chunk-AZLDR36U.js → chunk-QMNEDK7Z.js} +3 -3
  71. package/dist/bundle/{chunk-RXU5T5NM.js → chunk-R4JV3VLU.js} +12 -12
  72. package/dist/bundle/{chunk-5XPHFV7H.js → chunk-REOBWSGV.js} +8 -8
  73. package/dist/bundle/{chunk-LECMHK2F.js → chunk-RNVYNPXT.js} +1 -1
  74. package/dist/bundle/{chunk-JVESLS7B.js → chunk-RXGX2CZX.js} +63 -63
  75. package/dist/bundle/{chunk-KNCPBX5P.js → chunk-S35UJBFZ.js} +19 -19
  76. package/dist/bundle/{chunk-LQVDFD65.js → chunk-S5P7THM5.js} +2 -2
  77. package/dist/bundle/{chunk-A42T4YX7.js → chunk-SRVTGI3M.js} +2 -2
  78. package/dist/bundle/{chunk-CHPWBQUK.js → chunk-TWY543BS.js} +1 -1
  79. package/dist/bundle/{chunk-EZMG5QXB.js → chunk-UO4O6WQ4.js} +8 -8
  80. package/dist/bundle/{chunk-KGAUINBO.js → chunk-UQVUXG7H.js} +10 -10
  81. package/dist/bundle/{chunk-GUIQJUJV.js → chunk-UYEDQGMI.js} +6 -6
  82. package/dist/bundle/{chunk-AV2ZJ4WX.js → chunk-VRBEYOJL.js} +1 -1
  83. package/dist/bundle/{chunk-YDDI4QIT.js → chunk-VXKD533R.js} +575 -447
  84. package/dist/bundle/{chunk-KZJQPJK5.js → chunk-VYZ2J7DT.js} +4 -4
  85. package/dist/bundle/{chunk-G4ZU73SD.js → chunk-WJFQMOVM.js} +75 -60
  86. package/dist/bundle/{chunk-YXYZAWWW.js → chunk-WUNEJRLJ.js} +6 -6
  87. package/dist/bundle/{chunk-HHEWTLAT.js → chunk-X5LUHN62.js} +2 -2
  88. package/dist/bundle/{chunk-UOC52GCB.js → chunk-X737FHZP.js} +4 -4
  89. package/dist/bundle/{chunk-K5IC4FZN.js → chunk-YSF5JBRA.js} +1 -1
  90. package/dist/bundle/{chunk-SEAGUFBX.js → chunk-ZGUUP2T3.js} +12 -12
  91. package/dist/bundle/{chunk-QEJFBORC.js → chunk-ZMKAI3F3.js} +3 -3
  92. package/dist/bundle/command-contract-C2CF4QAH.js +41 -0
  93. package/dist/bundle/{command-server-entry-VUR6WL77.js → command-server-entry-F3B2KSPO.js} +29 -29
  94. package/dist/bundle/{decode-I64PF2RM.js → decode-FDHFF7GC.js} +5 -5
  95. package/dist/bundle/{dispatch-JQBAZWCL.js → dispatch-IXKG5Z5Y.js} +8 -8
  96. package/dist/bundle/{echarts-YRRVLEX3.js → echarts-PGJPVPA4.js} +2 -2
  97. package/dist/bundle/{embed-BLXLKMK2.js → embed-U6X7CNNK.js} +6 -6
  98. package/dist/bundle/{embedder-JYGF6R7I.js → embedder-3ROL6ROQ.js} +9 -9
  99. package/dist/bundle/{failure-I6AAF5R5.js → failure-IYMRXM2X.js} +2 -2
  100. package/dist/bundle/{first-run-YLDOZGY6.js → first-run-PNVNHGR7.js} +12 -12
  101. package/dist/bundle/first-screen-DEDD64YH.js +41 -0
  102. package/dist/bundle/{instructions-AG7SRWTR.js → instructions-MJQWRI2D.js} +1 -1
  103. package/dist/bundle/{mcp-YGOAUNC3.js → mcp-JNHOSK4L.js} +2 -2
  104. package/dist/bundle/meeting-combined-HEC25QPY.js +25 -0
  105. package/dist/bundle/meeting-model-R7QPDNZZ.js +27 -0
  106. package/dist/bundle/{meeting-semantic-3DZPHM7L.js → meeting-semantic-7WPLMBNT.js} +6 -6
  107. package/dist/bundle/{node-GJQYN4FT.js → node-3UXNV3CD.js} +2 -2
  108. package/dist/bundle/{node-sqlite-7VXIRQPH.js → node-sqlite-ULWDWM3I.js} +7 -7
  109. package/dist/bundle/notes-search-7PE3E3C7.js +64 -0
  110. package/dist/bundle/notion.js +13 -13
  111. package/dist/bundle/{oauth-N67CH2TK.js → oauth-LNUZMA72.js} +7 -7
  112. package/dist/bundle/{open-JGXVHIKO.js → open-HGHC35M4.js} +5 -5
  113. package/dist/bundle/{openai-PFQJTF4H.js → openai-ISSP57MV.js} +18 -18
  114. package/dist/bundle/{process-MEKCZMX3.js → process-PB2WCOR2.js} +1 -1
  115. package/dist/bundle/{program-DUJYLJH5.js → program-GASBJRMG.js} +1987 -1245
  116. package/dist/bundle/{prompt-FW44QDHD.js → prompt-3VGQVX2B.js} +5 -5
  117. package/dist/bundle/{recognize-62TDQ6A7.js → recognize-7Q2P3NME.js} +4 -4
  118. package/dist/bundle/{remote-7ONFD7GG.js → remote-BBAWKVIT.js} +11 -11
  119. package/dist/bundle/{rerank-YOHQQJS4.js → rerank-H4PUS4HV.js} +7 -7
  120. package/dist/bundle/{schemas-IIGJ7DOP.js → schemas-TTVUADHT.js} +1 -1
  121. package/dist/bundle/{serve-ZCXGT5RB.js → serve-FZNSKY7R.js} +9 -9
  122. package/dist/bundle/{server-RQ74M637.js → server-BRRNDW6L.js} +64 -64
  123. package/dist/bundle/server-CQJ4LKAZ.js +90 -0
  124. package/dist/bundle/{services-FWBRZ57M.js → services-PEU557KZ.js} +51 -51
  125. package/dist/bundle/{sqlite-runtime-ZZBNGV5L.js → sqlite-runtime-4IZJ4YUM.js} +6 -6
  126. package/dist/bundle/{state-GDDFO62Y.js → state-MX3JVT5Q.js} +6 -6
  127. package/dist/bundle/{store-D2LRIWEI.js → store-JUT34REM.js} +23 -23
  128. package/dist/bundle/{store-KQCLR57N.js → store-PP4BPADZ.js} +21 -21
  129. package/dist/bundle/store-maintenance-command-GRFTJBSB.js +77 -0
  130. package/dist/bundle/surface-FPWES3NY.js +76 -0
  131. package/dist/commands/api.d.ts.map +1 -1
  132. package/dist/commands/api.js +3 -25
  133. package/dist/commands/api.js.map +1 -1
  134. package/dist/commands/library.d.ts.map +1 -1
  135. package/dist/commands/library.js +8 -6
  136. package/dist/commands/library.js.map +1 -1
  137. package/dist/context.d.ts +11 -3
  138. package/dist/context.d.ts.map +1 -1
  139. package/dist/context.js +20 -7
  140. package/dist/context.js.map +1 -1
  141. package/dist/generated/wirecat-config.d.ts +13 -0
  142. package/dist/generated/wirecat-config.d.ts.map +1 -0
  143. package/dist/generated/wirecat-config.js +82 -0
  144. package/dist/generated/wirecat-config.js.map +1 -0
  145. package/dist/library.d.ts +0 -5
  146. package/dist/library.d.ts.map +1 -1
  147. package/dist/library.js +0 -13
  148. package/dist/library.js.map +1 -1
  149. package/dist/notion/client.d.ts +2 -6
  150. package/dist/notion/client.d.ts.map +1 -1
  151. package/dist/notion/client.js +7 -8
  152. package/dist/notion/client.js.map +1 -1
  153. package/dist/notion/errors.d.ts +5 -0
  154. package/dist/notion/errors.d.ts.map +1 -1
  155. package/dist/notion/errors.js +21 -1
  156. package/dist/notion/errors.js.map +1 -1
  157. package/dist/notion/port.d.ts +10 -0
  158. package/dist/notion/port.d.ts.map +1 -1
  159. package/dist/notion/port.js +19 -0
  160. package/dist/notion/port.js.map +1 -1
  161. package/dist/sync/files.d.ts +3 -3
  162. package/dist/sync/files.d.ts.map +1 -1
  163. package/dist/sync/from-config.d.ts +13 -0
  164. package/dist/sync/from-config.d.ts.map +1 -0
  165. package/dist/sync/from-config.js +32 -0
  166. package/dist/sync/from-config.js.map +1 -0
  167. package/dist/sync/source.d.ts +2 -1
  168. package/dist/sync/source.d.ts.map +1 -1
  169. package/dist/sync/source.js +4 -20
  170. package/dist/sync/source.js.map +1 -1
  171. package/dist/sync/users.d.ts +1 -11
  172. package/dist/sync/users.d.ts.map +1 -1
  173. package/dist/sync/users.js +0 -33
  174. package/dist/sync/users.js.map +1 -1
  175. package/dist/version.d.ts +1 -1
  176. package/dist/version.js +1 -1
  177. package/package.json +7 -7
  178. package/dist/bundle/agent-ILG6AH7S.js +0 -42
  179. package/dist/bundle/command-contract-L2FASWD6.js +0 -41
  180. package/dist/bundle/first-screen-GZH3LMLZ.js +0 -41
  181. package/dist/bundle/meeting-combined-OFQSGKBG.js +0 -25
  182. package/dist/bundle/meeting-model-K6NSX3O5.js +0 -27
  183. package/dist/bundle/notes-search-ACDOPTNH.js +0 -64
  184. package/dist/bundle/server-XMZF57WM.js +0 -90
  185. package/dist/bundle/store-maintenance-command-CK2MU5M6.js +0 -77
  186. package/dist/bundle/surface-K4TPIQW7.js +0 -76
@@ -3,7 +3,7 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  calendarMoment,
5
5
  dayIn
6
- } from "./chunk-VH7526NL.js";
6
+ } from "./chunk-3KOJNZH3.js";
7
7
  import {
8
8
  BUSINESS_KINDS,
9
9
  CATALOG_KINDS,
@@ -99,11 +99,11 @@ import {
99
99
  transactionLine,
100
100
  usableLinkSql,
101
101
  walletLine
102
- } from "./chunk-DIU2QJJF.js";
102
+ } from "./chunk-KBY42GKW.js";
103
103
  import {
104
104
  holdsCredential,
105
105
  secretNamed
106
- } from "./chunk-BQBC2WIG.js";
106
+ } from "./chunk-N3NJPHZB.js";
107
107
  import {
108
108
  compileAutomaton,
109
109
  foldName,
@@ -112,7 +112,7 @@ import {
112
112
  oneLine,
113
113
  trigrams,
114
114
  wildcardPattern
115
- } from "./chunk-KGAUINBO.js";
115
+ } from "./chunk-UQVUXG7H.js";
116
116
  import {
117
117
  DEFAULT_STEMMERS,
118
118
  DEFAULT_STEMMERS_VERSION,
@@ -123,7 +123,7 @@ import {
123
123
  analyzerIdentity,
124
124
  createStemmer,
125
125
  parseStemmers
126
- } from "./chunk-5XPHFV7H.js";
126
+ } from "./chunk-REOBWSGV.js";
127
127
  import {
128
128
  ACCOUNT_GROUPS,
129
129
  ADDED_ACCOUNT,
@@ -154,10 +154,10 @@ import {
154
154
  runEvent,
155
155
  unitedKinds,
156
156
  useStoredProviders
157
- } from "./chunk-BEV5LO4D.js";
157
+ } from "./chunk-BXXHUO7Y.js";
158
158
  import {
159
159
  sqliteCode
160
- } from "./chunk-LQVDFD65.js";
160
+ } from "./chunk-S5P7THM5.js";
161
161
  import {
162
162
  PRESENCE,
163
163
  QUERY_LIMITS,
@@ -168,17 +168,18 @@ import {
168
168
  parseBytes,
169
169
  plainQuery,
170
170
  searchError,
171
+ sqliteLimit,
171
172
  tooWideTerm
172
- } from "./chunk-LC6WE6JS.js";
173
+ } from "./chunk-FHYV4VWY.js";
173
174
  import {
174
175
  NORMALIZER_VERSION,
175
176
  fold,
176
177
  normalize
177
- } from "./chunk-2Z7UOXFC.js";
178
+ } from "./chunk-6MQSBWWF.js";
178
179
  import {
179
180
  normalizeTag,
180
181
  tagOf
181
- } from "./chunk-T37TAXVL.js";
182
+ } from "./chunk-3T3OAYL4.js";
182
183
  import {
183
184
  CHAT_MESSAGES_READ,
184
185
  FACT_TYPES,
@@ -234,27 +235,27 @@ import {
234
235
  validateQuery,
235
236
  walkQuery,
236
237
  zonedMoment
237
- } from "./chunk-JVESLS7B.js";
238
+ } from "./chunk-RXGX2CZX.js";
238
239
  import {
239
240
  DEFAULT_TASK_CATEGORIES,
240
241
  sharedConfigPath,
241
242
  storedTaskCategories,
242
243
  taskCategoriesReader
243
- } from "./chunk-HOVHE3A3.js";
244
+ } from "./chunk-NV7NNL5T.js";
244
245
  import {
245
246
  refuseOwnerStoreInTests,
246
247
  storePath
247
- } from "./chunk-HHEWTLAT.js";
248
+ } from "./chunk-X5LUHN62.js";
248
249
  import {
249
250
  quietSqliteWarning,
250
251
  storeCapable
251
- } from "./chunk-YXYZAWWW.js";
252
+ } from "./chunk-WUNEJRLJ.js";
252
253
  import {
253
254
  PRAGMAS,
254
255
  TIME_LIMIT_FUNCTION,
255
256
  TimeLimitReached,
256
257
  isQueryOnly
257
- } from "./chunk-FMMYBVCH.js";
258
+ } from "./chunk-EUF5JNPG.js";
258
259
  import {
259
260
  array,
260
261
  boolean,
@@ -280,7 +281,7 @@ import {
280
281
  CliError,
281
282
  isCliError,
282
283
  singleLine
283
- } from "./chunk-HM6AMYHR.js";
284
+ } from "./chunk-4FHKSSXQ.js";
284
285
  import {
285
286
  SQLiteTable,
286
287
  TableAliasProxyHandler,
@@ -305,7 +306,7 @@ import {
305
306
  sql,
306
307
  sqliteTable,
307
308
  text
308
- } from "./chunk-F5ZAN7OC.js";
309
+ } from "./chunk-364ET7LV.js";
309
310
  import {
310
311
  __commonJS,
311
312
  __name,
@@ -10049,7 +10050,7 @@ var require_cjs = __commonJS({
10049
10050
  }
10050
10051
  });
10051
10052
 
10052
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/account-store.js
10053
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/account-store.js
10053
10054
  var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
10054
10055
  const methods = whole;
10055
10056
  return Object.fromEntries(Object.keys(keyed).map((name) => [
@@ -10177,7 +10178,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
10177
10178
  };
10178
10179
  }, "bindAccount");
10179
10180
 
10180
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
10181
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
10181
10182
  var IndexBuilderOn = class {
10182
10183
  static {
10183
10184
  __name(this, "IndexBuilderOn");
@@ -10372,7 +10373,7 @@ function alias(table, alias2) {
10372
10373
  }
10373
10374
  __name(alias, "alias");
10374
10375
 
10375
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/record-fields.js
10376
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/record-fields.js
10376
10377
  var DECIMAL_PATTERN = "^[0-9]{1,16}(\\.[0-9]{1,6})?$";
10377
10378
  var SIGNED_DECIMAL = "^-?[0-9]{1,16}(\\.[0-9]{1,6})?$";
10378
10379
  var DAY = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$";
@@ -10491,7 +10492,7 @@ var fieldError = /* @__PURE__ */ __name((schema, value, at2 = []) => {
10491
10492
  return void 0;
10492
10493
  }, "fieldError");
10493
10494
 
10494
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/record-types.js
10495
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/record-types.js
10495
10496
  var kept = /* @__PURE__ */ __name((description) => ({ description }), "kept");
10496
10497
  var PARTY = ["person", "organization"];
10497
10498
  var ORGANIZATION = ["organization"];
@@ -10886,7 +10887,7 @@ var hasV1Roles = /* @__PURE__ */ __name((type) => rolesOf2(type).some(([, role])
10886
10887
  var IDENTITY_TYPES = RECORD_ENTITY_TYPES.filter((type) => RECORD_TYPES[type].review === "identity");
10887
10888
  var article = /* @__PURE__ */ __name((word2) => /^[aeiou]/.test(word2) ? "an" : "a", "article");
10888
10889
 
10889
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
10890
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
10890
10891
  var ENTITY_TABLES = {
10891
10892
  ...RECORD_TABLES,
10892
10893
  account: "accounts",
@@ -10926,7 +10927,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
10926
10927
  return { table, pointer, type, count: count2, known: known2 };
10927
10928
  }).filter(({ count: count2 }) => count2 > 0)), "orphanPointers");
10928
10929
 
10929
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/identity-links.js
10930
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/identity-links.js
10930
10931
  var IDENTITY_LINK_KIND = "identity_link";
10931
10932
  var IDENTITY_LINK_SIGNALS = ["agent", "phone", "email", "guest-email", "name", "account"];
10932
10933
  var LINK_WEAKNESSES = [
@@ -10939,7 +10940,7 @@ var LINK_WEAKNESSES = [
10939
10940
  "not-own-number"
10940
10941
  ];
10941
10942
 
10942
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/merged-persons.js
10943
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/merged-persons.js
10943
10944
  var SEPARATIONS = ["unlink", "split", "undo-merge"];
10944
10945
  var mergeSql = /* @__PURE__ */ __name((event2) => `(${event2}.from_person_id IS NOT NULL AND ${event2}.from_person_id <> ${event2}.to_person_id AND ${event2}.method NOT IN (${SEPARATIONS.map((method) => `'${method}'`).join(", ")}) AND NOT EXISTS (SELECT 1 FROM identity_link_events stay WHERE stay.to_person_id = ${event2}.from_person_id AND stay.identity_id <> ${event2}.identity_id AND stay.id < ${event2}.id AND stay.id = (SELECT max(s.id) FROM identity_link_events s WHERE s.identity_id = stay.identity_id AND s.id < ${event2}.id) AND NOT EXISTS (SELECT 1 FROM identity_link_events went WHERE went.identity_id = stay.identity_id AND went.from_person_id = ${event2}.from_person_id AND went.to_person_id = ${event2}.to_person_id AND went.id = (SELECT min(w.id) FROM identity_link_events w WHERE w.identity_id = stay.identity_id AND w.id > ${event2}.id))))`, "mergeSql");
10945
10946
  var mergedAwaySql = /* @__PURE__ */ __name((person2) => `(${person2}.owner = 0 AND NOT EXISTS (SELECT 1 FROM identity_links ml WHERE ml.person_id = ${person2}.id) AND EXISTS (SELECT 1 FROM identity_link_events me WHERE me.from_person_id = ${person2}.id AND ${mergeSql("me")}))`, "mergedAwaySql");
@@ -10971,7 +10972,7 @@ var samePersons = /* @__PURE__ */ __name((database, pk) => {
10971
10972
  }, "samePersons");
10972
10973
  var idsOf = /* @__PURE__ */ __name((database, type, id2) => JSON.stringify(type === "person" ? samePersons(database, id2) : [id2]), "idsOf");
10973
10974
 
10974
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-link-rows.js
10975
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-link-rows.js
10975
10976
  var pairOf = /* @__PURE__ */ __name((a, b) => [Number(a), Number(b)].sort((x, y) => x - y).join("-"), "pairOf");
10976
10977
  var pkOf = /* @__PURE__ */ __name((database, ref3) => {
10977
10978
  const at2 = ref3.indexOf(":");
@@ -11078,13 +11079,13 @@ var forgetErasedLinks = /* @__PURE__ */ __name((database) => {
11078
11079
  database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
11079
11080
  }, "forgetErasedLinks");
11080
11081
 
11081
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/identity-splits.js
11082
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/identity-splits.js
11082
11083
  var IDENTITY_SPLIT_KIND = "identity_split";
11083
11084
 
11084
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
11085
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
11085
11086
  var MAIL_FINDINGS_KIND = "mail_findings";
11086
11087
 
11087
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/decisions.js
11088
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/decisions.js
11088
11089
  var TASK_CLOSE_KIND = "task_close";
11089
11090
  var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
11090
11091
  var isOwnerOnlyKind = /* @__PURE__ */ __name((kind3) => kind3 === MAIL_FINDINGS_KIND || kind3 === MEETING_FINDINGS_KIND || kind3 === TASK_CLOSE_KIND || kind3 === SOURCE_REVIEW_KIND || kind3 === IDENTITY_LINK_KIND || kind3 === IDENTITY_SPLIT_KIND, "isOwnerOnlyKind");
@@ -11132,7 +11133,7 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
11132
11133
  }, "assertMayDecide");
11133
11134
  var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
11134
11135
 
11135
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/addresses.js
11136
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/addresses.js
11136
11137
  var EMAIL_ADDRESS = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
11137
11138
  var isEmailAddress = /* @__PURE__ */ __name((value) => EMAIL_ADDRESS.test(value), "isEmailAddress");
11138
11139
  var ROLE_ADDRESS_WORDS = {
@@ -11194,7 +11195,7 @@ var PERSON_LIKE = /* @__PURE__ */ new Set(["hr"]);
11194
11195
  var isPersonLikeRoleAddress = /* @__PURE__ */ __name((address) => PERSON_LIKE.has(localWord(address)), "isPersonLikeRoleAddress");
11195
11196
  var isNoReplyAddress = /* @__PURE__ */ __name((address) => NO_REPLY.has(localWord(address)), "isNoReplyAddress");
11196
11197
 
11197
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/mail/score.js
11198
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/mail/score.js
11198
11199
  var import_disposable_email_domains_js = __toESM(require_dist(), 1);
11199
11200
  var import_tldts = __toESM(require_cjs(), 1);
11200
11201
  var FREE_MAIL = /* @__PURE__ */ new Set([
@@ -11224,7 +11225,7 @@ var FREE_MAIL = /* @__PURE__ */ new Set([
11224
11225
  ]);
11225
11226
  var DAY_MS = 24 * 60 * 60 * 1e3;
11226
11227
 
11227
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/address-organization.js
11228
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/address-organization.js
11228
11229
  var BY_ADDRESS = "SELECT DISTINCT o.id FROM organizations o JOIN organization_identities oi ON oi.organization_id = o.id JOIN identities i ON i.id = oi.identity_id WHERE o.deleted_at IS NULL AND i.provider = 'email' AND ";
11229
11230
  var idsOf2 = /* @__PURE__ */ __name((rows) => rows.map((row2) => Number(row2.id)), "idsOf");
11230
11231
  var holdAddress = /* @__PURE__ */ __name(({ database, now: now2 }, organization2, email, { method, author }) => {
@@ -11249,7 +11250,7 @@ var organizationOfAddress = /* @__PURE__ */ __name((context, { name, email, meth
11249
11250
  return id2;
11250
11251
  }, "organizationOfAddress");
11251
11252
 
11252
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
11253
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
11253
11254
  var PHONE_PLANS = [
11254
11255
  {
11255
11256
  country: "us",
@@ -11629,7 +11630,7 @@ var PHONE_PLANS = [
11629
11630
  }
11630
11631
  ];
11631
11632
 
11632
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/phones.js
11633
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/phones.js
11633
11634
  var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
11634
11635
  var DEFAULT_PHONE_COUNTRIES = ["ru"];
11635
11636
  var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
@@ -11704,10 +11705,10 @@ var storedPhone = /* @__PURE__ */ __name((raw, provider) => {
11704
11705
  return found2 ? `+${found2[1]}` : void 0;
11705
11706
  }, "storedPhone");
11706
11707
 
11707
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
11708
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
11708
11709
  import { AsyncLocalStorage } from "node:async_hooks";
11709
11710
 
11710
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/journal.js
11711
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/journal.js
11711
11712
  import { existsSync, statSync } from "node:fs";
11712
11713
  var watched = /* @__PURE__ */ new WeakMap();
11713
11714
  var walInode = /* @__PURE__ */ __name((store) => statSync(`${store}-wal`, { throwIfNoEntry: false })?.ino, "walInode");
@@ -11733,7 +11734,7 @@ var checkJournal = /* @__PURE__ */ __name((database) => {
11733
11734
  throw new CliError("conflict", "the store's journal file was deleted or replaced by another program while this command had the store open, so nothing more is written; `store recover` says what to do", { reason: "store.journal-replaced" });
11734
11735
  }, "checkJournal");
11735
11736
 
11736
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/write-events.js
11737
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/write-events.js
11737
11738
  var WRITE = /^\s*(?:WITH\b[\s\S]*?\)\s*)?(INSERT|REPLACE|UPDATE|DELETE)\b(?:\s+OR\s+[A-Za-z]+)?\s+(?:INTO\s+|FROM\s+)?(?:("?)(\w+)\2\.)?["`[]?(\w+)/i;
11738
11739
  var writeTarget = /* @__PURE__ */ __name((sql2) => {
11739
11740
  const match = WRITE.exec(sql2);
@@ -11813,7 +11814,7 @@ var committedWrites = /* @__PURE__ */ __name((database) => {
11813
11814
  }, "committedWrites");
11814
11815
  var droppedWrites = /* @__PURE__ */ __name((database) => tallies.get(database)?.pending.clear(), "droppedWrites");
11815
11816
 
11816
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
11817
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
11817
11818
  var ARMS = [
11818
11819
  [
11819
11820
  "message",
@@ -11941,7 +11942,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
11941
11942
  return recomputed;
11942
11943
  }, "drainInvolvementQueue");
11943
11944
 
11944
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/mentions.js
11945
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/mentions.js
11945
11946
  import { domainToUnicode } from "node:url";
11946
11947
 
11947
11948
  // node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
@@ -21963,7 +21964,7 @@ var oa = /* @__PURE__ */ __name((e) => {
21963
21964
  }, "oa");
21964
21965
  var na = { parse: O, get: aa, isValid: oa };
21965
21966
 
21966
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
21967
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/google-documents.js
21967
21968
  var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
21968
21969
  var ID = /^[\w-]{10,}$/;
21969
21970
  var trimUrl = /* @__PURE__ */ __name((url) => {
@@ -22005,7 +22006,7 @@ var googleDocumentLinks = /* @__PURE__ */ __name((text9) => [...text9.matchAll(L
22005
22006
  return { url, documentId: googleDocumentId(url) };
22006
22007
  }), "googleDocumentLinks");
22007
22008
 
22008
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/places.js
22009
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/places.js
22009
22010
  var BEFORE = [
22010
22011
  [/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
22011
22012
  [/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
@@ -22265,7 +22266,7 @@ var findPlaces = /* @__PURE__ */ __name((text9) => {
22265
22266
  return found2.sort((a, b) => a.start - b.start);
22266
22267
  }, "findPlaces");
22267
22268
 
22268
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/mentions.js
22269
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/mentions.js
22269
22270
  var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
22270
22271
  var MENTION_VERSIONS = {
22271
22272
  phone: 1,
@@ -22441,7 +22442,7 @@ var exactlyOne = /* @__PURE__ */ __name((text9, options) => {
22441
22442
  return one2 && one2.start === 0 && one2.end === text9.length ? one2.value : void 0;
22442
22443
  }, "exactlyOne");
22443
22444
 
22444
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/first-names.js
22445
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/first-names.js
22445
22446
  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";
22446
22447
  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";
22447
22448
  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";
@@ -22449,7 +22450,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
22449
22450
  var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
22450
22451
  var NAME_WORDS = WORDS.split(" ");
22451
22452
 
22452
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/person-names.js
22453
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/person-names.js
22453
22454
  var LATIN_TO_CYRILLIC = {
22454
22455
  shch: "\u0449",
22455
22456
  sch: "\u0449",
@@ -22657,7 +22658,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text9, stem, taken) => {
22657
22658
  return found2;
22658
22659
  }, "findUnknownNames");
22659
22660
 
22660
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/attachments.js
22661
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/attachments.js
22661
22662
  var NOT_FILES = /* @__PURE__ */ new Set([
22662
22663
  "webpage",
22663
22664
  "share",
@@ -22698,7 +22699,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored4, files2) => {
22698
22699
  });
22699
22700
  }, "matchDownloads");
22700
22701
 
22701
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
22702
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
22702
22703
  var PRESET_VERSION = 1;
22703
22704
  var PRESETS = {
22704
22705
  password: {
@@ -22752,7 +22753,7 @@ var PRESETS = {
22752
22753
  }
22753
22754
  };
22754
22755
 
22755
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
22756
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
22756
22757
  var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
22757
22758
  var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
22758
22759
  var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
@@ -22776,7 +22777,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
22776
22777
  };
22777
22778
  }, "linkMatch");
22778
22779
 
22779
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
22780
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
22780
22781
  var SETTING = "phoneCountries";
22781
22782
  var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
22782
22783
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
@@ -22807,7 +22808,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
22807
22808
  return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
22808
22809
  }, "valueMatch");
22809
22810
 
22810
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
22811
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
22811
22812
  var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
22812
22813
  if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
22813
22814
  throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
@@ -22835,7 +22836,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
22835
22836
  return 2 * intersection2 / (aa2.size + bb.size);
22836
22837
  }, "vocabularySimilarity");
22837
22838
 
22838
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
22839
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
22839
22840
  import { createHash } from "node:crypto";
22840
22841
  var folded2 = /* @__PURE__ */ __name((name) => {
22841
22842
  try {
@@ -22901,7 +22902,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
22901
22902
  });
22902
22903
  }, "guardTagCreation");
22903
22904
 
22904
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
22905
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
22905
22906
  var invalid = /* @__PURE__ */ __name((message3) => {
22906
22907
  throw new CliError("validation_error", message3);
22907
22908
  }, "invalid");
@@ -22978,7 +22979,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
22978
22979
  };
22979
22980
  }, "createTagRedirectIndex");
22980
22981
 
22981
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
22982
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
22982
22983
  var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
22983
22984
  const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
22984
22985
  if (!row2)
@@ -23006,7 +23007,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
23006
23007
  return snapshot2;
23007
23008
  }, "tagRedirectSnapshot");
23008
23009
 
23009
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
23010
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
23010
23011
  import { createHash as createHash2 } from "node:crypto";
23011
23012
  var TASK_KEY_PREFIXES = {
23012
23013
  question: "Q",
@@ -23034,7 +23035,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
23034
23035
  return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
23035
23036
  }, "taskAccountOf");
23036
23037
 
23037
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
23038
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
23038
23039
  var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
23039
23040
  var REFERABLE = {
23040
23041
  ...Object.fromEntries(Object.entries(RECORD_TYPES).map(([type, { tombstone: tombstone2 }]) => [type, { tombstone: tombstone2 }])),
@@ -23198,7 +23199,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
23198
23199
  return row2 ? String(row2.id ?? row2.key) : void 0;
23199
23200
  }, "taskIdOf");
23200
23201
 
23201
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
23202
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
23202
23203
  var toMs = /* @__PURE__ */ __name((iso17) => {
23203
23204
  if (iso17 === null || iso17 === void 0)
23204
23205
  return null;
@@ -23212,7 +23213,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
23212
23213
  var DELIVERY = { delivered: 1, read: 2 };
23213
23214
  var deliveryOf = /* @__PURE__ */ __name((stored4) => stored4 === DELIVERY.read ? "read" : stored4 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
23214
23215
 
23215
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
23216
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
23216
23217
  var TAG_KINDS = ["tag", "topic"];
23217
23218
  var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
23218
23219
  var TAG_TYPE = {
@@ -23415,7 +23416,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
23415
23416
  return result;
23416
23417
  }, "tagsOf");
23417
23418
 
23418
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/trigram-match.js
23419
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/trigram-match.js
23419
23420
  var MOST_YO_SPELLINGS = 64;
23420
23421
  var yoSpellings = /* @__PURE__ */ __name((run) => {
23421
23422
  let spellings2 = [""];
@@ -23437,7 +23438,27 @@ var anyCaseGlob = /* @__PURE__ */ __name((word2) => `*${[...word2.normalize("NFC
23437
23438
  return forms2.size === 1 ? c : `[${[...forms2].join("")}]`;
23438
23439
  }).join("")}*`, "anyCaseGlob");
23439
23440
 
23440
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
23441
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
23442
+ var MESSAGES = {
23443
+ rows: "messages",
23444
+ threads: "chats",
23445
+ words: "message_words",
23446
+ stems: "message_stems",
23447
+ vocab: "message_words_vocab",
23448
+ item: "message",
23449
+ thread: "chat"
23450
+ };
23451
+ var MAIL = {
23452
+ rows: `(SELECT id, account_id, email_thread_id AS chat_id, external_id, deleted_at, from_identity_id AS sender_identity_id,
23453
+ outgoing, read, flagged, coalesce(sent_at, received_at) AS sent_at,
23454
+ coalesce(subject, '') || char(10, 10) || coalesce(body_text, '') AS text FROM emails)`,
23455
+ threads: "(SELECT id, account_id, external_id, subject AS title, 1 AS searchable FROM email_threads)",
23456
+ words: "email_words",
23457
+ stems: "email_stems",
23458
+ vocab: "email_words_vocab",
23459
+ item: "email",
23460
+ thread: "email_thread"
23461
+ };
23441
23462
  var speech = /* @__PURE__ */ __name((alias2) => `(coalesce(${alias2}.extractor,'') LIKE 'speech:%' OR ${alias2}.kind IN ('voice','video_note') OR coalesce(${alias2}.mime,'')='audio/ogg')`, "speech");
23442
23463
  var SPEECH = speech("att");
23443
23464
  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");
@@ -23925,7 +23946,7 @@ var FIELD_COMPILERS = {
23925
23946
  subject
23926
23947
  };
23927
23948
 
23928
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
23949
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
23929
23950
  var placeOf = /* @__PURE__ */ __name((database) => {
23930
23951
  const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
23931
23952
  const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
@@ -23941,7 +23962,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
23941
23962
  };
23942
23963
  }, "placeOf");
23943
23964
 
23944
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
23965
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
23945
23966
  var DRAIN_ON_WRITE = 500;
23946
23967
  var METHOD = "rules";
23947
23968
  var telegramLink = /* @__PURE__ */ __name((database) => {
@@ -24107,7 +24128,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
24107
24128
  return queued.length;
24108
24129
  }, "drainMentions");
24109
24130
 
24110
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
24131
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
24111
24132
  var indexRow = /* @__PURE__ */ __name((database, name) => {
24112
24133
  const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
24113
24134
  if (!exists2)
@@ -24115,7 +24136,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
24115
24136
  return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
24116
24137
  }, "indexRow");
24117
24138
 
24118
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
24139
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
24119
24140
  var INDEX = "message_stems";
24120
24141
  var SETTING2 = "searchStemmers";
24121
24142
  var DRAIN_ON_WRITE2 = 500;
@@ -24241,7 +24262,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
24241
24262
  };
24242
24263
  }, "stemmerCache");
24243
24264
 
24244
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
24265
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
24245
24266
  var rehearsal = new AsyncLocalStorage();
24246
24267
  var SQLITE_BUSY = 5;
24247
24268
  var pause = new Int32Array(new SharedArrayBuffer(4));
@@ -24384,7 +24405,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
24384
24405
  }
24385
24406
  }, "read");
24386
24407
 
24387
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
24408
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
24388
24409
  var FOLDED = [
24389
24410
  { table: "tasks", column: "title" },
24390
24411
  { table: "tasks", column: "close_reason" },
@@ -24421,7 +24442,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
24421
24442
  return filled;
24422
24443
  }, "fillFolded");
24423
24444
 
24424
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
24445
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
24425
24446
  import { createHash as createHash3 } from "node:crypto";
24426
24447
  var CHUNK_CHARS = 1200;
24427
24448
  var CHUNK_OVERLAP = 150;
@@ -24526,7 +24547,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
24526
24547
  return chunks2;
24527
24548
  }, "cutChunks");
24528
24549
 
24529
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/search/task-signature.js
24550
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/search/task-signature.js
24530
24551
  var DAY2 = 864e5;
24531
24552
  var CURRENCY = [
24532
24553
  [/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
@@ -24652,7 +24673,7 @@ var dueDayOf = /* @__PURE__ */ __name((text9, createdMs) => {
24652
24673
  return best?.day ?? null;
24653
24674
  }, "dueDayOf");
24654
24675
 
24655
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
24676
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
24656
24677
  var DAY3 = 864e5;
24657
24678
  var STOP_WORDS = new Set([
24658
24679
  // Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
@@ -24807,7 +24828,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
24807
24828
  ...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
24808
24829
  })).sort((a, b) => b.score - a.score), "rankCandidates");
24809
24830
 
24810
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
24831
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
24811
24832
  var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
24812
24833
  coalesce(CASE k.chunkable_type
24813
24834
  WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
@@ -24901,11 +24922,11 @@ var knn = /* @__PURE__ */ __name((database, index2, filter, query, k) => databas
24901
24922
  BigInt(filter.account),
24902
24923
  ...[filter.chat, filter.since, filter.before].flatMap((value) => value === void 0 ? [] : [BigInt(value)])
24903
24924
  ), "knn");
24904
- var searchIndex = /* @__PURE__ */ __name((database, model, filter, query, limit, survivors) => {
24925
+ var searchIndex = /* @__PURE__ */ __name((database, model, filter, query, limit, survivors, nearestOnly = false) => {
24905
24926
  const index2 = vectorIndexOf(database, model);
24906
24927
  if (!index2?.ready || index2.dims !== query.length)
24907
24928
  return void 0;
24908
- let k = Math.min(MAX_K, Math.max(100, limit * 4));
24929
+ let k = nearestOnly ? MAX_K : Math.min(MAX_K, Math.max(100, limit * 4));
24909
24930
  for (; ; ) {
24910
24931
  const candidates = knn(database, index2, filter, query, k);
24911
24932
  const { results, best } = survivors(candidates);
@@ -24917,7 +24938,7 @@ var searchIndex = /* @__PURE__ */ __name((database, model, filter, query, limit,
24917
24938
  if (best.length >= limit && best.every(nearer))
24918
24939
  return results;
24919
24940
  if (k === MAX_K)
24920
- return void 0;
24941
+ return nearestOnly ? results : void 0;
24921
24942
  k = Math.min(MAX_K, k * 4);
24922
24943
  }
24923
24944
  }, "searchIndex");
@@ -24949,7 +24970,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
24949
24970
  }, "dropUnusedVectors");
24950
24971
  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");
24951
24972
 
24952
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
24973
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
24953
24974
  var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
24954
24975
  r.last_message_id, r.text_start, r.text_end FROM conversations c
24955
24976
  CROSS JOIN chunks k ON k.chunkable_type = 'conversation' AND k.chunkable_id = c.id
@@ -25144,19 +25165,23 @@ var nearestChunks = /* @__PURE__ */ __name((context, accountPk2, filter) => {
25144
25165
  keepBest(best2, row2);
25145
25166
  const results = ranked([...best2.values()]);
25146
25167
  return { results, best: results.map(({ id: id2 }) => id2) };
25147
- });
25168
+ }, chatKey === void 0);
25148
25169
  if (indexed)
25149
25170
  return plain2(indexed);
25150
25171
  if (fromOwner) {
25151
- const ids3 = orm.all(sql`SELECT DISTINCT k.id FROM messages m
25152
- JOIN conversation_messages om ON om.message_id = m.id
25153
- JOIN conversations c ON c.id = om.conversation_id
25154
- JOIN conversation_state s ON s.chat_id = c.chat_id AND s.current_build = c.build
25155
- JOIN chats ch ON ch.id = c.chat_id
25156
- JOIN chunks k ON k.chunkable_type = 'conversation' AND k.chunkable_id = c.id
25157
- JOIN chunk_messages r ON r.chunk_id = k.id AND m.id BETWEEN r.first_message_id AND r.last_message_id
25158
- WHERE m.outgoing = 1 AND ch.account_id = ${accountPk2}
25159
- ${chatKey === void 0 ? sql`AND ch.searchable = 1` : sql`AND c.chat_id = ${chatKey}`}`).map(({ id: id2 }) => id2);
25172
+ const owned = /* @__PURE__ */ __name((byIdentity) => orm.all(sql`SELECT DISTINCT k.id FROM messages m
25173
+ CROSS JOIN conversation_messages om ON om.message_id = m.id
25174
+ CROSS JOIN conversations c ON c.id = om.conversation_id
25175
+ JOIN conversation_state s ON s.chat_id = c.chat_id AND s.current_build = c.build
25176
+ JOIN chats ch ON ch.id = c.chat_id
25177
+ CROSS JOIN chunks k ON k.chunkable_type = 'conversation' AND k.chunkable_id = c.id
25178
+ CROSS JOIN chunk_messages r ON r.chunk_id = k.id AND m.id BETWEEN r.first_message_id AND r.last_message_id
25179
+ WHERE m.outgoing = 1 AND ch.account_id = ${accountPk2}
25180
+ ${byIdentity ? sql`AND m.sender_identity_id IN (SELECT i.id FROM identities i JOIN accounts a
25181
+ ON a.provider = i.provider AND a.external_id = i.external_id WHERE a.id = ${accountPk2})` : sql``}
25182
+ ${chatKey === void 0 ? sql`AND ch.searchable = 1` : sql`AND c.chat_id = ${chatKey}`}`).map(({ id: id2 }) => id2), "owned");
25183
+ const found2 = owned(true);
25184
+ const ids3 = found2.length ? found2 : owned(false);
25160
25185
  const best2 = /* @__PURE__ */ new Map();
25161
25186
  for (const row2 of rows({ ids: ids3 }))
25162
25187
  keepBest(best2, row2);
@@ -25294,7 +25319,7 @@ var vectorCounts = /* @__PURE__ */ __name(({ orm }, models) => new Map(models.ma
25294
25319
  Number(orm.get(sql`SELECT count(*) AS n FROM embeddings WHERE model = ${model}`)?.n ?? 0)
25295
25320
  ])), "vectorCounts");
25296
25321
 
25297
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
25322
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
25298
25323
  var DOCUMENT_PICTURE = "document_picture";
25299
25324
  var SCAN_PAGE2 = 5e3;
25300
25325
  var idOf = /* @__PURE__ */ __name((ref3) => {
@@ -25357,12 +25382,12 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
25357
25382
  }, "nearestPictures")
25358
25383
  }), "documentPicturesOver");
25359
25384
 
25360
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/index-text.js
25385
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/index-text.js
25361
25386
  var noteIndexText = /* @__PURE__ */ __name((title2, text9) => title2 ? `${title2}
25362
25387
 
25363
25388
  ${text9}` : text9, "noteIndexText");
25364
25389
 
25365
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/enrichments.js
25390
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/enrichments.js
25366
25391
  var ENRICHMENT_SUBJECTS = ["document", "note", "email"];
25367
25392
  var ENRICHMENT_POSITION = 1e6;
25368
25393
  var EMAIL_ENRICHMENT = "email_enrichment";
@@ -25456,7 +25481,7 @@ var enrichmentsOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
25456
25481
  }), "clear")
25457
25482
  }), "enrichmentsOver");
25458
25483
 
25459
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
25484
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
25460
25485
  var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
25461
25486
  const literal4 = escaped2 ?? plain2 ?? "";
25462
25487
  return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
@@ -25532,7 +25557,7 @@ var compile = /* @__PURE__ */ __name((node, columns2, options) => {
25532
25557
  var queryFilter = /* @__PURE__ */ __name((ast, columns2, options) => compile(ast.root, columns2, options), "queryFilter");
25533
25558
  var bound2 = /* @__PURE__ */ __name(({ sql: text9, params }) => sql.join(text9.split("?").map((part2, at2) => at2 < params.length ? sql`${sql.raw(part2)}${params[at2]}` : sql.raw(part2)), sql``), "bound");
25534
25559
 
25535
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
25560
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
25536
25561
  var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
25537
25562
  var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
25538
25563
  var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
@@ -25622,7 +25647,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
25622
25647
  });
25623
25648
  }, "linkMeeting");
25624
25649
 
25625
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-titles.js
25650
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/task-titles.js
25626
25651
  var MAX_TITLE = 120;
25627
25652
  var placeholderTitleOf = /* @__PURE__ */ __name((row2) => `${String(row2.type)} \u2014 ${String(row2.source_locator ?? "")}`, "placeholderTitleOf");
25628
25653
  var PLACEHOLDER_TITLE_SQL = "title = type || ' \u2014 ' || coalesce(source_locator, '')";
@@ -25684,7 +25709,7 @@ var fillFoundTaskTitles = /* @__PURE__ */ __name((database, warn, { batch = 500
25684
25709
  }
25685
25710
  }, "fillFoundTaskTitles");
25686
25711
 
25687
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
25712
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
25688
25713
  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), ''))";
25689
25714
  var UNSEARCHED_EVENT_TYPES = [
25690
25715
  "working-location",
@@ -25931,7 +25956,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
25931
25956
  return true;
25932
25957
  }, "resetNoteIndex");
25933
25958
 
25934
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
25959
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
25935
25960
  var keyOf2 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
25936
25961
  var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
25937
25962
  for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf2))) {
@@ -25950,7 +25975,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
25950
25975
  }
25951
25976
  }, "resolvePersonLinks");
25952
25977
 
25953
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
25978
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
25954
25979
  var canonicalTags = sqliteTable("canonical_tags", {
25955
25980
  id: integer("id").primaryKey(),
25956
25981
  name: text("name").notNull().unique(),
@@ -25959,7 +25984,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
25959
25984
  updatedAt: integer("updated_at").notNull()
25960
25985
  });
25961
25986
 
25962
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/link-revisions.js
25987
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/link-revisions.js
25963
25988
  var linkRevisions = sqliteTable("link_revisions", {
25964
25989
  id: integer("id").primaryKey(),
25965
25990
  linkId: integer("link_id").notNull(),
@@ -25971,7 +25996,7 @@ var linkRevisions = sqliteTable("link_revisions", {
25971
25996
  createdAt: integer("created_at").notNull()
25972
25997
  }, (table) => [index("link_revisions_by_link_id_created_at").on(table.linkId, table.createdAt)]);
25973
25998
 
25974
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
25999
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
25975
26000
  var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
25976
26001
  sourceKey: text("source_key").notNull(),
25977
26002
  collection: text("collection").notNull(),
@@ -25981,13 +26006,13 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
25981
26006
  createdAt: integer("created_at").notNull()
25982
26007
  }, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
25983
26008
 
25984
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
26009
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
25985
26010
  var documentIndexPending = sqliteTable("document_index_pending", {
25986
26011
  id: integer("id").notNull(),
25987
26012
  indexableType: text("indexable_type").notNull()
25988
26013
  }, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
25989
26014
 
25990
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/decision-requests.js
26015
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/decision-requests.js
25991
26016
  var decisionRequests = sqliteTable("decision_requests", {
25992
26017
  id: integer("id").primaryKey(),
25993
26018
  tokenDigest: text("token_digest").notNull().unique(),
@@ -26007,7 +26032,7 @@ var decisionRequests = sqliteTable("decision_requests", {
26007
26032
  index("decision_requests_by_channel_bot_profile_chat_id_message_id").on(table.channel, table.botProfile, table.chatId, table.messageId)
26008
26033
  ]);
26009
26034
 
26010
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/enrichments.js
26035
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/enrichments.js
26011
26036
  var enrichments = sqliteTable("enrichments", {
26012
26037
  subjectType: text("subject_type").notNull(),
26013
26038
  subjectId: integer("subject_id").notNull(),
@@ -26019,7 +26044,7 @@ var enrichments = sqliteTable("enrichments", {
26019
26044
  createdAt: integer("created_at").notNull()
26020
26045
  }, (table) => [primaryKey({ columns: [table.subjectType, table.subjectId] })]);
26021
26046
 
26022
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/templates.js
26047
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/templates.js
26023
26048
  var templates = sqliteTable("templates", {
26024
26049
  key: text("key").notNull(),
26025
26050
  channel: text("channel").notNull(),
@@ -26041,7 +26066,7 @@ var templatesHistory = sqliteTable("templates_history", {
26041
26066
  index("templates_history_by_key_channel_language_id").on(table.key, table.channel, table.language, table.id)
26042
26067
  ]);
26043
26068
 
26044
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/links.js
26069
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/links.js
26045
26070
  var links = sqliteTable("links", {
26046
26071
  id: integer("id").primaryKey(),
26047
26072
  fromType: text("from_type").notNull(),
@@ -26072,7 +26097,7 @@ var links = sqliteTable("links", {
26072
26097
  index("links_by_to_type_to_id").on(table.toType, table.toId)
26073
26098
  ]);
26074
26099
 
26075
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
26100
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
26076
26101
  var tagRedirects = sqliteTable("tag_redirects", {
26077
26102
  sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
26078
26103
  survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
@@ -26098,7 +26123,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
26098
26123
  index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
26099
26124
  ]);
26100
26125
 
26101
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
26126
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
26102
26127
  var accounts = sqliteTable("accounts", {
26103
26128
  id: integer("id").primaryKey(),
26104
26129
  provider: text("provider").notNull(),
@@ -28265,7 +28290,7 @@ var storeSettings = sqliteTable("store_settings", {
28265
28290
  at: integer("at").notNull()
28266
28291
  });
28267
28292
 
28268
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
28293
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
28269
28294
  var contactsOf = /* @__PURE__ */ __name(({ phones: phones2, emails: emails3 }) => {
28270
28295
  if (phones2 === void 0 && emails3 === void 0)
28271
28296
  return void 0;
@@ -28511,7 +28536,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
28511
28536
  }, "meetingIdentityPk");
28512
28537
  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");
28513
28538
 
28514
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/display-names.js
28539
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/display-names.js
28515
28540
  var QUOTES = [
28516
28541
  ['"', '"'],
28517
28542
  ["'", "'"],
@@ -28569,7 +28594,7 @@ var nameKey = /* @__PURE__ */ __name((name) => {
28569
28594
  }, "nameKey");
28570
28595
  var isReadable = /* @__PURE__ */ __name((shown2) => shown2 !== null && READABLE.test(shown2), "isReadable");
28571
28596
 
28572
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-separation.js
28597
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/person-separation.js
28573
28598
  var identitiesOf = /* @__PURE__ */ __name(({ database }, person2) => database.prepare("SELECT identity_id AS pk FROM identity_links WHERE person_id = ?").all(person2).map(({ pk }) => Number(pk)), "identitiesOf");
28574
28599
  var MOVED_AWAY = `moved.identity_id IN (SELECT value FROM json_each(?))
28575
28600
  AND (moved.from_person_id IN (SELECT value FROM json_each(?))
@@ -28584,7 +28609,7 @@ var apart = /* @__PURE__ */ __name(({ database }, one2, other) => {
28584
28609
  var separated = /* @__PURE__ */ __name((context, one2, other) => one2 !== other && apart(context, { identities: identitiesOf(context, one2), person: one2 }, { identities: identitiesOf(context, other), person: other }), "separated");
28585
28610
  var identitySeparated = /* @__PURE__ */ __name((context, identity, person2) => apart(context, { identities: [identity] }, { identities: identitiesOf(context, person2).filter((pk) => pk !== identity), person: person2 }), "identitySeparated");
28586
28611
 
28587
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
28612
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
28588
28613
  var MESSAGE_FIELDS = {
28589
28614
  pk: messages.id,
28590
28615
  nativeId: messages.externalId,
@@ -28764,7 +28789,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
28764
28789
  storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
28765
28790
  }), "chatActivity");
28766
28791
 
28767
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
28792
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
28768
28793
  var HIT_FIELDS = {
28769
28794
  ...MESSAGE_FIELDS,
28770
28795
  chatTitle: sql`${chats.title}`.as("chat_title"),
@@ -28865,7 +28890,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
28865
28890
  };
28866
28891
  }, "directReplies");
28867
28892
 
28868
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
28893
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
28869
28894
  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");
28870
28895
  var required = /* @__PURE__ */ __name((context, ref3) => {
28871
28896
  const found2 = identityRow(context, ref3);
@@ -29078,7 +29103,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
29078
29103
  }, "mentioning");
29079
29104
  var escaped = /* @__PURE__ */ __name((text9) => text9.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
29080
29105
 
29081
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
29106
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
29082
29107
  var BOT_KINDS = ["agent", "rule", "script", "integration"];
29083
29108
  var ownerPerson = /* @__PURE__ */ __name((database) => {
29084
29109
  const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
@@ -29135,7 +29160,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
29135
29160
  return { sql: bot("pb.name = ?"), params: [by.bot] };
29136
29161
  }, "proposedBySql");
29137
29162
 
29138
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review-marks.js
29163
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review-marks.js
29139
29164
  var TABLES = { memory: "memories", fact: "facts" };
29140
29165
  var HOLDING = { memory: ["proposed", "confirmed"], fact: ["proposed", "accepted"] };
29141
29166
  var KEPT = 20;
@@ -29230,7 +29255,7 @@ var scrubSourceReviews = /* @__PURE__ */ __name((database, erased, { refs }) =>
29230
29255
  return scrubbed;
29231
29256
  }, "scrubSourceReviews");
29232
29257
 
29233
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-signature.js
29258
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-signature.js
29234
29259
  var QUOTE_LIMIT = 500;
29235
29260
  var GONE = { sig: "gone", rev: null, deleted: true, changedAt: null };
29236
29261
  var part = /* @__PURE__ */ __name((value) => value == null ? "" : String(value), "part");
@@ -29509,7 +29534,7 @@ var deleteDocumentRow = /* @__PURE__ */ __name((database, id2, at2) => {
29509
29534
  database.prepare("DELETE FROM documents WHERE id = ?").run(id2);
29510
29535
  }, "deleteDocumentRow");
29511
29536
 
29512
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-accounts.js
29537
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-accounts.js
29513
29538
  var accountKeys = /* @__PURE__ */ __name((database, ids3) => {
29514
29539
  const unique2 = [...new Set(ids3)];
29515
29540
  if (unique2.length === 0)
@@ -29598,7 +29623,7 @@ var refEndsOf = /* @__PURE__ */ __name((database, text9) => {
29598
29623
  }, "refEndsOf");
29599
29624
  var refAccountsOf = /* @__PURE__ */ __name((database, text9) => refEndsOf(database, text9)?.flat(), "refAccountsOf");
29600
29625
 
29601
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
29626
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
29602
29627
  var EXCERPT_CHARS = 280;
29603
29628
  var TITLE_CHARS = 120;
29604
29629
  var MEMORY_TITLE_CHARS = 80;
@@ -30022,7 +30047,7 @@ var refsStoreOver = /* @__PURE__ */ __name((context) => ({
30022
30047
  ends: /* @__PURE__ */ __name(async (text9) => refEndsOf(context.database, text9), "ends")
30023
30048
  }), "refsStoreOver");
30024
30049
 
30025
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
30050
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
30026
30051
  var sourceOf3 = /* @__PURE__ */ __name((read2, ref3) => ({
30027
30052
  ref: ref3,
30028
30053
  kind: read2.kind,
@@ -30060,7 +30085,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
30060
30085
  });
30061
30086
  }, "evidenceSourcesOf");
30062
30087
 
30063
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/attachments/limits.js
30088
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/attachments/limits.js
30064
30089
  var MAX_FILE_BYTES = 50 * 1024 * 1024;
30065
30090
  var MAX_TEXT_CHARS = 2e6;
30066
30091
  var ATTACHMENT_LIMIT_ENV = [
@@ -30086,7 +30111,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
30086
30111
  return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
30087
30112
  }, "pdfPreviewLimits");
30088
30113
 
30089
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/ulid.js
30114
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/ulid.js
30090
30115
  import { randomBytes } from "node:crypto";
30091
30116
  var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
30092
30117
  var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
@@ -30099,7 +30124,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
30099
30124
  return time3 + random;
30100
30125
  }, "ulid");
30101
30126
 
30102
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
30127
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
30103
30128
  var FOLDED_FIELDS = ["title", "site", "language", "author"];
30104
30129
  var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
30105
30130
  if (!meta && !sections?.length)
@@ -30120,11 +30145,11 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
30120
30145
  return typeof language === "string" && language !== "" ? language : null;
30121
30146
  }, "languageOf");
30122
30147
 
30123
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/file-note.js
30148
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/file-note.js
30124
30149
  var LIVE3 = "f.deleted_at IS NULL AND d.deleted_at IS NULL AND coalesce(json_extract(d.metadata, '$.catalog.active'), 1)=1";
30125
30150
  var fileNoteRow = /* @__PURE__ */ __name((database, account, local, path) => database.prepare(local ? `SELECT d.*, f.account_id AS account_id, f.external_id AS external_id, coalesce(f.external_updated_at, d.external_updated_at) AS external_updated_at FROM files f JOIN documents d ON d.id = f.document_id WHERE f.account_id = ? AND f.external_id = ? AND ${LIVE3} ORDER BY d.created_at, d.id LIMIT 1` : `SELECT d.*, f.account_id AS account_id, coalesce(f.external_updated_at, d.external_updated_at) AS external_updated_at FROM documents d JOIN files f ON f.document_id = d.id AND f.account_id = d.account_id WHERE d.account_id = ? AND d.external_id = ? AND ${LIVE3} LIMIT 1`).get(account, path), "fileNoteRow");
30126
30151
 
30127
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
30152
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
30128
30153
  var isObject2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
30129
30154
  var objectOf2 = /* @__PURE__ */ __name((value) => {
30130
30155
  if (isObject2(value))
@@ -30371,7 +30396,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
30371
30396
  };
30372
30397
  }, "filesStoreOver");
30373
30398
 
30374
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
30399
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
30375
30400
  var IMPORTED_DOCUMENT_QUERY = defineQuery({
30376
30401
  entity: "document",
30377
30402
  backend: "sql",
@@ -30417,7 +30442,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
30417
30442
  return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns2, { zone: timezoneOf() });
30418
30443
  }, "importedDocumentWhere");
30419
30444
 
30420
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
30445
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
30421
30446
  var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
30422
30447
  database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
30423
30448
  VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
@@ -30425,7 +30450,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
30425
30450
  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);
30426
30451
  }, "reviewLink");
30427
30452
 
30428
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/link-row.js
30453
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/link-row.js
30429
30454
  var iso3 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
30430
30455
  var thingRef = /* @__PURE__ */ __name((database, type, id2) => type == null || id2 == null ? null : referenceOfThing(database, storedThing(type, id2)) ?? null, "thingRef");
30431
30456
  var hasBothEnds = /* @__PURE__ */ __name((link3) => link3.from !== null && link3.to !== null, "hasBothEnds");
@@ -30459,7 +30484,7 @@ var linkOf = /* @__PURE__ */ __name((database, row2) => {
30459
30484
  };
30460
30485
  }, "linkOf");
30461
30486
 
30462
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/note-dates.js
30487
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/note-dates.js
30463
30488
  var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
30464
30489
  const fileAt = database.prepare("SELECT id, document_id FROM files WHERE account_id = ? AND external_id = ? AND kind <> 'folder' AND deleted_at IS NULL");
30465
30490
  const legacy = database.prepare("SELECT id FROM documents WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL");
@@ -30480,7 +30505,7 @@ var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
30480
30505
  return changed;
30481
30506
  }, "dateFileNotes");
30482
30507
 
30483
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/text-input.js
30508
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/text-input.js
30484
30509
  var textOf2 = /* @__PURE__ */ __name((text9, what, max = 1e5, allowEmpty = false) => {
30485
30510
  const value = text9.trim();
30486
30511
  if (!value && !allowEmpty || value.length > max)
@@ -30493,7 +30518,7 @@ var oneOf = /* @__PURE__ */ __name((value, allowed, what) => {
30493
30518
  return value;
30494
30519
  }, "oneOf");
30495
30520
 
30496
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
30521
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
30497
30522
  var NOTE_FORMATS = ["obsidian", "markdown"];
30498
30523
  var RELATIONSHIPS = RELATION_KINDS.map(linkKind).join(", ");
30499
30524
  var iso4 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
@@ -31015,10 +31040,10 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
31015
31040
  };
31016
31041
  }, "notesStoreOver");
31017
31042
 
31018
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/rows-page.js
31043
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/rows-page.js
31019
31044
  var pageOfRows = /* @__PURE__ */ __name((rows, limit, offset = 0) => rows.length > limit ? { items: rows.slice(0, limit), hasMore: true, nextOffset: offset + limit } : { items: rows, hasMore: false }, "pageOfRows");
31020
31045
 
31021
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
31046
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
31022
31047
  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";
31023
31048
  var iso5 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
31024
31049
  var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
@@ -31283,7 +31308,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
31283
31308
  };
31284
31309
  }, "memoriesStoreOver");
31285
31310
 
31286
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/reviewed.js
31311
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/reviewed.js
31287
31312
  var prefixesText = /* @__PURE__ */ __name((types) => `${article(types[0] ?? "")} ${types.map((type) => `${type}:`).join(" or ")}`, "prefixesText");
31288
31313
  var refuse = /* @__PURE__ */ __name((message3, reason, code = "validation_error") => {
31289
31314
  throw new CliError(code, message3, { reason });
@@ -31431,7 +31456,7 @@ var reviewedRowsOver = /* @__PURE__ */ __name((context) => {
31431
31456
  return { partyOf, partyThing, reviewedOf, written, keepEvidence, ownerOnly: ownerOnly2, linkedId, ...decisionsOver(context) };
31432
31457
  }, "reviewedRowsOver");
31433
31458
 
31434
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/money-lines.js
31459
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/money-lines.js
31435
31460
  var MAX_LINES = 500;
31436
31461
  var PARENTS = {
31437
31462
  invoice: {
@@ -31531,7 +31556,7 @@ var moneyLinesOver = /* @__PURE__ */ __name(({ database }) => {
31531
31556
  return { linesOf, insertLines, shownLines, appendLine, deleteLine, sumOf, retotal };
31532
31557
  }, "moneyLinesOver");
31533
31558
 
31534
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/refunds.js
31559
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/refunds.js
31535
31560
  var COUNTED = {
31536
31561
  confirmed: "np.review = 'confirmed' AND np.deleted_at IS NULL",
31537
31562
  // A proposed refund promises nothing back yet, so it must not free room an import could then fill.
@@ -31606,7 +31631,7 @@ var refundRulesOver = /* @__PURE__ */ __name((context) => {
31606
31631
  return { originalFor, refundShare, confirmable, keepsRefunded, keepsShare, keepsInvoice };
31607
31632
  }, "refundRulesOver");
31608
31633
 
31609
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
31634
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
31610
31635
  var FINANCE_TYPES = ["invoice", "payment"];
31611
31636
  var isFinanceType = /* @__PURE__ */ __name((type) => FINANCE_TYPES.includes(type), "isFinanceType");
31612
31637
  var PAID = netPaidSql("i.id");
@@ -32010,7 +32035,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
32010
32035
  };
32011
32036
  }, "financeStoreOver");
32012
32037
 
32013
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
32038
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
32014
32039
  var refuse2 = /* @__PURE__ */ __name((message3, reason) => {
32015
32040
  throw new CliError("validation_error", message3, { reason });
32016
32041
  }, "refuse");
@@ -32088,7 +32113,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
32088
32113
  };
32089
32114
  }, "paymentEntriesOver");
32090
32115
 
32091
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
32116
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
32092
32117
  var EVIDENCE_FINDINGS_KIND = "evidence_findings";
32093
32118
  var reference = /* @__PURE__ */ __name((raw) => {
32094
32119
  if (/^(document|note):[1-9]\d*$/.test(raw))
@@ -32115,7 +32140,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
32115
32140
  return valid;
32116
32141
  }, "validateEvidenceFindings");
32117
32142
 
32118
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
32143
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
32119
32144
  var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
32120
32145
  var PROPOSAL_VERDICTS = ["useful", "not_useful"];
32121
32146
  var iso7 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
@@ -32309,7 +32334,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
32309
32334
  };
32310
32335
  }, "proposedActionsStoreOver");
32311
32336
 
32312
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-proposals.js
32337
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-proposals.js
32313
32338
  var CONFIRMED = "proposal";
32314
32339
  var refOf = /* @__PURE__ */ __name(({ database }, pk) => {
32315
32340
  const row2 = database.prepare("SELECT provider, external_id FROM identities WHERE id = ?").get(pk);
@@ -32661,7 +32686,7 @@ var identityLinkRows = /* @__PURE__ */ __name((context, { person: person2, statu
32661
32686
  return { items, hasMore: rows.length > limit };
32662
32687
  }, "identityLinkRows");
32663
32688
 
32664
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-merges.js
32689
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/person-merges.js
32665
32690
  var mergeId = /* @__PURE__ */ __name((to, from2) => `merge:${to}-${from2}`, "mergeId");
32666
32691
  var parseMergeId = /* @__PURE__ */ __name((id2) => {
32667
32692
  const found2 = /^merge:([1-9]\d*)-([1-9]\d*)$/.exec(id2.trim());
@@ -32764,7 +32789,7 @@ var split = /* @__PURE__ */ __name((context, uid, refs, by) => {
32764
32789
  return recordOf(context, alone);
32765
32790
  }, "split");
32766
32791
 
32767
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-split-proposals.js
32792
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-split-proposals.js
32768
32793
  var refOf2 = /* @__PURE__ */ __name(({ provider, id: id2 }) => `${provider}:${id2}`, "refOf");
32769
32794
  var keyOf3 = /* @__PURE__ */ __name((split2, person2, identities2) => `${split2} ${person2} ${[...identities2].sort().join(" ")}`, "keyOf");
32770
32795
  var planOf = /* @__PURE__ */ __name((context, input) => {
@@ -32941,7 +32966,7 @@ var forgetErasedSplits = /* @__PURE__ */ __name((database) => {
32941
32966
  database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
32942
32967
  }, "forgetErasedSplits");
32943
32968
 
32944
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/test-data.js
32969
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/test-data.js
32945
32970
  var SEED_PEOPLE = [
32946
32971
  { name: "Owner", username: "owner" },
32947
32972
  { name: "Ann Lee", username: "ann" },
@@ -32958,7 +32983,7 @@ var RESERVED_ADDRESS_GLOBS = [
32958
32983
  ];
32959
32984
  var SEED_ID_GLOBS = ["person-[0-9]*"];
32960
32985
 
32961
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/test-people.js
32986
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/test-people.js
32962
32987
  var TEST_DATA_KIND = "test_data";
32963
32988
  var globs = /* @__PURE__ */ __name((column2, patterns) => patterns.map((pattern) => `${column2} GLOB '${pattern}'`).join(" OR "), "globs");
32964
32989
  var SURE = `(${globs("i.external_id", SEED_ID_GLOBS)} OR ${globs("lower(i.email)", RESERVED_ADDRESS_GLOBS)})`;
@@ -33027,7 +33052,7 @@ var forgetErasedTestData = /* @__PURE__ */ __name((database) => {
33027
33052
  database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
33028
33053
  }, "forgetErasedTestData");
33029
33054
 
33030
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
33055
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
33031
33056
  var accountPk = /* @__PURE__ */ __name(({ orm, now: now2 }, { provider, account, scope: scope3 }, name = null, startScope) => Number(orm.insert(accounts).values({
33032
33057
  provider,
33033
33058
  externalId: account,
@@ -33121,7 +33146,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
33121
33146
  AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
33122
33147
  }, "dropOrphanPeople");
33123
33148
 
33124
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
33149
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
33125
33150
  var HISTORY_KEY = "$history";
33126
33151
  var objectOf3 = /* @__PURE__ */ __name((text9) => {
33127
33152
  if (typeof text9 !== "string")
@@ -33197,7 +33222,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
33197
33222
  return rest;
33198
33223
  }, "withoutHistory");
33199
33224
 
33200
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
33225
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
33201
33226
  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");
33202
33227
  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");
33203
33228
  var setChatScope = /* @__PURE__ */ __name((context, accountKey, chatId, scope3) => {
@@ -33495,7 +33520,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
33495
33520
  }
33496
33521
  }, "replaceAutoTags");
33497
33522
 
33498
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/counters.js
33523
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/counters.js
33499
33524
  var COUNTER_FIELDS = ["views", "reactions", "comments"];
33500
33525
  var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
33501
33526
  var counterObservationTime = /* @__PURE__ */ __name((observation, now2) => {
@@ -33514,7 +33539,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
33514
33539
  return states.some((one2) => one2.freshness === "stale") ? "stale" : "fresh";
33515
33540
  }, "counterFreshness");
33516
33541
 
33517
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-tokens.js
33542
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-tokens.js
33518
33543
  var BOT_TOKEN = /(?<!\d)(\d{6,12}):[A-Za-z0-9_-]{30,40}(?![A-Za-z0-9_-])/g;
33519
33544
  var MAY_HOLD = "*[0-9][0-9][0-9][0-9][0-9][0-9]:*";
33520
33545
  var MASKED_THROUGH = "bot_tokens_masked_through";
@@ -33554,7 +33579,7 @@ var maskStoredBotTokens = /* @__PURE__ */ __name((context) => {
33554
33579
  }, "maskStoredBotTokens");
33555
33580
  var masks = /* @__PURE__ */ __name((value) => value != null && withoutBotTokens(String(value)) !== value, "masks");
33556
33581
 
33557
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/context/evidence.js
33582
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/context/evidence.js
33558
33583
  import { createHash as createHash4 } from "node:crypto";
33559
33584
  var CONTEXT_MAX_READ_BYTES = 262144;
33560
33585
  var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
@@ -33652,7 +33677,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
33652
33677
  return { source: source2, query, chat: chat2, senders, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
33653
33678
  }, "contextEvidenceRequest");
33654
33679
 
33655
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
33680
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
33656
33681
  var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
33657
33682
  var ACTIVITY = `
33658
33683
  SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
@@ -33782,7 +33807,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
33782
33807
  threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
33783
33808
  }), "mailActivity");
33784
33809
 
33785
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
33810
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
33786
33811
  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");
33787
33812
  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;
33788
33813
  var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
@@ -33863,7 +33888,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
33863
33888
  return withoutSignOff(withoutGreeting(kept2)).join("\n").trim();
33864
33889
  }, "mailCore");
33865
33890
 
33866
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
33891
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
33867
33892
  var titleOf2 = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
33868
33893
  var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
33869
33894
  k.start_offset, k.end_offset, k.account_id, k.occurred_at,
@@ -33976,7 +34001,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
33976
34001
  return emails3 + threads;
33977
34002
  }, "drainEmailIndex");
33978
34003
 
33979
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
34004
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
33980
34005
  var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
33981
34006
  SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
33982
34007
  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,
@@ -34074,7 +34099,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
34074
34099
  var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
34075
34100
  SELECT id FROM emails WHERE account_id = ? AND sent_at IS NULL AND received_at IS NOT NULL LIMIT ?)`).run(accountId, limit).changes), "backfillSentAt");
34076
34101
 
34077
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
34102
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
34078
34103
  var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
34079
34104
  emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
34080
34105
  last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
@@ -34124,7 +34149,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
34124
34149
  return threads.length;
34125
34150
  }, "markEmailsRestored");
34126
34151
 
34127
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-nearest.js
34152
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-nearest.js
34128
34153
  var MAIL_PIECE_ROWS = `SELECT p.id, p.content_hash AS hash, p.type, p.owner, p.position, p.email_id AS email, v.vector
34129
34154
  FROM ${MAIL_PIECES} JOIN embeddings v ON v.model = ? AND v.content_hash = p.content_hash
34130
34155
  WHERE p.account_id = ?
@@ -34184,7 +34209,7 @@ var indexedMailPieces = /* @__PURE__ */ __name((database, model, query, filter,
34184
34209
  }, "indexedMailPieces");
34185
34210
  var nearestMailPieces = /* @__PURE__ */ __name((database, model, query, filter, depth) => (filter.threadExternalId === void 0 ? indexedMailPieces(database, model, query, filter, depth) : void 0) ?? scannedMailPieces(database, model, query, filter), "nearestMailPieces");
34186
34211
 
34187
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
34212
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
34188
34213
  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");
34189
34214
  var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
34190
34215
  var ruleOf = /* @__PURE__ */ __name((row2) => ({
@@ -34251,7 +34276,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
34251
34276
  }
34252
34277
  }), "mailRulesOver");
34253
34278
 
34254
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
34279
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
34255
34280
  function checkMeetingCancelled(signal) {
34256
34281
  if (!signal?.aborted)
34257
34282
  return;
@@ -34262,7 +34287,7 @@ function checkMeetingCancelled(signal) {
34262
34287
  }
34263
34288
  __name(checkMeetingCancelled, "checkMeetingCancelled");
34264
34289
 
34265
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
34290
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
34266
34291
  var managerOf = /* @__PURE__ */ __name((database, meetingId) => {
34267
34292
  const found2 = database.prepare("SELECT p.display_name, i.name, l.person_id FROM meeting_participants p JOIN identities i ON i.id = p.identity_id LEFT JOIN identity_links l ON l.identity_id = p.identity_id WHERE p.meeting_id = ? AND p.role = 'manager' ORDER BY p.id LIMIT 1").get(meetingId);
34268
34293
  if (!found2)
@@ -34327,7 +34352,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
34327
34352
  createdAt: Number(row2.created_at)
34328
34353
  }), "transcriptRowOf");
34329
34354
 
34330
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
34355
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
34331
34356
  var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
34332
34357
  var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
34333
34358
  var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
@@ -34494,7 +34519,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
34494
34519
  }
34495
34520
  }), "meetingReadsOver");
34496
34521
 
34497
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
34522
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
34498
34523
  var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
34499
34524
  const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
34500
34525
  const params = [input.accountId];
@@ -34537,7 +34562,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
34537
34562
  return { clauses, params };
34538
34563
  }, "meetingSelectionSql");
34539
34564
 
34540
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-calls.js
34565
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-calls.js
34541
34566
  var MOST_CALLS = 2e5;
34542
34567
  var parsed3 = /* @__PURE__ */ __name((value) => {
34543
34568
  if (typeof value !== "string")
@@ -34592,7 +34617,7 @@ var meetingCallsOver = /* @__PURE__ */ __name(({ database }) => ({
34592
34617
  }
34593
34618
  }), "meetingCallsOver");
34594
34619
 
34595
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
34620
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
34596
34621
  var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
34597
34622
  async meetingChatLines(input) {
34598
34623
  checkMeetingCancelled(input.signal);
@@ -34620,7 +34645,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
34620
34645
  }
34621
34646
  }), "meetingChatLinesOver");
34622
34647
 
34623
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
34648
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
34624
34649
  var missing2 = /* @__PURE__ */ __name(() => {
34625
34650
  throw new CliError("not_found", "Meeting, participant or selected target not found");
34626
34651
  }, "missing");
@@ -34743,7 +34768,7 @@ function meetingContextLinksOver(context) {
34743
34768
  }
34744
34769
  __name(meetingContextLinksOver, "meetingContextLinksOver");
34745
34770
 
34746
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-documents.js
34771
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-documents.js
34747
34772
  var TRANSCRIPT_ROLE = "transcript";
34748
34773
  var roleOf3 = /* @__PURE__ */ __name((value) => MEETING_DOCUMENT_ROLES.find((role) => role === value), "roleOf");
34749
34774
  var attach = /* @__PURE__ */ __name((database, meetingId, fileId, role, metadata3, listed, now2) => {
@@ -34817,7 +34842,7 @@ var meetingTranscriptDocumentsOver = /* @__PURE__ */ __name(({ database }) => {
34817
34842
  };
34818
34843
  }, "meetingTranscriptDocumentsOver");
34819
34844
 
34820
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
34845
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
34821
34846
  var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
34822
34847
  var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
34823
34848
  var summaryOf2 = /* @__PURE__ */ __name((row2) => ({
@@ -34846,7 +34871,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
34846
34871
  return row2 ? summaryText(summaryOf2(row2)) : null;
34847
34872
  }, "indexedText");
34848
34873
 
34849
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
34874
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
34850
34875
  var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
34851
34876
  var meetingCurrentIndexRows = `
34852
34877
  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
@@ -34877,7 +34902,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
34877
34902
  }, "invalidateMeetingStems");
34878
34903
  var meetingStemmableText = /* @__PURE__ */ __name((text9) => text9.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
34879
34904
 
34880
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
34905
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
34881
34906
  function meetingHitIndexOver({ database, now: now2 }) {
34882
34907
  return {
34883
34908
  async indexSearch(original) {
@@ -34945,10 +34970,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
34945
34970
  }
34946
34971
  __name(meetingHitIndexOver, "meetingHitIndexOver");
34947
34972
 
34948
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
34973
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
34949
34974
  import { createHash as createHash5 } from "node:crypto";
34950
34975
 
34951
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/search/correct.js
34976
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/search/correct.js
34952
34977
  var SHORTEST_CORRECTION = 3;
34953
34978
  var maxEdits = /* @__PURE__ */ __name((word2) => word2.length <= 4 ? 1 : 2, "maxEdits");
34954
34979
  var editDistance = /* @__PURE__ */ __name((a, b, max) => {
@@ -34995,7 +35020,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words4) => {
34995
35020
  return corrections;
34996
35021
  }, "correctWords");
34997
35022
 
34998
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/search/garbled.js
35023
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/search/garbled.js
34999
35024
  var SHORTEST_GARBLED = 4;
35000
35025
  var MOST_WIDENED = 64;
35001
35026
  var plain = /* @__PURE__ */ __name((word2) => word2.replaceAll("\u044D", "\u0435"), "plain");
@@ -35087,7 +35112,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
35087
35112
  return found2.map((words4) => words4.sort((a, b) => a.distance - b.distance || b.docs - a.docs || a.term.localeCompare(b.term)).slice(0, MOST_WIDENED).map((word2) => word2.term));
35088
35113
  }, "widenWords");
35089
35114
 
35090
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
35115
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
35091
35116
  import { readFileSync } from "node:fs";
35092
35117
  var loaded;
35093
35118
  var dictionary = /* @__PURE__ */ __name(() => {
@@ -35146,7 +35171,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word2) => {
35146
35171
  return false;
35147
35172
  }, "knownRussianWord");
35148
35173
 
35149
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
35174
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
35150
35175
  var WORD2 = /[\p{L}\p{N}\p{M}]+/gu;
35151
35176
  var MOST_WORDS = 128;
35152
35177
  var quote = /* @__PURE__ */ __name((word2) => `"${word2.replaceAll('"', '""')}"`, "quote");
@@ -35402,7 +35427,7 @@ var matchedMeetingWords = /* @__PURE__ */ __name((tree, text9, stemmer2) => {
35402
35427
  return [...found2];
35403
35428
  }, "matchedMeetingWords");
35404
35429
 
35405
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
35430
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
35406
35431
  var fail = /* @__PURE__ */ __name((message3) => {
35407
35432
  throw new CliError("validation_error", message3);
35408
35433
  }, "fail");
@@ -35586,7 +35611,7 @@ function meetingHitSearchOver({ database }) {
35586
35611
  }
35587
35612
  __name(meetingHitSearchOver, "meetingHitSearchOver");
35588
35613
 
35589
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
35614
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
35590
35615
  var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
35591
35616
  async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
35592
35617
  positiveReadInteger(accountId, "accountId");
@@ -35618,7 +35643,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
35618
35643
  }
35619
35644
  }), "meetingLanguagesOver");
35620
35645
 
35621
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
35646
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
35622
35647
  import { createHash as createHash6 } from "node:crypto";
35623
35648
  var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
35624
35649
  if (value === void 0)
@@ -35711,7 +35736,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
35711
35736
  }
35712
35737
  }), "meetingParticipantSearchOver");
35713
35738
 
35714
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
35739
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
35715
35740
  var preparationQueries = {
35716
35741
  participants: {
35717
35742
  fields: "p.id, p.identity_id, p.display_name, l.person_id",
@@ -35761,7 +35786,7 @@ var preparationQueries = {
35761
35786
  }
35762
35787
  };
35763
35788
 
35764
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
35789
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
35765
35790
  var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
35766
35791
  async preparationContext(original) {
35767
35792
  const input = validateMeetingPreparationContext(original);
@@ -35802,7 +35827,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
35802
35827
  }
35803
35828
  }), "meetingPreparationContextOver");
35804
35829
 
35805
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
35830
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
35806
35831
  var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
35807
35832
  SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
35808
35833
  WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
@@ -35816,7 +35841,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
35816
35841
  JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
35817
35842
  )`, "preparationSubjects");
35818
35843
 
35819
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
35844
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
35820
35845
  var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
35821
35846
  async preparationKnowledge(original) {
35822
35847
  const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
@@ -35861,7 +35886,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
35861
35886
  }
35862
35887
  }), "meetingPreparationKnowledgeOver");
35863
35888
 
35864
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
35889
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
35865
35890
  var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
35866
35891
  async preparationNotes(original) {
35867
35892
  const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
@@ -35914,7 +35939,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
35914
35939
  }
35915
35940
  }), "meetingPreparationNotesOver");
35916
35941
 
35917
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
35942
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
35918
35943
  var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
35919
35944
  async relatedHistory(original) {
35920
35945
  const input = validateMeetingRelatedHistory(original);
@@ -35985,7 +36010,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
35985
36010
  }
35986
36011
  }), "meetingRelatedHistoryOver");
35987
36012
 
35988
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
36013
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
35989
36014
  var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
35990
36015
  var text4 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
35991
36016
  var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
@@ -36066,7 +36091,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
36066
36091
  }
36067
36092
  }), "meetingReviewOver");
36068
36093
 
36069
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
36094
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
36070
36095
  var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
36071
36096
  var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
36072
36097
  if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
@@ -36120,7 +36145,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
36120
36145
  }
36121
36146
  }), "meetingSeriesHistoryOver");
36122
36147
 
36123
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
36148
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
36124
36149
  var MOST_ROWS = 5e5;
36125
36150
  var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
36126
36151
  EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
@@ -36189,7 +36214,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
36189
36214
  }
36190
36215
  }), "meetingStatsOver");
36191
36216
 
36192
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/name-variants.js
36217
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/name-variants.js
36193
36218
  var CYRILLIC_TO_LATIN = {
36194
36219
  \u0430: "a",
36195
36220
  \u0431: "b",
@@ -36411,7 +36436,7 @@ for (const [full, short] of Object.entries(SHORT_FORMS))
36411
36436
  }
36412
36437
  var fullNames = /* @__PURE__ */ __name((skeleton) => [skeleton, ...FULL_NAMES.get(skeleton) ?? []], "fullNames");
36413
36438
 
36414
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/name-traces.js
36439
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/name-traces.js
36415
36440
  var peopleByNameKey = /* @__PURE__ */ __name((database) => {
36416
36441
  const found2 = /* @__PURE__ */ new Map();
36417
36442
  for (const row2 of database.prepare("SELECT p.id, p.name FROM persons p WHERE p.owner = 0 AND p.name IS NOT NULL AND EXISTS (SELECT 1 FROM identity_links l WHERE l.person_id = p.id) ORDER BY p.id").all()) {
@@ -36527,7 +36552,7 @@ function* sharedTraces(database, a, b, name, except) {
36527
36552
  }
36528
36553
  __name(sharedTraces, "sharedTraces");
36529
36554
 
36530
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-matcher.js
36555
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/person-matcher.js
36531
36556
  var spellingsOf = /* @__PURE__ */ __name((value) => [value, value.slice(1)], "spellingsOf");
36532
36557
  var PERSON_BY = {
36533
36558
  // UNION, not OR: each branch reads its own index.
@@ -36550,7 +36575,7 @@ var personsByIdentifiers = /* @__PURE__ */ __name((database, ids3) => {
36550
36575
  return [...found2].sort((a, b) => a - b);
36551
36576
  }, "personsByIdentifiers");
36552
36577
 
36553
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-match-scan.js
36578
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/person-match-scan.js
36554
36579
  var BY = "rule";
36555
36580
  var RULE = { bot: "rule", kind: "rule" };
36556
36581
  var MOST_SHARING = 6;
@@ -36999,7 +37024,7 @@ var linkPhones = /* @__PURE__ */ __name((context, identities2) => {
36999
37024
  return pass.result;
37000
37025
  }, "linkPhones");
37001
37026
 
37002
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
37027
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
37003
37028
  var CURSOR_KEY = "meetings";
37004
37029
  var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
37005
37030
  id: Number(row2.id),
@@ -37079,7 +37104,7 @@ var details = /* @__PURE__ */ __name((database, id2) => {
37079
37104
  return null;
37080
37105
  const meeting = meetingOf(database, row2);
37081
37106
  const series = meeting.meetingSeriesId === null ? null : seriesOf2(database.prepare("SELECT * FROM meeting_series WHERE id = ?").get(meeting.meetingSeriesId));
37082
- const rowsOf2 = database.prepare("SELECT * FROM meeting_transcript_rows WHERE meeting_transcript_id = ? ORDER BY position");
37107
+ const rowsOf3 = database.prepare("SELECT * FROM meeting_transcript_rows WHERE meeting_transcript_id = ? ORDER BY position");
37083
37108
  return {
37084
37109
  meeting,
37085
37110
  series,
@@ -37087,7 +37112,7 @@ var details = /* @__PURE__ */ __name((database, id2) => {
37087
37112
  ...participantOf(row3),
37088
37113
  ...row3.person_uid == null ? {} : { person: { uid: String(row3.person_uid), name: str(row3.person_name) } }
37089
37114
  })),
37090
- transcripts: database.prepare("SELECT * FROM meeting_transcripts WHERE meeting_id = ? ORDER BY id").all(id2).map((t) => ({ transcript: transcriptOf(t), rows: rowsOf2.all(Number(t.id)).map(transcriptRowOf) })),
37115
+ transcripts: database.prepare("SELECT * FROM meeting_transcripts WHERE meeting_id = ? ORDER BY id").all(id2).map((t) => ({ transcript: transcriptOf(t), rows: rowsOf3.all(Number(t.id)).map(transcriptRowOf) })),
37091
37116
  chat: database.prepare("SELECT * FROM meeting_chat_messages WHERE meeting_id = ? ORDER BY id").all(id2).map(chatOf2),
37092
37117
  summaries: database.prepare("SELECT * FROM meeting_summaries WHERE meeting_id = ? ORDER BY id").all(id2).map(summaryOf2),
37093
37118
  attachments: database.prepare("SELECT * FROM attachments WHERE attachable_type = 'meeting' AND attachable_id = ? ORDER BY position").all(id2).map(attachmentOf),
@@ -37606,7 +37631,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
37606
37631
  };
37607
37632
  }, "meetingStoreOver");
37608
37633
 
37609
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
37634
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
37610
37635
  var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
37611
37636
  const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
37612
37637
  return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
@@ -37632,7 +37657,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder2) => {
37632
37657
  orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder2))).run();
37633
37658
  }, "release");
37634
37659
 
37635
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
37660
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
37636
37661
  var THREAD_COLUMNS = {
37637
37662
  subject: {
37638
37663
  where: /* @__PURE__ */ __name(({ value }) => ({
@@ -37649,7 +37674,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
37649
37674
  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);
37650
37675
  }, "threadRows");
37651
37676
 
37652
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
37677
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
37653
37678
  var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
37654
37679
  id: `email:${place.emailId}`,
37655
37680
  chatId: place.threadExternalId,
@@ -38191,7 +38216,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
38191
38216
  }
38192
38217
  }), "mailStoreOver");
38193
38218
 
38194
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/search/dictionary.js
38219
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/search/dictionary.js
38195
38220
  import { readFileSync as readFileSync2 } from "node:fs";
38196
38221
  var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
38197
38222
  var folded5 = /* @__PURE__ */ __name((word2) => /^[а-яё'-]*$/.test(word2) ? word2.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word2), "folded");
@@ -38281,7 +38306,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
38281
38306
  }, "knownWord");
38282
38307
  var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
38283
38308
 
38284
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
38309
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
38285
38310
  var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
38286
38311
  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");
38287
38312
  var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
@@ -38367,7 +38392,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
38367
38392
  return found2;
38368
38393
  }, "spokenTranscripts");
38369
38394
 
38370
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
38395
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
38371
38396
  var startOf = /* @__PURE__ */ __name((node) => node.operator === "wildcard" && node.implicit ? /^([\p{L}\p{N}]+)\*$/u.exec(normalize(node.value))?.[1] : void 0, "startOf");
38372
38397
  var matchOf = /* @__PURE__ */ __name((node) => {
38373
38398
  const start = startOf(node);
@@ -38425,7 +38450,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
38425
38450
  });
38426
38451
  }, "placeHits");
38427
38452
 
38428
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
38453
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
38429
38454
  var GROUPS = {
38430
38455
  chat: {
38431
38456
  key: "m.chat_id",
@@ -38447,27 +38472,24 @@ var GROUPS = {
38447
38472
  }
38448
38473
  };
38449
38474
 
38450
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
38451
- var MESSAGES = {
38452
- rows: "messages",
38453
- threads: "chats",
38454
- words: "message_words",
38455
- stems: "message_stems",
38456
- vocab: "message_words_vocab",
38457
- item: "message",
38458
- thread: "chat"
38459
- };
38460
- var MAIL = {
38461
- rows: `(SELECT id, account_id, email_thread_id AS chat_id, external_id, deleted_at, from_identity_id AS sender_identity_id,
38462
- outgoing, read, flagged, coalesce(sent_at, received_at) AS sent_at,
38463
- coalesce(subject, '') || char(10, 10) || coalesce(body_text, '') AS text FROM emails)`,
38464
- threads: "(SELECT id, account_id, external_id, subject AS title, 1 AS searchable FROM email_threads)",
38465
- words: "email_words",
38466
- stems: "email_stems",
38467
- vocab: "email_words_vocab",
38468
- item: "email",
38469
- thread: "email_thread"
38470
- };
38475
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/word-rarity.js
38476
+ var withRarity = /* @__PURE__ */ __name((database, words4, leaves, ranked) => {
38477
+ const matches2 = [...new Set(leaves.flatMap(({ fragment }) => fragment.fts ?? []))];
38478
+ if (!matches2.length)
38479
+ return false;
38480
+ const total = Number(database.prepare(`SELECT count(*) AS n FROM ${words4}_docsize`).get()?.n ?? 0);
38481
+ const sets = matches2.map((fts) => {
38482
+ const match = `normalized_text : (${fts})`;
38483
+ const df = Number(database.prepare(`SELECT count(*) AS n FROM ${words4} WHERE ${words4} MATCH ?`).get(match)?.n ?? 0);
38484
+ ranked.params.push(match);
38485
+ return `SELECT rowid AS id, ${df ? Math.log(total / df) : 0} AS w FROM ${words4} WHERE ${words4} MATCH ?`;
38486
+ });
38487
+ ranked.sql.push(`rarity(id, score) AS MATERIALIZED (SELECT id, sum(w) FROM (${sets.join(" UNION ALL ")}) GROUP BY id)`);
38488
+ return true;
38489
+ }, "withRarity");
38490
+ var RARITY_ORDER = "coalesce(rarity.score, 0) - 0.2 * coalesce(f.rank, 0) DESC, ";
38491
+
38492
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
38471
38493
  var matchQuery = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution), "matchQuery");
38472
38494
  var countQuery = /* @__PURE__ */ __name((context, execution, by) => runQuery(context, execution, by), "countQuery");
38473
38495
  var queryMessagePks = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution, "pks"), "queryMessagePks");
@@ -38486,7 +38508,7 @@ var matchingPks = /* @__PURE__ */ __name((context, execution, cap) => inTime(()
38486
38508
  var timeLimited = /* @__PURE__ */ __name((limitMs) => (error) => {
38487
38509
  if (error instanceof TimeLimitReached)
38488
38510
  outOfTime(limitMs);
38489
- throw error;
38511
+ throw sqliteLimit(error);
38490
38512
  }, "timeLimited");
38491
38513
  var inTime = /* @__PURE__ */ __name((work, limitMs) => {
38492
38514
  try {
@@ -38656,17 +38678,18 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
38656
38678
  const rowsFrom = `FROM ${corpus.rows} m`;
38657
38679
  const joinedFrom = `${rowsFrom} JOIN ${corpus.threads} c ON c.id=m.chat_id JOIN accounts ac ON ac.id=m.account_id LEFT JOIN identities i ON i.id=m.sender_identity_id`;
38658
38680
  let baseFrom = joinedFrom;
38659
- const requiredText = /* @__PURE__ */ __name((node, index2 = "fts") => {
38681
+ const requiredText = /* @__PURE__ */ __name((node, index2 = "fts", partial = false) => {
38660
38682
  if (node.kind === "predicate")
38661
38683
  return fragments.get(node)?.fragment[index2];
38662
38684
  const required3 = node.clauses.filter(({ occur }) => occur === "must");
38663
38685
  const optional3 = node.clauses.filter(({ occur }) => occur === "should");
38664
38686
  if (required3.length) {
38665
- const parts2 = required3.flatMap(({ node: node2 }) => requiredText(node2, index2) ?? []);
38687
+ const parts2 = required3.flatMap(({ node: node2 }) => requiredText(node2, index2, partial) ?? []);
38666
38688
  return parts2.length ? parts2.map((part2) => `(${part2})`).join(" AND ") : void 0;
38667
38689
  }
38668
- const parts = optional3.map(({ node: node2 }) => requiredText(node2, index2));
38669
- return parts.length && parts.every((part2) => part2 !== void 0) ? parts.map((part2) => `(${part2})`).join(" OR ") : void 0;
38690
+ const parts = optional3.flatMap(({ node: node2 }) => requiredText(node2, index2, partial) ?? []);
38691
+ const whole = partial || parts.length === optional3.length;
38692
+ return parts.length && whole ? parts.map((part2) => `(${part2})`).join(" OR ") : void 0;
38670
38693
  }, "requiredText");
38671
38694
  const stemmed = [...fragments.keys()].some(isStemmed);
38672
38695
  const elsewhere = [...fragments.values()].some(({ fragment }) => fragment.elsewhere);
@@ -38712,8 +38735,9 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
38712
38735
  },
38713
38736
  where
38714
38737
  ], "AND");
38715
- const ranking = stemmed ? requiredText(execution.root, "stems") : elsewhere ? requiredText(execution.root) : void 0;
38716
- const rankIndex = stemmed ? { table: corpus.stems, column: "stems" } : { table: corpus.words, column: "normalized_text" };
38738
+ const byStems = stemmed ? requiredText(execution.root, "stems") : void 0;
38739
+ const ranking = byStems ?? (stemmed || elsewhere ? requiredText(execution.root, "fts", true) : void 0);
38740
+ const rankIndex = { table: byStems ? corpus.stems : corpus.words, column: byStems ? "stems" : "normalized_text" };
38717
38741
  const exactTier = stemmed ? requiredText(execution.root) : void 0;
38718
38742
  const ranked = driver ? { sql: [`d(id) AS MATERIALIZED (${driver.sql})`], params: [...driver.params] } : { sql: [], params: [] };
38719
38743
  if (ranking && !execution.newest) {
@@ -38732,16 +38756,19 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
38732
38756
  ranked.params.push(places2.join(" OR "), places2.join(" OR "), ...parts.flatMap(({ params }) => params));
38733
38757
  }
38734
38758
  const placeTier = places2.length && !execution.newest ? "coalesce((SELECT min(tier) FROM s WHERE s.id=m.id), 6)," : "";
38759
+ const rarity = execution.rareWordsFirst && !execution.newest && !mail && withRarity(database, corpus.words, [...fragments.values()], ranked);
38735
38760
  if (exactTier) {
38736
38761
  ranked.sql.push(`x(id) AS MATERIALIZED (SELECT rowid FROM ${corpus.words} WHERE ${corpus.words} MATCH ?)`);
38737
38762
  ranked.params.push(`normalized_text : (${exactTier})`);
38738
38763
  }
38739
38764
  const withRanking = ranked.sql.length ? `WITH ${ranked.sql.join(", ")} ` : "";
38740
- const rankedFrom = ranking && !execution.newest ? `${from2} LEFT JOIN f ON f.id=m.id` : from2;
38765
+ const rankedFrom = `${ranking && !execution.newest ? `${from2} LEFT JOIN f ON f.id=m.id` : from2}${rarity ? " LEFT JOIN rarity ON rarity.id=m.id" : ""}`;
38741
38766
  const exactColumn = exactTier ? ", m.id IN (SELECT id FROM x) AS exact" : "";
38742
38767
  const relevance = rankMatch ? "f.rank" : ranking && !execution.newest ? "f.rank" : "NULL";
38743
- const tiers = execution.newest ? "" : rankMatch ? "f.rank," : `${exactTier ? "m.id IN (SELECT id FROM x) DESC," : ""}${ranking ? `f.rank IS NULL, ${placeTier}f.rank,` : placeTier}`;
38744
- const order = `${tiers}m.sent_at DESC, ac.provider, ac.external_id, c.external_id, m.external_id DESC`;
38768
+ const tiers = /* @__PURE__ */ __name((rare) => execution.newest ? "" : rankMatch ? `${rare}f.rank,` : `${exactTier ? "m.id IN (SELECT id FROM x) DESC," : ""}${ranking ? `f.rank IS NULL, ${placeTier}${rare}f.rank,` : `${placeTier}${rare}`}`, "tiers");
38769
+ const ties = "m.sent_at DESC, ac.provider, ac.external_id, c.external_id, m.external_id DESC";
38770
+ const order = `${tiers(rarity ? RARITY_ORDER : "")}${ties}`;
38771
+ const acrossChats = `${tiers("")}${ties}`;
38745
38772
  const leaves = [...fragments.values()];
38746
38773
  const exact = leaves.filter(({ test }) => test === void 0);
38747
38774
  const projection = exact.map(({ fragment }, index2) => `coalesce(${fragment.sql},0) AS q${index2}`).join(",");
@@ -38790,6 +38817,7 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
38790
38817
  rankedFrom,
38791
38818
  exactColumn,
38792
38819
  order,
38820
+ acrossChats,
38793
38821
  placeTier,
38794
38822
  projection,
38795
38823
  projectionParams,
@@ -38846,7 +38874,7 @@ var runQuery = /* @__PURE__ */ __name((context, execution, by) => {
38846
38874
  }
38847
38875
  }, "runQuery");
38848
38876
  var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
38849
- const { corpus, rowsFrom, hits, database, check: check3, grouped, where, from: from2, withRanking, ranked, leaves, stemmed, exactTier, driver, baseFrom, filtered: filtered2, ranking, relevance, rankedFrom, exactColumn, order, placeTier, projection, projectionParams, joinedFrom, evaluate: evaluate2 } = compileQuery(context, execution);
38877
+ const { corpus, rowsFrom, hits, database, check: check3, grouped, where, from: from2, withRanking, ranked, leaves, stemmed, exactTier, driver, baseFrom, filtered: filtered2, ranking, relevance, rankedFrom, exactColumn, order, acrossChats, placeTier, projection, projectionParams, joinedFrom, evaluate: evaluate2 } = compileQuery(context, execution);
38850
38878
  if (by === "pks" && leaves.every(({ test }) => !test)) {
38851
38879
  const rows = database.prepare(`${withRanking}SELECT m.id AS id ${from2} WHERE ${where.sql}`).all(...ranked.params, ...where.params);
38852
38880
  await new Promise((resolve) => setImmediate(resolve));
@@ -38855,8 +38883,8 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
38855
38883
  }
38856
38884
  if (by && by !== "pks" && leaves.every(({ test }) => !test))
38857
38885
  return grouped(by, where.sql, [...ranked.params, ...where.params], from2, withRanking);
38858
- const { newest, perChat } = execution;
38859
- if (stemmed && exactTier && driver && !newest && !perChat && leaves.every(({ test }) => !test)) {
38886
+ const { newest, perChat, rareWordsFirst } = execution;
38887
+ if (stemmed && exactTier && driver && !newest && !perChat && !rareWordsFirst && leaves.every(({ test }) => !test)) {
38860
38888
  const exactRows = database.prepare(`SELECT m.id AS id, w.rank AS relevance ${baseFrom.replace(rowsFrom, `FROM ${corpus.words} w CROSS JOIN ${corpus.rows} m`)} WHERE ${corpus.words} MATCH ? AND w.rank MATCH 'bm25(1.0, 0.0)' AND m.id=w.rowid AND ${filtered2.sql} ORDER BY w.rank, m.sent_at DESC, ac.provider, ac.external_id, c.external_id, m.external_id DESC LIMIT ?`).all(`normalized_text : (${exactTier})`, ...filtered2.params, execution.limit + 1);
38861
38889
  await new Promise((resolve) => setImmediate(resolve));
38862
38890
  check3();
@@ -38878,7 +38906,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
38878
38906
  };
38879
38907
  }
38880
38908
  if (leaves.every(({ test }) => !test)) {
38881
- const rows = database.prepare(perChat === void 0 ? `${withRanking}SELECT m.id AS id, ${relevance} AS relevance${exactColumn} ${rankedFrom} WHERE ${where.sql} ORDER BY ${order} LIMIT ?` : `${withRanking}SELECT id, relevance${exactColumn ? ", exact" : ""} FROM (SELECT m.id AS id, ${relevance} AS relevance${exactColumn}, ROW_NUMBER() OVER (PARTITION BY m.chat_id ORDER BY ${order}) AS in_chat, ROW_NUMBER() OVER (ORDER BY ${order}) AS place ${rankedFrom} WHERE ${where.sql}) WHERE in_chat <= ${perChat} ORDER BY place LIMIT ?`).all(...ranked.params, ...where.params, execution.limit + 1);
38909
+ const rows = database.prepare(perChat === void 0 ? `${withRanking}SELECT m.id AS id, ${relevance} AS relevance${exactColumn} ${rankedFrom} WHERE ${where.sql} ORDER BY ${order} LIMIT ?` : `${withRanking}SELECT id, relevance${exactColumn ? ", exact" : ""} FROM (SELECT m.id AS id, ${relevance} AS relevance${exactColumn}, ROW_NUMBER() OVER (PARTITION BY m.chat_id ORDER BY ${order}) AS in_chat, ROW_NUMBER() OVER (ORDER BY ${acrossChats}) AS place ${rankedFrom} WHERE ${where.sql}) WHERE in_chat <= ${perChat} ORDER BY place LIMIT ?`).all(...ranked.params, ...where.params, execution.limit + 1);
38882
38910
  await new Promise((resolve) => setImmediate(resolve));
38883
38911
  check3();
38884
38912
  return {
@@ -38943,7 +38971,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
38943
38971
  };
38944
38972
  }, "runCompiled");
38945
38973
 
38946
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
38974
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
38947
38975
  function invalidMetadata() {
38948
38976
  throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
38949
38977
  }
@@ -39045,7 +39073,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
39045
39073
  };
39046
39074
  }), "counterTargets");
39047
39075
 
39048
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
39076
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
39049
39077
  var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
39050
39078
  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,
39051
39079
  att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
@@ -39164,7 +39192,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
39164
39192
  }));
39165
39193
  }, "attachmentViews");
39166
39194
 
39167
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
39195
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
39168
39196
  var transcript2 = /* @__PURE__ */ __name(({ orm }, chatKey, messageId) => orm.select({ text: messageTranscripts.text, source: messageTranscripts.source }).from(messageTranscripts).where(and(eq(messageTranscripts.chatId, chatKey), eq(messageTranscripts.messageExternalId, messageId))).get(), "transcript");
39169
39197
  var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text9, source2) => {
39170
39198
  const { orm, database, now: now2 } = context;
@@ -39202,7 +39230,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
39202
39230
  keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
39203
39231
  }, "intoVoiceAttachment");
39204
39232
 
39205
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
39233
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
39206
39234
  var FIELDS = [
39207
39235
  "threadExternalId",
39208
39236
  "senderIdentityId",
@@ -39526,7 +39554,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
39526
39554
  reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
39527
39555
  }, "writeDerivedReactions");
39528
39556
 
39529
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/keys.js
39557
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/keys.js
39530
39558
  var keysOver = /* @__PURE__ */ __name((context) => {
39531
39559
  const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
39532
39560
  const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
@@ -39547,7 +39575,16 @@ var keysOver = /* @__PURE__ */ __name((context) => {
39547
39575
  };
39548
39576
  }, "keysOver");
39549
39577
 
39550
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
39578
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
39579
+ var unquoted3 = /* @__PURE__ */ __name((value) => {
39580
+ if (typeof value !== "string")
39581
+ return value;
39582
+ try {
39583
+ return JSON.parse(value);
39584
+ } catch {
39585
+ return value;
39586
+ }
39587
+ }, "unquoted");
39551
39588
  var accountGroupsOf = /* @__PURE__ */ __name((database) => {
39552
39589
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(ACCOUNT_GROUPS);
39553
39590
  if (!row2)
@@ -39556,7 +39593,7 @@ var accountGroupsOf = /* @__PURE__ */ __name((database) => {
39556
39593
  const value = JSON.parse(String(row2.value));
39557
39594
  if (typeof value !== "object" || value === null || Array.isArray(value))
39558
39595
  return {};
39559
- return Object.fromEntries(Object.entries(value).filter((entry2) => Array.isArray(entry2[1]) && entry2[1].every((member) => typeof member === "string")));
39596
+ return Object.fromEntries(Object.entries(value).map(([name, members2]) => [name, unquoted3(members2)]).filter((entry2) => Array.isArray(entry2[1]) && entry2[1].every((member) => typeof member === "string")));
39560
39597
  } catch {
39561
39598
  return {};
39562
39599
  }
@@ -39568,7 +39605,9 @@ var profilesOf = /* @__PURE__ */ __name((database) => {
39568
39605
  return {};
39569
39606
  try {
39570
39607
  const value = JSON.parse(String(row2.value));
39571
- return typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
39608
+ if (typeof value !== "object" || value === null || Array.isArray(value))
39609
+ return {};
39610
+ return Object.fromEntries(Object.entries(value).map(([app, own]) => [app, unquoted3(own)]));
39572
39611
  } catch {
39573
39612
  return {};
39574
39613
  }
@@ -39594,7 +39633,7 @@ var forgetProfile = /* @__PURE__ */ __name((database, app, profile, now2) => {
39594
39633
  database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
39595
39634
  }, "forgetProfile");
39596
39635
 
39597
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
39636
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
39598
39637
  var DAY4 = 864e5;
39599
39638
  var COUNTERPART_LINK = `EXISTS (SELECT 1 FROM links l WHERE l.from_type = 'event' AND l.from_id = e.id AND l.to_type = 'person' AND l.to_id = ? AND l.kind = ${linkKind("related-to")} AND l.role = '${COUNTERPART_ROLE}')`;
39600
39639
  var accountsOf = /* @__PURE__ */ __name((filter) => {
@@ -39710,7 +39749,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
39710
39749
  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);
39711
39750
  }, "listEvents");
39712
39751
 
39713
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
39752
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
39714
39753
  var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
39715
39754
  var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey, now: now2 }, refresh) => {
39716
39755
  const unseenBefore = unreferenced(database, "identities");
@@ -39767,7 +39806,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
39767
39806
  return { entries: entryIds.length, events: goneEvents.length };
39768
39807
  }, "forgetCalendarRows");
39769
39808
 
39770
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
39809
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
39771
39810
  var calendarOf = /* @__PURE__ */ __name((row2) => ({
39772
39811
  id: Number(row2.id),
39773
39812
  accountId: Number(row2.account_id),
@@ -40370,7 +40409,7 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
40370
40409
  };
40371
40410
  }, "eventStoreOver");
40372
40411
 
40373
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/account-purge.js
40412
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/account-purge.js
40374
40413
  var purgeAccount = /* @__PURE__ */ __name((context, accountKey) => {
40375
40414
  const { orm, database, now: now2 } = context;
40376
40415
  const unseenBefore = unreferenced(database, "identities");
@@ -40494,7 +40533,7 @@ var purgeCrmCopies = /* @__PURE__ */ __name((database, accountKey) => {
40494
40533
  run("DELETE FROM pipelines WHERE account_id = ?", accountKey);
40495
40534
  }, "purgeCrmCopies");
40496
40535
 
40497
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
40536
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
40498
40537
  var ACCOUNT_REASON = "an account you connected, under another name: a mailbox or messenger you read may be someone else's";
40499
40538
  var ownerNames = /* @__PURE__ */ __name(({ database }, owner) => database.prepare("SELECT i.name FROM identity_links l JOIN identities i ON i.id = l.identity_id WHERE l.person_id = ?").all(owner).map(({ name }) => new Set(nameSkeletons(displayName(typeof name === "string" ? name : null)))).filter((words4) => words4.size > 0), "ownerNames");
40500
40539
  var ownersName = /* @__PURE__ */ __name((name, owner, alone) => {
@@ -40553,7 +40592,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
40553
40592
  return personOf2(context, ref3);
40554
40593
  }, "linkToOwner");
40555
40594
 
40556
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
40595
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
40557
40596
  var PROVIDERS_SETTING = "providers";
40558
40597
  var storedProvidersOf = /* @__PURE__ */ __name((database) => {
40559
40598
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
@@ -40601,7 +40640,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
40601
40640
  });
40602
40641
  }, "registerProvider");
40603
40642
 
40604
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
40643
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
40605
40644
  var DAY5 = 864e5;
40606
40645
  var RECENTLY_CLOSED_MS = 14 * DAY5;
40607
40646
  var TEXT_LIMIT = 20;
@@ -40799,7 +40838,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
40799
40838
  };
40800
40839
  }, "taskSimilarityOver");
40801
40840
 
40802
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
40841
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
40803
40842
  var SETTING3 = "taskCategories";
40804
40843
  var savedTaskCategories = /* @__PURE__ */ __name((database) => {
40805
40844
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
@@ -40818,7 +40857,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
40818
40857
  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);
40819
40858
  }, "saveTaskCategories");
40820
40859
 
40821
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
40860
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
40822
40861
  var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
40823
40862
  var ALLOWED = "taskAgentClose";
40824
40863
  var MIN = "taskAgentCloseMin";
@@ -40874,7 +40913,7 @@ var SUGGESTION_COLUMNS = [
40874
40913
  ];
40875
40914
  var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
40876
40915
 
40877
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
40916
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
40878
40917
  var DEFAULT_FIRST_PASS_PER_CHAT = 0;
40879
40918
  var KEY = "taskFirstPassPerChat";
40880
40919
  var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
@@ -40894,7 +40933,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
40894
40933
  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);
40895
40934
  }, "saveFirstPassPerChat");
40896
40935
 
40897
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/external-links.js
40936
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/external-links.js
40898
40937
  var EXTERNAL_SERVICE = /^[a-z][a-z0-9-]{0,31}$/;
40899
40938
  var EXTERNAL_ID_CHARS = 200;
40900
40939
  var SOURCE_URL_CHARS = 2e3;
@@ -40921,7 +40960,7 @@ var sourceUrlOf = /* @__PURE__ */ __name((value, reason = "task.source-url") =>
40921
40960
  return text9;
40922
40961
  }, "sourceUrlOf");
40923
40962
 
40924
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
40963
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
40925
40964
  var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
40926
40965
  var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
40927
40966
  name,
@@ -41173,7 +41212,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
41173
41212
  var TASK_PEOPLE = `WITH merged AS (SELECT json_extract(value, '$[0]') AS id, json_extract(value, '$[1]') AS now FROM json_each(?)), counts AS (SELECT coalesce(m.now, a.assignee_id) AS person, count(DISTINCT t.id) AS n FROM task_assignments a JOIN tasks t ON t.id = a.task_id AND t.deleted_at IS NULL LEFT JOIN merged m ON m.id = a.assignee_id WHERE a.assignee_type = 'person' GROUP BY 1) SELECT p.id, p.name, p.owner, coalesce(c.n, 0) AS n FROM persons p LEFT JOIN counts c ON c.person = p.id WHERE NOT ${mergedAwaySql("p")} ORDER BY p.owner DESC, n DESC, p.name IS NULL, p.name COLLATE NOCASE, p.id LIMIT ?`;
41174
41213
  var mergedAssignees = /* @__PURE__ */ __name((database) => JSON.stringify(database.prepare(`SELECT DISTINCT a.assignee_id AS id FROM task_assignments a JOIN persons p ON p.id = a.assignee_id WHERE a.assignee_type = 'person' AND ${mergedAwaySql("p")}`).all().map(({ id: id2 }) => [Number(id2), currentPerson(database, Number(id2))])), "mergedAssignees");
41175
41214
 
41176
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
41215
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
41177
41216
  var authorNamed = /* @__PURE__ */ __name((database, row2) => {
41178
41217
  if (row2.author_type == null)
41179
41218
  return null;
@@ -41201,7 +41240,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
41201
41240
  return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
41202
41241
  }, "addComment");
41203
41242
 
41204
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
41243
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
41205
41244
  var TASK_RELATION_KINDS = [
41206
41245
  "blocked-by",
41207
41246
  "follow-up-of",
@@ -41331,7 +41370,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record3) => {
41331
41370
  };
41332
41371
  }, "taskRelationsStoreOver");
41333
41372
 
41334
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
41373
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
41335
41374
  var TASK_ROLES = ["assignee", "reviewer", "watcher"];
41336
41375
  var TASK_EVENT_KINDS = [
41337
41376
  "created",
@@ -41890,7 +41929,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
41890
41929
  };
41891
41930
  }, "workTasksOver");
41892
41931
 
41893
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
41932
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
41894
41933
  var taskCloseOver = /* @__PURE__ */ __name((context) => {
41895
41934
  const { database, now: now2 } = context;
41896
41935
  const liveRow = /* @__PURE__ */ __name((id2) => {
@@ -41939,7 +41978,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
41939
41978
  };
41940
41979
  }, "taskCloseOver");
41941
41980
 
41942
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
41981
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
41943
41982
  var TASK_PAIR_DECISIONS = ["review", "unsure", "merged", "rejected", "unmerged", "attached", "new"];
41944
41983
  var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
41945
41984
  const { database, now: now2 } = context;
@@ -42158,7 +42197,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
42158
42197
  };
42159
42198
  }, "taskPairsOver");
42160
42199
 
42161
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
42200
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
42162
42201
  var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
42163
42202
  var TASK_STATS_SQL = {
42164
42203
  rows: /* @__PURE__ */ __name((board, filter) => `SELECT t.source_group, t.source_kind, t.project_id, t.status, t.created_at, t.closed_at FROM tasks t WHERE ${board ? PROJECT_SCOPE : ACCOUNT_SCOPE}${filter} ORDER BY t.created_at, t.id`, "rows"),
@@ -42197,7 +42236,7 @@ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
42197
42236
  }, "statNames")
42198
42237
  }), "taskStatsOver");
42199
42238
 
42200
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
42239
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
42201
42240
  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";
42202
42241
  var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
42203
42242
  const key2 = inboxKey(account);
@@ -42413,7 +42452,7 @@ var oneOf4 = /* @__PURE__ */ __name((values, value, column2) => {
42413
42452
  throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
42414
42453
  }, "oneOf");
42415
42454
 
42416
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/accounts.js
42455
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/accounts.js
42417
42456
  var accountAccountsOver = /* @__PURE__ */ __name((context) => {
42418
42457
  const { database } = context;
42419
42458
  const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
@@ -42483,7 +42522,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
42483
42522
  };
42484
42523
  }, "accountsStoreOver");
42485
42524
 
42486
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
42525
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
42487
42526
  var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
42488
42527
  var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
42489
42528
  const message3 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
@@ -42507,7 +42546,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
42507
42546
  })), "keepDownloads");
42508
42547
  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");
42509
42548
 
42510
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/attachments.js
42549
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/attachments.js
42511
42550
  var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
42512
42551
  const { database } = context;
42513
42552
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -42564,7 +42603,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
42564
42603
  }, "keepAttachmentText")
42565
42604
  }), "attachmentsStoreOver");
42566
42605
 
42567
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
42606
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
42568
42607
  var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
42569
42608
  var pointerMover = /* @__PURE__ */ __name((context, type) => {
42570
42609
  const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
@@ -42749,7 +42788,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
42749
42788
  return done;
42750
42789
  }, "rekeyChats");
42751
42790
 
42752
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
42791
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
42753
42792
  var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
42754
42793
  var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
42755
42794
  var CHAT_LIST_KEY = "chat_list_complete";
@@ -42807,7 +42846,7 @@ var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
42807
42846
  return { ...coverage, oldestMessageAt: toIso(oldest) };
42808
42847
  }, "chatCoverage");
42809
42848
 
42810
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/chats.js
42849
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/chats.js
42811
42850
  var chatsStoreOver = /* @__PURE__ */ __name((context) => {
42812
42851
  const { database } = context;
42813
42852
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
@@ -42956,7 +42995,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
42956
42995
  };
42957
42996
  }, "chatsStoreOver");
42958
42997
 
42959
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
42998
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
42960
42999
  import { createHash as createHash7 } from "node:crypto";
42961
43000
  var BATCH_CONTEXT = 50;
42962
43001
  var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
@@ -43096,7 +43135,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
43096
43135
  var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
43097
43136
  ${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
43098
43137
 
43099
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
43138
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
43100
43139
  import { setTimeout } from "node:timers/promises";
43101
43140
  var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
43102
43141
  var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
@@ -43360,6 +43399,49 @@ var conversationOf = /* @__PURE__ */ __name(({ orm }, chatKey, messageId) => {
43360
43399
  const found2 = orm.select({ pk: conversationMessages.conversationId }).from(conversationMessages).innerJoin(messages, eq(messages.id, conversationMessages.messageId)).innerJoin(conversations, eq(conversations.id, conversationMessages.conversationId)).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId), isCurrent)).get();
43361
43400
  return found2 ? String(found2.pk) : void 0;
43362
43401
  }, "conversationOf");
43402
+ var chunkMessagesOf = /* @__PURE__ */ __name(({ orm }, accountPk2, conversationPk, first, last, limit) => orm.all(sql`SELECT m.external_id AS id, m.sender_name AS sender, m.text, m.outgoing
43403
+ FROM conversations c
43404
+ JOIN chats ch ON ch.id = c.chat_id AND ch.account_id = ${accountPk2}
43405
+ JOIN messages f ON f.chat_id = c.chat_id AND f.external_id = ${first}
43406
+ JOIN messages l ON l.chat_id = c.chat_id AND l.external_id = ${last}
43407
+ JOIN conversation_messages cm ON cm.conversation_id = c.id
43408
+ JOIN messages m ON m.id = cm.message_id
43409
+ WHERE c.id = ${conversationPk} AND m.deleted_at IS NULL AND m.text != ''
43410
+ AND (m.sent_at, m.id) >= (f.sent_at, f.id) AND (m.sent_at, m.id) <= (l.sent_at, l.id)
43411
+ ORDER BY m.sent_at, m.id LIMIT ${limit}`).map(({ outgoing, ...line }) => ({ ...line, outgoing: Boolean(outgoing) })), "chunkMessagesOf");
43412
+ var chunkRepliesOf = /* @__PURE__ */ __name(({ orm }, accountPk2, chunks2, limit) => {
43413
+ const found2 = chunks2.map(() => []);
43414
+ const wanted = chunks2.map(({ conversationId, firstMessageId, lastMessageId }) => ({
43415
+ c: Number(conversationId),
43416
+ f: firstMessageId,
43417
+ l: lastMessageId
43418
+ }));
43419
+ if (!wanted.length)
43420
+ return found2;
43421
+ const rows = orm.all(sql`WITH want(n, conv, first, last) AS (SELECT key, json_extract(value, '$.c'), json_extract(value, '$.f'),
43422
+ json_extract(value, '$.l') FROM json_each(${JSON.stringify(wanted)})),
43423
+ inside(n, id) AS MATERIALIZED (SELECT w.n, m.id
43424
+ FROM want w
43425
+ JOIN conversations c ON c.id = w.conv
43426
+ JOIN chats ch ON ch.id = c.chat_id AND ch.account_id = ${accountPk2}
43427
+ JOIN messages f ON f.chat_id = c.chat_id AND f.external_id = w.first
43428
+ JOIN messages l ON l.chat_id = c.chat_id AND l.external_id = w.last
43429
+ JOIN conversation_messages cm ON cm.conversation_id = c.id
43430
+ JOIN messages m ON m.id = cm.message_id
43431
+ WHERE (m.sent_at, m.id) >= (f.sent_at, f.id) AND (m.sent_at, m.id) <= (l.sent_at, l.id))
43432
+ SELECT DISTINCT i.n, r.external_id AS id, r.sender_name AS sender, r.text, r.outgoing, r.sent_at, r.id AS pk
43433
+ FROM inside i
43434
+ JOIN message_links k ON k.parent_id = i.id AND k.kind = 'reply' AND k.stale_at IS NULL
43435
+ JOIN messages r ON r.id = k.message_id
43436
+ WHERE r.deleted_at IS NULL AND r.text != '' AND NOT EXISTS (SELECT 1 FROM inside o WHERE o.n = i.n AND o.id = r.id)
43437
+ ORDER BY i.n, r.sent_at, r.id`);
43438
+ for (const { n, id: id2, sender, text: text9, outgoing } of rows) {
43439
+ const list2 = found2[n];
43440
+ if (list2 && list2.length < limit)
43441
+ list2.push({ id: id2, sender, text: text9, outgoing: Boolean(outgoing) });
43442
+ }
43443
+ return found2;
43444
+ }, "chunkRepliesOf");
43363
43445
  var staleLink = /* @__PURE__ */ __name((chatKey) => sql`(${messageLinks.staleAt} IS NOT NULL
43364
43446
  OR EXISTS (SELECT 1 FROM message_revisions r WHERE r.message_id IN (${messageLinks.messageId}, ${messageLinks.parentId})
43365
43447
  AND r.created_at >= ${messageLinks.createdAt})
@@ -43408,7 +43490,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
43408
43490
  AND NOT EXISTS (SELECT 1 FROM messages d
43409
43491
  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");
43410
43492
 
43411
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/conversations.js
43493
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/conversations.js
43412
43494
  var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
43413
43495
  const { database } = context;
43414
43496
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -43452,6 +43534,15 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
43452
43534
  const found2 = summariesOf(context, accountPk2, pks.filter((pk) => pk !== void 0));
43453
43535
  return pks.map((pk) => pk === void 0 ? void 0 : found2.get(pk));
43454
43536
  }, "conversationsOfMessages"),
43537
+ chunkMessages: /* @__PURE__ */ __name(async (key2, conversationId, { firstMessageId, lastMessageId }, limit) => {
43538
+ const accountPk2 = findAccountPk2(key2);
43539
+ const pk = Number(conversationId);
43540
+ return accountPk2 === void 0 || !Number.isSafeInteger(pk) ? [] : chunkMessagesOf(context, accountPk2, pk, firstMessageId, lastMessageId, limit);
43541
+ }, "chunkMessages"),
43542
+ chunkReplies: /* @__PURE__ */ __name(async (key2, chunks2, limit) => {
43543
+ const accountPk2 = findAccountPk2(key2);
43544
+ return accountPk2 === void 0 ? chunks2.map(() => []) : chunkRepliesOf(context, accountPk2, chunks2, limit);
43545
+ }, "chunkReplies"),
43455
43546
  links: /* @__PURE__ */ __name(async (key2, chatId, messageId, options) => {
43456
43547
  const chatKey = chatKeyOf(key2, chatId);
43457
43548
  return chatKey === void 0 ? [] : linksOf(context, chatKey, messageId, options?.limit);
@@ -43515,7 +43606,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
43515
43606
  };
43516
43607
  }, "conversationsStoreOver");
43517
43608
 
43518
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/counters.js
43609
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/counters.js
43519
43610
  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";
43520
43611
  var accountCountersOver = /* @__PURE__ */ __name((context) => {
43521
43612
  const { database } = context;
@@ -43540,7 +43631,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
43540
43631
  counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
43541
43632
  }), "countersStoreOver");
43542
43633
 
43543
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
43634
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
43544
43635
  var MENTION_STATUSES = ["found", "linked", "proposed", "dismissed"];
43545
43636
  var MENTION_QUERY = defineQuery({
43546
43637
  entity: "mention",
@@ -43759,7 +43850,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
43759
43850
  return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
43760
43851
  }, "listPlaces");
43761
43852
 
43762
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/mentions.js
43853
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/mentions.js
43763
43854
  var accountMentionsOver = /* @__PURE__ */ __name((context) => {
43764
43855
  const { database } = context;
43765
43856
  const { findAccountPk: findAccountPk2 } = keysOver(context);
@@ -43794,7 +43885,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
43794
43885
  places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
43795
43886
  }), "mentionsStoreOver");
43796
43887
 
43797
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
43888
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
43798
43889
  var FAR = Number.MAX_SAFE_INTEGER;
43799
43890
  var MUTED_NOW = "(coalesce(c.muted,0)=1 AND (c.muted_until IS NULL OR c.muted_until>?))";
43800
43891
  var chatsIn = /* @__PURE__ */ __name((scope3, kinds2, now2) => {
@@ -43893,7 +43984,7 @@ var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
43893
43984
  });
43894
43985
  }, "waitingChats");
43895
43986
 
43896
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-activity-counts.js
43987
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-activity-counts.js
43897
43988
  var SQL = `SELECT coalesce(nullif(trim(c.title), ''), (SELECT sender_name FROM messages WHERE chat_id = c.id AND outgoing = 0 AND deleted_at IS NULL ORDER BY sent_at DESC LIMIT 1)) AS title, ${MUTED_NOW} AS muted, w.messages, w.sent, (SELECT max(sent_at) FROM messages WHERE chat_id = c.id AND deleted_at IS NULL AND sent_at < ?) AS last FROM chats c, (SELECT count(*) AS messages, coalesce(sum(outgoing = 1), 0) AS sent FROM messages WHERE chat_id = ? AND deleted_at IS NULL AND sent_at >= ? AND sent_at < ?) w WHERE c.id = ?`;
43898
43989
  var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since, until, now: now2 }) => {
43899
43990
  const statement = database.prepare(SQL);
@@ -43913,7 +44004,7 @@ var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since
43913
44004
  return found2;
43914
44005
  }, "chatActivityCounts");
43915
44006
 
43916
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
44007
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
43917
44008
  var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
43918
44009
  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");
43919
44010
  const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
@@ -43928,7 +44019,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
43928
44019
  }));
43929
44020
  }, "documentLinkMessages");
43930
44021
 
43931
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
44022
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
43932
44023
  var stemmerFor = stemmerCache();
43933
44024
  var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
43934
44025
  if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
@@ -43972,7 +44063,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
43972
44063
  });
43973
44064
  }, "laterSharingRare");
43974
44065
 
43975
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/messages.js
44066
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/messages.js
43976
44067
  var accountMessagesOver = /* @__PURE__ */ __name((context) => {
43977
44068
  const { database } = context;
43978
44069
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
@@ -44113,7 +44204,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
44113
44204
  laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
44114
44205
  }), "messagesStoreOver");
44115
44206
 
44116
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-links.js
44207
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-links.js
44117
44208
  var AGENT_METHOD = "agent";
44118
44209
  var personsOf = /* @__PURE__ */ __name(({ database }) => new Map(database.prepare("SELECT identity_id, person_id FROM identity_links").all().map((row2) => [Number(row2.identity_id), Number(row2.person_id)])), "personsOf");
44119
44210
  var weaknessOf = /* @__PURE__ */ __name((context, kind3, value, holders, sides, others) => {
@@ -44257,7 +44348,7 @@ var agentMerges = /* @__PURE__ */ __name((context, { limit, offset }) => {
44257
44348
  return { items: found2.slice(offset, offset + limit), hasMore: found2.length > offset + limit };
44258
44349
  }, "agentMerges");
44259
44350
 
44260
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-rekey.js
44351
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-rekey.js
44261
44352
  var quoted2 = /* @__PURE__ */ __name((name) => `"${name.replace(/"/g, '""')}"`, "quoted");
44262
44353
  var columnsOf3 = /* @__PURE__ */ __name((database, table) => database.prepare("SELECT name, pk, type FROM pragma_table_info(?)").all(table), "columnsOf");
44263
44354
  var foreignKeysTo = /* @__PURE__ */ __name((database, table) => database.prepare(`SELECT m.name AS tbl, f."from" AS col FROM sqlite_master m JOIN pragma_foreign_key_list(m.name) f
@@ -44401,7 +44492,7 @@ var rekeyIdentities = /* @__PURE__ */ __name((context, provider, pairs, { lockMs
44401
44492
  return done;
44402
44493
  }, "rekeyIdentities");
44403
44494
 
44404
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/person-kinds.js
44495
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/person-kinds.js
44405
44496
  var PERSON_KINDS = ["person", "organization", "automated", "stranger", "unsorted", "test"];
44406
44497
  var AUTOMATED_WORDS = /* @__PURE__ */ new Set([
44407
44498
  "noreply",
@@ -44464,7 +44555,7 @@ var isCompanyName = /* @__PURE__ */ __name((name) => {
44464
44555
  return wordsOf3(name.replaceAll(".", "")).some((word2) => LEGAL_FORMS.has(word2) || COMPANY_WORDS.has(word2));
44465
44556
  }, "isCompanyName");
44466
44557
 
44467
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-ties.js
44558
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/person-ties.js
44468
44559
  var SMALL_GROUP_MEMBERS = 10;
44469
44560
  var PERSON_TIES = ["chat", "small-group", "mail", "meeting", "crm", "phone-book"];
44470
44561
  var ALWAYS_SHOWN = ["owner", "added", "task"];
@@ -44519,7 +44610,7 @@ var shownReasons = /* @__PURE__ */ __name((database, people2) => {
44519
44610
  return new Map([...found2].map(([person2, reasons]) => [person2, ORDER.filter((one2) => reasons.has(one2))]));
44520
44611
  }, "shownReasons");
44521
44612
 
44522
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/people-list.js
44613
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/people-list.js
44523
44614
  var PEOPLE_SORTS = ["interactions", "recent", "name", "tasks"];
44524
44615
  var MIN_QUERY = 3;
44525
44616
  var matching2 = /* @__PURE__ */ __name((query) => {
@@ -44864,7 +44955,7 @@ var similarPeople = /* @__PURE__ */ __name((database, typed, limit) => {
44864
44955
  return withLastContact(database, rows).map((person2, at2) => ({ ...person2, sameName: same[at2] === true }));
44865
44956
  }, "similarPeople");
44866
44957
 
44867
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-doubts.js
44958
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/person-doubts.js
44868
44959
  var DOUBT_REASONS = ["owner-other-name", "test-data", "shared-address", "mixed-names"];
44869
44960
  var COLUMNS5 = "l.person_id AS person, p.owner, p.name AS person_name, i.id AS pk, i.provider, i.external_id, i.name, i.phone, i.email, i.username, l.method, l.author, l.created_at, EXISTS (SELECT 1 FROM accounts a WHERE a.provider = i.provider AND a.external_id = i.external_id) AS account FROM identity_links l JOIN identities i ON i.id = l.identity_id JOIN persons p ON p.id = l.person_id";
44870
44961
  var text5 = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? value : null, "text");
@@ -45120,7 +45211,7 @@ var markTestData = /* @__PURE__ */ __name((context, uid, by) => {
45120
45211
  return { person: `person:${person2}`, identities: identities2 };
45121
45212
  }, "markTestData");
45122
45213
 
45123
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
45214
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
45124
45215
  var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
45125
45216
  var IN_SCOPES = "IN (SELECT value FROM json_each(?))";
45126
45217
  var projectScope = /* @__PURE__ */ __name((id2) => `(SELECT p.scope FROM main.projects p WHERE p.id=${id2})`, "projectScope");
@@ -45189,7 +45280,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, {
45189
45280
  });
45190
45281
  }, "personPreparation");
45191
45282
 
45192
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
45283
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
45193
45284
  var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
45194
45285
  const id2 = Number(uid);
45195
45286
  if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
@@ -45197,7 +45288,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
45197
45288
  return Boolean(database.prepare("SELECT 1 FROM persons p JOIN identity_links l ON l.person_id=p.id JOIN account_identities a ON a.identity_id=l.identity_id WHERE p.id=? AND a.account_id IN (SELECT value FROM json_each(?)) LIMIT 1").get(currentPerson(database, id2), JSON.stringify(accountIds)));
45198
45289
  }, "personSeenInAccounts");
45199
45290
 
45200
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
45291
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
45201
45292
  var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
45202
45293
  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);
45203
45294
  if (!row2)
@@ -45264,7 +45355,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
45264
45355
  return { id: id2, personId, removed: true };
45265
45356
  }, "removeNote");
45266
45357
 
45267
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/people.js
45358
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/people.js
45268
45359
  var accountPeopleOver = /* @__PURE__ */ __name((context) => {
45269
45360
  const { database } = context;
45270
45361
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
@@ -45407,13 +45498,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
45407
45498
  };
45408
45499
  }, "peopleStoreOver");
45409
45500
 
45410
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
45501
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
45411
45502
  import { createHash as createHash9 } from "node:crypto";
45412
45503
 
45413
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
45504
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
45414
45505
  import { createHash as createHash8 } from "node:crypto";
45415
45506
 
45416
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
45507
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
45417
45508
  var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
45418
45509
  var AUTHOR_MEASURES = [
45419
45510
  "messages",
@@ -45553,7 +45644,7 @@ var withoutUrls = /* @__PURE__ */ __name((text9) => text9.replace(/\S+/gu, (toke
45553
45644
  var rankingWords = /* @__PURE__ */ __name((text9) => withoutUrls(text9).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
45554
45645
  var rankingQuestion = /* @__PURE__ */ __name((text9) => withoutUrls(text9).includes("?"), "rankingQuestion");
45555
45646
 
45556
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
45647
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
45557
45648
  var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
45558
45649
  var exhausted2 = /* @__PURE__ */ __name((budget) => {
45559
45650
  throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
@@ -45775,7 +45866,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
45775
45866
  };
45776
45867
  }, "rankReplyGraph");
45777
45868
 
45778
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
45869
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
45779
45870
  var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
45780
45871
  var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
45781
45872
  var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
@@ -45949,7 +46040,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
45949
46040
  return { items, evidence, summary, graph: graph.quality };
45950
46041
  }, "calculateAdminStatistics");
45951
46042
 
45952
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
46043
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
45953
46044
  var rankingContextRange = /* @__PURE__ */ __name((root) => {
45954
46045
  const dates = [];
45955
46046
  const visit = /* @__PURE__ */ __name((node, required3) => {
@@ -45971,7 +46062,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
45971
46062
  return dates[0].node.resolution.date;
45972
46063
  }, "rankingContextRange");
45973
46064
 
45974
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
46065
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
45975
46066
  var reactionCounts = /* @__PURE__ */ __name((stored4) => {
45976
46067
  let counts;
45977
46068
  try {
@@ -46266,14 +46357,14 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
46266
46357
  });
46267
46358
  }, "rankQuery");
46268
46359
 
46269
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
46360
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
46270
46361
  function fail2(message3, reason = "query.too-large") {
46271
46362
  throw new CliError("validation_error", message3, { reason, complete: false });
46272
46363
  }
46273
46364
  __name(fail2, "fail");
46274
46365
  var joined2 = "FROM messages m JOIN chats c ON c.id=m.chat_id JOIN accounts ac ON ac.id=m.account_id LEFT JOIN identities i ON i.id=m.sender_identity_id";
46275
- var attachmentSnapshot = `(SELECT json_group_array(json_object('position',position,'kind',kind,'mime',mime,'name',name,'title',title,'url',url,'size',size,'width',width,'height',height,'duration',duration,'localPath',local_path)) FROM attachments WHERE attachable_type='message' AND attachable_id=m.id)`;
46276
- var snapshot = `json_object('edited',m.edited_at,'senderName',m.sender_name,'reply',m.reply_to,'forward',m.forward,'reactions',m.reactions,'outgoing',m.outgoing,'thread',m.thread_external_id,'attachments',${attachmentSnapshot},'counterObservations',(SELECT json_group_array(json_object('counter',counter,'value',value,'at',created_at,'source',source)) FROM message_counter_observations WHERE message_id=m.id))`;
46366
+ var attachmentSnapshot = `json((SELECT json_group_array(json_object('position',position,'kind',kind,'mime',mime,'name',name,'title',title,'url',url,'size',size,'width',width,'height',height,'duration',duration,'localPath',local_path)) FROM attachments WHERE attachable_type='message' AND attachable_id=m.id))`;
46367
+ var snapshot = `json_object('edited',m.edited_at,'senderName',m.sender_name,'reply',m.reply_to,'forward',m.forward,'reactions',m.reactions,'outgoing',m.outgoing,'thread',m.thread_external_id,'attachments',${attachmentSnapshot},'counterObservations',json((SELECT json_group_array(json_object('counter',counter,'value',value,'at',created_at,'source',source)) FROM message_counter_observations WHERE message_id=m.id)))`;
46277
46368
  var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request) => withQuerySelection(context, execution, (selection, check3) => {
46278
46369
  const { database } = context, { options } = request;
46279
46370
  const prefix = `WITH selected AS (${selection.sql}) `;
@@ -46443,7 +46534,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
46443
46534
  return result;
46444
46535
  }), "adminStatisticsQuery");
46445
46536
 
46446
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
46537
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
46447
46538
  var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
46448
46539
  if (!execution.accounts.length)
46449
46540
  return { conversations: [], chats: [] };
@@ -46461,7 +46552,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
46461
46552
  return { conversations: conversations2, chats: chats2 };
46462
46553
  }, "conversationEligibility");
46463
46554
 
46464
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
46555
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
46465
46556
  import { createHash as createHash10 } from "node:crypto";
46466
46557
  var EVIDENCE_BYTES = 64 * 1024;
46467
46558
  var FINGERPRINT_BYTES = 8 * 1024 * 1024;
@@ -46611,7 +46702,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
46611
46702
  return result;
46612
46703
  }, "rankingEvidence");
46613
46704
 
46614
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/queries.js
46705
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/queries.js
46615
46706
  var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
46616
46707
  const mailIndexed = /* @__PURE__ */ __name((execution) => {
46617
46708
  if (execution.corpus === "mail")
@@ -46632,7 +46723,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
46632
46723
  };
46633
46724
  }, "queriesStoreOver");
46634
46725
 
46635
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
46726
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
46636
46727
  var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
46637
46728
  const { database, now: now2 } = context;
46638
46729
  const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
@@ -46671,10 +46762,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
46671
46762
  }));
46672
46763
  }, "chatEventsOf");
46673
46764
 
46674
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
46765
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
46675
46766
  import { createHash as createHash11 } from "node:crypto";
46676
46767
 
46677
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/calendar.js
46768
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/calendar.js
46678
46769
  var calendarKey = /* @__PURE__ */ __name((zone, by) => {
46679
46770
  const format = new Intl.DateTimeFormat("en-CA", {
46680
46771
  timeZone: zone,
@@ -46694,7 +46785,7 @@ var weekKey = /* @__PURE__ */ __name((day3) => {
46694
46785
  return date3.toISOString().slice(0, 10);
46695
46786
  }, "weekKey");
46696
46787
 
46697
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/retention.js
46788
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/retention.js
46698
46789
  var RETENTION_TOLERANCE = 864e5;
46699
46790
  var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
46700
46791
  const { since, until, cutoff, checkpoints, within, limit, by } = options;
@@ -46748,7 +46839,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
46748
46839
  return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
46749
46840
  }, "retentionCohorts");
46750
46841
 
46751
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
46842
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
46752
46843
  var iso10 = /* @__PURE__ */ __name((at2) => new Date(at2).toISOString(), "iso");
46753
46844
  var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
46754
46845
  validateRetentionOptions(options);
@@ -46879,7 +46970,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
46879
46970
  };
46880
46971
  }, "retentionQuery");
46881
46972
 
46882
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
46973
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
46883
46974
  var iso11 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
46884
46975
  var marksOf = /* @__PURE__ */ __name(({ isBot: isBot2, flagged, deleted, hasPhoto }) => ({
46885
46976
  ...isBot2 === void 0 ? {} : { bot: isBot2 },
@@ -47008,7 +47099,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
47008
47099
  lastCount: memberCountsOf(context, pk).at(-1) ?? null
47009
47100
  })), "trackedChats");
47010
47101
 
47011
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/roster.js
47102
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/roster.js
47012
47103
  var rosterStoreOver = /* @__PURE__ */ __name((context) => {
47013
47104
  const { database } = context;
47014
47105
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
@@ -47064,7 +47155,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
47064
47155
  };
47065
47156
  }, "rosterStoreOver");
47066
47157
 
47067
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
47158
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
47068
47159
  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");
47069
47160
  var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
47070
47161
  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 ?`);
@@ -47088,7 +47179,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
47088
47179
  }
47089
47180
  }, "backfillNormalized");
47090
47181
 
47091
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
47182
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
47092
47183
  var INDEX2 = "message_words";
47093
47184
  var searchIndexState2 = /* @__PURE__ */ __name((database) => {
47094
47185
  const row2 = indexRow(database, INDEX2);
@@ -47215,7 +47306,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
47215
47306
  });
47216
47307
  }, "resetSearchIndex");
47217
47308
 
47218
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
47309
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
47219
47310
  var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
47220
47311
  const filled = { stemmed: 0, drained: 0 };
47221
47312
  const before2 = stemsState(database);
@@ -47310,7 +47401,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
47310
47401
  return resetStems(database, { now: now2 });
47311
47402
  }, "followDefaultStemmers");
47312
47403
 
47313
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
47404
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
47314
47405
  var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
47315
47406
  var knownTerms = /* @__PURE__ */ __name(({ database }, terms) => {
47316
47407
  const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
@@ -47332,7 +47423,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
47332
47423
  });
47333
47424
  }, "termCandidates");
47334
47425
 
47335
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/search-index.js
47426
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/search-index.js
47336
47427
  var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
47337
47428
  const { database } = context;
47338
47429
  const stemmerFor2 = stemmerCache();
@@ -47357,7 +47448,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
47357
47448
  };
47358
47449
  }, "searchIndexStoreOver");
47359
47450
 
47360
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
47451
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
47361
47452
  var HISTORY_KEPT = 1e3;
47362
47453
  var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
47363
47454
  var COLUMNS6 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
@@ -47427,7 +47518,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
47427
47518
  return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
47428
47519
  }, "clearHistory");
47429
47520
 
47430
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/searches.js
47521
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/searches.js
47431
47522
  var searchesStoreOver = /* @__PURE__ */ __name((context) => {
47432
47523
  const { database } = context;
47433
47524
  return {
@@ -47451,7 +47542,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
47451
47542
  };
47452
47543
  }, "searchesStoreOver");
47453
47544
 
47454
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/added-sources.js
47545
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/added-sources.js
47455
47546
  import { createHash as createHash12 } from "node:crypto";
47456
47547
  var ADDED_KINDS = ["text", "file", "page"];
47457
47548
  var TEXT_COLUMNS = "kind = ?, title = ?, file_name = ?, extension = ?, url = ?, mime = ?, size = ?, content_hash = ?, body = ?, extraction = ?, metadata = ?, language = ?";
@@ -47693,7 +47784,7 @@ var addedSourcesOver = /* @__PURE__ */ __name((context) => {
47693
47784
  };
47694
47785
  }, "addedSourcesOver");
47695
47786
 
47696
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
47787
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
47697
47788
  var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
47698
47789
  var ACTION_OUTCOMES = ["ok", "refused", "failed"];
47699
47790
  var CODE = /^[a-z][a-z0-9_]{0,63}$/;
@@ -47741,7 +47832,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
47741
47832
  };
47742
47833
  }, "agentActionsStoreOver");
47743
47834
 
47744
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/base-suggest.js
47835
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/base-suggest.js
47745
47836
  var baseSettingKey = /* @__PURE__ */ __name((kind3) => `stages.base.${kind3}`, "baseSettingKey");
47746
47837
  var storedPipeline = /* @__PURE__ */ __name((value) => {
47747
47838
  if (typeof value !== "string")
@@ -47787,11 +47878,11 @@ var suggestBaseStages = /* @__PURE__ */ __name((database, kind3, pipelines2, { o
47787
47878
  }
47788
47879
  }, "suggestBaseStages");
47789
47880
 
47790
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/copy-viewer.js
47881
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/copy-viewer.js
47791
47882
  var viewerSql = /* @__PURE__ */ __name((alias2, viewer) => viewer === void 0 ? { sql: "1", params: [] } : viewer.assignee === null ? { sql: "0", params: [] } : { sql: `json_extract(${alias2}.metadata, '$.assignee') = ?`, params: [viewer.assignee] }, "viewerSql");
47792
47883
  var seenBy = /* @__PURE__ */ __name((viewer, row2) => viewer === void 0 || row2.provider !== viewer.account.provider || row2.account !== viewer.account.account || viewer.assignee !== null && row2.assignee === viewer.assignee, "seenBy");
47793
47884
 
47794
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/records.js
47885
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/records.js
47795
47886
  import { createHash as createHash13 } from "node:crypto";
47796
47887
  var RECORDS_SCHEMA_VERSION = 1;
47797
47888
  var RECORD_OPERATIONS = ["upsert", "delete"];
@@ -48122,7 +48213,7 @@ var fieldReferences = /* @__PURE__ */ __name((record3, options = {}) => {
48122
48213
  return found2;
48123
48214
  }, "fieldReferences");
48124
48215
 
48125
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-rows.js
48216
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-rows.js
48126
48217
  var TABLES2 = { deal: "deals", lead: "leads" };
48127
48218
  var MONEY_REFUSALS = ["money.currency", "money.amount"];
48128
48219
  var amountFault = /* @__PURE__ */ __name((item, code) => {
@@ -48294,7 +48385,7 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
48294
48385
  return { savePipeline, saveItemRow };
48295
48386
  }, "crmRowsOver");
48296
48387
 
48297
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-activities.js
48388
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-activities.js
48298
48389
  var ACTIVITY_RECORD = "crm.activity";
48299
48390
  var forgetActivitiesOn = /* @__PURE__ */ __name((database, accountId, kind3, externalIds, at2) => {
48300
48391
  const removed = "rr.target_type = ? AND rr.target_external_id IN (SELECT value FROM json_each(?))";
@@ -48482,7 +48573,7 @@ var seenSql = /* @__PURE__ */ __name((viewer) => {
48482
48573
  };
48483
48574
  }, "seenSql");
48484
48575
 
48485
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-stage-entries.js
48576
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-stage-entries.js
48486
48577
  var STAGE_ENTRY_RECORD = "crm.stage-entry";
48487
48578
  var STAGE_ENTRY_DAYS = 90;
48488
48579
  var STAGE_TASK_DAYS = 7;
@@ -48550,7 +48641,7 @@ var crmStageEntriesOver = /* @__PURE__ */ __name((context) => {
48550
48641
  return { save: save2, pending, handled, expire };
48551
48642
  }, "crmStageEntriesOver");
48552
48643
 
48553
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/stage-amounts.js
48644
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/stage-amounts.js
48554
48645
  var TABLES3 = { deal: "deals", lead: "leads" };
48555
48646
  var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, { since, until }, viewer) => {
48556
48647
  const seen = viewerSql("d", viewer);
@@ -48568,7 +48659,7 @@ var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, { si
48568
48659
  });
48569
48660
  }, "stageAmountsOf");
48570
48661
 
48571
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/pipeline-period.js
48662
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/pipeline-period.js
48572
48663
  var TABLES4 = { deal: "deals", lead: "leads" };
48573
48664
  var DAY7 = 864e5;
48574
48665
  var LOST_REASONS = 10;
@@ -48725,7 +48816,7 @@ var pipelinePeriod = /* @__PURE__ */ __name((context, pipeline, window, zone, vi
48725
48816
  };
48726
48817
  }, "pipelinePeriod");
48727
48818
 
48728
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/deals.js
48819
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/deals.js
48729
48820
  var TABLES5 = { deal: "deals", lead: "leads" };
48730
48821
  var itemsSql = /* @__PURE__ */ __name((kind3) => `SELECT d.*, s.name AS stage_name, s.pipeline_id, p.name AS pipeline_name, b.name AS author_name, b.kind AS author_kind, a.provider AS account_provider, a.external_id AS account_external_id, bs.id AS base_stage_ref_id, bs.name AS base_stage_name FROM ${TABLES5[kind3]} d JOIN pipeline_stages s ON s.id = d.stage_id JOIN pipelines p ON p.id = s.pipeline_id LEFT JOIN bots b ON d.author_type = 'bot' AND b.id = d.author_id LEFT JOIN accounts a ON a.id = d.account_id LEFT JOIN pipeline_stages bs ON s.base_confirmed = 1 AND bs.id = s.base_stage_id`, "itemsSql");
48731
48822
  var MAX_STAGES = 30;
@@ -49198,7 +49289,7 @@ var dealsStoreOver = /* @__PURE__ */ __name((context) => {
49198
49289
  };
49199
49290
  }, "dealsStoreOver");
49200
49291
 
49201
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/owner-languages.js
49292
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/owner-languages.js
49202
49293
  var KEY2 = "ownerLanguages";
49203
49294
  var ISO_639_1 = new Set("aa ab ae af ak am an ar as av ay az ba be bg bi bm bn bo br bs ca ce ch co cr cs cu cv cy da de dv dz ee el en eo es et eu fa ff fi fj fo fr fy ga gd gl gn gu gv ha he hi ho hr ht hu hy hz ia id ie ig ii ik io is it iu ja jv ka kg ki kj kk kl km kn ko kr ks ku kv kw ky la lb lg li ln lo lt lu lv mg mh mi mk ml mn mr ms mt my na nb nd ne ng nl nn no nr nv ny oc oj om or os pa pi pl ps pt qu rm rn ro ru rw sa sc sd se sg si sk sl sm sn so sq sr ss st su sv sw ta te tg th ti tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa wo xh yi yo za zh zu".split(" "));
49204
49295
  var DEFAULT_OWNER_LANGUAGES = ["ru"];
@@ -49228,7 +49319,7 @@ var saveOwnerLanguages = /* @__PURE__ */ __name((database, languages, now2) => {
49228
49319
  database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(KEY2, JSON.stringify(languages), now2);
49229
49320
  }, "saveOwnerLanguages");
49230
49321
 
49231
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/base-stages.js
49322
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/base-stages.js
49232
49323
  var OUTCOMES = {
49233
49324
  lead: ["open", "open", "open", "won", "lost"],
49234
49325
  deal: ["open", "open", "open", "open", "won", "lost"]
@@ -49561,7 +49652,7 @@ var baseStagesStoreOver = /* @__PURE__ */ __name((context) => {
49561
49652
  };
49562
49653
  }, "baseStagesStoreOver");
49563
49654
 
49564
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
49655
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
49565
49656
  var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
49566
49657
  }) => {
49567
49658
  const { database, now: now2 } = context;
@@ -49620,7 +49711,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
49620
49711
  };
49621
49712
  }, "botUpdateStoreOver");
49622
49713
 
49623
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projection.js
49714
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projection.js
49624
49715
  var IMPORTER = { bot: "import" };
49625
49716
  var importersProposal = /* @__PURE__ */ __name((entity) => entity.review === "proposed" && entity.author.type === "bot" && entity.author.name === IMPORTER.bot, "importersProposal");
49626
49717
  var codeOf = /* @__PURE__ */ __name((error) => {
@@ -49665,7 +49756,7 @@ var moneyLinesOf = /* @__PURE__ */ __name((projection, list2) => (Array.isArray(
49665
49756
  };
49666
49757
  }), "moneyLinesOf");
49667
49758
 
49668
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/relation-role-labels.js
49759
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/relation-role-labels.js
49669
49760
  var label = /* @__PURE__ */ __name((en, ru, es) => ({ en, ru, es }), "label");
49670
49761
  var ROLE_LABELS = {
49671
49762
  organization: {
@@ -49706,7 +49797,7 @@ var ROLE_LABELS = {
49706
49797
  }
49707
49798
  };
49708
49799
 
49709
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-roles.js
49800
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-roles.js
49710
49801
  var settingOf = /* @__PURE__ */ __name((list2) => `relationships.roles.${list2}`, "settingOf");
49711
49802
  var isList = /* @__PURE__ */ __name((list2) => Object.hasOwn(ROLE_LISTS, list2), "isList");
49712
49803
  var listOf2 = /* @__PURE__ */ __name((list2) => {
@@ -49790,7 +49881,7 @@ var relationRolesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
49790
49881
  };
49791
49882
  }, "relationRolesOver");
49792
49883
 
49793
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-settings.js
49884
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-settings.js
49794
49885
  var CRM_LINK_MODES = ["reported", "review"];
49795
49886
  var COMPANY_TYPE_MEANINGS = ["customer-of", "supplier", "partner-of"];
49796
49887
  var CRM_SCOPES = ["mine", "all"];
@@ -50021,7 +50112,7 @@ var crmSettingsOf = /* @__PURE__ */ __name((database) => database.prepare("SELEC
50021
50112
  return [{ setting: String(row2.key), value: settingValue(database, parsed5.key, parsed5.name) }];
50022
50113
  }), "crmSettingsOf");
50023
50114
 
50024
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
50115
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
50025
50116
  var isoOf = /* @__PURE__ */ __name((ms) => ms === void 0 ? null : new Date(ms).toISOString(), "isoOf");
50026
50117
  var relationOf = /* @__PURE__ */ __name((link3, now2) => ({
50027
50118
  id: link3.id,
@@ -50381,7 +50472,7 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
50381
50472
  provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
50382
50473
  }, "decidedOrigin");
50383
50474
 
50384
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/reported-relations.js
50475
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/reported-relations.js
50385
50476
  var keyOf4 = /* @__PURE__ */ __name((kind3, fromType, fromId, toType, toId, role) => `${String(kind3)}|${String(fromType)}:${String(fromId)}|${String(toType)}:${String(toId)}|${role == null ? "" : String(role)}`, "keyOf");
50386
50477
  var metadataOf = /* @__PURE__ */ __name((relation) => relation.metadata && Object.keys(relation.metadata).length ? JSON.stringify(relation.metadata) : null, "metadataOf");
50387
50478
  var syncReportedIn = /* @__PURE__ */ __name((context, key2, relationships, scope3, { source: source2 = "import", by = { bot: key2.provider, kind: "rule" }, onOutcome } = {}) => {
@@ -50519,7 +50610,7 @@ var relationsStoreOver = /* @__PURE__ */ __name((context) => ({
50519
50610
  syncReported: /* @__PURE__ */ __name(async (key2, relationships, scope3, options) => write(context.database, () => syncReportedIn(context, key2, relationships, scope3, options)), "syncReported")
50520
50611
  }), "relationsStoreOver");
50521
50612
 
50522
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relationships.js
50613
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relationships.js
50523
50614
  var importSource = /* @__PURE__ */ __name((provider) => `import:${provider}`, "importSource");
50524
50615
  var noRelationships = /* @__PURE__ */ __name(() => ({
50525
50616
  added: 0,
@@ -50709,7 +50800,7 @@ var recordRelationshipsOver = /* @__PURE__ */ __name((context) => {
50709
50800
  return { report, placeOf: placeOf2, withdrawFrom };
50710
50801
  }, "recordRelationshipsOver");
50711
50802
 
50712
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/business-contracts.js
50803
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/business-contracts.js
50713
50804
  var CONTRACTS = "SELECT k.*, b.name AS author_name, b.kind AS author_kind FROM contracts k LEFT JOIN bots b ON k.author_type = 'bot' AND b.id = k.author_id";
50714
50805
  var DAY_MS2 = 864e5;
50715
50806
  var deadlineOf = /* @__PURE__ */ __name((expiration, days) => expiration === null || days === null ? null : new Date(Date.parse(`${expiration}T00:00:00Z`) - days * DAY_MS2).toISOString().slice(0, 10), "deadlineOf");
@@ -50868,7 +50959,7 @@ var contractsStoreOver = /* @__PURE__ */ __name((context) => {
50868
50959
  };
50869
50960
  }, "contractsStoreOver");
50870
50961
 
50871
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/business-search.js
50962
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/business-search.js
50872
50963
  var BUSINESS_FIND_MAX = 2001;
50873
50964
  var party2 = /* @__PURE__ */ __name((kind3, id2, as) => `LEFT JOIN persons ${as}p ON ${kind3} = 'person' AND ${as}p.id = ${id2} AND ${as}p.owner = 0 LEFT JOIN organizations ${as}o ON ${kind3} = 'organization' AND ${as}o.id = ${id2} LEFT JOIN projects ${as}j ON ${kind3} = 'project' AND ${as}j.id = ${id2}`, "party");
50874
50965
  var partyName = /* @__PURE__ */ __name((as) => `coalesce(${as}p.name, ${as}o.name, ${as}j.name)`, "partyName");
@@ -50973,7 +51064,7 @@ var businessSearchOver = /* @__PURE__ */ __name(({ database }) => {
50973
51064
  };
50974
51065
  }, "businessSearchOver");
50975
51066
 
50976
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
51067
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
50977
51068
  var CATALOG_QUERY = defineQuery({
50978
51069
  entity: "document",
50979
51070
  backend: "sql",
@@ -51206,10 +51297,10 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
51206
51297
  };
51207
51298
  }, "catalogStoreOver");
51208
51299
 
51209
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/content.js
51300
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/content.js
51210
51301
  import { createHash as createHash14 } from "node:crypto";
51211
51302
 
51212
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-files.js
51303
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-files.js
51213
51304
  import { sep } from "node:path";
51214
51305
  var MOST = 500;
51215
51306
  var CURRENTLY = /* @__PURE__ */ __name((table) => `EXISTS (SELECT 1 FROM ${table} r WHERE r.account_id = f.account_id AND r.external_id = f.owner_id AND r.deleted_at IS NULL AND json_extract(r.metadata, '$.assignee') = ?)`, "CURRENTLY");
@@ -51270,7 +51361,7 @@ var crmFilesOver = /* @__PURE__ */ __name((context) => {
51270
51361
  const accountId = accountPk(context, key2);
51271
51362
  database.prepare("INSERT INTO crm_files (account_id, external_id, owner_kind, owner_id, owner_assignee, source, name, name_folded, mime, size, external_created_at, local_path, content_sha256, text, normalized_text, extraction, extraction_error, downloaded_by, downloaded_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT (account_id, external_id) DO UPDATE SET owner_assignee = excluded.owner_assignee, source = excluded.source, name = excluded.name, name_folded = excluded.name_folded, mime = excluded.mime, size = excluded.size, external_created_at = excluded.external_created_at, local_path = excluded.local_path, content_sha256 = excluded.content_sha256, text = excluded.text, normalized_text = excluded.normalized_text, extraction = excluded.extraction, extraction_error = excluded.extraction_error, downloaded_by = excluded.downloaded_by, downloaded_at = excluded.downloaded_at").run(accountId, file.externalId, file.ownerKind, file.ownerId, file.ownerAssignee, file.source, file.name, fold(file.name), file.mime, file.size, file.externalCreatedAt, file.localPath, file.contentSha256, file.text, file.text === null ? null : normalize(file.text), file.extraction, file.extractionError, file.downloadedBy, file.downloadedAt);
51272
51363
  }), "save");
51273
- const rowsOf2 = /* @__PURE__ */ __name((key2, columns2, where, ...params) => {
51364
+ const rowsOf3 = /* @__PURE__ */ __name((key2, columns2, where, ...params) => {
51274
51365
  const accountId = findAccountPk(context, key2);
51275
51366
  if (accountId === void 0)
51276
51367
  return [];
@@ -51316,13 +51407,13 @@ var crmFilesOver = /* @__PURE__ */ __name((context) => {
51316
51407
  return {
51317
51408
  save: /* @__PURE__ */ __name(async (key2, file) => save2(key2, file), "save"),
51318
51409
  get: /* @__PURE__ */ __name(async (key2, externalId) => {
51319
- const [row2] = rowsOf2(key2, `${COLUMNS7}, f.text`, "f.external_id = ?", externalId);
51410
+ const [row2] = rowsOf3(key2, `${COLUMNS7}, f.text`, "f.external_id = ?", externalId);
51320
51411
  return row2 ? { ...rowOf2(row2), text: text6(row2.text) } : void 0;
51321
51412
  }, "get"),
51322
- ofOwner: /* @__PURE__ */ __name(async (key2, kind3, id2) => rowsOf2(key2, COLUMNS7, "f.owner_kind = ? AND f.owner_id = ? ORDER BY f.downloaded_at DESC, f.id DESC", kind3, id2).map(rowOf2), "ofOwner"),
51323
- storedBytes: /* @__PURE__ */ __name(async (key2, folder) => rowsOf2(key2, "coalesce(sum(f.size), 0) AS bytes", `f.local_path IS NOT NULL AND ${under}`, inside(folder), inside(folder)).reduce((sum, row2) => sum + Number(row2.bytes), 0), "storedBytes"),
51324
- droppable: /* @__PURE__ */ __name(async (key2, folder) => rowsOf2(key2, COLUMNS7, `f.local_path IS NOT NULL AND ${under} AND coalesce(f.text, '') <> '' ORDER BY f.downloaded_at, f.id`, inside(folder), inside(folder)).map(rowOf2), "droppable"),
51325
- savedPaths: /* @__PURE__ */ __name(async (key2) => rowsOf2(key2, "f.local_path", "f.local_path IS NOT NULL ORDER BY f.id").map((row2) => String(row2.local_path)), "savedPaths"),
51413
+ ofOwner: /* @__PURE__ */ __name(async (key2, kind3, id2) => rowsOf3(key2, COLUMNS7, "f.owner_kind = ? AND f.owner_id = ? ORDER BY f.downloaded_at DESC, f.id DESC", kind3, id2).map(rowOf2), "ofOwner"),
51414
+ storedBytes: /* @__PURE__ */ __name(async (key2, folder) => rowsOf3(key2, "coalesce(sum(f.size), 0) AS bytes", `f.local_path IS NOT NULL AND ${under}`, inside(folder), inside(folder)).reduce((sum, row2) => sum + Number(row2.bytes), 0), "storedBytes"),
51415
+ droppable: /* @__PURE__ */ __name(async (key2, folder) => rowsOf3(key2, COLUMNS7, `f.local_path IS NOT NULL AND ${under} AND coalesce(f.text, '') <> '' ORDER BY f.downloaded_at, f.id`, inside(folder), inside(folder)).map(rowOf2), "droppable"),
51416
+ savedPaths: /* @__PURE__ */ __name(async (key2) => rowsOf3(key2, "f.local_path", "f.local_path IS NOT NULL ORDER BY f.id").map((row2) => String(row2.local_path)), "savedPaths"),
51326
51417
  forgetFile: /* @__PURE__ */ __name(async (key2, externalId) => {
51327
51418
  const accountId = findAccountPk(context, key2);
51328
51419
  if (accountId === void 0)
@@ -51334,7 +51425,7 @@ var crmFilesOver = /* @__PURE__ */ __name((context) => {
51334
51425
  };
51335
51426
  }, "crmFilesOver");
51336
51427
 
51337
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/content.js
51428
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/content.js
51338
51429
  var MOST2 = 500;
51339
51430
  var TABLE = {
51340
51431
  author: "content_authors",
@@ -51613,7 +51704,7 @@ var contentStoreOver = /* @__PURE__ */ __name((context) => {
51613
51704
  };
51614
51705
  }, "contentStoreOver");
51615
51706
 
51616
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
51707
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
51617
51708
  var remote = /* @__PURE__ */ __name(() => `CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source') IN (${documentAccountProvidersSql()}) ELSE 0 END`, "remote");
51618
51709
  var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${remote()}) THEN
51619
51710
  CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
@@ -51626,7 +51717,7 @@ var contextDocumentTimeKind = /* @__PURE__ */ __name(() => `CASE WHEN (${remoteT
51626
51717
  THEN 'source-modified' ELSE 'stored-update' END`, "contextDocumentTimeKind");
51627
51718
  var contextDocumentUrl = /* @__PURE__ */ __name(() => `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`, "contextDocumentUrl");
51628
51719
 
51629
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
51720
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
51630
51721
  var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
51631
51722
  const { source: source2, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
51632
51723
  signal?.throwIfAborted();
@@ -51725,7 +51816,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
51725
51816
  });
51726
51817
  }, "readMeetingContextEvidence");
51727
51818
 
51728
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
51819
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
51729
51820
  var corpora = {
51730
51821
  message: {
51731
51822
  table: "messages",
@@ -51970,7 +52061,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
51970
52061
  }
51971
52062
  }), "contextRecordsOver");
51972
52063
 
51973
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-changes.js
52064
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-changes.js
51974
52065
  var CRM_CHANGES = [
51975
52066
  "created",
51976
52067
  "moved",
@@ -52113,7 +52204,7 @@ var crmReadsOver = /* @__PURE__ */ __name((context) => {
52113
52204
  };
52114
52205
  }, "crmReadsOver");
52115
52206
 
52116
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-contacts.js
52207
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-contacts.js
52117
52208
  var PLACEHOLDER = /(?:^|\s)null(?:\s+#\d+)?(?=\s|$)/gi;
52118
52209
  var withoutPlaceholder = /* @__PURE__ */ __name((name) => name.replace(PLACEHOLDER, " ").replace(/\s+/g, " ").trim() || null, "withoutPlaceholder");
52119
52210
  var DryRun = class extends Error {
@@ -52192,7 +52283,7 @@ var removeCrmContacts = /* @__PURE__ */ __name((context, key2, { users, before:
52192
52283
  }
52193
52284
  }, "removeCrmContacts");
52194
52285
 
52195
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/crm.js
52286
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/crm.js
52196
52287
  var PENDING = "crm:pending-relations";
52197
52288
  var PENDING_DAYS = 30;
52198
52289
  var PENDING_MOST = 5e3;
@@ -52747,10 +52838,10 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
52747
52838
  };
52748
52839
  }, "crmCopiesOver");
52749
52840
 
52750
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
52841
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
52751
52842
  import { createHash as createHash15, randomBytes as randomBytes2 } from "node:crypto";
52752
52843
 
52753
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/decision-requests.js
52844
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/decision-requests.js
52754
52845
  var DECISION_ACTIONS = ["confirm", "reject", "ask-confirm", "ask-reject", "back", "later"];
52755
52846
  var DECISION_TTL_MS = 72 * 60 * 60 * 1e3;
52756
52847
  var CALLBACK_PREFIX = "wcr1:";
@@ -52764,7 +52855,7 @@ var callbackDataOf = /* @__PURE__ */ __name((token) => {
52764
52855
  }, "callbackDataOf");
52765
52856
  var parseCallbackData = /* @__PURE__ */ __name((data) => typeof data === "string" ? CALLBACK.exec(data)?.[1] : void 0, "parseCallbackData");
52766
52857
 
52767
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
52858
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
52768
52859
  var digestOf = /* @__PURE__ */ __name((token) => createHash15("sha256").update(token).digest("hex"), "digestOf");
52769
52860
  var newToken = /* @__PURE__ */ __name(() => randomBytes2(16).toString("base64url"), "newToken");
52770
52861
  var requestOf = /* @__PURE__ */ __name((row2) => ({
@@ -52863,7 +52954,7 @@ var decisionRequestStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
52863
52954
  };
52864
52955
  }, "decisionRequestStoreOver");
52865
52956
 
52866
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-listing.js
52957
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-listing.js
52867
52958
  var MEETING_ROW_KINDS = ["meeting", "call", "event"];
52868
52959
  var DAY9 = 864e5;
52869
52960
  var JOINED = `(SELECT ce.event_id FROM calendar_entries ce JOIN events je ON je.id = ce.event_id
@@ -53250,7 +53341,7 @@ var meetingListingOver = /* @__PURE__ */ __name((context) => {
53250
53341
  };
53251
53342
  }, "meetingListingOver");
53252
53343
 
53253
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/document-listing.js
53344
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/document-listing.js
53254
53345
  var DOCUMENT_KINDS = [
53255
53346
  "transcript",
53256
53347
  "doc",
@@ -53487,7 +53578,7 @@ var documentListingOver = /* @__PURE__ */ __name((context) => {
53487
53578
  };
53488
53579
  }, "documentListingOver");
53489
53580
 
53490
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
53581
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
53491
53582
  var NOTE_FIELDS = [
53492
53583
  "text",
53493
53584
  "exact",
@@ -53984,7 +54075,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
53984
54075
  };
53985
54076
  }, "noteSearchOver");
53986
54077
 
53987
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
54078
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
53988
54079
  var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
53989
54080
  var inEventAccounts = /* @__PURE__ */ __name((event2) => searchableCopy(event2, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
53990
54081
  var EVENT_CORPUS = {
@@ -54124,7 +54215,7 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
54124
54215
  };
54125
54216
  }, "eventSearchOver");
54126
54217
 
54127
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
54218
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
54128
54219
  var NAMED4 = "SELECT f.*, b.name AS author_name, b.kind AS author_kind FROM facts f LEFT JOIN bots b ON f.author_type = 'bot' AND b.id = f.author_id";
54129
54220
  var iso13 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
54130
54221
  var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
@@ -54387,7 +54478,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
54387
54478
  };
54388
54479
  }, "factsStoreOver");
54389
54480
 
54390
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
54481
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
54391
54482
  var invalid6 = /* @__PURE__ */ __name((message3) => {
54392
54483
  throw new CliError("validation_error", message3);
54393
54484
  }, "invalid");
@@ -54555,7 +54646,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
54555
54646
  return { snapshot: snapshot2, snapshotParts, previous, settle, keepWaiting, named: named2, sameDecision, create };
54556
54647
  }, "findingsCoreOver");
54557
54648
 
54558
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
54649
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
54559
54650
  var stale = /* @__PURE__ */ __name(() => {
54560
54651
  throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
54561
54652
  reason: "evidence-findings.stale"
@@ -54819,7 +54910,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
54819
54910
  };
54820
54911
  }, "evidenceFindingsStoreOver");
54821
54912
 
54822
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
54913
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
54823
54914
  var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
54824
54915
  var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
54825
54916
  rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
@@ -54873,7 +54964,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
54873
54964
  }, "forPerson")
54874
54965
  }), "involvementStoreOver");
54875
54966
 
54876
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/labelled.js
54967
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/labelled.js
54877
54968
  var LABELLED = {
54878
54969
  note: "note",
54879
54970
  document: "document",
@@ -54886,7 +54977,7 @@ var LABELLED = {
54886
54977
  };
54887
54978
  var accountMeetingTagging = /* @__PURE__ */ __name((alias2) => `(${alias2}.taggable_type <> 'meeting' OR EXISTS (SELECT 1 FROM meetings mt WHERE mt.id = ${alias2}.taggable_id AND mt.deleted_at IS NULL AND (? IS NULL OR mt.account_id = ?)))`, "accountMeetingTagging");
54888
54979
 
54889
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
54980
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
54890
54981
  import { createHash as createHash16 } from "node:crypto";
54891
54982
  var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
54892
54983
  var id = /* @__PURE__ */ __name((value) => {
@@ -54972,7 +55063,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
54972
55063
  };
54973
55064
  }, "meetingProjectsStoreOver");
54974
55065
 
54975
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
55066
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
54976
55067
  var ORGANIZATIONS_QUERY = {
54977
55068
  entity: "organization",
54978
55069
  backend: "sql",
@@ -55013,7 +55104,7 @@ var REMINDERS_QUERY = {
55013
55104
  })
55014
55105
  };
55015
55106
 
55016
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/organization-categories.js
55107
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/organization-categories.js
55017
55108
  var OWN2 = "(SELECT id FROM organizations WHERE deleted_at IS NULL AND json_extract(metadata, '$.own') = 1)";
55018
55109
  var EMPLOYED = "('employee', 'contractor', 'founder')";
55019
55110
  var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now2) => {
@@ -55034,7 +55125,7 @@ var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now
55034
55125
  return { sql: `EXISTS (SELECT 1 FROM links l WHERE ${where} AND ${usable})`, params: keys };
55035
55126
  }, "categorySql");
55036
55127
 
55037
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
55128
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
55038
55129
  var organizationOf = /* @__PURE__ */ __name((row2) => ({
55039
55130
  id: String(row2.id),
55040
55131
  ref: `organization:${row2.id}`,
@@ -55079,7 +55170,7 @@ var organizationsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) =>
55079
55170
  }), "setOwnOrganization")
55080
55171
  }), "organizationsStoreOver");
55081
55172
 
55082
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-list.js
55173
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-list.js
55083
55174
  var KINDS = RELATION_KINDS.map(linkKind).join(", ");
55084
55175
  var ACCOUNT_ENDS = [
55085
55176
  ["deal", "deals"],
@@ -55242,13 +55333,13 @@ var relationListOver = /* @__PURE__ */ __name((context) => {
55242
55333
  __name(proposalItem, "proposalItem");
55243
55334
  }, "relationListOver");
55244
55335
 
55245
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-reads.js
55336
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-reads.js
55246
55337
  var relationReadsOver = /* @__PURE__ */ __name((context) => ({
55247
55338
  ...relationListOver(context),
55248
55339
  ...relationRolesOver(context)
55249
55340
  }), "relationReadsOver");
55250
55341
 
55251
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review.js
55342
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review.js
55252
55343
  var TABLES6 = { memory: "memories", fact: "facts" };
55253
55344
  var RETIRED = /* @__PURE__ */ new Set(["superseded", "reversed", "rejected", "stale"]);
55254
55345
  var DEFAULT_LIMIT = 500;
@@ -55491,16 +55582,16 @@ var sourceReviewStoreOver = /* @__PURE__ */ __name((context) => {
55491
55582
  };
55492
55583
  }, "sourceReviewStoreOver");
55493
55584
 
55494
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
55585
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
55495
55586
  import { createHash as createHash19 } from "node:crypto";
55496
55587
 
55497
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
55588
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
55498
55589
  import { createHash as createHash18 } from "node:crypto";
55499
55590
 
55500
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
55591
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
55501
55592
  import { createHash as createHash17 } from "node:crypto";
55502
55593
 
55503
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
55594
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
55504
55595
  var consolidationId = /* @__PURE__ */ __name((value, field4) => {
55505
55596
  if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
55506
55597
  throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
@@ -55551,7 +55642,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
55551
55642
  return input;
55552
55643
  }, "consolidationApplyInput");
55553
55644
 
55554
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
55645
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
55555
55646
  var receiptOf = /* @__PURE__ */ __name((row2) => ({
55556
55647
  id: String(row2.id),
55557
55648
  sourceId: String(row2.source_id),
@@ -55626,7 +55717,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
55626
55717
  }, { beforeCommit: check3 });
55627
55718
  }, "applyTagConsolidation");
55628
55719
 
55629
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
55720
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
55630
55721
  var selections = [
55631
55722
  ["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
55632
55723
  ["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
@@ -55770,7 +55861,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
55770
55861
  };
55771
55862
  }, "previewRows");
55772
55863
 
55773
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
55864
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
55774
55865
  var kinds = ["project", "tag", "topic"];
55775
55866
  var cancelled2 = /* @__PURE__ */ __name((signal) => {
55776
55867
  if (signal?.aborted)
@@ -56034,7 +56125,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
56034
56125
  };
56035
56126
  }, "vocabularyStoreOver");
56036
56127
 
56037
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
56128
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
56038
56129
  var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
56039
56130
  var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
56040
56131
  var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
@@ -56588,7 +56679,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
56588
56679
  return key2.padEnd(3, "X");
56589
56680
  }, "projectKey");
56590
56681
 
56591
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
56682
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
56592
56683
  var DAY10 = 864e5;
56593
56684
  var SETTING5 = "logs_pruned_at";
56594
56685
  var LOG_RETENTION = { agentActionsMs: 90 * DAY10, botUpdatePayloadsMs: 30 * DAY10 };
@@ -56615,7 +56706,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
56615
56706
  };
56616
56707
  }, "logPruner");
56617
56708
 
56618
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/mail/findings.js
56709
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/mail/findings.js
56619
56710
  var MAIL_FINDINGS_PER_RUN = 30;
56620
56711
  var MAIL_FINDINGS_PER_SENDER = 5;
56621
56712
  var invalid8 = /* @__PURE__ */ __name((message3) => {
@@ -56974,7 +57065,7 @@ var checkMailFindings = /* @__PURE__ */ __name((input) => {
56974
57065
  }, "checkMailFindings");
56975
57066
  var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
56976
57067
 
56977
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
57068
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
56978
57069
  var ORDERS = "SELECT o.*, b.name AS author_name, b.kind AS author_kind FROM orders o LEFT JOIN bots b ON o.author_type = 'bot' AND b.id = o.author_id";
56979
57070
  var orderOperationsOver = /* @__PURE__ */ __name((context) => {
56980
57071
  const { database, now: now2 } = context;
@@ -57189,7 +57280,7 @@ var ordersStoreOver = /* @__PURE__ */ __name((context) => {
57189
57280
  };
57190
57281
  }, "ordersStoreOver");
57191
57282
 
57192
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
57283
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
57193
57284
  var MAIL_EDITS = {
57194
57285
  task: ["title", "type", "reason", "commitment", "project", "dueAt", "dueEvidence", "assignee", "assigneeEvidence"],
57195
57286
  fact: ["statement", "type", "reason", "subject", "project"],
@@ -57678,7 +57769,7 @@ ${evidence.join("\n")}`, agent);
57678
57769
  };
57679
57770
  }, "mailFindingsStoreOver");
57680
57771
 
57681
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
57772
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
57682
57773
  var stale3 = /* @__PURE__ */ __name(() => {
57683
57774
  throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
57684
57775
  reason: "meeting-findings.stale"
@@ -57891,7 +57982,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
57891
57982
  };
57892
57983
  }, "meetingFindingsStoreOver");
57893
57984
 
57894
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
57985
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
57895
57986
  var RANK_BATCH = 512;
57896
57987
  var LIVE6 = "FROM chunks k JOIN meeting_transcripts t ON k.chunkable_type = 'meeting_transcript' AND t.id = k.chunkable_id JOIN meetings m ON m.id = t.meeting_id WHERE m.account_id = ? AND m.deleted_at IS NULL AND t.deleted_at IS NULL AND t.superseded_at IS NULL";
57897
57988
  var limitOf2 = /* @__PURE__ */ __name((value, name, max = 1e3) => {
@@ -58162,7 +58253,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
58162
58253
  }
58163
58254
  }), "meetingVectorsOver");
58164
58255
 
58165
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
58256
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
58166
58257
  var OTHER_SOURCES = ["document", "note", "email"];
58167
58258
  var TEXTS = {
58168
58259
  document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
@@ -58263,7 +58354,7 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
58263
58354
  };
58264
58355
  }, "sourceMentionStoreOver");
58265
58356
 
58266
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/money-transactions.js
58357
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/money-transactions.js
58267
58358
  var TRANSACTIONS = "SELECT t.*, w.name AS wallet_name, b.name AS author_name, b.kind AS author_kind, (SELECT coalesce(sum(amount), 0) FROM transaction_splits WHERE transaction_id = t.id) AS split FROM financial_transactions t JOIN financial_accounts w ON w.id = t.financial_account_id LEFT JOIN bots b ON t.author_type = 'bot' AND b.id = t.author_id";
58268
58359
  var MAX_SPLITS = 100;
58269
58360
  var transactionOperationsOver = /* @__PURE__ */ __name((context) => {
@@ -58497,11 +58588,11 @@ var transactionsStoreOver = /* @__PURE__ */ __name((context) => {
58497
58588
  };
58498
58589
  }, "transactionsStoreOver");
58499
58590
 
58500
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
58591
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
58501
58592
  import { accessSync, constants, existsSync as existsSync2, mkdirSync as mkdirSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
58502
58593
  import { dirname as dirname2 } from "node:path";
58503
58594
 
58504
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
58595
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
58505
58596
  import { readFileSync as readFileSync3 } from "node:fs";
58506
58597
  var CLIENTS_SETTING = "clients";
58507
58598
  var coreVersion = (() => {
@@ -58562,7 +58653,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
58562
58653
  return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
58563
58654
  }, "refusalAdvice");
58564
58655
 
58565
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
58656
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
58566
58657
  var GENERATED = [
58567
58658
  {
58568
58659
  "name": "20261010184427_initial",
@@ -59239,8 +59330,8 @@ WHERE json_type(params, '$.selection') = 'object';`
59239
59330
  "UPDATE mention_pending SET source_id = (SELECT account_id FROM temp.drive_moves WHERE folder_id = mention_pending.source_id)\nWHERE source_type = 'account' AND source_id IN (SELECT folder_id FROM temp.drive_moves);",
59240
59331
  "UPDATE mentions SET source_id = (SELECT account_id FROM temp.drive_moves WHERE folder_id = mentions.source_id)\nWHERE source_type = 'account' AND source_id IN (SELECT folder_id FROM temp.drive_moves);",
59241
59332
  "UPDATE mentions SET target_id = (SELECT account_id FROM temp.drive_moves WHERE folder_id = mentions.target_id)\nWHERE target_type = 'account' AND target_id IN (SELECT folder_id FROM temp.drive_moves);",
59242
- "-- A profile that named the folder names the account: `{ provider: \"google-drive\", account: <principal> }`.\nUPDATE store_settings SET value = (\n SELECT json_group_object(app.key, CASE WHEN app.type = 'object' THEN (\n SELECT json_group_object(profile.key, CASE\n WHEN profile.type = 'object' AND json_extract(profile.value, '$.provider') = 'folder'\n AND json_extract(profile.value, '$.account') IN (SELECT 'google-drive:' || principal FROM temp.drive_moves)\n THEN json_set(profile.value, '$.provider', 'google-drive', '$.account', substr(json_extract(profile.value, '$.account'), 14))\n WHEN profile.type IN ('object', 'array') THEN json(profile.value)\n ELSE profile.value END)\n FROM json_each(app.value) profile\n ) WHEN app.type = 'array' THEN json(app.value) ELSE app.value END)\n FROM json_each(store_settings.value) app\n)\nWHERE key = 'profiles' AND json_valid(value) AND json_type(value) = 'object'\n AND EXISTS (SELECT 1 FROM temp.drive_moves);",
59243
- "-- A group member `notes:<folder id>` follows the documents to `notes:<account id>`.\nUPDATE store_settings SET value = (\n SELECT json_group_object(grp.key, CASE WHEN grp.type = 'array' THEN (\n SELECT json_group_array(coalesce(\n (SELECT 'notes:' || m.account_id FROM temp.drive_moves m WHERE 'notes:' || m.folder_id = member.value),\n member.value))\n FROM json_each(grp.value) member\n ) WHEN grp.type = 'object' THEN json(grp.value) ELSE grp.value END)\n FROM json_each(store_settings.value) grp\n)\nWHERE key = 'accountGroups' AND json_valid(value) AND json_type(value) = 'object'\n AND EXISTS (SELECT 1 FROM temp.drive_moves);",
59333
+ "-- A profile that named the folder names the account: `{ provider: \"google-drive\", account: <principal> }`.\n-- json() keeps the inner object an object: SQLite 3.54 (Node 24.22) no longer passes a subquery's JSON subtype up.\nUPDATE store_settings SET value = (\n SELECT json_group_object(app.key, CASE WHEN app.type = 'object' THEN json((\n SELECT json_group_object(profile.key, CASE\n WHEN profile.type = 'object' AND json_extract(profile.value, '$.provider') = 'folder'\n AND json_extract(profile.value, '$.account') IN (SELECT 'google-drive:' || principal FROM temp.drive_moves)\n THEN json_set(profile.value, '$.provider', 'google-drive', '$.account', substr(json_extract(profile.value, '$.account'), 14))\n WHEN profile.type IN ('object', 'array') THEN json(profile.value)\n ELSE profile.value END)\n FROM json_each(app.value) profile\n )) WHEN app.type = 'array' THEN json(app.value) ELSE app.value END)\n FROM json_each(store_settings.value) app\n)\nWHERE key = 'profiles' AND json_valid(value) AND json_type(value) = 'object'\n AND EXISTS (SELECT 1 FROM temp.drive_moves);",
59334
+ "-- A group member `notes:<folder id>` follows the documents to `notes:<account id>`.\nUPDATE store_settings SET value = (\n SELECT json_group_object(grp.key, CASE WHEN grp.type = 'array' THEN json((\n SELECT json_group_array(coalesce(\n (SELECT 'notes:' || m.account_id FROM temp.drive_moves m WHERE 'notes:' || m.folder_id = member.value),\n member.value))\n FROM json_each(grp.value) member\n )) WHEN grp.type = 'object' THEN json(grp.value) ELSE grp.value END)\n FROM json_each(store_settings.value) grp\n)\nWHERE key = 'accountGroups' AND json_valid(value) AND json_type(value) = 'object'\n AND EXISTS (SELECT 1 FROM temp.drive_moves);",
59244
59335
  "DELETE FROM accounts WHERE id IN (SELECT folder_id FROM temp.drive_moves);",
59245
59336
  "DROP TABLE temp.drive_moves;"
59246
59337
  ]
@@ -60005,7 +60096,7 @@ WHERE json_type(params, '$.selection') = 'object';`
60005
60096
  }
60006
60097
  ];
60007
60098
 
60008
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/rollback-copy.js
60099
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/rollback-copy.js
60009
60100
  import { mkdirSync, rmSync, statfsSync, writeFileSync } from "node:fs";
60010
60101
  import { basename, dirname, join as join3, parse } from "node:path";
60011
60102
  var DERIVED = /(_fts|_words|_stems|_trigrams|_pending)$|^(embeddings|chunks|chunk_messages|mentions|involvements|search_terms)$|^vector_index/;
@@ -60238,7 +60329,7 @@ var rollBack2 = /* @__PURE__ */ __name((database, path) => {
60238
60329
  return { ...result, foreignKeyViolations };
60239
60330
  }, "rollBack");
60240
60331
 
60241
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
60332
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
60242
60333
  var V31_TABLES = [
60243
60334
  "accounts",
60244
60335
  "account_identities",
@@ -60412,7 +60503,7 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
60412
60503
  return migrations;
60413
60504
  }, "generatedMigrations");
60414
60505
 
60415
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/migrations.js
60506
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/migrations.js
60416
60507
  var MIGRATIONS = generatedMigrations();
60417
60508
  var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
60418
60509
  version INTEGER PRIMARY KEY,
@@ -60509,7 +60600,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
60509
60600
  }
60510
60601
  }, "migrate");
60511
60602
 
60512
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
60603
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
60513
60604
  var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
60514
60605
  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 ?");
60515
60606
  if (pending.get(0, 1) === void 0)
@@ -60531,7 +60622,41 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
60531
60622
  }
60532
60623
  }, "fillJoinKeys");
60533
60624
 
60534
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
60625
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/slow-queries.js
60626
+ var queryShape = /* @__PURE__ */ __name((sql2) => sql2.replace(/'(?:[^']|'')*'/g, "?").replace(/\b\d+(?:\.\d+)?\b/g, "?").replace(/\s+/g, " ").trim().slice(0, 400), "queryShape");
60627
+ var rowsOf2 = /* @__PURE__ */ __name((result) => Array.isArray(result) ? result.length : result && typeof result === "object" && "changes" in result ? Number(result.changes) : result === void 0 || result === null ? 0 : 1, "rowsOf");
60628
+ var timeQueries = /* @__PURE__ */ __name((client, methods) => {
60629
+ const threshold = Number(process.env.WIRECAT_SQL_SLOW_MS);
60630
+ if (!process.env.WIRECAT_SQL_SLOW_MS || !Number.isFinite(threshold))
60631
+ return client;
60632
+ const target = client;
60633
+ for (const name of methods) {
60634
+ const prepare3 = target[name];
60635
+ if (typeof prepare3 !== "function")
60636
+ continue;
60637
+ target[name] = (sql2, ...rest) => {
60638
+ const statement = prepare3.call(client, sql2, ...rest);
60639
+ if (typeof sql2 !== "string")
60640
+ return statement;
60641
+ for (const method of ["run", "all", "get"]) {
60642
+ const original = statement[method];
60643
+ statement[method] = (...parameters) => {
60644
+ const started = performance.now();
60645
+ const result = original.apply(statement, parameters);
60646
+ const took = performance.now() - started;
60647
+ if (took >= threshold)
60648
+ process.stderr.write(`sql ${took.toFixed(0)} ms, ${rowsOf2(result)} rows: ${queryShape(sql2)}
60649
+ `);
60650
+ return result;
60651
+ };
60652
+ }
60653
+ return statement;
60654
+ };
60655
+ }
60656
+ return client;
60657
+ }, "timeQueries");
60658
+
60659
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
60535
60660
  var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
60536
60661
  refuseOwnerStoreInTests(path);
60537
60662
  const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
@@ -60545,12 +60670,13 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
60545
60670
  }, "openSqlite");
60546
60671
  var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
60547
60672
  quietSqliteWarning();
60548
- const { drizzle } = await import("./node-GJQYN4FT.js");
60549
- const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-7VXIRQPH.js");
60673
+ const { drizzle } = await import("./node-3UXNV3CD.js");
60674
+ const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-ULWDWM3I.js");
60550
60675
  const client = await nodeClient(path, { readOnly });
60551
60676
  try {
60552
60677
  if (!readOnly)
60553
60678
  countWrites(client, ["prepare"], () => client.isTransaction);
60679
+ timeQueries(client, ["prepare"]);
60554
60680
  const database = cacheOverNodeSqlite(client);
60555
60681
  shareCounts(client, database);
60556
60682
  return { database, orm: drizzle({ client }) };
@@ -60560,12 +60686,13 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
60560
60686
  }
60561
60687
  }, "openUnderNode");
60562
60688
  var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
60563
- const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-QB6CU6TH.js");
60564
- const { drizzle } = await import("./bun-2FLR4IV4.js");
60689
+ const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-LU5V5Y4A.js");
60690
+ const { drizzle } = await import("./bun-ICK2XT7J.js");
60565
60691
  const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
60566
60692
  try {
60567
60693
  if (!readOnly)
60568
60694
  countWrites(client, ["prepare", "query"], () => client.inTransaction);
60695
+ timeQueries(client, ["prepare", "query"]);
60569
60696
  const database = cacheOverBunSqlite(client);
60570
60697
  shareCounts(client, database);
60571
60698
  return { database, orm: drizzle({ client }) };
@@ -60575,7 +60702,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
60575
60702
  }
60576
60703
  }, "openUnderBun");
60577
60704
 
60578
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
60705
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
60579
60706
  var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
60580
60707
  var paymentOf = /* @__PURE__ */ __name((metadata3) => {
60581
60708
  try {
@@ -60643,7 +60770,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
60643
60770
  });
60644
60771
  }, "movePaymentFacts");
60645
60772
 
60646
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
60773
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
60647
60774
  var readCompatibility = /* @__PURE__ */ __name((database, command) => {
60648
60775
  const ours = MIGRATIONS.at(-1)?.version ?? 0;
60649
60776
  if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
@@ -60661,7 +60788,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
60661
60788
  throw new CliError("configuration_error", `The store needs schema ${MIGRATIONS.at(-1)?.version ?? 0} maintenance before a read-only open`);
60662
60789
  }, "assertReadCompatible");
60663
60790
 
60664
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
60791
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
60665
60792
  var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
60666
60793
  var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
60667
60794
  if (provenance2?.startsWith("rule:"))
@@ -60707,7 +60834,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
60707
60834
  });
60708
60835
  }, "moveSuggestedLinks");
60709
60836
 
60710
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
60837
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
60711
60838
  var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
60712
60839
  var TEST_PROVIDER = "chat";
60713
60840
  var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
@@ -60728,7 +60855,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
60728
60855
  }
60729
60856
  }, "purgeTestAccounts");
60730
60857
 
60731
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
60858
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
60732
60859
  var BACKFILL_ON_OPEN = 5e3;
60733
60860
  var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
60734
60861
  var createWritable = /* @__PURE__ */ __name((file) => {
@@ -60840,7 +60967,7 @@ var openStoreContext = /* @__PURE__ */ __name(async (options = {}) => {
60840
60967
  }
60841
60968
  }, "openStoreContext");
60842
60969
 
60843
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/products.js
60970
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/products.js
60844
60971
  var PRODUCTS = "SELECT c.*, b.name AS author_name, b.kind AS author_kind FROM catalog_items c LEFT JOIN bots b ON c.author_type = 'bot' AND b.id = c.author_id";
60845
60972
  var productOperationsOver = /* @__PURE__ */ __name((context) => {
60846
60973
  const { database, now: now2 } = context;
@@ -60948,13 +61075,13 @@ var productsStoreOver = /* @__PURE__ */ __name((context) => {
60948
61075
  };
60949
61076
  }, "productsStoreOver");
60950
61077
 
60951
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
61078
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
60952
61079
  import { createHash as createHash21 } from "node:crypto";
60953
61080
 
60954
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
61081
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
60955
61082
  import { createHash as createHash20 } from "node:crypto";
60956
61083
 
60957
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
61084
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
60958
61085
  var text7 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
60959
61086
  var ref = text7(2048);
60960
61087
  var timestamp2 = pipe(number(), safeInteger(), minValue(0));
@@ -61024,7 +61151,7 @@ var projectAnnotationsSchema = strictObject({
61024
61151
  }))
61025
61152
  });
61026
61153
 
61027
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
61154
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
61028
61155
  var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
61029
61156
  var invalid11 = /* @__PURE__ */ __name((field4) => {
61030
61157
  throw new CliError("validation_error", `invalid project annotations.${field4}`);
@@ -61157,7 +61284,7 @@ var projectAnnotationsFingerprint = /* @__PURE__ */ __name((json3) => {
61157
61284
  return createHash20("sha256").update(JSON.stringify(normalized)).digest("hex");
61158
61285
  }, "projectAnnotationsFingerprint");
61159
61286
 
61160
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
61287
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
61161
61288
  var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
61162
61289
  var ref2 = pipe(string(), minLength(1), maxLength(2048));
61163
61290
  var targetSchema = strictObject({
@@ -61264,7 +61391,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
61264
61391
  }, "planBoundProjectAnnotations");
61265
61392
  var planProjectAnnotations = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotations(json3), projectAnnotationsFingerprint(json3), target, bindings), "planProjectAnnotations");
61266
61393
 
61267
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
61394
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
61268
61395
  import { createHash as createHash22 } from "node:crypto";
61269
61396
  var text8 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
61270
61397
  var timestamp3 = pipe(number(), safeInteger(), minValue(0));
@@ -61358,7 +61485,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json3) => {
61358
61485
  })).digest("hex");
61359
61486
  }, "projectAnnotationSnapshotFingerprint");
61360
61487
 
61361
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
61488
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
61362
61489
  var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
61363
61490
  if (!request || typeof request !== "object" || Array.isArray(request))
61364
61491
  throw new CliError("validation_error", "project annotation request is required");
@@ -61375,7 +61502,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
61375
61502
  return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
61376
61503
  }, "projectAnnotationRequest");
61377
61504
 
61378
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
61505
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
61379
61506
  var SnapshotBudget = class {
61380
61507
  static {
61381
61508
  __name(this, "SnapshotBudget");
@@ -61401,13 +61528,13 @@ var SnapshotBudget = class {
61401
61528
  }
61402
61529
  };
61403
61530
 
61404
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
61531
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
61405
61532
  import { createHash as createHash24 } from "node:crypto";
61406
61533
 
61407
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
61534
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
61408
61535
  var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json3, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json3), projectAnnotationSnapshotFingerprint(json3), target, bindings), "planProjectAnnotationSnapshot");
61409
61536
 
61410
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
61537
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
61411
61538
  import { createHash as createHash23 } from "node:crypto";
61412
61539
  var invalid13 = /* @__PURE__ */ __name(() => {
61413
61540
  throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
@@ -61550,7 +61677,7 @@ var ProjectSnapshotSources = class {
61550
61677
  }
61551
61678
  };
61552
61679
 
61553
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
61680
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
61554
61681
  var unsupported = /* @__PURE__ */ __name(() => {
61555
61682
  throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
61556
61683
  }, "unsupported");
@@ -61728,7 +61855,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
61728
61855
  return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
61729
61856
  }), "projectAnnotationSnapshot");
61730
61857
 
61731
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
61858
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
61732
61859
  var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
61733
61860
  const current2 = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
61734
61861
  const sources = new ProjectSnapshotSources(database, budget);
@@ -61790,7 +61917,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
61790
61917
  };
61791
61918
  }), "previewAnnotationSnapshot");
61792
61919
 
61793
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
61920
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
61794
61921
  var metadataOf2 = /* @__PURE__ */ __name((database, link3, to) => {
61795
61922
  const provenance2 = link3.provenance === null ? {} : { provenance: link3.provenance };
61796
61923
  if (link3.kind === "evidence" && to)
@@ -61857,7 +61984,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
61857
61984
  return mappings;
61858
61985
  }, "restoreAnnotationRecords");
61859
61986
 
61860
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
61987
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
61861
61988
  var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
61862
61989
  async preview(request) {
61863
61990
  const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
@@ -61887,7 +62014,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
61887
62014
  }
61888
62015
  }), "projectAnnotationStoreOver");
61889
62016
 
61890
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relations.js
62017
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relations.js
61891
62018
  var isDerived = /* @__PURE__ */ __name((role) => role.startsWith("fields."), "isDerived");
61892
62019
  var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
61893
62020
  const sql2 = /* @__PURE__ */ __name((text9) => database.prepare(text9), "sql");
@@ -61958,7 +62085,7 @@ var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
61958
62085
  return { entityRef, relatedOf, storedRelations, relate, missingOf };
61959
62086
  }, "recordRelationsOver");
61960
62087
 
61961
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-remap.js
62088
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/record-remap.js
61962
62089
  var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
61963
62090
  const pointedAt = /* @__PURE__ */ __name((type, id2) => {
61964
62091
  for (const { table, pointer } of pointerPairs(database))
@@ -62012,7 +62139,7 @@ var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
62012
62139
  return { pointedAt, remap };
62013
62140
  }, "recordRemapOver");
62014
62141
 
62015
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-run.js
62142
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/record-run.js
62016
62143
  var runs = 0;
62017
62144
  var PAGE = 500;
62018
62145
  var recordRunOver = /* @__PURE__ */ __name((context, writes) => {
@@ -62225,7 +62352,7 @@ var waitingPointer = /* @__PURE__ */ __name((index2, missing4) => {
62225
62352
  return pointerOf("records", index2, "fields", key2);
62226
62353
  }, "waitingPointer");
62227
62354
 
62228
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-matching.js
62355
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/record-matching.js
62229
62356
  var valuesOf = /* @__PURE__ */ __name((value) => (Array.isArray(value) ? value : [value]).filter((one2) => typeof one2 === "string"), "valuesOf");
62230
62357
  var SCHEME = /^(email|domain|tax-id:[a-z]{2}|registration:[a-z]{2})$/;
62231
62358
  var ORG_EMAIL = "org-email";
@@ -62391,7 +62518,7 @@ var renameMade = /* @__PURE__ */ __name(({ database, now: now2 }, type, id2, nam
62391
62518
  ]);
62392
62519
  }, "renameMade");
62393
62520
 
62394
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-direct.js
62521
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-direct.js
62395
62522
  var productFields = /* @__PURE__ */ __name((fields4) => ({
62396
62523
  name: given2(fields4, "name"),
62397
62524
  unit: given2(fields4, "unit"),
@@ -62514,7 +62641,7 @@ var DIRECT_PROJECTORS = {
62514
62641
  lead: dealProjector("lead")
62515
62642
  };
62516
62643
 
62517
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-document.js
62644
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-document.js
62518
62645
  var TEXT_ONLY = { storage: "text", localPath: null };
62519
62646
  var textOf7 = /* @__PURE__ */ __name(({ fields: fields4, externalId }) => {
62520
62647
  const text9 = String(fields4.text ?? "");
@@ -62583,7 +62710,7 @@ var DOCUMENT_PROJECTORS = {
62583
62710
  }
62584
62711
  };
62585
62712
 
62586
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-money.js
62713
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-money.js
62587
62714
  var allocatedByOthers = /* @__PURE__ */ __name((context, paymentId) => {
62588
62715
  const importer = authorActor(context, IMPORTER).actor;
62589
62716
  return context.database.prepare("SELECT 1 FROM payment_allocations WHERE payment_id = ? AND NOT (author_type = ? AND author_id = ?) LIMIT 1").get(paymentId, importer.type, importer.id) !== void 0;
@@ -62793,7 +62920,7 @@ var MONEY_PROJECTORS = {
62793
62920
  }
62794
62921
  };
62795
62922
 
62796
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-phone.js
62923
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-phone.js
62797
62924
  var CALLS_CALENDAR = "calls";
62798
62925
  var importOnly = /* @__PURE__ */ __name((source2, type) => {
62799
62926
  if (!isImportedProvider(source2.provider))
@@ -62968,7 +63095,7 @@ var PHONE_PROJECTORS = {
62968
63095
  }
62969
63096
  };
62970
63097
 
62971
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors.js
63098
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors.js
62972
63099
  var RECORD_PROJECTORS = {
62973
63100
  ...MONEY_PROJECTORS,
62974
63101
  ...DIRECT_PROJECTORS,
@@ -62979,7 +63106,7 @@ var RECORD_PROJECTORS = {
62979
63106
  project: null
62980
63107
  };
62981
63108
 
62982
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-settling.js
63109
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/record-settling.js
62983
63110
  var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
62984
63111
  const sql2 = /* @__PURE__ */ __name((text9) => database.prepare(text9), "sql");
62985
63112
  const freeOn = /* @__PURE__ */ __name((invoice, payment) => {
@@ -63041,7 +63168,7 @@ var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
63041
63168
  return { settle, checkShares };
63042
63169
  }, "recordSettlingOver");
63043
63170
 
63044
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-stamps.js
63171
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/record-stamps.js
63045
63172
  import { createHash as createHash25 } from "node:crypto";
63046
63173
  var VOLATILE = /* @__PURE__ */ new Set(["id", "created_at", "updated_at", "metadata"]);
63047
63174
  var content = /* @__PURE__ */ __name((row2) => row2 === void 0 ? null : Object.fromEntries(Object.entries(row2).filter(([column2]) => !VOLATILE.has(column2))), "content");
@@ -63057,7 +63184,7 @@ var importStampsOver = /* @__PURE__ */ __name(({ database }) => {
63057
63184
  return { stamp, untouched };
63058
63185
  }, "importStampsOver");
63059
63186
 
63060
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/subscriptions.js
63187
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/subscriptions.js
63061
63188
  var SUBSCRIPTIONS = "SELECT s.*, b.name AS author_name, b.kind AS author_kind FROM subscriptions s LEFT JOIN bots b ON s.author_type = 'bot' AND b.id = s.author_id";
63062
63189
  var PRICES = "SELECT p.*, b.name AS author_name, b.kind AS author_kind FROM subscription_prices p LEFT JOIN bots b ON p.author_type = 'bot' AND b.id = p.author_id";
63063
63190
  var PRICE_REF = /^subscription_price:([1-9]\d{0,15})$/;
@@ -63294,7 +63421,7 @@ var subscriptionsStoreOver = /* @__PURE__ */ __name((context) => {
63294
63421
  };
63295
63422
  }, "subscriptionsStoreOver");
63296
63423
 
63297
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/wallets.js
63424
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/wallets.js
63298
63425
  var WALLETS = "SELECT w.*, b.name AS author_name, b.kind AS author_kind FROM financial_accounts w LEFT JOIN bots b ON w.author_type = 'bot' AND b.id = w.author_id";
63299
63426
  var SIGNED = "CASE t.direction WHEN 'in' THEN t.amount ELSE -t.amount END";
63300
63427
  var walletOperationsOver = /* @__PURE__ */ __name((context) => {
@@ -63419,7 +63546,7 @@ var walletsStoreOver = /* @__PURE__ */ __name((context) => {
63419
63546
  };
63420
63547
  }, "walletsStoreOver");
63421
63548
 
63422
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/record-writes.js
63549
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/record-writes.js
63423
63550
  var specOf = /* @__PURE__ */ __name((type) => RECORD_TYPES[type], "specOf");
63424
63551
  var unsettled = /* @__PURE__ */ __name((fields4, relations) => recordFingerprint(fields4, relations.filter((relation) => !AMOUNT_ROLES.includes(relation.role))), "unsettled");
63425
63552
  var tableOf2 = /* @__PURE__ */ __name((type) => typeof type === "string" && Object.hasOwn(DECIDED_TABLES, type) ? DECIDED_TABLES[type] : void 0, "tableOf");
@@ -63678,7 +63805,7 @@ var recordWritesOver = /* @__PURE__ */ __name((context) => {
63678
63805
  return { writeOne, project: project2, completeDependents, entityRef, missingOf: relations.missingOf };
63679
63806
  }, "recordWritesOver");
63680
63807
 
63681
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
63808
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
63682
63809
  var LIMIT = 1e3;
63683
63810
  var iso16 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
63684
63811
  var checkLimit = /* @__PURE__ */ __name((limit) => {
@@ -63902,7 +64029,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
63902
64029
  };
63903
64030
  }, "recordStoreOver");
63904
64031
 
63905
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/templates.js
64032
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/templates.js
63906
64033
  var templateOf = /* @__PURE__ */ __name((row2) => ({
63907
64034
  key: row2.key,
63908
64035
  channel: row2.channel,
@@ -63957,12 +64084,12 @@ var storedTemplateBodies = /* @__PURE__ */ __name((database, key2, language) =>
63957
64084
  return Object.fromEntries(rows.map((row2) => [row2.channel, row2.body]));
63958
64085
  }, "storedTemplateBodies");
63959
64086
 
63960
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/domain/tracker.js
64087
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/domain/tracker.js
63961
64088
  var trackerTitleOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "issue" ? record3.title : kind3 === "comment" ? record3.body.split("\n")[0]?.slice(0, 120) || "(comment)" : record3.name, "trackerTitleOf");
63962
64089
  var trackerBodyOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "comment" ? record3.body : kind3 === "issue" || kind3 === "project" ? record3.description : null, "trackerBodyOf");
63963
64090
  var trackerParentOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "comment" ? record3.issue : kind3 === "state" || kind3 === "label" ? record3.team : kind3 === "issue" ? record3.team : null, "trackerParentOf");
63964
64091
 
63965
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/tracker.js
64092
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/tracker.js
63966
64093
  var MOST3 = 500;
63967
64094
  var itemOf2 = /* @__PURE__ */ __name((row2) => ({
63968
64095
  kind: String(row2.kind),
@@ -64132,7 +64259,7 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
64132
64259
  };
64133
64260
  }, "trackerStoreOver");
64134
64261
 
64135
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/store-errors.js
64262
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/store-errors.js
64136
64263
  var refusalOf2 = /* @__PURE__ */ __name((error) => error instanceof Error && error.name === "DrizzleQueryError" && error.cause instanceof CliError ? error.cause : error, "refusalOf");
64137
64264
  var wrapped2 = /* @__PURE__ */ new WeakMap();
64138
64265
  var storeErrors = /* @__PURE__ */ __name((area) => {
@@ -64167,7 +64294,7 @@ var storeErrors = /* @__PURE__ */ __name((area) => {
64167
64294
  return proxy;
64168
64295
  }, "storeErrors");
64169
64296
 
64170
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
64297
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
64171
64298
  var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
64172
64299
  const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
64173
64300
  let merged2 = { from: from2, to };
@@ -64180,7 +64307,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
64180
64307
  }, "markRange");
64181
64308
  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");
64182
64309
 
64183
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
64310
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
64184
64311
  var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
64185
64312
  var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
64186
64313
  chatId: String(row2.key).slice(prefix.length),
@@ -64201,7 +64328,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
64201
64328
  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);
64202
64329
  }, "setTaskAnalysisMark");
64203
64330
 
64204
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
64331
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
64205
64332
  var keyOf6 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
64206
64333
  var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
64207
64334
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf6(account));
@@ -64211,7 +64338,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
64211
64338
  database.prepare("INSERT INTO store_settings (key, value, at) VALUES (?, ?, ?) ON CONFLICT (key) DO UPDATE SET value = excluded.value, at = excluded.at").run(keyOf6(account), JSON.stringify(until), now2);
64212
64339
  }, "setTaskRulesStop");
64213
64340
 
64214
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sync.js
64341
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sync.js
64215
64342
  var syncStoreOver = /* @__PURE__ */ __name((context) => {
64216
64343
  const { database } = context;
64217
64344
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
@@ -64270,7 +64397,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
64270
64397
  };
64271
64398
  }, "syncStoreOver");
64272
64399
 
64273
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/tags.js
64400
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/tags.js
64274
64401
  var tagsStoreOver = /* @__PURE__ */ __name((context) => {
64275
64402
  const { database } = context;
64276
64403
  return {
@@ -64292,7 +64419,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
64292
64419
  };
64293
64420
  }, "tagsStoreOver");
64294
64421
 
64295
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
64422
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
64296
64423
  var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
64297
64424
  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
64298
64425
  WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
@@ -64419,7 +64546,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
64419
64546
  dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
64420
64547
  }, "savePictureChunks");
64421
64548
 
64422
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
64549
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
64423
64550
  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,
64424
64551
  EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
64425
64552
  FROM messages m
@@ -64508,7 +64635,7 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
64508
64635
  return plain2(best(found2));
64509
64636
  }, "nearestMessages");
64510
64637
 
64511
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/vectors.js
64638
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/vectors.js
64512
64639
  var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
64513
64640
  const { database } = context;
64514
64641
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -64772,7 +64899,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
64772
64899
  vectorCounts: /* @__PURE__ */ __name(async (models) => vectorCounts(context, models), "vectorCounts")
64773
64900
  }), "vectorsStoreOver");
64774
64901
 
64775
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
64902
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
64776
64903
  import { existsSync as existsSync3, readFileSync as readFileSync4 } from "node:fs";
64777
64904
  import { dirname as dirname3, join as join4 } from "node:path";
64778
64905
  var BOOKKEEPING2 = ["schema_migrations", "store_settings"];
@@ -64860,10 +64987,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
64860
64987
  }
64861
64988
  }, "lastBackup");
64862
64989
 
64863
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/providers.js
64990
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/providers.js
64864
64991
  var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
64865
64992
 
64866
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
64993
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
64867
64994
  var COUNTED_TABLES = [
64868
64995
  "accounts",
64869
64996
  "chats",
@@ -64948,7 +65075,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
64948
65075
  };
64949
65076
  }, "storeContents");
64950
65077
 
64951
- // node_modules/.pnpm/@wirecat+cli-core@0.707.0_@wirecat+cli-base@0.124.0_commander@15.0.0_esbuild@0.28.2_typ_1ab7200af0919d16d129ae0ece32d37f/node_modules/@wirecat/cli-core/dist/store/store.js
65078
+ // node_modules/.pnpm/@wirecat+cli-core@0.718.0_@wirecat+cli-base@0.125.0_commander@15.0.0_esbuild@0.28.2_typ_cfff6f86942c54bd7564e982a7834a83/node_modules/@wirecat/cli-core/dist/store/store.js
64952
65079
  var openStore = /* @__PURE__ */ __name(async (options = {}) => {
64953
65080
  const context = await openStoreContext(options);
64954
65081
  try {
@@ -65308,6 +65435,7 @@ export {
65308
65435
  contextSource,
65309
65436
  contextEvidenceRequest,
65310
65437
  MAIL_AGENDA_COLUMNS,
65438
+ editDistance,
65311
65439
  correctWords,
65312
65440
  drainMeetingIndex,
65313
65441
  THREAD_COLUMNS,