@wirecat/drive-cli 0.72.1 → 0.73.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 (205) hide show
  1. package/README.md +4 -0
  2. package/contracts/wirecat.json +82 -18
  3. package/dist/bin/drive.js +2 -2
  4. package/dist/bundle/agent-ZOHMLVWI.js +46 -0
  5. package/dist/bundle/{all-profiles-PZVP3G73.js → all-profiles-HGQGKCKQ.js} +14 -14
  6. package/dist/bundle/{anthropic-PUOTKSYV.js → anthropic-2L5DN3HF.js} +8 -8
  7. package/dist/bundle/{app-server-MKDCXRZM.js → app-server-TRSOKYYF.js} +79 -79
  8. package/dist/bundle/{bun-NS5YLOQT.js → bun-AFA5HULK.js} +2 -2
  9. package/dist/bundle/{bun-sqlite-KSKWRLLO.js → bun-sqlite-5MW2BWV4.js} +9 -9
  10. package/dist/bundle/{chunk-JHAACT4I.js → chunk-2G24DYSZ.js} +2 -2
  11. package/dist/bundle/{chunk-MDJUYCHT.js → chunk-2MCMUZCE.js} +1 -1
  12. package/dist/bundle/{chunk-FKP4T7A4.js → chunk-2NAMKBBV.js} +31 -23
  13. package/dist/bundle/{chunk-3YCUYFTD.js → chunk-2WAGRBQT.js} +50 -47
  14. package/dist/bundle/{chunk-S3SLDYTU.js → chunk-33RQ3YVC.js} +1 -1
  15. package/dist/bundle/{chunk-54O5NJRC.js → chunk-36256UTA.js} +12 -12
  16. package/dist/bundle/{chunk-ZNFXKFGF.js → chunk-4FTGSEBR.js} +6 -6
  17. package/dist/bundle/{chunk-YRCGFSRR.js → chunk-4KOMZRN6.js} +2 -2
  18. package/dist/bundle/{chunk-HPS2YGSZ.js → chunk-4LLO4USI.js} +1 -1
  19. package/dist/bundle/{chunk-HDGJ7IDE.js → chunk-4VTAPSZE.js} +4 -4
  20. package/dist/bundle/{chunk-QB7K6PIP.js → chunk-4ZP3IK5I.js} +6 -6
  21. package/dist/bundle/{chunk-KVBGIZ2C.js → chunk-5CYWWYIG.js} +6 -1
  22. package/dist/bundle/{chunk-FJQO5OHR.js → chunk-5EZCDENA.js} +61 -35
  23. package/dist/bundle/{chunk-RM4DO2WZ.js → chunk-5R2VPXVT.js} +1 -1
  24. package/dist/bundle/{chunk-2CG3LUQS.js → chunk-5SQHQRNO.js} +4 -4
  25. package/dist/bundle/{chunk-3VIEGRBA.js → chunk-6AVHD6WB.js} +6 -6
  26. package/dist/bundle/{chunk-JSYUB4SM.js → chunk-6EC3LAVC.js} +2 -2
  27. package/dist/bundle/{chunk-SWQDKO6D.js → chunk-6HZKX65K.js} +3 -3
  28. package/dist/bundle/{chunk-YE7DJB3F.js → chunk-6TGZCOYR.js} +3 -3
  29. package/dist/bundle/{chunk-SUQT4KI2.js → chunk-6V5556NF.js} +7 -7
  30. package/dist/bundle/{chunk-R3EDZWXF.js → chunk-6WZLP4CI.js} +5 -5
  31. package/dist/bundle/{chunk-UT64BBEP.js → chunk-77SAHCDZ.js} +4 -4
  32. package/dist/bundle/{chunk-FTL3WXZB.js → chunk-AGATODLO.js} +12 -12
  33. package/dist/bundle/{chunk-IBQZT2YD.js → chunk-B6YBN6VK.js} +1 -1
  34. package/dist/bundle/{chunk-AG34MPVN.js → chunk-BAG4KIN5.js} +1 -1
  35. package/dist/bundle/{chunk-MA7ETVTZ.js → chunk-BAHWXDWN.js} +16 -16
  36. package/dist/bundle/{chunk-2TVHFJKV.js → chunk-BFESDJPU.js} +1 -1
  37. package/dist/bundle/{chunk-SODB63MR.js → chunk-BOHC2GPY.js} +36 -36
  38. package/dist/bundle/{chunk-VHTELRUA.js → chunk-BY5D2LXE.js} +3 -3
  39. package/dist/bundle/{chunk-G7SKXAVZ.js → chunk-CMB6URN7.js} +5 -5
  40. package/dist/bundle/{chunk-HOICQNJX.js → chunk-CY2MNN3I.js} +5 -5
  41. package/dist/bundle/{chunk-G2KKMQRN.js → chunk-DAYHLKTM.js} +2 -2
  42. package/dist/bundle/{chunk-JVM75M4H.js → chunk-DOUFW7RK.js} +3 -3
  43. package/dist/bundle/{chunk-S27UKJVL.js → chunk-DZG5SAO6.js} +14 -14
  44. package/dist/bundle/{chunk-X6HPQKAI.js → chunk-E3UFICXC.js} +33 -29
  45. package/dist/bundle/{chunk-MA6U4XH2.js → chunk-EBGI3Z6U.js} +1 -1
  46. package/dist/bundle/{chunk-DOEP4EPW.js → chunk-EQGVNLUN.js} +42 -42
  47. package/dist/bundle/{chunk-HMN26CVU.js → chunk-F5XMZDR5.js} +2 -2
  48. package/dist/bundle/{chunk-VBIZD5V5.js → chunk-FITKBN46.js} +2 -2
  49. package/dist/bundle/{chunk-6KND2DYT.js → chunk-FRQBKAPV.js} +6 -6
  50. package/dist/bundle/{chunk-IE3R46YN.js → chunk-GW7L2G4I.js} +57 -57
  51. package/dist/bundle/{chunk-MGC2BAD2.js → chunk-HGXFOXSA.js} +1 -1
  52. package/dist/bundle/{chunk-SSFGSY77.js → chunk-HYJEBBFK.js} +489 -317
  53. package/dist/bundle/{chunk-KOI5G7NM.js → chunk-I2KGZ6XQ.js} +6 -6
  54. package/dist/bundle/{chunk-PMAV3RNP.js → chunk-I3DZHZHM.js} +7 -7
  55. package/dist/bundle/{chunk-HSASPXRW.js → chunk-I3MLLVPE.js} +3 -3
  56. package/dist/bundle/{chunk-PUVQOZ2N.js → chunk-IDJKYHVG.js} +2246 -2047
  57. package/dist/bundle/{chunk-EXHTGQR2.js → chunk-IEGU6GG7.js} +1 -1
  58. package/dist/bundle/{chunk-QURQ2OU2.js → chunk-IKW3PRNG.js} +13 -13
  59. package/dist/bundle/{chunk-XZEVHUKI.js → chunk-J3I4WOBI.js} +3 -3
  60. package/dist/bundle/{chunk-B6JC5RS3.js → chunk-JA37PJL4.js} +11 -11
  61. package/dist/bundle/{chunk-3QBRS3JT.js → chunk-JJGKHGBX.js} +8 -8
  62. package/dist/bundle/{chunk-7YPZPJTB.js → chunk-JWNM6FCC.js} +1 -1
  63. package/dist/bundle/{chunk-IPBYU43F.js → chunk-JZYNXTMH.js} +46 -15
  64. package/dist/bundle/{chunk-KPBUJQKT.js → chunk-K34B37AP.js} +1 -1
  65. package/dist/bundle/{chunk-QK7GKFKB.js → chunk-KERX3BQL.js} +4 -4
  66. package/dist/bundle/{chunk-IE6O7463.js → chunk-KV232TIK.js} +4 -4
  67. package/dist/bundle/{chunk-HCMEU7AF.js → chunk-KXETGAU4.js} +8 -8
  68. package/dist/bundle/{chunk-IV77ZFF4.js → chunk-L5ZZ6RLL.js} +2 -2
  69. package/dist/bundle/{chunk-CP2TZXAG.js → chunk-LGRZNEMA.js} +8 -8
  70. package/dist/bundle/{chunk-QMUWHKP5.js → chunk-M3VJTLFM.js} +6 -6
  71. package/dist/bundle/{chunk-JDGF3YYS.js → chunk-MTH76YSQ.js} +418 -404
  72. package/dist/bundle/{chunk-XKWQDQ4B.js → chunk-NA4HEM4Z.js} +3 -3
  73. package/dist/bundle/{chunk-5BHP4FVM.js → chunk-OCZWU2H4.js} +2 -2
  74. package/dist/bundle/{chunk-6JU4KLAZ.js → chunk-OHKAL25R.js} +62 -62
  75. package/dist/bundle/{chunk-BDZXGDGI.js → chunk-P2FOF6RR.js} +3 -3
  76. package/dist/bundle/{chunk-KI6OOW6D.js → chunk-PMYTDTT4.js} +1 -1
  77. package/dist/bundle/{chunk-4DK55MLP.js → chunk-PQSCABAC.js} +10 -10
  78. package/dist/bundle/{chunk-A5XNUMW7.js → chunk-PSFACXOC.js} +2 -2
  79. package/dist/bundle/{chunk-BMTMGMGE.js → chunk-PSWVHX53.js} +1 -1
  80. package/dist/bundle/{chunk-PB6ACIME.js → chunk-Q2L3W7PS.js} +2 -2
  81. package/dist/bundle/{chunk-GTROGY74.js → chunk-QMDVQ4AN.js} +12 -12
  82. package/dist/bundle/{chunk-OBDPKDGB.js → chunk-QZXFWDTX.js} +6 -6
  83. package/dist/bundle/{chunk-GYAPDUF5.js → chunk-R2GLRHNK.js} +5 -5
  84. package/dist/bundle/{chunk-PSY67L73.js → chunk-R6K36FZ7.js} +23 -23
  85. package/dist/bundle/{chunk-SAEBHENE.js → chunk-RHS3OBO5.js} +4 -4
  86. package/dist/bundle/{chunk-LKUWH6KU.js → chunk-RNLLWYPV.js} +1 -1
  87. package/dist/bundle/{chunk-3ZGWJYSG.js → chunk-RX6D64YA.js} +20 -20
  88. package/dist/bundle/{chunk-YJVQ5GST.js → chunk-S7EQIYNF.js} +1 -1
  89. package/dist/bundle/{chunk-UL5HSHFU.js → chunk-SIC2CGYE.js} +4 -4
  90. package/dist/bundle/{chunk-T3OK6AYZ.js → chunk-SNY4WYPH.js} +5 -5
  91. package/dist/bundle/{chunk-TUL6MCTY.js → chunk-SQODI3DH.js} +2 -2
  92. package/dist/bundle/{chunk-IABPGOMT.js → chunk-SRRNRQSQ.js} +2 -2
  93. package/dist/bundle/{chunk-TFIAD57H.js → chunk-SYQKLEP3.js} +4 -4
  94. package/dist/bundle/{chunk-WDJRUNQN.js → chunk-TAQUEQ5B.js} +8 -8
  95. package/dist/bundle/{chunk-GFI3UUIU.js → chunk-TPIGO4JJ.js} +1 -1
  96. package/dist/bundle/{chunk-4P6D6CUS.js → chunk-U5SB2WDG.js} +10 -10
  97. package/dist/bundle/{chunk-G2CH4FRW.js → chunk-UDP7EQNY.js} +4 -4
  98. package/dist/bundle/{chunk-E2TMWONO.js → chunk-UZAOKKGK.js} +753 -494
  99. package/dist/bundle/{chunk-SM7Z2BQF.js → chunk-V5GIK53Z.js} +17 -17
  100. package/dist/bundle/{chunk-3T7JIHSO.js → chunk-VENGEFU4.js} +8 -8
  101. package/dist/bundle/{chunk-E5EYJU5R.js → chunk-VHPNTMJJ.js} +1 -1
  102. package/dist/bundle/{chunk-3CH7I452.js → chunk-VM3IERRK.js} +7 -7
  103. package/dist/bundle/{chunk-B5V2U7IS.js → chunk-VQ7K2EAW.js} +9 -9
  104. package/dist/bundle/{chunk-IS7STZEB.js → chunk-VQC4GYIQ.js} +3 -3
  105. package/dist/bundle/{chunk-X5CXANSA.js → chunk-VZTDELYM.js} +3 -3
  106. package/dist/bundle/{chunk-35GROSBS.js → chunk-W3OKRT6L.js} +179 -135
  107. package/dist/bundle/{chunk-KBR7OC5S.js → chunk-WB46DJSK.js} +2 -2
  108. package/dist/bundle/{chunk-43PCMVTZ.js → chunk-WITO2RZO.js} +1 -1
  109. package/dist/bundle/{chunk-ODTBJGWQ.js → chunk-WJ7E6TPR.js} +17 -17
  110. package/dist/bundle/{chunk-JRED7BNX.js → chunk-WUVNBZWC.js} +191 -160
  111. package/dist/bundle/{chunk-VOQICE3G.js → chunk-ZDYWRT3X.js} +7 -7
  112. package/dist/bundle/{chunk-JZ65CQWK.js → chunk-ZQMURHTL.js} +6 -6
  113. package/dist/bundle/{cli-KXRWXGTS.js → cli-A7MMBLGR.js} +83 -83
  114. package/dist/bundle/command-contract-WCGIIXYM.js +45 -0
  115. package/dist/bundle/{command-server-entry-7FZX74T6.js → command-server-entry-557ZCX63.js} +35 -35
  116. package/dist/bundle/{decode-SZ6W34U3.js → decode-3IPZIY2P.js} +8 -8
  117. package/dist/bundle/{dispatch-4KNSZ3PI.js → dispatch-UWS7A35Q.js} +9 -9
  118. package/dist/bundle/drive.js +11 -11
  119. package/dist/bundle/{echarts-ISH62J4E.js → echarts-JLCV6NKC.js} +2 -2
  120. package/dist/bundle/{embed-6ODGTZPK.js → embed-Q6H3QSMC.js} +9 -9
  121. package/dist/bundle/{embedder-6FY67FTQ.js → embedder-536EI65E.js} +12 -12
  122. package/dist/bundle/entry-3PKJTP5E.js +25 -0
  123. package/dist/bundle/{failure-V3ILKUTX.js → failure-W3VT5D3H.js} +4 -4
  124. package/dist/bundle/first-run-XTLP6VXF.js +31 -0
  125. package/dist/bundle/first-screen-3GQGULPE.js +45 -0
  126. package/dist/bundle/google-MEPVU4EP.js +46 -0
  127. package/dist/bundle/{google-api-ZTI3NKZX.js → google-api-SY25TRXJ.js} +85 -85
  128. package/dist/bundle/grants-77W5MSWQ.js +133 -0
  129. package/dist/bundle/{identity-YX4IPGOO.js → identity-ZBMVHXUY.js} +6 -6
  130. package/dist/bundle/{instructions-G5ZGHVFB.js → instructions-XQOWVU6J.js} +1 -1
  131. package/dist/bundle/{login-CVX5VJX6.js → login-LXXYFMD3.js} +91 -91
  132. package/dist/bundle/{mcp-MQ2L5IIM.js → mcp-VNOYBWW2.js} +2 -2
  133. package/dist/bundle/meeting-combined-NWWZCYN4.js +28 -0
  134. package/dist/bundle/meeting-model-K7UQ7TO5.js +29 -0
  135. package/dist/bundle/{meeting-semantic-OHG2QN2G.js → meeting-semantic-Z7FAOSLQ.js} +10 -10
  136. package/dist/bundle/{node-NLJINXVQ.js → node-MPZ3SVB4.js} +2 -2
  137. package/dist/bundle/{node-sqlite-KDFQDYVZ.js → node-sqlite-VL5BMY34.js} +10 -10
  138. package/dist/bundle/notes-search-MF7QKFQD.js +74 -0
  139. package/dist/bundle/oauth-EYJXUTXZ.js +22 -0
  140. package/dist/bundle/{open-WVRUVBIZ.js → open-SERV3YXC.js} +8 -8
  141. package/dist/bundle/{openai-JJWOSJMV.js → openai-HUXETQVC.js} +20 -20
  142. package/dist/bundle/{process-LPVAYRO7.js → process-RFIII6TW.js} +1 -1
  143. package/dist/bundle/{program-ZJRIP25J.js → program-VQ6IKDBJ.js} +352 -130
  144. package/dist/bundle/{prompt-XCDHTEAO.js → prompt-LCD5ZR7Q.js} +8 -8
  145. package/dist/bundle/{reasons-REEEQDAZ.js → reasons-GDQIXGWT.js} +5 -5
  146. package/dist/bundle/{recognize-OZLFDJAT.js → recognize-GWKRFWHF.js} +7 -7
  147. package/dist/bundle/{remote-MDPYVCZB.js → remote-XM2CRZJY.js} +13 -13
  148. package/dist/bundle/{rerank-FLZWJNHA.js → rerank-HR5J35V6.js} +10 -10
  149. package/dist/bundle/{serve-5UV5VLRV.js → serve-PP3XR3GA.js} +12 -12
  150. package/dist/bundle/{server-53A2X2MK.js → server-DD3DE536.js} +71 -71
  151. package/dist/bundle/server-NB4RGNYM.js +97 -0
  152. package/dist/bundle/{services-XSMH7BXB.js → services-4Y7R425J.js} +62 -58
  153. package/dist/bundle/{sqlite-runtime-E3L7ENFU.js → sqlite-runtime-CVYBPVKO.js} +9 -9
  154. package/dist/bundle/{start-4S2VNR4J.js → start-2KFZDMWM.js} +7 -7
  155. package/dist/bundle/{state-TQI4JSH7.js → state-AUXW4REW.js} +9 -9
  156. package/dist/bundle/{store-VYJPL7MW.js → store-B7X6UN75.js} +28 -28
  157. package/dist/bundle/{store-GS7PU6PJ.js → store-RADARFIH.js} +26 -26
  158. package/dist/bundle/store-maintenance-command-UTZWPNUF.js +85 -0
  159. package/dist/bundle/surface-4MUNDC3D.js +83 -0
  160. package/dist/bundle/tokens-AIKNGAOI.js +133 -0
  161. package/dist/commands/file-edit.d.ts +18 -0
  162. package/dist/commands/file-edit.d.ts.map +1 -0
  163. package/dist/commands/file-edit.js +39 -0
  164. package/dist/commands/file-edit.js.map +1 -0
  165. package/dist/commands/remote.d.ts +4 -0
  166. package/dist/commands/remote.d.ts.map +1 -1
  167. package/dist/commands/remote.js +59 -17
  168. package/dist/commands/remote.js.map +1 -1
  169. package/dist/config.d.ts +2 -0
  170. package/dist/config.d.ts.map +1 -1
  171. package/dist/config.js +17 -1
  172. package/dist/config.js.map +1 -1
  173. package/dist/drive-files.d.ts +26 -0
  174. package/dist/drive-files.d.ts.map +1 -0
  175. package/dist/drive-files.js +127 -0
  176. package/dist/drive-files.js.map +1 -0
  177. package/dist/program.d.ts.map +1 -1
  178. package/dist/program.js +52 -1
  179. package/dist/program.js.map +1 -1
  180. package/dist/reasons.d.ts.map +1 -1
  181. package/dist/reasons.js +5 -0
  182. package/dist/reasons.js.map +1 -1
  183. package/dist/upload.d.ts +3 -1
  184. package/dist/upload.d.ts.map +1 -1
  185. package/dist/upload.js +5 -4
  186. package/dist/upload.js.map +1 -1
  187. package/dist/version.d.ts +1 -1
  188. package/dist/version.js +1 -1
  189. package/package.json +3 -3
  190. package/skills/drive-cli/SKILL.md +4 -0
  191. package/dist/bundle/agent-GOCD4ZW2.js +0 -46
  192. package/dist/bundle/command-contract-BGNT7MTQ.js +0 -45
  193. package/dist/bundle/entry-2SA6ZX7E.js +0 -25
  194. package/dist/bundle/first-run-ZNKPPD6M.js +0 -31
  195. package/dist/bundle/first-screen-WF6GYLPN.js +0 -45
  196. package/dist/bundle/google-QCADNPCQ.js +0 -46
  197. package/dist/bundle/grants-BPN5AGDK.js +0 -133
  198. package/dist/bundle/meeting-combined-HKZJMJ6Q.js +0 -28
  199. package/dist/bundle/meeting-model-DSE4GRVE.js +0 -29
  200. package/dist/bundle/notes-search-3VBVSQ3R.js +0 -70
  201. package/dist/bundle/oauth-M3E62ZHC.js +0 -22
  202. package/dist/bundle/server-5GMURMDE.js +0 -97
  203. package/dist/bundle/store-maintenance-command-JJVYUZMG.js +0 -85
  204. package/dist/bundle/surface-JC4XVMZR.js +0 -83
  205. package/dist/bundle/tokens-KJQ5EAPW.js +0 -133
@@ -5,11 +5,11 @@ import {
5
5
  googleDocumentId,
6
6
  googleDocumentLinks,
7
7
  trimUrl
8
- } from "./chunk-YE7DJB3F.js";
8
+ } from "./chunk-6TGZCOYR.js";
9
9
  import {
10
10
  calendarMoment,
11
11
  dayIn
12
- } from "./chunk-BDZXGDGI.js";
12
+ } from "./chunk-P2FOF6RR.js";
13
13
  import {
14
14
  compileAutomaton,
15
15
  foldName,
@@ -18,7 +18,7 @@ import {
18
18
  oneLine,
19
19
  trigrams,
20
20
  wildcardPattern
21
- } from "./chunk-B6JC5RS3.js";
21
+ } from "./chunk-JA37PJL4.js";
22
22
  import {
23
23
  DEFAULT_STEMMERS,
24
24
  DEFAULT_STEMMERS_VERSION,
@@ -29,10 +29,11 @@ import {
29
29
  analyzerIdentity,
30
30
  createStemmer,
31
31
  parseStemmers
32
- } from "./chunk-WDJRUNQN.js";
32
+ } from "./chunk-TAQUEQ5B.js";
33
33
  import {
34
34
  PRESENCE,
35
35
  QUERY_LIMITS,
36
+ RRF_K,
36
37
  exhausted,
37
38
  fuseRanked,
38
39
  isPresence,
@@ -42,16 +43,16 @@ import {
42
43
  searchError,
43
44
  sqliteLimit,
44
45
  tooWideTerm
45
- } from "./chunk-CP2TZXAG.js";
46
+ } from "./chunk-LGRZNEMA.js";
46
47
  import {
47
48
  NORMALIZER_VERSION,
48
49
  fold,
49
50
  normalize
50
- } from "./chunk-AG34MPVN.js";
51
+ } from "./chunk-BAG4KIN5.js";
51
52
  import {
52
53
  quietSqliteWarning,
53
54
  storeCapable
54
- } from "./chunk-QMUWHKP5.js";
55
+ } from "./chunk-M3VJTLFM.js";
55
56
  import {
56
57
  BUSINESS_KINDS,
57
58
  CATALOG_KINDS,
@@ -147,16 +148,17 @@ import {
147
148
  transactionLine,
148
149
  usableLinkSql,
149
150
  walletLine
150
- } from "./chunk-PSY67L73.js";
151
+ } from "./chunk-R6K36FZ7.js";
151
152
  import {
152
153
  holdsCredential,
153
154
  secretNamed
154
- } from "./chunk-LKUWH6KU.js";
155
+ } from "./chunk-RNLLWYPV.js";
155
156
  import {
156
157
  ACCOUNT_GROUPS,
157
158
  ADDED_ACCOUNT,
158
159
  ADDED_PROVIDER,
159
160
  addProvider,
161
+ alsoListedByKey,
160
162
  canonicalReference,
161
163
  documentAccountProviders,
162
164
  documentAccountProvidersSql,
@@ -182,14 +184,14 @@ import {
182
184
  runEvent,
183
185
  unitedKinds,
184
186
  useStoredProviders
185
- } from "./chunk-FKP4T7A4.js";
187
+ } from "./chunk-2NAMKBBV.js";
186
188
  import {
187
189
  sqliteCode
188
- } from "./chunk-VBIZD5V5.js";
190
+ } from "./chunk-FITKBN46.js";
189
191
  import {
190
192
  normalizeTag,
191
193
  tagOf
192
- } from "./chunk-X5CXANSA.js";
194
+ } from "./chunk-VZTDELYM.js";
193
195
  import {
194
196
  CHAT_MESSAGES_READ,
195
197
  FACT_TYPES,
@@ -235,7 +237,7 @@ import {
235
237
  validateMeetingRelatedHistory,
236
238
  validateMeetingSeriesHistory,
237
239
  validatePayment
238
- } from "./chunk-IE3R46YN.js";
240
+ } from "./chunk-GW7L2G4I.js";
239
241
  import {
240
242
  OPERATORS_BY_TYPE,
241
243
  dateRange,
@@ -248,13 +250,13 @@ import {
248
250
  validateQuery,
249
251
  walkQuery,
250
252
  zonedMoment
251
- } from "./chunk-4DK55MLP.js";
253
+ } from "./chunk-PQSCABAC.js";
252
254
  import {
253
255
  DEFAULT_TASK_CATEGORIES,
254
256
  sharedConfigPath,
255
257
  storedTaskCategories,
256
258
  taskCategoriesReader
257
- } from "./chunk-HCMEU7AF.js";
259
+ } from "./chunk-KXETGAU4.js";
258
260
  import {
259
261
  SQLiteTable,
260
262
  TableAliasProxyHandler,
@@ -279,20 +281,20 @@ import {
279
281
  sql,
280
282
  sqliteTable,
281
283
  text
282
- } from "./chunk-GFI3UUIU.js";
284
+ } from "./chunk-TPIGO4JJ.js";
283
285
  import {
284
286
  PRAGMAS,
285
287
  TIME_LIMIT_FUNCTION,
286
288
  TimeLimitReached,
287
289
  isQueryOnly
288
- } from "./chunk-7YPZPJTB.js";
290
+ } from "./chunk-JWNM6FCC.js";
289
291
  import {
290
292
  refuseOwnerStoreInTests,
291
293
  storePath
292
- } from "./chunk-HMN26CVU.js";
294
+ } from "./chunk-F5XMZDR5.js";
293
295
  import {
294
296
  singleLine
295
- } from "./chunk-MDJUYCHT.js";
297
+ } from "./chunk-2MCMUZCE.js";
296
298
  import {
297
299
  array,
298
300
  boolean,
@@ -310,11 +312,11 @@ import {
310
312
  safeParse,
311
313
  strictObject,
312
314
  string
313
- } from "./chunk-OBDPKDGB.js";
315
+ } from "./chunk-QZXFWDTX.js";
314
316
  import {
315
317
  CliError,
316
318
  isCliError
317
- } from "./chunk-IBQZT2YD.js";
319
+ } from "./chunk-B6YBN6VK.js";
318
320
  import {
319
321
  resolveFrom
320
322
  } from "./chunk-Y5E2WNWB.js";
@@ -10061,7 +10063,7 @@ var require_cjs = __commonJS({
10061
10063
  }
10062
10064
  });
10063
10065
 
10064
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/account-store.js
10066
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/account-store.js
10065
10067
  var bindArea = /* @__PURE__ */ __name(({ keyed, whole }, account) => {
10066
10068
  const methods = whole;
10067
10069
  return Object.fromEntries(Object.keys(keyed).map((name) => [
@@ -10189,7 +10191,7 @@ var bindAccount = /* @__PURE__ */ __name((store, account, areas, owners) => {
10189
10191
  };
10190
10192
  }, "bindAccount");
10191
10193
 
10192
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
10194
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/core.js
10193
10195
  var IndexBuilderOn = class {
10194
10196
  static {
10195
10197
  __name(this, "IndexBuilderOn");
@@ -10384,7 +10386,7 @@ function alias(table, alias2) {
10384
10386
  }
10385
10387
  __name(alias, "alias");
10386
10388
 
10387
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/record-fields.js
10389
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/record-fields.js
10388
10390
  var DECIMAL_PATTERN = "^[0-9]{1,16}(\\.[0-9]{1,6})?$";
10389
10391
  var SIGNED_DECIMAL = "^-?[0-9]{1,16}(\\.[0-9]{1,6})?$";
10390
10392
  var DAY = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$";
@@ -10503,7 +10505,7 @@ var fieldError = /* @__PURE__ */ __name((schema, value, at2 = []) => {
10503
10505
  return void 0;
10504
10506
  }, "fieldError");
10505
10507
 
10506
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/record-types.js
10508
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/record-types.js
10507
10509
  var kept = /* @__PURE__ */ __name((description) => ({ description }), "kept");
10508
10510
  var PARTY = ["person", "organization"];
10509
10511
  var ORGANIZATION = ["organization"];
@@ -10898,7 +10900,7 @@ var hasV1Roles = /* @__PURE__ */ __name((type) => rolesOf2(type).some(([, role])
10898
10900
  var IDENTITY_TYPES = RECORD_ENTITY_TYPES.filter((type) => RECORD_TYPES[type].review === "identity");
10899
10901
  var article = /* @__PURE__ */ __name((word2) => /^[aeiou]/.test(word2) ? "an" : "a", "article");
10900
10902
 
10901
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
10903
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/entity-types.js
10902
10904
  var ENTITY_TABLES = {
10903
10905
  ...RECORD_TABLES,
10904
10906
  account: "accounts",
@@ -10938,7 +10940,7 @@ var orphanPointers = /* @__PURE__ */ __name((database) => pointerPairs(database)
10938
10940
  return { table, pointer, type, count: count3, known: known2 };
10939
10941
  }).filter(({ count: count3 }) => count3 > 0)), "orphanPointers");
10940
10942
 
10941
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/identity-links.js
10943
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/identity-links.js
10942
10944
  var IDENTITY_LINK_KIND = "identity_link";
10943
10945
  var IDENTITY_LINK_SIGNALS = ["agent", "phone", "email", "guest-email", "name", "account"];
10944
10946
  var LINK_WEAKNESSES = [
@@ -10951,7 +10953,7 @@ var LINK_WEAKNESSES = [
10951
10953
  "not-own-number"
10952
10954
  ];
10953
10955
 
10954
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/merged-persons.js
10956
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/merged-persons.js
10955
10957
  var SEPARATIONS = ["unlink", "split", "undo-merge"];
10956
10958
  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");
10957
10959
  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");
@@ -10983,7 +10985,7 @@ var samePersons = /* @__PURE__ */ __name((database, pk) => {
10983
10985
  }, "samePersons");
10984
10986
  var idsOf = /* @__PURE__ */ __name((database, type, id2) => JSON.stringify(type === "person" ? samePersons(database, id2) : [id2]), "idsOf");
10985
10987
 
10986
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-link-rows.js
10988
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-link-rows.js
10987
10989
  var pairOf = /* @__PURE__ */ __name((a, b) => [Number(a), Number(b)].sort((x, y) => x - y).join("-"), "pairOf");
10988
10990
  var pkOf = /* @__PURE__ */ __name((database, ref3) => {
10989
10991
  const at2 = ref3.indexOf(":");
@@ -11090,13 +11092,13 @@ var forgetErasedLinks = /* @__PURE__ */ __name((database) => {
11090
11092
  database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
11091
11093
  }, "forgetErasedLinks");
11092
11094
 
11093
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/identity-splits.js
11095
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/identity-splits.js
11094
11096
  var IDENTITY_SPLIT_KIND = "identity_split";
11095
11097
 
11096
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
11098
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/mail-findings.js
11097
11099
  var MAIL_FINDINGS_KIND = "mail_findings";
11098
11100
 
11099
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/decisions.js
11101
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/decisions.js
11100
11102
  var TASK_CLOSE_KIND = "task_close";
11101
11103
  var DEFAULT_DECISION_POLICY = { agentDecisions: false, ruleProposalsOwnerOnly: true };
11102
11104
  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");
@@ -11144,7 +11146,7 @@ var assertMayDecide = /* @__PURE__ */ __name((row2, by, policy = DEFAULT_DECISIO
11144
11146
  }, "assertMayDecide");
11145
11147
  var deciderAuthor = /* @__PURE__ */ __name((by) => by === "owner" ? "owner" : { bot: by.bot, ...by.model === void 0 ? {} : { model: by.model } }, "deciderAuthor");
11146
11148
 
11147
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/addresses.js
11149
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/addresses.js
11148
11150
  var EMAIL_ADDRESS = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
11149
11151
  var isEmailAddress = /* @__PURE__ */ __name((value) => EMAIL_ADDRESS.test(value), "isEmailAddress");
11150
11152
  var ROLE_ADDRESS_WORDS = {
@@ -11206,7 +11208,7 @@ var PERSON_LIKE = /* @__PURE__ */ new Set(["hr"]);
11206
11208
  var isPersonLikeRoleAddress = /* @__PURE__ */ __name((address) => PERSON_LIKE.has(localWord(address)), "isPersonLikeRoleAddress");
11207
11209
  var isNoReplyAddress = /* @__PURE__ */ __name((address) => NO_REPLY.has(localWord(address)), "isNoReplyAddress");
11208
11210
 
11209
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/mail/score.js
11211
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/mail/score.js
11210
11212
  var import_disposable_email_domains_js = __toESM(require_dist(), 1);
11211
11213
  var import_tldts = __toESM(require_cjs(), 1);
11212
11214
  var FREE_MAIL = /* @__PURE__ */ new Set([
@@ -11236,7 +11238,7 @@ var FREE_MAIL = /* @__PURE__ */ new Set([
11236
11238
  ]);
11237
11239
  var DAY_MS = 24 * 60 * 60 * 1e3;
11238
11240
 
11239
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/address-organization.js
11241
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/address-organization.js
11240
11242
  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 ";
11241
11243
  var idsOf2 = /* @__PURE__ */ __name((rows) => rows.map((row2) => Number(row2.id)), "idsOf");
11242
11244
  var holdAddress = /* @__PURE__ */ __name(({ database, now: now2 }, organization2, email, { method, author }) => {
@@ -11261,7 +11263,7 @@ var organizationOfAddress = /* @__PURE__ */ __name((context, { name, email, meth
11261
11263
  return id2;
11262
11264
  }, "organizationOfAddress");
11263
11265
 
11264
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
11266
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
11265
11267
  var PHONE_PLANS = [
11266
11268
  {
11267
11269
  country: "us",
@@ -11641,7 +11643,7 @@ var PHONE_PLANS = [
11641
11643
  }
11642
11644
  ];
11643
11645
 
11644
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/phones.js
11646
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/phones.js
11645
11647
  var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
11646
11648
  var DEFAULT_PHONE_COUNTRIES = ["ru"];
11647
11649
  var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
@@ -11716,10 +11718,10 @@ var storedPhone = /* @__PURE__ */ __name((raw, provider) => {
11716
11718
  return found2 ? `+${found2[1]}` : void 0;
11717
11719
  }, "storedPhone");
11718
11720
 
11719
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
11721
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
11720
11722
  import { AsyncLocalStorage } from "node:async_hooks";
11721
11723
 
11722
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/journal.js
11724
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/journal.js
11723
11725
  import { existsSync, statSync } from "node:fs";
11724
11726
  var watched = /* @__PURE__ */ new WeakMap();
11725
11727
  var walInode = /* @__PURE__ */ __name((store) => statSync(`${store}-wal`, { throwIfNoEntry: false })?.ino, "walInode");
@@ -11745,7 +11747,7 @@ var checkJournal = /* @__PURE__ */ __name((database) => {
11745
11747
  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" });
11746
11748
  }, "checkJournal");
11747
11749
 
11748
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/write-events.js
11750
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/write-events.js
11749
11751
  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;
11750
11752
  var writeTarget = /* @__PURE__ */ __name((sql2) => {
11751
11753
  const match = WRITE.exec(sql2);
@@ -11825,7 +11827,7 @@ var committedWrites = /* @__PURE__ */ __name((database) => {
11825
11827
  }, "committedWrites");
11826
11828
  var droppedWrites = /* @__PURE__ */ __name((database) => tallies.get(database)?.pending.clear(), "droppedWrites");
11827
11829
 
11828
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
11830
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/involvement-queue.js
11829
11831
  var ARMS = [
11830
11832
  [
11831
11833
  "message",
@@ -11953,7 +11955,7 @@ var drainInvolvementQueue = /* @__PURE__ */ __name((database, cap = QUEUE_CAP) =
11953
11955
  return recomputed;
11954
11956
  }, "drainInvolvementQueue");
11955
11957
 
11956
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/mentions.js
11958
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/mentions.js
11957
11959
  import { domainToUnicode } from "node:url";
11958
11960
 
11959
11961
  // node_modules/.pnpm/psl@1.15.0/node_modules/psl/dist/psl.mjs
@@ -21975,7 +21977,7 @@ var oa = /* @__PURE__ */ __name((e) => {
21975
21977
  }, "oa");
21976
21978
  var na = { parse: O, get: aa, isValid: oa };
21977
21979
 
21978
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/places.js
21980
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/places.js
21979
21981
  var BEFORE = [
21980
21982
  [/^(?:ул\.?|улиц[аеыу]|улицей)$/iu, "\u0443\u043B\u0438\u0446\u0430"],
21981
21983
  [/^(?:пр-т|просп\.?|проспект[аеу]?)$/iu, "\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442"],
@@ -22235,7 +22237,7 @@ var findPlaces = /* @__PURE__ */ __name((text9) => {
22235
22237
  return found2.sort((a, b) => a.start - b.start);
22236
22238
  }, "findPlaces");
22237
22239
 
22238
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/mentions.js
22240
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/mentions.js
22239
22241
  var MENTION_KINDS = ["phone", "email", "url", "document", "person-name", "place"];
22240
22242
  var MENTION_VERSIONS = {
22241
22243
  phone: 1,
@@ -22411,7 +22413,7 @@ var exactlyOne = /* @__PURE__ */ __name((text9, options) => {
22411
22413
  return one2 && one2.start === 0 && one2.end === text9.length ? one2.value : void 0;
22412
22414
  }, "exactlyOne");
22413
22415
 
22414
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/first-names.js
22416
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/first-names.js
22415
22417
  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";
22416
22418
  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";
22417
22419
  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";
@@ -22419,7 +22421,7 @@ var NOT_NAMES = ["\u0436\u0435\u043D\u0430", "\u0436\u0435\u043D\u044B", "\u0436
22419
22421
  var FIRST_NAMES = [...new Set(`${RUSSIAN} ${EUROPEAN}`.split(" "))];
22420
22422
  var NAME_WORDS = WORDS.split(" ");
22421
22423
 
22422
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/person-names.js
22424
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/person-names.js
22423
22425
  var LATIN_TO_CYRILLIC = {
22424
22426
  shch: "\u0449",
22425
22427
  sch: "\u0449",
@@ -22627,7 +22629,7 @@ var findUnknownNames = /* @__PURE__ */ __name((text9, stem, taken) => {
22627
22629
  return found2;
22628
22630
  }, "findUnknownNames");
22629
22631
 
22630
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/attachments.js
22632
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/attachments.js
22631
22633
  var NOT_FILES = /* @__PURE__ */ new Set([
22632
22634
  "webpage",
22633
22635
  "share",
@@ -22668,7 +22670,7 @@ var matchDownloads = /* @__PURE__ */ __name((stored4, files2) => {
22668
22670
  });
22669
22671
  }, "matchDownloads");
22670
22672
 
22671
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
22673
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/search/lucene/presets.js
22672
22674
  var PRESET_VERSION = 1;
22673
22675
  var PRESETS = {
22674
22676
  password: {
@@ -22722,7 +22724,7 @@ var PRESETS = {
22722
22724
  }
22723
22725
  };
22724
22726
 
22725
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
22727
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-links.js
22726
22728
  var LIVE = "mn.kind = 'url' AND mn.status <> 'dismissed'";
22727
22729
  var MAIL_ROWS = `SELECT mn.source_id FROM mentions mn WHERE mn.source_type = 'email' AND ${LIVE}`;
22728
22730
  var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
@@ -22746,7 +22748,7 @@ var linkMatch = /* @__PURE__ */ __name((field4, typed, mail, mentioned2) => {
22746
22748
  };
22747
22749
  }, "linkMatch");
22748
22750
 
22749
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
22751
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/phone-countries.js
22750
22752
  var SETTING = "phoneCountries";
22751
22753
  var savedPhoneCountries = /* @__PURE__ */ __name((database) => {
22752
22754
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING);
@@ -22777,7 +22779,7 @@ var valueMatch = /* @__PURE__ */ __name((database, typed) => {
22777
22779
  return { sql: "mn.value = ?", params: [phone?.value ?? normalizedValue(typed, { phoneCountries })] };
22778
22780
  }, "valueMatch");
22779
22781
 
22780
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
22782
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/vocabulary.js
22781
22783
  var normalizeVocabularyName = /* @__PURE__ */ __name((input) => {
22782
22784
  if (typeof input !== "string" || input.length > 200 || /[\p{Cc}\p{Cf}]/u.test(input))
22783
22785
  throw new CliError("validation_error", "a vocabulary name takes 1\u2013200 characters without control characters");
@@ -22805,7 +22807,7 @@ var vocabularySimilarity = /* @__PURE__ */ __name((left, right) => {
22805
22807
  return 2 * intersection2 / (aa2.size + bb.size);
22806
22808
  }, "vocabularySimilarity");
22807
22809
 
22808
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
22810
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-creation.js
22809
22811
  import { createHash } from "node:crypto";
22810
22812
  var folded2 = /* @__PURE__ */ __name((name) => {
22811
22813
  try {
@@ -22871,7 +22873,7 @@ var guardTagCreation = /* @__PURE__ */ __name((context, name, kind3, by, options
22871
22873
  });
22872
22874
  }, "guardTagCreation");
22873
22875
 
22874
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
22876
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/tag-redirects.js
22875
22877
  var invalid = /* @__PURE__ */ __name((message3) => {
22876
22878
  throw new CliError("validation_error", message3);
22877
22879
  }, "invalid");
@@ -22948,7 +22950,7 @@ var createTagRedirectIndex = /* @__PURE__ */ __name((snapshot2) => {
22948
22950
  };
22949
22951
  }, "createTagRedirectIndex");
22950
22952
 
22951
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
22953
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-resolution.js
22952
22954
  var tagCanonicalId = /* @__PURE__ */ __name((database, id2) => {
22953
22955
  const row2 = database.prepare("SELECT canonical_id FROM resolved_tags WHERE id=?").get(id2);
22954
22956
  if (!row2)
@@ -22976,7 +22978,7 @@ var tagRedirectSnapshot = /* @__PURE__ */ __name((database) => {
22976
22978
  return snapshot2;
22977
22979
  }, "tagRedirectSnapshot");
22978
22980
 
22979
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
22981
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/task-keys.js
22980
22982
  import { createHash as createHash2 } from "node:crypto";
22981
22983
  var TASK_KEY_PREFIXES = {
22982
22984
  question: "Q",
@@ -23004,7 +23006,7 @@ var taskAccountOf = /* @__PURE__ */ __name((database, rowId) => {
23004
23006
  return row2 && String(row2.key) === inboxKey(String(row2.name)) ? String(row2.name) : void 0;
23005
23007
  }, "taskAccountOf");
23006
23008
 
23007
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
23009
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/things.js
23008
23010
  var storedThing = /* @__PURE__ */ __name((type, id2) => ({ type: String(type), id: Number(id2) }), "storedThing");
23009
23011
  var REFERABLE = {
23010
23012
  ...Object.fromEntries(Object.entries(RECORD_TYPES).map(([type, { tombstone: tombstone2 }]) => [type, { tombstone: tombstone2 }])),
@@ -23168,7 +23170,7 @@ var taskIdOf = /* @__PURE__ */ __name((database, rowId) => {
23168
23170
  return row2 ? String(row2.id ?? row2.key) : void 0;
23169
23171
  }, "taskIdOf");
23170
23172
 
23171
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
23173
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/values.js
23172
23174
  var toMs = /* @__PURE__ */ __name((iso18) => {
23173
23175
  if (iso18 === null || iso18 === void 0)
23174
23176
  return null;
@@ -23182,7 +23184,7 @@ var present = /* @__PURE__ */ __name((entries) => Object.fromEntries(Object.entr
23182
23184
  var DELIVERY = { delivered: 1, read: 2 };
23183
23185
  var deliveryOf = /* @__PURE__ */ __name((stored4) => stored4 === DELIVERY.read ? "read" : stored4 === DELIVERY.delivered ? "delivered" : void 0, "deliveryOf");
23184
23186
 
23185
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
23187
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/tags.js
23186
23188
  var TAG_KINDS = ["tag", "topic"];
23187
23189
  var TAGGABLE = { chat: "chat", contact: "identity", message: "message", task: "task" };
23188
23190
  var TAG_TYPE = {
@@ -23385,7 +23387,7 @@ var tagsOf = /* @__PURE__ */ __name(({ database }, key2, filter) => {
23385
23387
  return result;
23386
23388
  }, "tagsOf");
23387
23389
 
23388
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/trigram-match.js
23390
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/trigram-match.js
23389
23391
  var MOST_YO_SPELLINGS = 64;
23390
23392
  var yoSpellings = /* @__PURE__ */ __name((run) => {
23391
23393
  let spellings2 = [""];
@@ -23407,7 +23409,7 @@ var anyCaseGlob = /* @__PURE__ */ __name((word2) => `*${[...word2.normalize("NFC
23407
23409
  return forms2.size === 1 ? c : `[${[...forms2].join("")}]`;
23408
23410
  }).join("")}*`, "anyCaseGlob");
23409
23411
 
23410
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
23412
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-fields.js
23411
23413
  var MESSAGES = {
23412
23414
  rows: "messages",
23413
23415
  threads: "chats",
@@ -23915,7 +23917,7 @@ var FIELD_COMPILERS = {
23915
23917
  subject
23916
23918
  };
23917
23919
 
23918
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
23920
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/place-key.js
23919
23921
  var placeOf = /* @__PURE__ */ __name((database) => {
23920
23922
  const exact = database.prepare("SELECT id FROM places WHERE folded = ?");
23921
23923
  const onStreet = database.prepare("SELECT id FROM places WHERE substr(folded, 1, ?) = ? LIMIT 2");
@@ -23931,7 +23933,7 @@ var placeOf = /* @__PURE__ */ __name((database) => {
23931
23933
  };
23932
23934
  }, "placeOf");
23933
23935
 
23934
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
23936
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-drain.js
23935
23937
  var DRAIN_ON_WRITE = 500;
23936
23938
  var METHOD = "rules";
23937
23939
  var telegramLink = /* @__PURE__ */ __name((database) => {
@@ -24097,7 +24099,7 @@ var drainMentions = /* @__PURE__ */ __name((database, now2, limit = DRAIN_ON_WRI
24097
24099
  return queued.length;
24098
24100
  }, "drainMentions");
24099
24101
 
24100
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
24102
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/index-state.js
24101
24103
  var indexRow = /* @__PURE__ */ __name((database, name) => {
24102
24104
  const exists2 = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'search_index_state'").get();
24103
24105
  if (!exists2)
@@ -24105,7 +24107,7 @@ var indexRow = /* @__PURE__ */ __name((database, name) => {
24105
24107
  return database.prepare("SELECT * FROM search_index_state WHERE name = ?").get(name);
24106
24108
  }, "indexRow");
24107
24109
 
24108
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
24110
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/stems.js
24109
24111
  var INDEX = "message_stems";
24110
24112
  var SETTING2 = "searchStemmers";
24111
24113
  var DRAIN_ON_WRITE2 = 500;
@@ -24231,7 +24233,7 @@ var stemmerCache = /* @__PURE__ */ __name(() => {
24231
24233
  };
24232
24234
  }, "stemmerCache");
24233
24235
 
24234
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
24236
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/transaction.js
24235
24237
  var rehearsal = new AsyncLocalStorage();
24236
24238
  var SQLITE_BUSY = 5;
24237
24239
  var pause = new Int32Array(new SharedArrayBuffer(4));
@@ -24374,7 +24376,7 @@ var read = /* @__PURE__ */ __name((database, body2) => {
24374
24376
  }
24375
24377
  }, "read");
24376
24378
 
24377
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
24379
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/folded.js
24378
24380
  var FOLDED = [
24379
24381
  { table: "tasks", column: "title" },
24380
24382
  { table: "tasks", column: "close_reason" },
@@ -24411,7 +24413,7 @@ var fillFolded = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
24411
24413
  return filled;
24412
24414
  }, "fillFolded");
24413
24415
 
24414
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
24416
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/conversations/chunks.js
24415
24417
  import { createHash as createHash3 } from "node:crypto";
24416
24418
  var CHUNK_CHARS = 1200;
24417
24419
  var CHUNK_OVERLAP = 150;
@@ -24516,7 +24518,7 @@ var cutChunks = /* @__PURE__ */ __name((members2, limit = CHUNK_CHARS, check3, c
24516
24518
  return chunks2;
24517
24519
  }, "cutChunks");
24518
24520
 
24519
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/search/task-signature.js
24521
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/search/task-signature.js
24520
24522
  var DAY2 = 864e5;
24521
24523
  var CURRENCY = [
24522
24524
  [/^(₽|руб.*|р\.?|rub)$/u, "RUB"],
@@ -24642,7 +24644,7 @@ var dueDayOf = /* @__PURE__ */ __name((text9, createdMs) => {
24642
24644
  return best?.day ?? null;
24643
24645
  }, "dueDayOf");
24644
24646
 
24645
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
24647
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/search/task-similarity.js
24646
24648
  var DAY3 = 864e5;
24647
24649
  var STOP_WORDS = new Set([
24648
24650
  // Russian and English as the test set ran them, already folded (пожалуйста → пожалуиста).
@@ -24797,7 +24799,7 @@ var rankCandidates = /* @__PURE__ */ __name((views, candidates) => candidates.ma
24797
24799
  ...compareViews(subjectViews ?? views, candidate, replyChain === void 0 ? {} : { replyChain })
24798
24800
  })).sort((a, b) => b.score - a.score), "rankCandidates");
24799
24801
 
24800
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
24802
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/vector-index.js
24801
24803
  var source = /* @__PURE__ */ __name((model, dims) => `SELECT k.id, k.chunkable_type,
24802
24804
  coalesce(CASE k.chunkable_type
24803
24805
  WHEN 'image' THEN (SELECT ch.account_id FROM attachments a JOIN messages m ON m.id = a.attachable_id
@@ -24939,7 +24941,7 @@ var dropUnusedVectors = /* @__PURE__ */ __name((database, hashes) => {
24939
24941
  }, "dropUnusedVectors");
24940
24942
  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");
24941
24943
 
24942
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
24944
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/vectors.js
24943
24945
  var currentChunks = /* @__PURE__ */ __name((chatKey) => sql`SELECT k.content_hash, k.chunkable_id AS conversation_id, r.first_message_id,
24944
24946
  r.last_message_id, r.text_start, r.text_end FROM conversations c
24945
24947
  CROSS JOIN chunks k ON k.chunkable_type = 'conversation' AND k.chunkable_id = c.id
@@ -25117,7 +25119,7 @@ var nearestChunks = /* @__PURE__ */ __name((context, accountPk2, filter) => {
25117
25119
  score
25118
25120
  });
25119
25121
  }, "keepBest");
25120
- const ranked = /* @__PURE__ */ __name((found2) => found2.sort((a, b) => b.score - a.score).slice(0, limit), "ranked");
25122
+ const ranked2 = /* @__PURE__ */ __name((found2) => found2.sort((a, b) => b.score - a.score).slice(0, limit), "ranked");
25121
25123
  const plain2 = /* @__PURE__ */ __name((found2) => found2.map(({ id: _, ...chunk }) => chunk), "plain");
25122
25124
  const indexable = personId === void 0 && projectId2 === void 0 && scope3 === void 0 && conversations2 === void 0 && !fromOwner;
25123
25125
  const indexed = indexable && searchIndex(context.database, model, {
@@ -25132,7 +25134,7 @@ var nearestChunks = /* @__PURE__ */ __name((context, accountPk2, filter) => {
25132
25134
  for (const row2 of rows({ ids: [...hashes.keys()] }))
25133
25135
  if (hashes.get(row2.id) === row2.hash)
25134
25136
  keepBest(best2, row2);
25135
- const results = ranked([...best2.values()]);
25137
+ const results = ranked2([...best2.values()]);
25136
25138
  return { results, best: results.map(({ id: id2 }) => id2) };
25137
25139
  }, chatKey === void 0);
25138
25140
  if (indexed)
@@ -25154,7 +25156,7 @@ var nearestChunks = /* @__PURE__ */ __name((context, accountPk2, filter) => {
25154
25156
  const best2 = /* @__PURE__ */ new Map();
25155
25157
  for (const row2 of rows({ ids: ids3 }))
25156
25158
  keepBest(best2, row2);
25157
- return plain2(ranked([...best2.values()]));
25159
+ return plain2(ranked2([...best2.values()]));
25158
25160
  }
25159
25161
  const best = /* @__PURE__ */ new Map();
25160
25162
  let after2 = { conversation: 0, ordinal: -1 };
@@ -25167,7 +25169,7 @@ var nearestChunks = /* @__PURE__ */ __name((context, accountPk2, filter) => {
25167
25169
  break;
25168
25170
  after2 = { conversation: last.conversation, ordinal: last.ordinal };
25169
25171
  }
25170
- return plain2(ranked([...best.values()]));
25172
+ return plain2(ranked2([...best.values()]));
25171
25173
  }, "nearestChunks");
25172
25174
  var hasVectorOf = /* @__PURE__ */ __name((models) => sql`EXISTS (SELECT 1 FROM chunks k
25173
25175
  JOIN conversations c ON k.chunkable_type = 'conversation' AND c.id = k.chunkable_id
@@ -25288,7 +25290,7 @@ var vectorCounts = /* @__PURE__ */ __name(({ orm }, models) => new Map(models.ma
25288
25290
  Number(orm.get(sql`SELECT count(*) AS n FROM embeddings WHERE model = ${model}`)?.n ?? 0)
25289
25291
  ])), "vectorCounts");
25290
25292
 
25291
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
25293
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/document-pictures.js
25292
25294
  var DOCUMENT_PICTURE = "document_picture";
25293
25295
  var SCAN_PAGE2 = 5e3;
25294
25296
  var idOf = /* @__PURE__ */ __name((ref3) => {
@@ -25351,12 +25353,12 @@ var documentPicturesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
25351
25353
  }, "nearestPictures")
25352
25354
  }), "documentPicturesOver");
25353
25355
 
25354
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/index-text.js
25356
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/index-text.js
25355
25357
  var noteIndexText = /* @__PURE__ */ __name((title2, text9) => title2 ? `${title2}
25356
25358
 
25357
25359
  ${text9}` : text9, "noteIndexText");
25358
25360
 
25359
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/enrichments.js
25361
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/enrichments.js
25360
25362
  var ENRICHMENT_SUBJECTS = ["document", "note", "email"];
25361
25363
  var ENRICHMENT_POSITION = 1e6;
25362
25364
  var EMAIL_ENRICHMENT = "email_enrichment";
@@ -25450,7 +25452,7 @@ var enrichmentsOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
25450
25452
  }), "clear")
25451
25453
  }), "enrichmentsOver");
25452
25454
 
25453
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
25455
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/query-filter.js
25454
25456
  var glob = /* @__PURE__ */ __name((value) => [...fold(value).matchAll(/\\(.)|([*?])|(.)/gsu)].map(([, escaped2, wildcard, plain2]) => {
25455
25457
  const literal4 = escaped2 ?? plain2 ?? "";
25456
25458
  return wildcard ?? (/[*?[]/u.test(literal4) ? `[${literal4}]` : literal4);
@@ -25526,7 +25528,7 @@ var compile = /* @__PURE__ */ __name((node, columns2, options) => {
25526
25528
  var queryFilter = /* @__PURE__ */ __name((ast, columns2, options) => compile(ast.root, columns2, options), "queryFilter");
25527
25529
  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");
25528
25530
 
25529
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
25531
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/events.js
25530
25532
  var toJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.stringify(value), "toJson");
25531
25533
  var fromJson = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : JSON.parse(String(value)), "fromJson");
25532
25534
  var int = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "int");
@@ -25616,7 +25618,7 @@ var linkMeeting = /* @__PURE__ */ __name((database, id2, eventId, now2, mode = "
25616
25618
  });
25617
25619
  }, "linkMeeting");
25618
25620
 
25619
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/task-titles.js
25621
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/task-titles.js
25620
25622
  var MAX_TITLE = 120;
25621
25623
  var placeholderTitleOf = /* @__PURE__ */ __name((row2) => `${String(row2.type)} \u2014 ${String(row2.source_locator ?? "")}`, "placeholderTitleOf");
25622
25624
  var PLACEHOLDER_TITLE_SQL = "title = type || ' \u2014 ' || coalesce(source_locator, '')";
@@ -25678,7 +25680,7 @@ var fillFoundTaskTitles = /* @__PURE__ */ __name((database, warn, { batch = 500
25678
25680
  }
25679
25681
  }, "fillFoundTaskTitles");
25680
25682
 
25681
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
25683
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/note-index.js
25682
25684
  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), ''))";
25683
25685
  var UNSEARCHED_EVENT_TYPES = [
25684
25686
  "working-location",
@@ -25925,7 +25927,7 @@ var resetNoteIndex = /* @__PURE__ */ __name((database) => {
25925
25927
  return true;
25926
25928
  }, "resetNoteIndex");
25927
25929
 
25928
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
25930
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/person-resolution.js
25929
25931
  var keyOf2 = /* @__PURE__ */ __name((name) => fold(name).trim().replace(/^@/, ""), "keyOf");
25930
25932
  var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
25931
25933
  for (const key2 of new Set(names.filter((name) => !!name?.trim()).map(keyOf2))) {
@@ -25944,7 +25946,7 @@ var resolvePersonLinks = /* @__PURE__ */ __name((database, names) => {
25944
25946
  }
25945
25947
  }, "resolvePersonLinks");
25946
25948
 
25947
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
25949
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/canonical-tags.js
25948
25950
  var canonicalTags = sqliteTable("canonical_tags", {
25949
25951
  id: integer("id").primaryKey(),
25950
25952
  name: text("name").notNull().unique(),
@@ -25953,7 +25955,7 @@ var canonicalTags = sqliteTable("canonical_tags", {
25953
25955
  updatedAt: integer("updated_at").notNull()
25954
25956
  });
25955
25957
 
25956
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/link-revisions.js
25958
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/link-revisions.js
25957
25959
  var linkRevisions = sqliteTable("link_revisions", {
25958
25960
  id: integer("id").primaryKey(),
25959
25961
  linkId: integer("link_id").notNull(),
@@ -25965,7 +25967,7 @@ var linkRevisions = sqliteTable("link_revisions", {
25965
25967
  createdAt: integer("created_at").notNull()
25966
25968
  }, (table) => [index("link_revisions_by_link_id_created_at").on(table.linkId, table.createdAt)]);
25967
25969
 
25968
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
25970
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-transfers.js
25969
25971
  var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
25970
25972
  sourceKey: text("source_key").notNull(),
25971
25973
  collection: text("collection").notNull(),
@@ -25975,7 +25977,7 @@ var documentAnnotationTransfers = sqliteTable("document_annotation_transfers", {
25975
25977
  createdAt: integer("created_at").notNull()
25976
25978
  }, (table) => [primaryKey({ columns: [table.sourceKey, table.collection] })]);
25977
25979
 
25978
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-changes.js
25980
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-changes.js
25979
25981
  var documentChanges = sqliteTable("document_changes", {
25980
25982
  id: integer("id").primaryKey(),
25981
25983
  accountId: integer("account_id").notNull(),
@@ -25987,13 +25989,13 @@ var documentChanges = sqliteTable("document_changes", {
25987
25989
  at: integer("at").notNull()
25988
25990
  }, (table) => [index("document_changes_by_account_id_at").on(table.accountId, table.at)]);
25989
25991
 
25990
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
25992
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/document-index-pending.js
25991
25993
  var documentIndexPending = sqliteTable("document_index_pending", {
25992
25994
  id: integer("id").notNull(),
25993
25995
  indexableType: text("indexable_type").notNull()
25994
25996
  }, (table) => [primaryKey({ columns: [table.indexableType, table.id] })]);
25995
25997
 
25996
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/decision-requests.js
25998
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/decision-requests.js
25997
25999
  var decisionRequests = sqliteTable("decision_requests", {
25998
26000
  id: integer("id").primaryKey(),
25999
26001
  tokenDigest: text("token_digest").notNull().unique(),
@@ -26013,7 +26015,7 @@ var decisionRequests = sqliteTable("decision_requests", {
26013
26015
  index("decision_requests_by_channel_bot_profile_chat_id_message_id").on(table.channel, table.botProfile, table.chatId, table.messageId)
26014
26016
  ]);
26015
26017
 
26016
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/enrichments.js
26018
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/enrichments.js
26017
26019
  var enrichments = sqliteTable("enrichments", {
26018
26020
  subjectType: text("subject_type").notNull(),
26019
26021
  subjectId: integer("subject_id").notNull(),
@@ -26025,7 +26027,7 @@ var enrichments = sqliteTable("enrichments", {
26025
26027
  createdAt: integer("created_at").notNull()
26026
26028
  }, (table) => [primaryKey({ columns: [table.subjectType, table.subjectId] })]);
26027
26029
 
26028
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/templates.js
26030
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/templates.js
26029
26031
  var templates = sqliteTable("templates", {
26030
26032
  key: text("key").notNull(),
26031
26033
  channel: text("channel").notNull(),
@@ -26047,7 +26049,7 @@ var templatesHistory = sqliteTable("templates_history", {
26047
26049
  index("templates_history_by_key_channel_language_id").on(table.key, table.channel, table.language, table.id)
26048
26050
  ]);
26049
26051
 
26050
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/links.js
26052
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/links.js
26051
26053
  var links = sqliteTable("links", {
26052
26054
  id: integer("id").primaryKey(),
26053
26055
  fromType: text("from_type").notNull(),
@@ -26078,7 +26080,7 @@ var links = sqliteTable("links", {
26078
26080
  index("links_by_to_type_to_id").on(table.toType, table.toId)
26079
26081
  ]);
26080
26082
 
26081
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
26083
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/schema/tag-consolidations.js
26082
26084
  var tagRedirects = sqliteTable("tag_redirects", {
26083
26085
  sourceId: integer("source_id").primaryKey().references(() => canonicalTags.id),
26084
26086
  survivorId: integer("survivor_id").notNull().references(() => canonicalTags.id),
@@ -26104,7 +26106,7 @@ var tagConsolidations = sqliteTable("tag_consolidations", {
26104
26106
  index("tag_consolidations_by_actor_type_actor_id").on(table.actorType, table.actorId)
26105
26107
  ]);
26106
26108
 
26107
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
26109
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/schema.js
26108
26110
  var accounts = sqliteTable("accounts", {
26109
26111
  id: integer("id").primaryKey(),
26110
26112
  provider: text("provider").notNull(),
@@ -28275,7 +28277,7 @@ var storeSettings = sqliteTable("store_settings", {
28275
28277
  at: integer("at").notNull()
28276
28278
  });
28277
28279
 
28278
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
28280
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/identities.js
28279
28281
  var contactsOf = /* @__PURE__ */ __name(({ phones: phones2, emails: emails3 }) => {
28280
28282
  if (phones2 === void 0 && emails3 === void 0)
28281
28283
  return void 0;
@@ -28521,7 +28523,7 @@ var meetingIdentityPk = /* @__PURE__ */ __name((context, accountId, identity) =>
28521
28523
  }, "meetingIdentityPk");
28522
28524
  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");
28523
28525
 
28524
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/display-names.js
28526
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/display-names.js
28525
28527
  var QUOTES = [
28526
28528
  ['"', '"'],
28527
28529
  ["'", "'"],
@@ -28579,7 +28581,7 @@ var nameKey = /* @__PURE__ */ __name((name) => {
28579
28581
  }, "nameKey");
28580
28582
  var isReadable = /* @__PURE__ */ __name((shown2) => shown2 !== null && READABLE.test(shown2), "isReadable");
28581
28583
 
28582
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/person-separation.js
28584
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/person-separation.js
28583
28585
  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");
28584
28586
  var MOVED_AWAY = `moved.identity_id IN (SELECT value FROM json_each(?))
28585
28587
  AND (moved.from_person_id IN (SELECT value FROM json_each(?))
@@ -28594,7 +28596,7 @@ var apart = /* @__PURE__ */ __name(({ database }, one2, other) => {
28594
28596
  var separated = /* @__PURE__ */ __name((context, one2, other) => one2 !== other && apart(context, { identities: identitiesOf(context, one2), person: one2 }, { identities: identitiesOf(context, other), person: other }), "separated");
28595
28597
  var identitySeparated = /* @__PURE__ */ __name((context, identity, person2) => apart(context, { identities: [identity] }, { identities: identitiesOf(context, person2).filter((pk) => pk !== identity), person: person2 }), "identitySeparated");
28596
28598
 
28597
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
28599
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/reads.js
28598
28600
  var MESSAGE_FIELDS = {
28599
28601
  pk: messages.id,
28600
28602
  nativeId: messages.externalId,
@@ -28774,7 +28776,7 @@ var chatActivity = /* @__PURE__ */ __name(({ database }, accountKey, since, wher
28774
28776
  storedAt: toIso(Number(database.prepare("SELECT max(created_at) AS at FROM messages WHERE account_id = ?").get(accountKey)?.at) || null)
28775
28777
  }), "chatActivity");
28776
28778
 
28777
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
28779
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/search.js
28778
28780
  var HIT_FIELDS = {
28779
28781
  ...MESSAGE_FIELDS,
28780
28782
  chatTitle: sql`${chats.title}`.as("chat_title"),
@@ -28849,8 +28851,8 @@ var hitsByPk = /* @__PURE__ */ __name((context, pks) => {
28849
28851
  return toHits(context, pks.flatMap((pk) => rows.get(pk) ?? []));
28850
28852
  }, "hitsByPk");
28851
28853
  var perChatNewest = /* @__PURE__ */ __name((context, where, wanted) => {
28852
- const ranked = selectRanked(context).where(where).as("ranked");
28853
- return context.orm.select().from(ranked).where(lte(ranked.chatRank, wanted)).orderBy(desc(ranked.sentAt), desc(ranked.pk)).all();
28854
+ const ranked2 = selectRanked(context).where(where).as("ranked");
28855
+ return context.orm.select().from(ranked2).where(lte(ranked2.chatRank, wanted)).orderBy(desc(ranked2.sentAt), desc(ranked2.pk)).all();
28854
28856
  }, "perChatNewest");
28855
28857
  var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
28856
28858
  if (!Number.isInteger(limit) || limit < 1 || limit > 100 || parents.length > 300)
@@ -28875,7 +28877,7 @@ var directReplies = /* @__PURE__ */ __name((context, parents, limit) => {
28875
28877
  };
28876
28878
  }, "directReplies");
28877
28879
 
28878
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
28880
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/person-links.js
28879
28881
  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");
28880
28882
  var required = /* @__PURE__ */ __name((context, ref3) => {
28881
28883
  const found2 = identityRow(context, ref3);
@@ -29088,7 +29090,7 @@ var mentioning = /* @__PURE__ */ __name((context, accountKey, { id: id2, usernam
29088
29090
  }, "mentioning");
29089
29091
  var escaped = /* @__PURE__ */ __name((text9) => text9.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "escaped");
29090
29092
 
29091
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
29093
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/actors.js
29092
29094
  var BOT_KINDS = ["agent", "rule", "script", "integration"];
29093
29095
  var ownerPerson = /* @__PURE__ */ __name((database) => {
29094
29096
  const found2 = database.prepare("SELECT id FROM persons WHERE owner = 1 ORDER BY id LIMIT 1").get();
@@ -29145,7 +29147,7 @@ var proposedBySql = /* @__PURE__ */ __name((type, id2, by) => {
29145
29147
  return { sql: bot("pb.name = ?"), params: [by.bot] };
29146
29148
  }, "proposedBySql");
29147
29149
 
29148
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review-marks.js
29150
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review-marks.js
29149
29151
  var TABLES = { memory: "memories", fact: "facts" };
29150
29152
  var HOLDING = { memory: ["proposed", "confirmed"], fact: ["proposed", "accepted"] };
29151
29153
  var KEPT = 20;
@@ -29240,7 +29242,7 @@ var scrubSourceReviews = /* @__PURE__ */ __name((database, erased, { refs }) =>
29240
29242
  return scrubbed;
29241
29243
  }, "scrubSourceReviews");
29242
29244
 
29243
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-signature.js
29245
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-signature.js
29244
29246
  var QUOTE_LIMIT = 500;
29245
29247
  var GONE = { sig: "gone", rev: null, deleted: true, changedAt: null };
29246
29248
  var part = /* @__PURE__ */ __name((value) => value == null ? "" : String(value), "part");
@@ -29519,15 +29521,18 @@ var deleteDocumentRow = /* @__PURE__ */ __name((database, id2, at2) => {
29519
29521
  database.prepare("DELETE FROM documents WHERE id = ?").run(id2);
29520
29522
  }, "deleteDocumentRow");
29521
29523
 
29522
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-accounts.js
29524
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-accounts.js
29523
29525
  var accountKeys = /* @__PURE__ */ __name((database, ids3) => {
29524
29526
  const unique2 = [...new Set(ids3)];
29525
29527
  if (unique2.length === 0)
29526
29528
  return [];
29527
- return database.prepare(`SELECT id, provider, external_id FROM accounts WHERE id IN (${unique2.map(() => "?").join(",")})`).all(...unique2).map(({ id: id2, provider, external_id }) => (
29528
- // A notes folder or a documents account is `notes:<its store id>`, as source lists and groups name it.
29529
- isFolderProvider(String(provider)) || isDocumentAccountProvider(String(provider)) ? { provider: "notes", account: String(id2) } : { provider: String(provider), account: String(external_id) }
29530
- ));
29529
+ return database.prepare(`SELECT id, provider, external_id FROM accounts WHERE id IN (${unique2.map(() => "?").join(",")})`).all(...unique2).flatMap(({ id: id2, provider, external_id }) => {
29530
+ const own = { provider: String(provider), account: String(external_id) };
29531
+ if (!isFolderProvider(own.provider) && !isDocumentAccountProvider(own.provider))
29532
+ return [own];
29533
+ const notes2 = { provider: "notes", account: String(id2) };
29534
+ return alsoListedByKey(own.provider) ? [notes2, own] : [notes2];
29535
+ });
29531
29536
  }, "accountKeys");
29532
29537
  var hasAccountColumn = /* @__PURE__ */ new WeakMap();
29533
29538
  var accountColumnIn = /* @__PURE__ */ __name((database, table) => {
@@ -29608,7 +29613,7 @@ var refEndsOf = /* @__PURE__ */ __name((database, text9) => {
29608
29613
  }, "refEndsOf");
29609
29614
  var refAccountsOf = /* @__PURE__ */ __name((database, text9) => refEndsOf(database, text9)?.flat(), "refAccountsOf");
29610
29615
 
29611
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
29616
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/ref-summaries.js
29612
29617
  var EXCERPT_CHARS = 280;
29613
29618
  var TITLE_CHARS = 120;
29614
29619
  var MEMORY_TITLE_CHARS = 80;
@@ -30032,7 +30037,7 @@ var refsStoreOver = /* @__PURE__ */ __name((context) => ({
30032
30037
  ends: /* @__PURE__ */ __name(async (text9) => refEndsOf(context.database, text9), "ends")
30033
30038
  }), "refsStoreOver");
30034
30039
 
30035
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
30040
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-sources.js
30036
30041
  var sourceOf3 = /* @__PURE__ */ __name((read2, ref3) => ({
30037
30042
  ref: ref3,
30038
30043
  kind: read2.kind,
@@ -30070,7 +30075,7 @@ var evidenceSourcesOf = /* @__PURE__ */ __name((database, from2) => {
30070
30075
  });
30071
30076
  }, "evidenceSourcesOf");
30072
30077
 
30073
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/ulid.js
30078
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/ulid.js
30074
30079
  import { randomBytes } from "node:crypto";
30075
30080
  var CROCKFORD = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
30076
30081
  var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
@@ -30083,7 +30088,7 @@ var ulid = /* @__PURE__ */ __name((now2 = Date.now()) => {
30083
30088
  return time3 + random;
30084
30089
  }, "ulid");
30085
30090
 
30086
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/document-history.js
30091
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/document-history.js
30087
30092
  var DOCUMENT_REMOVALS = ["deleted", "unavailable", "unsynced"];
30088
30093
  var DOCUMENT_EVENTS = ["added", "changed", "restored", ...DOCUMENT_REMOVALS];
30089
30094
  var iso3 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
@@ -30203,7 +30208,7 @@ var documentHistoryOver = /* @__PURE__ */ __name(({ database }) => {
30203
30208
  };
30204
30209
  }, "documentHistoryOver");
30205
30210
 
30206
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
30211
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/document-metadata.js
30207
30212
  var FOLDED_FIELDS = ["title", "site", "language", "author"];
30208
30213
  var encodeDocumentMetadata = /* @__PURE__ */ __name((meta, sections) => {
30209
30214
  if (!meta && !sections?.length)
@@ -30224,11 +30229,11 @@ var languageOf = /* @__PURE__ */ __name((meta) => {
30224
30229
  return typeof language === "string" && language !== "" ? language : null;
30225
30230
  }, "languageOf");
30226
30231
 
30227
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/file-note.js
30232
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/file-note.js
30228
30233
  var LIVE3 = "f.deleted_at IS NULL AND d.deleted_at IS NULL AND coalesce(json_extract(d.metadata, '$.catalog.active'), 1)=1";
30229
30234
  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");
30230
30235
 
30231
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
30236
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/files.js
30232
30237
  var isObject2 = /* @__PURE__ */ __name((value) => value !== null && typeof value === "object" && !Array.isArray(value), "isObject");
30233
30238
  var objectOf2 = /* @__PURE__ */ __name((value) => {
30234
30239
  if (isObject2(value))
@@ -30475,7 +30480,7 @@ var filesStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
30475
30480
  };
30476
30481
  }, "filesStoreOver");
30477
30482
 
30478
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
30483
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/imported-documents.js
30479
30484
  var IMPORTED_DOCUMENT_QUERY = defineQuery({
30480
30485
  entity: "document",
30481
30486
  backend: "sql",
@@ -30521,7 +30526,7 @@ var importedDocumentWhere = /* @__PURE__ */ __name((database, query) => {
30521
30526
  return queryFilter(validateQuery(query, IMPORTED_DOCUMENT_QUERY), columns2, { zone: timezoneOf() });
30522
30527
  }, "importedDocumentWhere");
30523
30528
 
30524
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
30529
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/link-reviews.js
30525
30530
  var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates, reason, now2) => {
30526
30531
  database.prepare(`INSERT INTO link_reviews (linkable_type, linkable_id, entity_type, candidates, reason, status, created_at, updated_at)
30527
30532
  VALUES (?, ?, ?, ?, ?, 'open', ?, ?)
@@ -30529,7 +30534,7 @@ var reviewLink = /* @__PURE__ */ __name((database, linkable, entity, candidates,
30529
30534
  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);
30530
30535
  }, "reviewLink");
30531
30536
 
30532
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/link-row.js
30537
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/link-row.js
30533
30538
  var iso4 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
30534
30539
  var thingRef = /* @__PURE__ */ __name((database, type, id2) => type == null || id2 == null ? null : referenceOfThing(database, storedThing(type, id2)) ?? null, "thingRef");
30535
30540
  var hasBothEnds = /* @__PURE__ */ __name((link3) => link3.from !== null && link3.to !== null, "hasBothEnds");
@@ -30563,7 +30568,7 @@ var linkOf = /* @__PURE__ */ __name((database, row2) => {
30563
30568
  };
30564
30569
  }, "linkOf");
30565
30570
 
30566
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/note-dates.js
30571
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/note-dates.js
30567
30572
  var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
30568
30573
  const fileAt = database.prepare("SELECT id, document_id FROM files WHERE account_id = ? AND external_id = ? AND kind <> 'folder' AND deleted_at IS NULL");
30569
30574
  const legacy = database.prepare("SELECT id FROM documents WHERE account_id = ? AND external_id = ? AND deleted_at IS NULL");
@@ -30584,7 +30589,7 @@ var dateFileNotes = /* @__PURE__ */ __name((database, folder, dates) => {
30584
30589
  return changed;
30585
30590
  }, "dateFileNotes");
30586
30591
 
30587
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/text-input.js
30592
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/text-input.js
30588
30593
  var textOf2 = /* @__PURE__ */ __name((text9, what, max = 1e5, allowEmpty = false) => {
30589
30594
  const value = text9.trim();
30590
30595
  if (!value && !allowEmpty || value.length > max)
@@ -30597,7 +30602,7 @@ var oneOf = /* @__PURE__ */ __name((value, allowed, what) => {
30597
30602
  return value;
30598
30603
  }, "oneOf");
30599
30604
 
30600
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
30605
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/notes.js
30601
30606
  var NOTE_FORMATS = ["obsidian", "markdown"];
30602
30607
  var RELATIONSHIPS = RELATION_KINDS.map(linkKind).join(", ");
30603
30608
  var iso5 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
@@ -31133,10 +31138,10 @@ var notesStoreOver = /* @__PURE__ */ __name((context) => {
31133
31138
  };
31134
31139
  }, "notesStoreOver");
31135
31140
 
31136
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/rows-page.js
31141
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/rows-page.js
31137
31142
  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");
31138
31143
 
31139
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
31144
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/memories.js
31140
31145
  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";
31141
31146
  var iso6 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
31142
31147
  var oneOf2 = /* @__PURE__ */ __name((value, allowed, what) => {
@@ -31401,7 +31406,7 @@ var memoriesStoreOver = /* @__PURE__ */ __name((context) => {
31401
31406
  };
31402
31407
  }, "memoriesStoreOver");
31403
31408
 
31404
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/reviewed.js
31409
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/reviewed.js
31405
31410
  var prefixesText = /* @__PURE__ */ __name((types) => `${article(types[0] ?? "")} ${types.map((type) => `${type}:`).join(" or ")}`, "prefixesText");
31406
31411
  var refuse = /* @__PURE__ */ __name((message3, reason, code = "validation_error") => {
31407
31412
  throw new CliError(code, message3, { reason });
@@ -31549,7 +31554,7 @@ var reviewedRowsOver = /* @__PURE__ */ __name((context) => {
31549
31554
  return { partyOf, partyThing, reviewedOf, written, keepEvidence, ownerOnly: ownerOnly2, linkedId, ...decisionsOver(context) };
31550
31555
  }, "reviewedRowsOver");
31551
31556
 
31552
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/money-lines.js
31557
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/money-lines.js
31553
31558
  var MAX_LINES = 500;
31554
31559
  var PARENTS = {
31555
31560
  invoice: {
@@ -31649,7 +31654,7 @@ var moneyLinesOver = /* @__PURE__ */ __name(({ database }) => {
31649
31654
  return { linesOf, insertLines, shownLines, appendLine, deleteLine, sumOf, retotal };
31650
31655
  }, "moneyLinesOver");
31651
31656
 
31652
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/refunds.js
31657
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/refunds.js
31653
31658
  var COUNTED = {
31654
31659
  confirmed: "np.review = 'confirmed' AND np.deleted_at IS NULL",
31655
31660
  // A proposed refund promises nothing back yet, so it must not free room an import could then fill.
@@ -31724,7 +31729,7 @@ var refundRulesOver = /* @__PURE__ */ __name((context) => {
31724
31729
  return { originalFor, refundShare, confirmable, keepsRefunded, keepsShare, keepsInvoice };
31725
31730
  }, "refundRulesOver");
31726
31731
 
31727
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
31732
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/finance.js
31728
31733
  var FINANCE_TYPES = ["invoice", "payment"];
31729
31734
  var isFinanceType = /* @__PURE__ */ __name((type) => FINANCE_TYPES.includes(type), "isFinanceType");
31730
31735
  var PAID = netPaidSql("i.id");
@@ -32128,7 +32133,7 @@ var financeStoreOver = /* @__PURE__ */ __name((context) => {
32128
32133
  };
32129
32134
  }, "financeStoreOver");
32130
32135
 
32131
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
32136
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-entries.js
32132
32137
  var refuse2 = /* @__PURE__ */ __name((message3, reason) => {
32133
32138
  throw new CliError("validation_error", message3, { reason });
32134
32139
  }, "refuse");
@@ -32206,7 +32211,7 @@ var paymentEntriesOver = /* @__PURE__ */ __name((context) => {
32206
32211
  };
32207
32212
  }, "paymentEntriesOver");
32208
32213
 
32209
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
32214
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/evidence-findings.js
32210
32215
  var EVIDENCE_FINDINGS_KIND = "evidence_findings";
32211
32216
  var reference = /* @__PURE__ */ __name((raw) => {
32212
32217
  if (/^(document|note):[1-9]\d*$/.test(raw))
@@ -32233,7 +32238,7 @@ var validateEvidenceFindings = /* @__PURE__ */ __name((input) => {
32233
32238
  return valid;
32234
32239
  }, "validateEvidenceFindings");
32235
32240
 
32236
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
32241
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/proposed-actions.js
32237
32242
  var PROPOSAL_STATUSES = ["proposed", "approved", "rejected", "executed", "failed"];
32238
32243
  var PROPOSAL_VERDICTS = ["useful", "not_useful"];
32239
32244
  var iso8 = /* @__PURE__ */ __name((value) => value == null ? null : new Date(Number(value)).toISOString(), "iso");
@@ -32427,7 +32432,7 @@ var proposedActionsStoreOver = /* @__PURE__ */ __name((context) => {
32427
32432
  };
32428
32433
  }, "proposedActionsStoreOver");
32429
32434
 
32430
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-proposals.js
32435
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-proposals.js
32431
32436
  var CONFIRMED = "proposal";
32432
32437
  var refOf = /* @__PURE__ */ __name(({ database }, pk) => {
32433
32438
  const row2 = database.prepare("SELECT provider, external_id FROM identities WHERE id = ?").get(pk);
@@ -32779,7 +32784,7 @@ var identityLinkRows = /* @__PURE__ */ __name((context, { person: person2, statu
32779
32784
  return { items, hasMore: rows.length > limit };
32780
32785
  }, "identityLinkRows");
32781
32786
 
32782
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/person-merges.js
32787
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/person-merges.js
32783
32788
  var mergeId = /* @__PURE__ */ __name((to, from2) => `merge:${to}-${from2}`, "mergeId");
32784
32789
  var parseMergeId = /* @__PURE__ */ __name((id2) => {
32785
32790
  const found2 = /^merge:([1-9]\d*)-([1-9]\d*)$/.exec(id2.trim());
@@ -32882,7 +32887,7 @@ var split = /* @__PURE__ */ __name((context, uid, refs, by) => {
32882
32887
  return recordOf(context, alone);
32883
32888
  }, "split");
32884
32889
 
32885
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-split-proposals.js
32890
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-split-proposals.js
32886
32891
  var refOf2 = /* @__PURE__ */ __name(({ provider, id: id2 }) => `${provider}:${id2}`, "refOf");
32887
32892
  var keyOf3 = /* @__PURE__ */ __name((split2, person2, identities2) => `${split2} ${person2} ${[...identities2].sort().join(" ")}`, "keyOf");
32888
32893
  var planOf = /* @__PURE__ */ __name((context, input) => {
@@ -33059,7 +33064,7 @@ var forgetErasedSplits = /* @__PURE__ */ __name((database) => {
33059
33064
  database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
33060
33065
  }, "forgetErasedSplits");
33061
33066
 
33062
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/test-data.js
33067
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/test-data.js
33063
33068
  var SEED_PEOPLE = [
33064
33069
  { name: "Owner", username: "owner" },
33065
33070
  { name: "Ann Lee", username: "ann" },
@@ -33076,7 +33081,7 @@ var RESERVED_ADDRESS_GLOBS = [
33076
33081
  ];
33077
33082
  var SEED_ID_GLOBS = ["person-[0-9]*"];
33078
33083
 
33079
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/test-people.js
33084
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/test-people.js
33080
33085
  var TEST_DATA_KIND = "test_data";
33081
33086
  var globs = /* @__PURE__ */ __name((column2, patterns) => patterns.map((pattern) => `${column2} GLOB '${pattern}'`).join(" OR "), "globs");
33082
33087
  var SURE = `(${globs("i.external_id", SEED_ID_GLOBS)} OR ${globs("lower(i.email)", RESERVED_ADDRESS_GLOBS)})`;
@@ -33145,7 +33150,7 @@ var forgetErasedTestData = /* @__PURE__ */ __name((database) => {
33145
33150
  database.prepare("DELETE FROM proposed_actions WHERE id = ?").run(Number(row2.id));
33146
33151
  }, "forgetErasedTestData");
33147
33152
 
33148
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
33153
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/accounts.js
33149
33154
  var accountPk = /* @__PURE__ */ __name(({ orm, now: now2 }, { provider, account, scope: scope3 }, name = null, startScope) => Number(orm.insert(accounts).values({
33150
33155
  provider,
33151
33156
  externalId: account,
@@ -33239,7 +33244,7 @@ var dropOrphanPeople = /* @__PURE__ */ __name((database, unseenBefore) => {
33239
33244
  AND id NOT IN (SELECT id FROM (${referencesTo(database, "persons", /* @__PURE__ */ new Set(["identity_links"]))}) WHERE id IS NOT NULL)`).run(JSON.stringify(persons2));
33240
33245
  }, "dropOrphanPeople");
33241
33246
 
33242
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
33247
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/history-skips.js
33243
33248
  var HISTORY_KEY = "$history";
33244
33249
  var objectOf3 = /* @__PURE__ */ __name((text9) => {
33245
33250
  if (typeof text9 !== "string")
@@ -33315,7 +33320,7 @@ var withoutHistory = /* @__PURE__ */ __name((metadata3) => {
33315
33320
  return rest;
33316
33321
  }, "withoutHistory");
33317
33322
 
33318
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
33323
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/chats.js
33319
33324
  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");
33320
33325
  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");
33321
33326
  var setChatScope = /* @__PURE__ */ __name((context, accountKey, chatId, scope3) => {
@@ -33613,7 +33618,7 @@ var replaceAutoTags = /* @__PURE__ */ __name((context, key2, chatId, algorithm,
33613
33618
  }
33614
33619
  }, "replaceAutoTags");
33615
33620
 
33616
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/counters.js
33621
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/counters.js
33617
33622
  var COUNTER_FIELDS = ["views", "reactions", "comments"];
33618
33623
  var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
33619
33624
  var counterObservationTime = /* @__PURE__ */ __name((observation, now2) => {
@@ -33632,7 +33637,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
33632
33637
  return states.some((one2) => one2.freshness === "stale") ? "stale" : "fresh";
33633
33638
  }, "counterFreshness");
33634
33639
 
33635
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-tokens.js
33640
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-tokens.js
33636
33641
  var BOT_TOKEN = /(?<!\d)(\d{6,12}):[A-Za-z0-9_-]{30,40}(?![A-Za-z0-9_-])/g;
33637
33642
  var MAY_HOLD = "*[0-9][0-9][0-9][0-9][0-9][0-9]:*";
33638
33643
  var MASKED_THROUGH = "bot_tokens_masked_through";
@@ -33672,7 +33677,7 @@ var maskStoredBotTokens = /* @__PURE__ */ __name((context) => {
33672
33677
  }, "maskStoredBotTokens");
33673
33678
  var masks = /* @__PURE__ */ __name((value) => value != null && withoutBotTokens(String(value)) !== value, "masks");
33674
33679
 
33675
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/context/evidence.js
33680
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/context/evidence.js
33676
33681
  import { createHash as createHash4 } from "node:crypto";
33677
33682
  var CONTEXT_MAX_READ_BYTES = 262144;
33678
33683
  var CONTEXT_SOURCE_KINDS = ["message", "mail", "document", "meeting"];
@@ -33770,7 +33775,7 @@ var contextEvidenceRequest = /* @__PURE__ */ __name((input) => {
33770
33775
  return { source: source2, query, chat: chat2, senders, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal: input.signal };
33771
33776
  }, "contextEvidenceRequest");
33772
33777
 
33773
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
33778
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/email-activity.js
33774
33779
  var MAIL_AGENDA_COLUMNS = { chat_kind: { type: "enum", sql: "'dialog'" } };
33775
33780
  var ACTIVITY = `
33776
33781
  SELECT t.external_id AS thread, t.subject, t.last_email_at, t.emails_count,
@@ -33900,7 +33905,7 @@ var mailActivity = /* @__PURE__ */ __name((database) => ({
33900
33905
  threadActivity: /* @__PURE__ */ __name(async (accountId, since, where) => threadActivity(database, accountId, since, where), "threadActivity")
33901
33906
  }), "mailActivity");
33902
33907
 
33903
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
33908
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/conversations/mail-text.js
33904
33909
  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");
33905
33910
  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;
33906
33911
  var ATTRIBUTION = /(wrote|написал[аи]?|escribió|a écrit|schrieb)\s*:\s*$/iu;
@@ -33981,7 +33986,7 @@ var mailCore = /* @__PURE__ */ __name((body2, earlier) => {
33981
33986
  return withoutSignOff(withoutGreeting(kept2)).join("\n").trim();
33982
33987
  }, "mailCore");
33983
33988
 
33984
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
33989
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/email-index.js
33985
33990
  var titleOf2 = /* @__PURE__ */ __name((subject2) => subject2?.replace(/^\s*((re|fwd?|aw|wg)\s*:\s*)+/i, "").trim() || null, "titleOf");
33986
33991
  var MAIL_PIECES = `(SELECT k.id, k.content_hash, k.chunkable_type AS type, k.chunkable_id AS owner, k.position,
33987
33992
  k.start_offset, k.end_offset, k.account_id, k.occurred_at,
@@ -34094,7 +34099,7 @@ var drainEmailIndex = /* @__PURE__ */ __name((database, stemmerFor2) => {
34094
34099
  return emails3 + threads;
34095
34100
  }, "drainEmailIndex");
34096
34101
 
34097
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
34102
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/email-locations.js
34098
34103
  var locate = /* @__PURE__ */ __name((database, accountId, emailId, where) => database.prepare(`INSERT OR REPLACE INTO email_locations (mailbox_id, uidvalidity, uid, email_id)
34099
34104
  SELECT id, ?, ?, ? FROM mailboxes WHERE account_id = ? AND external_id = ?`).run(where.uidvalidity, where.uid, emailId, accountId, where.folder), "locate");
34100
34105
  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,
@@ -34192,7 +34197,7 @@ var forgetLocations = /* @__PURE__ */ __name((database, accountId, folder, uidva
34192
34197
  var backfillSentAt = /* @__PURE__ */ __name((database, accountId, limit) => Number(database.prepare(`UPDATE emails SET sent_at = received_at WHERE id IN (
34193
34198
  SELECT id FROM emails WHERE account_id = ? AND sent_at IS NULL AND received_at IS NOT NULL LIMIT ?)`).run(accountId, limit).changes), "backfillSentAt");
34194
34199
 
34195
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
34200
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/email-state.js
34196
34201
  var recountEmailThread = /* @__PURE__ */ __name((database, threadId, now2) => database.prepare(`UPDATE email_threads SET
34197
34202
  emails_count = (SELECT count(*) FROM emails WHERE email_thread_id = ? AND deleted_at IS NULL),
34198
34203
  last_email_at = (SELECT max(coalesce(sent_at, received_at)) FROM emails
@@ -34242,7 +34247,7 @@ var markEmailsRestored = /* @__PURE__ */ __name((database, accountId, externalId
34242
34247
  return threads.length;
34243
34248
  }, "markEmailsRestored");
34244
34249
 
34245
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-nearest.js
34250
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-nearest.js
34246
34251
  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
34247
34252
  FROM ${MAIL_PIECES} JOIN embeddings v ON v.model = ? AND v.content_hash = p.content_hash
34248
34253
  WHERE p.account_id = ?
@@ -34302,7 +34307,7 @@ var indexedMailPieces = /* @__PURE__ */ __name((database, model, query, filter,
34302
34307
  }, "indexedMailPieces");
34303
34308
  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");
34304
34309
 
34305
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
34310
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-rules.js
34306
34311
  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");
34307
34312
  var conditionsKey = /* @__PURE__ */ __name((conditions) => JSON.stringify(sorted(conditions)), "conditionsKey");
34308
34313
  var ruleOf = /* @__PURE__ */ __name((row2) => ({
@@ -34369,7 +34374,7 @@ var mailRulesOver = /* @__PURE__ */ __name((database) => ({
34369
34374
  }
34370
34375
  }), "mailRulesOver");
34371
34376
 
34372
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
34377
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-operation.js
34373
34378
  function checkMeetingCancelled(signal) {
34374
34379
  if (!signal?.aborted)
34375
34380
  return;
@@ -34380,7 +34385,7 @@ function checkMeetingCancelled(signal) {
34380
34385
  }
34381
34386
  __name(checkMeetingCancelled, "checkMeetingCancelled");
34382
34387
 
34383
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
34388
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-values.js
34384
34389
  var managerOf = /* @__PURE__ */ __name((database, meetingId) => {
34385
34390
  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);
34386
34391
  if (!found2)
@@ -34445,7 +34450,7 @@ var transcriptRowOf = /* @__PURE__ */ __name((row2) => ({
34445
34450
  createdAt: Number(row2.created_at)
34446
34451
  }), "transcriptRowOf");
34447
34452
 
34448
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
34453
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-reads.js
34449
34454
  var MEETING_TEXT = ["external_id", "title", "description", "location", "join_url", "timezone", "metadata"];
34450
34455
  var TRANSCRIPT_TEXT = ["source", "format", "language", "content_hash", "metadata"];
34451
34456
  var ROW_TEXT = ["speaker_name", "text", "normalized_text", "metadata"];
@@ -34612,7 +34617,7 @@ var meetingReadsOver = /* @__PURE__ */ __name(({ database }) => ({
34612
34617
  }
34613
34618
  }), "meetingReadsOver");
34614
34619
 
34615
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
34620
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-selection.js
34616
34621
  var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
34617
34622
  const clauses = ["m.account_id=?", "m.deleted_at IS NULL"];
34618
34623
  const params = [input.accountId];
@@ -34655,7 +34660,7 @@ var meetingSelectionSql = /* @__PURE__ */ __name((input) => {
34655
34660
  return { clauses, params };
34656
34661
  }, "meetingSelectionSql");
34657
34662
 
34658
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-calls.js
34663
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-calls.js
34659
34664
  var MOST_CALLS = 2e5;
34660
34665
  var parsed3 = /* @__PURE__ */ __name((value) => {
34661
34666
  if (typeof value !== "string")
@@ -34710,7 +34715,7 @@ var meetingCallsOver = /* @__PURE__ */ __name(({ database }) => ({
34710
34715
  }
34711
34716
  }), "meetingCallsOver");
34712
34717
 
34713
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
34718
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-chat-lines.js
34714
34719
  var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
34715
34720
  async meetingChatLines(input) {
34716
34721
  checkMeetingCancelled(input.signal);
@@ -34738,7 +34743,7 @@ var meetingChatLinesOver = /* @__PURE__ */ __name(({ database }) => ({
34738
34743
  }
34739
34744
  }), "meetingChatLinesOver");
34740
34745
 
34741
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
34746
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-context-links.js
34742
34747
  var missing2 = /* @__PURE__ */ __name(() => {
34743
34748
  throw new CliError("not_found", "Meeting, participant or selected target not found");
34744
34749
  }, "missing");
@@ -34861,7 +34866,7 @@ function meetingContextLinksOver(context) {
34861
34866
  }
34862
34867
  __name(meetingContextLinksOver, "meetingContextLinksOver");
34863
34868
 
34864
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-documents.js
34869
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-documents.js
34865
34870
  var TRANSCRIPT_ROLE = "transcript";
34866
34871
  var roleOf3 = /* @__PURE__ */ __name((value) => MEETING_DOCUMENT_ROLES.find((role) => role === value), "roleOf");
34867
34872
  var attach = /* @__PURE__ */ __name((database, meetingId, fileId, role, metadata3, listed, now2) => {
@@ -34935,7 +34940,7 @@ var meetingTranscriptDocumentsOver = /* @__PURE__ */ __name(({ database }) => {
34935
34940
  };
34936
34941
  }, "meetingTranscriptDocumentsOver");
34937
34942
 
34938
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
34943
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-index-values.js
34939
34944
  var INDEX_CODES = { meeting_transcript_row: 1, meeting_chat_message: 2, meeting_summary: 3 };
34940
34945
  var meetingRowid = /* @__PURE__ */ __name((type, id2) => id2 * 4 + INDEX_CODES[type], "meetingRowid");
34941
34946
  var summaryOf2 = /* @__PURE__ */ __name((row2) => ({
@@ -34964,7 +34969,7 @@ var indexedText = /* @__PURE__ */ __name((database, type, id2) => {
34964
34969
  return row2 ? summaryText(summaryOf2(row2)) : null;
34965
34970
  }, "indexedText");
34966
34971
 
34967
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
34972
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stem-state.js
34968
34973
  var summaryBytes = ["title", "overview", "sections", "next_steps", "content"].map((key2) => `coalesce(length(CAST(s.${key2} AS BLOB)),0)`).join("+");
34969
34974
  var meetingCurrentIndexRows = `
34970
34975
  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
@@ -34995,7 +35000,7 @@ var invalidateMeetingStems = /* @__PURE__ */ __name((database, type, id2) => {
34995
35000
  }, "invalidateMeetingStems");
34996
35001
  var meetingStemmableText = /* @__PURE__ */ __name((text9) => text9.replace(/[\p{L}\p{N}\p{M}\p{Co}]+/gu, (token) => token.length <= 1024 ? token : ""), "meetingStemmableText");
34997
35002
 
34998
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
35003
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-index.js
34999
35004
  function meetingHitIndexOver({ database, now: now2 }) {
35000
35005
  return {
35001
35006
  async indexSearch(original) {
@@ -35063,10 +35068,10 @@ function meetingHitIndexOver({ database, now: now2 }) {
35063
35068
  }
35064
35069
  __name(meetingHitIndexOver, "meetingHitIndexOver");
35065
35070
 
35066
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
35071
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
35067
35072
  import { createHash as createHash5 } from "node:crypto";
35068
35073
 
35069
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/search/correct.js
35074
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/search/correct.js
35070
35075
  var SHORTEST_CORRECTION = 3;
35071
35076
  var maxEdits = /* @__PURE__ */ __name((word2) => word2.length <= 4 ? 1 : 2, "maxEdits");
35072
35077
  var editDistance = /* @__PURE__ */ __name((a, b, max) => {
@@ -35113,7 +35118,7 @@ var correctWords = /* @__PURE__ */ __name(async (vocabulary, words4) => {
35113
35118
  return corrections;
35114
35119
  }, "correctWords");
35115
35120
 
35116
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/search/garbled.js
35121
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/search/garbled.js
35117
35122
  var SHORTEST_GARBLED = 4;
35118
35123
  var MOST_WIDENED = 64;
35119
35124
  var plain = /* @__PURE__ */ __name((word2) => word2.replaceAll("\u044D", "\u0435"), "plain");
@@ -35205,7 +35210,7 @@ var widenWords = /* @__PURE__ */ __name((probes, vocabulary, stem, known2) => {
35205
35210
  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));
35206
35211
  }, "widenWords");
35207
35212
 
35208
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
35213
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/search/russian-dictionary.js
35209
35214
  import { readFileSync } from "node:fs";
35210
35215
  var loaded;
35211
35216
  var dictionary = /* @__PURE__ */ __name(() => {
@@ -35264,7 +35269,7 @@ var knownRussianWord = /* @__PURE__ */ __name((word2) => {
35264
35269
  return false;
35265
35270
  }, "knownRussianWord");
35266
35271
 
35267
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
35272
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-query.js
35268
35273
  var WORD2 = /[\p{L}\p{N}\p{M}]+/gu;
35269
35274
  var MOST_WORDS = 128;
35270
35275
  var quote = /* @__PURE__ */ __name((word2) => `"${word2.replaceAll('"', '""')}"`, "quote");
@@ -35520,7 +35525,7 @@ var matchedMeetingWords = /* @__PURE__ */ __name((tree, text9, stemmer2) => {
35520
35525
  return [...found2];
35521
35526
  }, "matchedMeetingWords");
35522
35527
 
35523
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
35528
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-hit-search.js
35524
35529
  var fail = /* @__PURE__ */ __name((message3) => {
35525
35530
  throw new CliError("validation_error", message3);
35526
35531
  }, "fail");
@@ -35704,7 +35709,7 @@ function meetingHitSearchOver({ database }) {
35704
35709
  }
35705
35710
  __name(meetingHitSearchOver, "meetingHitSearchOver");
35706
35711
 
35707
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
35712
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-languages.js
35708
35713
  var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
35709
35714
  async fillTranscriptLanguages({ accountId, apply, now: now2 }) {
35710
35715
  positiveReadInteger(accountId, "accountId");
@@ -35736,7 +35741,7 @@ var meetingLanguagesOver = /* @__PURE__ */ __name(({ database }) => ({
35736
35741
  }
35737
35742
  }), "meetingLanguagesOver");
35738
35743
 
35739
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
35744
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-participant-search.js
35740
35745
  import { createHash as createHash6 } from "node:crypto";
35741
35746
  var cursorOf2 = /* @__PURE__ */ __name((value, key2) => {
35742
35747
  if (value === void 0)
@@ -35829,7 +35834,7 @@ var meetingParticipantSearchOver = /* @__PURE__ */ __name((context) => ({
35829
35834
  }
35830
35835
  }), "meetingParticipantSearchOver");
35831
35836
 
35832
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
35837
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-context-queries.js
35833
35838
  var preparationQueries = {
35834
35839
  participants: {
35835
35840
  fields: "p.id, p.identity_id, p.display_name, l.person_id",
@@ -35879,7 +35884,7 @@ var preparationQueries = {
35879
35884
  }
35880
35885
  };
35881
35886
 
35882
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
35887
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-context.js
35883
35888
  var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
35884
35889
  async preparationContext(original) {
35885
35890
  const input = validateMeetingPreparationContext(original);
@@ -35920,7 +35925,7 @@ var meetingPreparationContextOver = /* @__PURE__ */ __name(({ database }) => ({
35920
35925
  }
35921
35926
  }), "meetingPreparationContextOver");
35922
35927
 
35923
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
35928
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/preparation-subjects.js
35924
35929
  var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
35925
35930
  SELECT m.id FROM meetings m JOIN meeting_series s ON s.id=m.meeting_series_id
35926
35931
  WHERE m.id IN (${Array.from({ length: anchors }, () => "?").join(",")}) AND m.account_id=? AND s.account_id=?
@@ -35934,7 +35939,7 @@ var preparationSubjects = /* @__PURE__ */ __name((anchors) => `WITH anchors AS (
35934
35939
  JOIN main.projects p ON p.id=l.to_id WHERE p.account_id IS NULL AND p.deleted_at IS NULL
35935
35940
  )`, "preparationSubjects");
35936
35941
 
35937
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
35942
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-knowledge.js
35938
35943
  var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => ({
35939
35944
  async preparationKnowledge(original) {
35940
35945
  const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
@@ -35979,7 +35984,7 @@ var meetingPreparationKnowledgeOver = /* @__PURE__ */ __name(({ database }) => (
35979
35984
  }
35980
35985
  }), "meetingPreparationKnowledgeOver");
35981
35986
 
35982
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
35987
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-preparation-notes.js
35983
35988
  var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
35984
35989
  async preparationNotes(original) {
35985
35990
  const { accountId, seriesId, anchorIds, after: after2, before: before2, limit, maxReadBytes, signal } = validateMeetingRelatedHistory(original);
@@ -36032,7 +36037,7 @@ var meetingPreparationNotesOver = /* @__PURE__ */ __name(({ database }) => ({
36032
36037
  }
36033
36038
  }), "meetingPreparationNotesOver");
36034
36039
 
36035
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
36040
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-related-history.js
36036
36041
  var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
36037
36042
  async relatedHistory(original) {
36038
36043
  const input = validateMeetingRelatedHistory(original);
@@ -36103,7 +36108,7 @@ var meetingRelatedHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
36103
36108
  }
36104
36109
  }), "meetingRelatedHistoryOver");
36105
36110
 
36106
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
36111
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-review.js
36107
36112
  var number2 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : Number(value), "number");
36108
36113
  var text4 = /* @__PURE__ */ __name((value) => value === null || value === void 0 ? null : String(value), "text");
36109
36114
  var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
@@ -36184,7 +36189,7 @@ var meetingReviewOver = /* @__PURE__ */ __name(({ database }) => ({
36184
36189
  }
36185
36190
  }), "meetingReviewOver");
36186
36191
 
36187
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
36192
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-series-history.js
36188
36193
  var bytes2 = "length(CAST(external_id AS BLOB)) + coalesce(length(CAST(title AS BLOB)), 0)";
36189
36194
  var ensureBytes2 = /* @__PURE__ */ __name((size2, budget) => {
36190
36195
  if (!Number.isSafeInteger(size2) || size2 < 0 || size2 > budget)
@@ -36238,7 +36243,7 @@ var meetingSeriesHistoryOver = /* @__PURE__ */ __name(({ database }) => ({
36238
36243
  }
36239
36244
  }), "meetingSeriesHistoryOver");
36240
36245
 
36241
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
36246
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-stats.js
36242
36247
  var MOST_ROWS = 5e5;
36243
36248
  var meetingCountsSql = /* @__PURE__ */ __name((where) => `SELECT m.started_at, coalesce(m.duration_ms, m.ended_at - m.started_at) AS duration_ms,
36244
36249
  EXISTS (SELECT 1 FROM meeting_transcripts t WHERE t.meeting_id = m.id AND t.deleted_at IS NULL
@@ -36307,7 +36312,7 @@ var meetingStatsOver = /* @__PURE__ */ __name(({ database }) => ({
36307
36312
  }
36308
36313
  }), "meetingStatsOver");
36309
36314
 
36310
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/name-variants.js
36315
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/name-variants.js
36311
36316
  var CYRILLIC_TO_LATIN = {
36312
36317
  \u0430: "a",
36313
36318
  \u0431: "b",
@@ -36529,7 +36534,7 @@ for (const [full, short] of Object.entries(SHORT_FORMS))
36529
36534
  }
36530
36535
  var fullNames = /* @__PURE__ */ __name((skeleton) => [skeleton, ...FULL_NAMES.get(skeleton) ?? []], "fullNames");
36531
36536
 
36532
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/name-traces.js
36537
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/name-traces.js
36533
36538
  var peopleByNameKey = /* @__PURE__ */ __name((database) => {
36534
36539
  const found2 = /* @__PURE__ */ new Map();
36535
36540
  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()) {
@@ -36645,7 +36650,7 @@ function* sharedTraces(database, a, b, name, except) {
36645
36650
  }
36646
36651
  __name(sharedTraces, "sharedTraces");
36647
36652
 
36648
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/person-matcher.js
36653
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/person-matcher.js
36649
36654
  var spellingsOf = /* @__PURE__ */ __name((value) => [value, value.slice(1)], "spellingsOf");
36650
36655
  var PERSON_BY = {
36651
36656
  // UNION, not OR: each branch reads its own index.
@@ -36668,7 +36673,7 @@ var personsByIdentifiers = /* @__PURE__ */ __name((database, ids3) => {
36668
36673
  return [...found2].sort((a, b) => a - b);
36669
36674
  }, "personsByIdentifiers");
36670
36675
 
36671
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/person-match-scan.js
36676
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/person-match-scan.js
36672
36677
  var BY = "rule";
36673
36678
  var RULE = { bot: "rule", kind: "rule" };
36674
36679
  var MOST_SHARING = 6;
@@ -37117,7 +37122,7 @@ var linkPhones = /* @__PURE__ */ __name((context, identities2) => {
37117
37122
  return pass.result;
37118
37123
  }, "linkPhones");
37119
37124
 
37120
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
37125
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meetings.js
37121
37126
  var CURSOR_KEY = "meetings";
37122
37127
  var seriesOf2 = /* @__PURE__ */ __name((row2) => ({
37123
37128
  id: Number(row2.id),
@@ -37724,7 +37729,7 @@ var meetingStoreOver = /* @__PURE__ */ __name((context) => {
37724
37729
  };
37725
37730
  }, "meetingStoreOver");
37726
37731
 
37727
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
37732
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/sync.js
37728
37733
  var syncStateOf = /* @__PURE__ */ __name(({ orm }, accountKey, name) => {
37729
37734
  const row2 = orm.select({ value: syncCursors.value, at: syncCursors.updatedAt }).from(syncCursors).where(and(eq(syncCursors.accountId, accountKey), eq(syncCursors.key, name))).get();
37730
37735
  return row2 ? { value: row2.value, at: toIso(row2.at) } : void 0;
@@ -37750,7 +37755,7 @@ var release = /* @__PURE__ */ __name(({ orm }, chatKey, anchor, holder2) => {
37750
37755
  orm.delete(fetchLeases).where(and(eq(fetchLeases.chatId, chatKey), eq(fetchLeases.anchor, anchor), eq(fetchLeases.holder, holder2))).run();
37751
37756
  }, "release");
37752
37757
 
37753
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
37758
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/thread-columns.js
37754
37759
  var THREAD_COLUMNS = {
37755
37760
  subject: {
37756
37761
  where: /* @__PURE__ */ __name(({ value }) => ({
@@ -37767,7 +37772,7 @@ var threadRows = /* @__PURE__ */ __name((database, filter) => {
37767
37772
  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);
37768
37773
  }, "threadRows");
37769
37774
 
37770
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
37775
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/emails.js
37771
37776
  var threadConversation = /* @__PURE__ */ __name((place, builtAt) => ({
37772
37777
  id: `email:${place.emailId}`,
37773
37778
  chatId: place.threadExternalId,
@@ -38309,7 +38314,7 @@ var mailStoreOver = /* @__PURE__ */ __name(({ database, orm, now: now2 }, stemme
38309
38314
  }
38310
38315
  }), "mailStoreOver");
38311
38316
 
38312
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/search/dictionary.js
38317
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/search/dictionary.js
38313
38318
  import { readFileSync as readFileSync2 } from "node:fs";
38314
38319
  var DICTIONARIES = Object.fromEntries(LANGUAGES.map(({ name, dictionary: dictionary3 }) => [name, dictionary3]));
38315
38320
  var folded5 = /* @__PURE__ */ __name((word2) => /^[а-яё'-]*$/.test(word2) ? word2.replaceAll("\u0451", "\u0435").replaceAll("\u0439", "\u0438") : fold(word2), "folded");
@@ -38399,7 +38404,7 @@ var knownWord = /* @__PURE__ */ __name((languages) => {
38399
38404
  }, "knownWord");
38400
38405
  var dictionaryLanguages = /* @__PURE__ */ __name((stemmers) => [stemmers.cyrillic, ...stemmers.latin.split(",")].filter((name) => Object.hasOwn(DICTIONARIES, name)), "dictionaryLanguages");
38401
38406
 
38402
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
38407
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/transcript-query.js
38403
38408
  var predicates = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? [node] : node.clauses.flatMap(({ node: node2 }) => predicates(node2)), "predicates");
38404
38409
  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");
38405
38410
  var LATIN_NUMBERS = new Set(`zero one two three four five six seven eight nine ten eleven twelve twenty thirty forty fifty sixty seventy
@@ -38485,7 +38490,7 @@ var spokenTranscripts = /* @__PURE__ */ __name((database, item, speaking, keys)
38485
38490
  return found2;
38486
38491
  }, "spokenTranscripts");
38487
38492
 
38488
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
38493
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/hit-places.js
38489
38494
  var startOf = /* @__PURE__ */ __name((node) => node.operator === "wildcard" && node.implicit ? /^([\p{L}\p{N}]+)\*$/u.exec(normalize(node.value))?.[1] : void 0, "startOf");
38490
38495
  var matchOf = /* @__PURE__ */ __name((node) => {
38491
38496
  const start = startOf(node);
@@ -38543,7 +38548,7 @@ var placeHits = /* @__PURE__ */ __name((database, corpus, leaves, transcripts, f
38543
38548
  });
38544
38549
  }, "placeHits");
38545
38550
 
38546
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
38551
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene-groups.js
38547
38552
  var GROUPS = {
38548
38553
  chat: {
38549
38554
  key: "m.chat_id",
@@ -38565,8 +38570,8 @@ var GROUPS = {
38565
38570
  }
38566
38571
  };
38567
38572
 
38568
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/word-rarity.js
38569
- var withRarity = /* @__PURE__ */ __name((database, words4, leaves, ranked) => {
38573
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/word-rarity.js
38574
+ var withRarity = /* @__PURE__ */ __name((database, words4, leaves, ranked2) => {
38570
38575
  const matches2 = [...new Set(leaves.flatMap(({ fragment }) => fragment.fts ?? []))];
38571
38576
  if (!matches2.length)
38572
38577
  return false;
@@ -38574,27 +38579,27 @@ var withRarity = /* @__PURE__ */ __name((database, words4, leaves, ranked) => {
38574
38579
  const sets = matches2.map((fts) => {
38575
38580
  const match = `normalized_text : (${fts})`;
38576
38581
  const df = Number(database.prepare(`SELECT count(*) AS n FROM ${words4} WHERE ${words4} MATCH ?`).get(match)?.n ?? 0);
38577
- ranked.params.push(match);
38582
+ ranked2.params.push(match);
38578
38583
  return `SELECT rowid AS id, ${df ? Math.log(total / df) : 0} AS w FROM ${words4} WHERE ${words4} MATCH ?`;
38579
38584
  });
38580
- ranked.sql.push(`rarity(id, score) AS MATERIALIZED (SELECT id, sum(w) FROM (${sets.join(" UNION ALL ")}) GROUP BY id)`);
38585
+ ranked2.sql.push(`rarity(id, score) AS MATERIALIZED (SELECT id, sum(w) FROM (${sets.join(" UNION ALL ")}) GROUP BY id)`);
38581
38586
  return true;
38582
38587
  }, "withRarity");
38583
38588
  var RARITY_ORDER = "coalesce(rarity.score, 0) - 0.2 * coalesce(f.rank, 0) DESC, ";
38584
38589
 
38585
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
38590
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/lucene.js
38586
38591
  var matchQuery = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution), "matchQuery");
38587
38592
  var countQuery = /* @__PURE__ */ __name((context, execution, by) => runQuery(context, execution, by), "countQuery");
38588
38593
  var queryMessagePks = /* @__PURE__ */ __name((context, execution) => runQuery(context, execution, "pks"), "queryMessagePks");
38589
38594
  var countMatches = /* @__PURE__ */ __name((context, execution, cap) => matchingPks(context, execution, cap)?.length, "countMatches");
38590
38595
  var matchingPks = /* @__PURE__ */ __name((context, execution, cap) => inTime(() => {
38591
- const { database, check: check3, where, from: from2, withRanking, ranked, leaves } = compileQuery(context, {
38596
+ const { database, check: check3, where, from: from2, withRanking, ranked: ranked2, leaves } = compileQuery(context, {
38592
38597
  ...execution,
38593
38598
  newest: true
38594
38599
  });
38595
38600
  if (leaves.some(({ test }) => test))
38596
38601
  return void 0;
38597
- const rows = database.prepare(`${withRanking}SELECT m.id ${from2} WHERE ${where.sql} LIMIT ?`).all(...ranked.params, ...where.params, cap + 1);
38602
+ const rows = database.prepare(`${withRanking}SELECT m.id ${from2} WHERE ${where.sql} LIMIT ?`).all(...ranked2.params, ...where.params, cap + 1);
38598
38603
  check3();
38599
38604
  return rows.map(({ id: id2 }) => Number(id2));
38600
38605
  }, execution.timeLimitMs), "matchingPks");
@@ -38832,10 +38837,10 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
38832
38837
  const ranking = byStems ?? (stemmed || elsewhere ? requiredText(execution.root, "fts", true) : void 0);
38833
38838
  const rankIndex = { table: byStems ? corpus.stems : corpus.words, column: byStems ? "stems" : "normalized_text" };
38834
38839
  const exactTier = stemmed ? requiredText(execution.root) : void 0;
38835
- const ranked = driver ? { sql: [`d(id) AS MATERIALIZED (${driver.sql})`], params: [...driver.params] } : { sql: [], params: [] };
38840
+ const ranked2 = driver ? { sql: [`d(id) AS MATERIALIZED (${driver.sql})`], params: [...driver.params] } : { sql: [], params: [] };
38836
38841
  if (ranking && !execution.newest) {
38837
- ranked.sql.push(`f(id, rank) AS MATERIALIZED (SELECT rowid, bm25(${rankIndex.table}, 1.0, 0.0) FROM ${rankIndex.table} WHERE ${rankIndex.table} MATCH ?)`);
38838
- ranked.params.push(`${rankIndex.column} : (${ranking})`);
38842
+ ranked2.sql.push(`f(id, rank) AS MATERIALIZED (SELECT rowid, bm25(${rankIndex.table}, 1.0, 0.0) FROM ${rankIndex.table} WHERE ${rankIndex.table} MATCH ?)`);
38843
+ ranked2.params.push(`${rankIndex.column} : (${ranking})`);
38839
38844
  }
38840
38845
  const placeNodes = [...fragments.values()].flatMap(({ node, fragment }) => fragment.elsewhere && fragment.fts ? [node] : []);
38841
38846
  const places2 = placeNodes.map(ftsMatch);
@@ -38845,16 +38850,16 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
38845
38850
  return { sql: `SELECT attachable_id, ${tier} FROM (${one2.sql})`, params: one2.params };
38846
38851
  }), "spoken");
38847
38852
  const parts = [...spoken("forms", 2), ...spoken("widened", 5)];
38848
- ranked.sql.push(`s(id, tier) AS MATERIALIZED (SELECT att.attachable_id, min(CASE WHEN ${SPEECH} THEN 1 ELSE 4 END) FROM attachments att WHERE att.attachable_type='${corpus.item}' AND att.id IN (SELECT rowid FROM attachment_words WHERE attachment_words MATCH ?) GROUP BY att.attachable_id UNION ALL SELECT attachable_id, 3 FROM (${namedSql})${parts.map(({ sql: sql2 }) => ` UNION ALL ${sql2}`).join("")})`);
38849
- ranked.params.push(places2.join(" OR "), places2.join(" OR "), ...parts.flatMap(({ params }) => params));
38853
+ ranked2.sql.push(`s(id, tier) AS MATERIALIZED (SELECT att.attachable_id, min(CASE WHEN ${SPEECH} THEN 1 ELSE 4 END) FROM attachments att WHERE att.attachable_type='${corpus.item}' AND att.id IN (SELECT rowid FROM attachment_words WHERE attachment_words MATCH ?) GROUP BY att.attachable_id UNION ALL SELECT attachable_id, 3 FROM (${namedSql})${parts.map(({ sql: sql2 }) => ` UNION ALL ${sql2}`).join("")})`);
38854
+ ranked2.params.push(places2.join(" OR "), places2.join(" OR "), ...parts.flatMap(({ params }) => params));
38850
38855
  }
38851
38856
  const placeTier = places2.length && !execution.newest ? "coalesce((SELECT min(tier) FROM s WHERE s.id=m.id), 6)," : "";
38852
- const rarity = execution.rareWordsFirst && !execution.newest && !mail && withRarity(database, corpus.words, [...fragments.values()], ranked);
38857
+ const rarity = execution.rareWordsFirst && !execution.newest && !mail && withRarity(database, corpus.words, [...fragments.values()], ranked2);
38853
38858
  if (exactTier) {
38854
- ranked.sql.push(`x(id) AS MATERIALIZED (SELECT rowid FROM ${corpus.words} WHERE ${corpus.words} MATCH ?)`);
38855
- ranked.params.push(`normalized_text : (${exactTier})`);
38859
+ ranked2.sql.push(`x(id) AS MATERIALIZED (SELECT rowid FROM ${corpus.words} WHERE ${corpus.words} MATCH ?)`);
38860
+ ranked2.params.push(`normalized_text : (${exactTier})`);
38856
38861
  }
38857
- const withRanking = ranked.sql.length ? `WITH ${ranked.sql.join(", ")} ` : "";
38862
+ const withRanking = ranked2.sql.length ? `WITH ${ranked2.sql.join(", ")} ` : "";
38858
38863
  const rankedFrom = `${ranking && !execution.newest ? `${from2} LEFT JOIN f ON f.id=m.id` : from2}${rarity ? " LEFT JOIN rarity ON rarity.id=m.id" : ""}`;
38859
38864
  const exactColumn = exactTier ? ", m.id IN (SELECT id FROM x) AS exact" : "";
38860
38865
  const relevance = rankMatch ? "f.rank" : ranking && !execution.newest ? "f.rank" : "NULL";
@@ -38898,7 +38903,7 @@ var compileQuery = /* @__PURE__ */ __name((context, execution, boundedAttachment
38898
38903
  where,
38899
38904
  from: from2,
38900
38905
  withRanking,
38901
- ranked,
38906
+ ranked: ranked2,
38902
38907
  leaves,
38903
38908
  stemmed,
38904
38909
  exactTier,
@@ -38923,16 +38928,16 @@ var withQuerySelection = /* @__PURE__ */ __name((context, execution, consume) =>
38923
38928
  const { database } = context;
38924
38929
  return inTime(() => read(database, () => {
38925
38930
  const query = compileQuery(context, execution, true);
38926
- const { check: check3, leaves, where, from: from2, withRanking, ranked } = query;
38931
+ const { check: check3, leaves, where, from: from2, withRanking, ranked: ranked2 } = query;
38927
38932
  check3();
38928
38933
  let selection;
38929
38934
  if (leaves.every(({ test }) => !test)) {
38930
38935
  selection = {
38931
38936
  sql: `${withRanking}SELECT DISTINCT m.id AS id ${from2} WHERE ${where.sql}`,
38932
- params: [...ranked.params, ...where.params]
38937
+ params: [...ranked2.params, ...where.params]
38933
38938
  };
38934
38939
  } else {
38935
- const candidates = database.prepare(`${withRanking}SELECT m.id AS id, length(cast(m.text AS BLOB)) AS bytes ${from2} WHERE ${where.sql} ORDER BY m.id LIMIT ?`).all(...ranked.params, ...where.params, QUERY_LIMITS.candidates + 1);
38940
+ const candidates = database.prepare(`${withRanking}SELECT m.id AS id, length(cast(m.text AS BLOB)) AS bytes ${from2} WHERE ${where.sql} ORDER BY m.id LIMIT ?`).all(...ranked2.params, ...where.params, QUERY_LIMITS.candidates + 1);
38936
38941
  check3();
38937
38942
  if (candidates.length > QUERY_LIMITS.candidates)
38938
38943
  tooWideTerm(testedTerms(leaves), "candidate rows");
@@ -38967,22 +38972,22 @@ var runQuery = /* @__PURE__ */ __name((context, execution, by) => {
38967
38972
  }
38968
38973
  }, "runQuery");
38969
38974
  var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
38970
- 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);
38975
+ const { corpus, rowsFrom, hits, database, check: check3, grouped, where, from: from2, withRanking, ranked: ranked2, leaves, stemmed, exactTier, driver, baseFrom, filtered: filtered2, ranking, relevance, rankedFrom, exactColumn, order, acrossChats, placeTier, projection, projectionParams, joinedFrom, evaluate: evaluate2 } = compileQuery(context, execution);
38971
38976
  if (by === "pks" && leaves.every(({ test }) => !test)) {
38972
- const rows = database.prepare(`${withRanking}SELECT m.id AS id ${from2} WHERE ${where.sql}`).all(...ranked.params, ...where.params);
38977
+ const rows = database.prepare(`${withRanking}SELECT m.id AS id ${from2} WHERE ${where.sql}`).all(...ranked2.params, ...where.params);
38973
38978
  await new Promise((resolve) => setImmediate(resolve));
38974
38979
  check3();
38975
38980
  return rows.map(({ id: id2 }) => Number(id2));
38976
38981
  }
38977
38982
  if (by && by !== "pks" && leaves.every(({ test }) => !test))
38978
- return grouped(by, where.sql, [...ranked.params, ...where.params], from2, withRanking);
38983
+ return grouped(by, where.sql, [...ranked2.params, ...where.params], from2, withRanking);
38979
38984
  const { newest, perChat, rareWordsFirst } = execution;
38980
38985
  if (stemmed && exactTier && driver && !newest && !perChat && !rareWordsFirst && leaves.every(({ test }) => !test)) {
38981
38986
  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);
38982
38987
  await new Promise((resolve) => setImmediate(resolve));
38983
38988
  check3();
38984
38989
  const room = execution.limit + 1 - exactRows.length;
38985
- const otherRows = room > 0 ? database.prepare(`${withRanking}SELECT m.id AS id, ${relevance} AS relevance ${rankedFrom} WHERE ${where.sql} AND m.id NOT IN (SELECT id FROM x) ORDER BY ${ranking ? `f.rank IS NULL, ${placeTier}f.rank,` : placeTier}m.sent_at DESC, ac.provider, ac.external_id, c.external_id, m.external_id DESC LIMIT ?`).all(...ranked.params, ...where.params, room) : [];
38990
+ const otherRows = room > 0 ? database.prepare(`${withRanking}SELECT m.id AS id, ${relevance} AS relevance ${rankedFrom} WHERE ${where.sql} AND m.id NOT IN (SELECT id FROM x) ORDER BY ${ranking ? `f.rank IS NULL, ${placeTier}f.rank,` : placeTier}m.sent_at DESC, ac.provider, ac.external_id, c.external_id, m.external_id DESC LIMIT ?`).all(...ranked2.params, ...where.params, room) : [];
38986
38991
  await new Promise((resolve) => setImmediate(resolve));
38987
38992
  check3();
38988
38993
  const rows = [
@@ -38999,7 +39004,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
38999
39004
  };
39000
39005
  }
39001
39006
  if (leaves.every(({ test }) => !test)) {
39002
- 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);
39007
+ 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(...ranked2.params, ...where.params, execution.limit + 1);
39003
39008
  await new Promise((resolve) => setImmediate(resolve));
39004
39009
  check3();
39005
39010
  return {
@@ -39011,7 +39016,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
39011
39016
  hasMore: rows.length > execution.limit
39012
39017
  };
39013
39018
  }
39014
- const candidates = database.prepare(`${withRanking}SELECT m.id AS id, m.chat_id AS chat, ${relevance} AS relevance${exactColumn}, length(cast(m.text AS BLOB)) AS bytes ${rankedFrom} WHERE ${where.sql} ORDER BY ${order} LIMIT ?`).all(...ranked.params, ...where.params, QUERY_LIMITS.candidates + 1);
39019
+ const candidates = database.prepare(`${withRanking}SELECT m.id AS id, m.chat_id AS chat, ${relevance} AS relevance${exactColumn}, length(cast(m.text AS BLOB)) AS bytes ${rankedFrom} WHERE ${where.sql} ORDER BY ${order} LIMIT ?`).all(...ranked2.params, ...where.params, QUERY_LIMITS.candidates + 1);
39015
39020
  await new Promise((resolve) => setImmediate(resolve));
39016
39021
  check3();
39017
39022
  const tooWide = /* @__PURE__ */ __name((budget) => tooWideTerm(testedTerms(leaves), budget), "tooWide");
@@ -39064,7 +39069,7 @@ var runCompiled = /* @__PURE__ */ __name(async (context, execution, by) => {
39064
39069
  };
39065
39070
  }, "runCompiled");
39066
39071
 
39067
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
39072
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/counters.js
39068
39073
  function invalidMetadata() {
39069
39074
  throw new CliError("validation_error", "stored counter metadata is malformed \u2014 check the store before refreshing");
39070
39075
  }
@@ -39166,7 +39171,7 @@ var counterTargets = /* @__PURE__ */ __name((context, execution, options) => wit
39166
39171
  };
39167
39172
  }), "counterTargets");
39168
39173
 
39169
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
39174
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/attachment-texts.js
39170
39175
  var NOT_FILE_LIST = [...NOT_FILES].map((kind3) => `'${kind3}'`).join(",");
39171
39176
  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,
39172
39177
  att.size, att.local_path, att.extraction AS origin, att.size AS read_bytes, att.extraction_error AS error, att.content_sha256, att.extractor
@@ -39285,7 +39290,7 @@ var attachmentViews = /* @__PURE__ */ __name(({ database }, accountKey, { chatKe
39285
39290
  }));
39286
39291
  }, "attachmentViews");
39287
39292
 
39288
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
39293
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/transcripts.js
39289
39294
  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");
39290
39295
  var keepTranscript = /* @__PURE__ */ __name((context, chatKey, messageId, text9, source2) => {
39291
39296
  const { orm, database, now: now2 } = context;
@@ -39323,7 +39328,7 @@ var intoVoiceAttachment = /* @__PURE__ */ __name((context, messagePk) => {
39323
39328
  keepText(context, Number(row2.id), { text: String(row2.text), origin: "extracted", extractor: `speech:${row2.source}` });
39324
39329
  }, "intoVoiceAttachment");
39325
39330
 
39326
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
39331
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/messages.js
39327
39332
  var FIELDS = [
39328
39333
  "threadExternalId",
39329
39334
  "senderIdentityId",
@@ -39647,7 +39652,7 @@ var writeDerivedReactions = /* @__PURE__ */ __name((context, chatKey, messageId)
39647
39652
  reactionStatementsOf(context.database).total.run(JSON.stringify(derived), chatKey, messageId);
39648
39653
  }, "writeDerivedReactions");
39649
39654
 
39650
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/keys.js
39655
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/keys.js
39651
39656
  var keysOver = /* @__PURE__ */ __name((context) => {
39652
39657
  const findAccountPk2 = /* @__PURE__ */ __name((key2) => findAccountPk(context, key2), "findAccountPk");
39653
39658
  const findChatPk2 = /* @__PURE__ */ __name((accountKey, chatId) => findChatPk(context, accountKey, chatId), "findChatPk");
@@ -39668,7 +39673,7 @@ var keysOver = /* @__PURE__ */ __name((context) => {
39668
39673
  };
39669
39674
  }, "keysOver");
39670
39675
 
39671
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
39676
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/account-groups.js
39672
39677
  var unquoted3 = /* @__PURE__ */ __name((value) => {
39673
39678
  if (typeof value !== "string")
39674
39679
  return value;
@@ -39726,7 +39731,7 @@ var forgetProfile = /* @__PURE__ */ __name((database, app, profile, now2) => {
39726
39731
  database.prepare("INSERT OR REPLACE INTO store_settings (key, value, at) VALUES (?, ?, ?)").run(PROFILES, JSON.stringify(profiles), now2);
39727
39732
  }, "forgetProfile");
39728
39733
 
39729
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
39734
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-events.js
39730
39735
  var DAY4 = 864e5;
39731
39736
  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}')`;
39732
39737
  var accountsOf = /* @__PURE__ */ __name((filter) => {
@@ -39842,7 +39847,7 @@ var listEvents = /* @__PURE__ */ __name((database, filter) => {
39842
39847
  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);
39843
39848
  }, "listEvents");
39844
39849
 
39845
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
39850
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar-forget.js
39846
39851
  var distinctIds = /* @__PURE__ */ __name((rows) => [...new Set(rows.map((row2) => Number(row2.id)))], "distinctIds");
39847
39852
  var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, accountId, cursorKey, now: now2 }, refresh) => {
39848
39853
  const unseenBefore = unreferenced(database, "identities");
@@ -39899,7 +39904,7 @@ var forgetCalendarRows = /* @__PURE__ */ __name((database, { calendarId, account
39899
39904
  return { entries: entryIds.length, events: goneEvents.length };
39900
39905
  }, "forgetCalendarRows");
39901
39906
 
39902
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
39907
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/calendar.js
39903
39908
  var calendarOf = /* @__PURE__ */ __name((row2) => ({
39904
39909
  id: Number(row2.id),
39905
39910
  accountId: Number(row2.account_id),
@@ -40502,11 +40507,12 @@ var eventStoreOver = /* @__PURE__ */ __name((context) => {
40502
40507
  };
40503
40508
  }, "eventStoreOver");
40504
40509
 
40505
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/erase-plan.js
40510
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/erase-plan.js
40506
40511
  var AUTHORS = /* @__PURE__ */ new Set(["author", "confirmed_by", "decided_by", "proposed_by", "actor", "closed_by"]);
40507
40512
  var LINK_ROWS = /* @__PURE__ */ new Set(["links", "mentions", "task_assignments"]);
40508
- var hasChildren = /* @__PURE__ */ __name((database, table) => database.prepare(`SELECT 1 FROM sqlite_master m JOIN pragma_foreign_key_list(m.name) f WHERE m.type = 'table' AND f."table" = ?
40509
- LIMIT 1`).get(table) !== void 0, "hasChildren");
40513
+ var HISTORY = /* @__PURE__ */ new Set(["note_revisions"]);
40514
+ var childrenOf = /* @__PURE__ */ __name((database, table) => database.prepare(`SELECT m.name AS child, f."from" AS col, coalesce(f."to", 'id') AS parent FROM sqlite_master m
40515
+ JOIN pragma_foreign_key_list(m.name) f WHERE m.type = 'table' AND f."table" = ?`).all(table).map((row2) => ({ child: String(row2.child), col: String(row2.col), parent: String(row2.parent) })), "childrenOf");
40510
40516
  var nullable3 = /* @__PURE__ */ __name((database, table, column2) => Number(database.prepare(`SELECT "notnull" AS n FROM pragma_table_info('${table}') WHERE name = ?`).get(column2)?.n) === 0, "nullable");
40511
40517
  var count2 = /* @__PURE__ */ __name((database, sql2, ...params) => Number(database.prepare(`SELECT count(*) AS n FROM ${sql2}`).get(...params)?.n), "count");
40512
40518
  var ErasePlan = class {
@@ -40529,7 +40535,7 @@ var ErasePlan = class {
40529
40535
  continue;
40530
40536
  const key2 = `${table}.${pointer}`;
40531
40537
  if (LINK_ROWS.has(table) || !nullable3(this.database, table, `${pointer}_id`)) {
40532
- if (!LINK_ROWS.has(table) && (AUTHORS.has(pointer) || hasChildren(this.database, table))) {
40538
+ if (!LINK_ROWS.has(table) && (AUTHORS.has(pointer) || !this.#history(table, where, params))) {
40533
40539
  this.blocked.push(`${n} ${table} (${pointer})`);
40534
40540
  continue;
40535
40541
  }
@@ -40561,13 +40567,32 @@ var ErasePlan = class {
40561
40567
  for (const step of this.#steps)
40562
40568
  step();
40563
40569
  }
40570
+ /**
40571
+ * Whether the rows `where` picks in `table` can go: rows of other tables that hang on them must be their history,
40572
+ * which then goes first. Another table's row, such as an invoice under a contract, keeps them.
40573
+ */
40574
+ #history(table, where, params) {
40575
+ const steps = [];
40576
+ for (const { child, col, parent: parent2 } of childrenOf(this.database, table)) {
40577
+ const hanging = `"${col}" IN (SELECT "${parent2}" FROM "${table}" WHERE ${where})`;
40578
+ const n = count2(this.database, `"${child}" WHERE ${hanging}`, ...params);
40579
+ if (n === 0)
40580
+ continue;
40581
+ if (!HISTORY.has(child))
40582
+ return false;
40583
+ steps.push([`${child}.${col}`, n, `DELETE FROM "${child}" WHERE ${hanging}`]);
40584
+ }
40585
+ for (const [key2, n, sql2] of steps)
40586
+ this.#add(this.deleted, key2, n, sql2, params);
40587
+ return true;
40588
+ }
40564
40589
  #add(into, key2, n, sql2, params) {
40565
40590
  into[key2] = (into[key2] ?? 0) + n;
40566
40591
  this.#steps.push(() => this.database.prepare(sql2).run(...params));
40567
40592
  }
40568
40593
  };
40569
40594
 
40570
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/organization-erase.js
40595
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/organization-erase.js
40571
40596
  var OWN_ROWS = /* @__PURE__ */ new Set(["organization_identities"]);
40572
40597
  var organizationOf = /* @__PURE__ */ __name((database, ref3) => {
40573
40598
  const asked = /^(?:organization:)?([1-9]\d*)$/u.exec(ref3.trim())?.[1];
@@ -40625,7 +40650,7 @@ var eraseImportedOrganizations = /* @__PURE__ */ __name((context, organizations2
40625
40650
  }
40626
40651
  }, "eraseImportedOrganizations");
40627
40652
 
40628
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/person-erase.js
40653
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/person-erase.js
40629
40654
  var personOf4 = /* @__PURE__ */ __name((context, uid) => {
40630
40655
  const asked = /^(?:person:)?([1-9]\d*)$/u.exec(uid.trim())?.[1];
40631
40656
  const known2 = asked === void 0 ? void 0 : context.database.prepare("SELECT id FROM persons WHERE id = ?").get(Number(asked));
@@ -40651,12 +40676,14 @@ var erasePerson = /* @__PURE__ */ __name((context, uid, by, apply) => {
40651
40676
  const going = linked.filter(({ id: id2 }) => !named2.has(id2));
40652
40677
  const kept2 = linked.filter(({ id: id2 }) => named2.has(id2));
40653
40678
  const goingIds = JSON.stringify(going.map(({ id: id2 }) => id2));
40654
- const plan = new ErasePlan(database).pointers("person", "?", [person2]).pointers("identity", theirs, [goingIds]);
40679
+ const chain = samePersons(database, person2);
40680
+ const chainIds = JSON.stringify(chain);
40681
+ const plan = new ErasePlan(database).pointers("person", theirs, [chainIds]).pointers("identity", theirs, [goingIds]);
40655
40682
  const { deleted, detached, blocked } = plan;
40656
- const involvements2 = count2(database, `involvements WHERE person_id = ? OR identity_id IN (${theirs})`, person2, goingIds);
40683
+ const involvements2 = count2(database, `involvements WHERE person_id IN (${theirs}) OR identity_id IN (${theirs})`, chainIds, goingIds);
40657
40684
  if (involvements2 > 0)
40658
40685
  deleted["involvements.person"] = (deleted["involvements.person"] ?? 0) + involvements2;
40659
- const bots2 = count2(database, "bots WHERE owner_person_id = ?", person2);
40686
+ const bots2 = count2(database, `bots WHERE owner_person_id IN (${theirs})`, chainIds);
40660
40687
  if (bots2 > 0)
40661
40688
  detached["bots.owner_person"] = bots2;
40662
40689
  if (blocked.length > 0)
@@ -40665,6 +40692,7 @@ var erasePerson = /* @__PURE__ */ __name((context, uid, by, apply) => {
40665
40692
  person: `person:${person2}`,
40666
40693
  name: row2?.name == null ? null : String(row2.name),
40667
40694
  erased,
40695
+ merged: chain.filter((one2) => one2 !== person2).map((one2) => `person:${one2}`),
40668
40696
  identities: going.map(({ ref: ref3 }) => ref3),
40669
40697
  kept: kept2.map(({ id: id2, ref: ref3 }) => ({ identity: ref3, references: named2.get(id2) ?? 0 })),
40670
40698
  deleted,
@@ -40673,15 +40701,15 @@ var erasePerson = /* @__PURE__ */ __name((context, uid, by, apply) => {
40673
40701
  if (!apply)
40674
40702
  return answer(false);
40675
40703
  plan.run();
40676
- database.prepare(`DELETE FROM involvements WHERE person_id = ? OR identity_id IN (${theirs})`).run(person2, goingIds);
40677
- database.prepare("UPDATE bots SET owner_person_id = NULL WHERE owner_person_id = ?").run(person2);
40704
+ database.prepare(`DELETE FROM involvements WHERE person_id IN (${theirs}) OR identity_id IN (${theirs})`).run(chainIds, goingIds);
40705
+ database.prepare(`UPDATE bots SET owner_person_id = NULL WHERE owner_person_id IN (${theirs})`).run(chainIds);
40678
40706
  for (const table of ["account_identities", "organization_identities", "identity_revisions"])
40679
40707
  database.prepare(`DELETE FROM ${table} WHERE identity_id IN (${theirs})`).run(goingIds);
40680
- database.prepare(`DELETE FROM identity_link_events WHERE to_person_id = ? OR identity_id IN (${theirs})`).run(person2, goingIds);
40681
- database.prepare("UPDATE identity_link_events SET from_person_id = NULL WHERE from_person_id = ?").run(person2);
40682
- database.prepare("DELETE FROM identity_links WHERE person_id = ?").run(person2);
40708
+ database.prepare(`DELETE FROM identity_link_events WHERE to_person_id IN (${theirs}) OR identity_id IN (${theirs})`).run(chainIds, goingIds);
40709
+ database.prepare(`UPDATE identity_link_events SET from_person_id = NULL WHERE from_person_id IN (${theirs})`).run(chainIds);
40710
+ database.prepare(`DELETE FROM identity_links WHERE person_id IN (${theirs})`).run(chainIds);
40683
40711
  database.prepare(`DELETE FROM identities WHERE id IN (${theirs})`).run(goingIds);
40684
- database.prepare("DELETE FROM persons WHERE id = ?").run(person2);
40712
+ database.prepare(`DELETE FROM persons WHERE id IN (${theirs})`).run(chainIds);
40685
40713
  forgetErasedLinks(database);
40686
40714
  forgetErasedSplits(database);
40687
40715
  forgetErasedTestData(database);
@@ -40699,13 +40727,20 @@ var eraseImportedPeople = /* @__PURE__ */ __name((context, people2) => {
40699
40727
  const params = Array.from({ length: others.split("IN (?)").length - 1 }, () => person2);
40700
40728
  if (database.prepare(`SELECT 1 FROM (${others}) LIMIT 1`).get(...params) !== void 0)
40701
40729
  continue;
40702
- const plan = erasePerson(context, String(person2), "owner", false);
40703
- if (plan.kept.length === 0)
40704
- erasePerson(context, String(person2), "owner", true);
40730
+ if (samePersons(database, person2).length > 1)
40731
+ continue;
40732
+ try {
40733
+ const plan = erasePerson(context, String(person2), "owner", false);
40734
+ if (plan.kept.length === 0)
40735
+ erasePerson(context, String(person2), "owner", true);
40736
+ } catch (error) {
40737
+ if (!(error instanceof CliError))
40738
+ throw error;
40739
+ }
40705
40740
  }
40706
40741
  }, "eraseImportedPeople");
40707
40742
 
40708
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/account-purge.js
40743
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/account-purge.js
40709
40744
  var purgeAccount = /* @__PURE__ */ __name((context, accountKey) => {
40710
40745
  const { orm, database, now: now2 } = context;
40711
40746
  const unseenBefore = unreferenced(database, "identities");
@@ -40794,6 +40829,7 @@ var purgeAccount = /* @__PURE__ */ __name((context, accountKey) => {
40794
40829
  const recordsOf = sql`(SELECT id FROM records WHERE account_id = ${accountKey})`;
40795
40830
  orm.run(sql`DELETE FROM record_relations WHERE record_id IN ${recordsOf} OR target_id IN ${recordsOf}`);
40796
40831
  orm.run(sql`DELETE FROM records WHERE account_id = ${accountKey}`);
40832
+ orm.run(sql`DELETE FROM links WHERE account_id = ${accountKey}`);
40797
40833
  orm.delete(accounts).where(eq(accounts.id, accountKey)).run();
40798
40834
  dropOrphanPeople(database, unseenBefore);
40799
40835
  eraseImportedPeople(context, imported);
@@ -40808,21 +40844,7 @@ var purgeCrmCopies = /* @__PURE__ */ __name((database, accountKey) => {
40808
40844
  const leadsOf = "(SELECT id FROM leads WHERE account_id = ?)";
40809
40845
  const pipelinesOf = "(SELECT id FROM pipelines WHERE account_id = ?)";
40810
40846
  const stagesOf = `(SELECT id FROM pipeline_stages WHERE pipeline_id IN ${pipelinesOf})`;
40811
- for (const [type, ids3] of [
40812
- ["deal", dealsOf],
40813
- ["lead", leadsOf]
40814
- ]) {
40815
- run(`DELETE FROM links WHERE (from_type = ? AND from_id IN ${ids3}) OR (to_type = ? AND to_id IN ${ids3})`, type, accountKey, type, accountKey);
40816
- for (const [table, pointer] of [
40817
- ["taggings", "taggable"],
40818
- ["aliases", "aliasable"],
40819
- ["attachments", "attachable"],
40820
- ["link_reviews", "linkable"],
40821
- ["entity_link_events", "linkable"]
40822
- ])
40823
- run(`DELETE FROM ${table} WHERE ${pointer}_type = ? AND ${pointer}_id IN ${ids3}`, type, accountKey);
40824
- run(`DELETE FROM pipeline_stage_changes WHERE item_type = ? AND item_id IN ${ids3}`, type, accountKey);
40825
- }
40847
+ new ErasePlan(database).pointers("deal", dealsOf.slice(1, -1), [accountKey]).pointers("lead", leadsOf.slice(1, -1), [accountKey]).run();
40826
40848
  run(`DELETE FROM pipeline_stage_changes WHERE pipeline_id IN ${pipelinesOf}`, accountKey);
40827
40849
  for (const table of ["leads", "orders", "contracts"])
40828
40850
  run(`UPDATE ${table} SET deal_id = NULL WHERE deal_id IN ${dealsOf}`, accountKey);
@@ -40833,7 +40855,7 @@ var purgeCrmCopies = /* @__PURE__ */ __name((database, accountKey) => {
40833
40855
  run("DELETE FROM pipelines WHERE account_id = ?", accountKey);
40834
40856
  }, "purgeCrmCopies");
40835
40857
 
40836
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
40858
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/own-identities.js
40837
40859
  var ACCOUNT_REASON = "an account you connected, under another name: a mailbox or messenger you read may be someone else's";
40838
40860
  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");
40839
40861
  var ownersName = /* @__PURE__ */ __name((name, owner, alone) => {
@@ -40892,7 +40914,7 @@ var linkToOwner = /* @__PURE__ */ __name((context, ref3) => {
40892
40914
  return personOf2(context, ref3);
40893
40915
  }, "linkToOwner");
40894
40916
 
40895
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
40917
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/providers.js
40896
40918
  var PROVIDERS_SETTING = "providers";
40897
40919
  var storedProvidersOf = /* @__PURE__ */ __name((database) => {
40898
40920
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(PROVIDERS_SETTING);
@@ -40940,7 +40962,7 @@ var registerProvider = /* @__PURE__ */ __name((database, value, now2) => {
40940
40962
  });
40941
40963
  }, "registerProvider");
40942
40964
 
40943
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
40965
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/task-candidates.js
40944
40966
  var DAY5 = 864e5;
40945
40967
  var RECENTLY_CLOSED_MS = 14 * DAY5;
40946
40968
  var TEXT_LIMIT = 20;
@@ -41116,13 +41138,13 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
41116
41138
  const row2 = known2?.row ?? rowOf4(id2);
41117
41139
  return [id2, { row: row2, side: linkedOf(known2?.side ?? sideOf2(row2)) }];
41118
41140
  }));
41119
- const ranked = rankCandidates(views, chosen.map(([id2]) => {
41141
+ const ranked2 = rankCandidates(views, chosen.map(([id2]) => {
41120
41142
  const other = rows.get(id2)?.side;
41121
41143
  if (sameSource(side, other))
41122
41144
  return { id: id2, views: viewsOf(other, stemmer2).slice(0, 1), subjectViews: views.slice(0, 1) };
41123
41145
  return { id: id2, views: viewsOf(other, stemmer2), replyChain: inChain(other) };
41124
41146
  }));
41125
- return ranked.slice(0, Math.min(Math.max(limit, 1), CANDIDATE_LIMIT)).map(({ id: id2, ...similarity }) => {
41147
+ return ranked2.slice(0, Math.min(Math.max(limit, 1), CANDIDATE_LIMIT)).map(({ id: id2, ...similarity }) => {
41126
41148
  const row2 = rows.get(id2)?.row;
41127
41149
  return {
41128
41150
  ref: `task:${String(row2.package_id ?? row2.key)}`,
@@ -41138,7 +41160,7 @@ var taskSimilarityOver = /* @__PURE__ */ __name((context) => {
41138
41160
  };
41139
41161
  }, "taskSimilarityOver");
41140
41162
 
41141
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
41163
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/task-category-settings.js
41142
41164
  var SETTING3 = "taskCategories";
41143
41165
  var savedTaskCategories = /* @__PURE__ */ __name((database) => {
41144
41166
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(SETTING3);
@@ -41157,7 +41179,7 @@ var saveTaskCategories = /* @__PURE__ */ __name((database, categories, now2) =>
41157
41179
  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);
41158
41180
  }, "saveTaskCategories");
41159
41181
 
41160
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
41182
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close.js
41161
41183
  var DEFAULT_AGENT_CLOSE = { allowed: true, min: 0.8 };
41162
41184
  var ALLOWED = "taskAgentClose";
41163
41185
  var MIN = "taskAgentCloseMin";
@@ -41213,7 +41235,7 @@ var SUGGESTION_COLUMNS = [
41213
41235
  ];
41214
41236
  var CLEAR_SUGGESTION = SUGGESTION_COLUMNS.map((column2) => `${column2} = NULL`).join(", ");
41215
41237
 
41216
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
41238
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/task-first-pass.js
41217
41239
  var DEFAULT_FIRST_PASS_PER_CHAT = 0;
41218
41240
  var KEY = "taskFirstPassPerChat";
41219
41241
  var firstPassPerChatOf = /* @__PURE__ */ __name((value, setting = "task_first_pass_per_chat") => {
@@ -41233,7 +41255,7 @@ var saveFirstPassPerChat = /* @__PURE__ */ __name((database, value, now2) => {
41233
41255
  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);
41234
41256
  }, "saveFirstPassPerChat");
41235
41257
 
41236
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/external-links.js
41258
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/external-links.js
41237
41259
  var EXTERNAL_SERVICE = /^[a-z][a-z0-9-]{0,31}$/;
41238
41260
  var EXTERNAL_ID_CHARS = 200;
41239
41261
  var SOURCE_URL_CHARS = 2e3;
@@ -41260,7 +41282,7 @@ var sourceUrlOf = /* @__PURE__ */ __name((value, reason = "task.source-url") =>
41260
41282
  return text9;
41261
41283
  }, "sourceUrlOf");
41262
41284
 
41263
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
41285
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/task-board.js
41264
41286
  var TASK_SORTS = ["priority", "due", "created", "updated", "key", "state"];
41265
41287
  var field = /* @__PURE__ */ __name((name, type, example, more = {}) => ({
41266
41288
  name,
@@ -41512,7 +41534,7 @@ var withoutField = /* @__PURE__ */ __name((query, name) => {
41512
41534
  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 ?`;
41513
41535
  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");
41514
41536
 
41515
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
41537
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/task-comments.js
41516
41538
  var authorNamed = /* @__PURE__ */ __name((database, row2) => {
41517
41539
  if (row2.author_type == null)
41518
41540
  return null;
@@ -41540,7 +41562,7 @@ var addComment = /* @__PURE__ */ __name((context, task, body2, by) => {
41540
41562
  return commentsOf(database, task).find((one2) => one2.ref === `note:${made}`);
41541
41563
  }, "addComment");
41542
41564
 
41543
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
41565
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/task-relations.js
41544
41566
  var TASK_RELATION_KINDS = [
41545
41567
  "blocked-by",
41546
41568
  "follow-up-of",
@@ -41670,7 +41692,7 @@ var taskRelationsStoreOver = /* @__PURE__ */ __name((context, record3) => {
41670
41692
  };
41671
41693
  }, "taskRelationsStoreOver");
41672
41694
 
41673
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
41695
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/work-tasks.js
41674
41696
  var TASK_ROLES = ["assignee", "reviewer", "watcher"];
41675
41697
  var TASK_EVENT_KINDS = [
41676
41698
  "created",
@@ -41840,9 +41862,9 @@ var workTaskOperationsOver = /* @__PURE__ */ __name((context) => {
41840
41862
  }, "renumber");
41841
41863
  renumber(before2, null);
41842
41864
  const moved = [];
41843
- const childrenOf = database.prepare("SELECT * FROM tasks WHERE parent_id = ? AND deleted_at IS NULL ORDER BY id");
41865
+ const childrenOf2 = database.prepare("SELECT * FROM tasks WHERE parent_id = ? AND deleted_at IS NULL ORDER BY id");
41844
41866
  for (const queue = [task]; queue.length > 0; ) {
41845
- for (const child of childrenOf.all(queue.shift())) {
41867
+ for (const child of childrenOf2.all(queue.shift())) {
41846
41868
  moved.push({ from: String(child.key), to: renumber(child, child.parent_id) });
41847
41869
  queue.push(Number(child.id));
41848
41870
  }
@@ -42229,7 +42251,7 @@ var workTasksOver = /* @__PURE__ */ __name((context) => {
42229
42251
  };
42230
42252
  }, "workTasksOver");
42231
42253
 
42232
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
42254
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/task-close-store.js
42233
42255
  var taskCloseOver = /* @__PURE__ */ __name((context) => {
42234
42256
  const { database, now: now2 } = context;
42235
42257
  const liveRow = /* @__PURE__ */ __name((id2) => {
@@ -42278,7 +42300,7 @@ var taskCloseOver = /* @__PURE__ */ __name((context) => {
42278
42300
  };
42279
42301
  }, "taskCloseOver");
42280
42302
 
42281
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
42303
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/task-pairs.js
42282
42304
  var TASK_PAIR_DECISIONS = ["review", "unsure", "merged", "rejected", "unmerged", "attached", "new"];
42283
42305
  var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
42284
42306
  const { database, now: now2 } = context;
@@ -42497,7 +42519,7 @@ var taskPairsOver = /* @__PURE__ */ __name((context, similarity) => {
42497
42519
  };
42498
42520
  }, "taskPairsOver");
42499
42521
 
42500
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
42522
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/task-stats.js
42501
42523
  var ACCOUNT_SCOPE = "t.package_id IS NOT NULL AND t.deleted_at IS NULL AND t.project_id = ?";
42502
42524
  var TASK_STATS_SQL = {
42503
42525
  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"),
@@ -42536,7 +42558,7 @@ var taskStatsOver = /* @__PURE__ */ __name(({ database }, inbox) => ({
42536
42558
  }, "statNames")
42537
42559
  }), "taskStatsOver");
42538
42560
 
42539
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
42561
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/tasks.js
42540
42562
  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";
42541
42563
  var inboxProject = /* @__PURE__ */ __name(({ database, now: now2 }, account, create) => {
42542
42564
  const key2 = inboxKey(account);
@@ -42752,7 +42774,7 @@ var oneOf4 = /* @__PURE__ */ __name((values, value, column2) => {
42752
42774
  throw new CliError("configuration_error", `the store holds a task with an unknown ${column2} "${String(value)}"`);
42753
42775
  }, "oneOf");
42754
42776
 
42755
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/accounts.js
42777
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/accounts.js
42756
42778
  var accountAccountsOver = /* @__PURE__ */ __name((context) => {
42757
42779
  const { database } = context;
42758
42780
  const { accountPk: accountPk2, findAccountPk: findAccountPk2 } = keysOver(context);
@@ -42822,7 +42844,7 @@ var accountsStoreOver = /* @__PURE__ */ __name((context, keyed) => {
42822
42844
  };
42823
42845
  }, "accountsStoreOver");
42824
42846
 
42825
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
42847
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/attachments.js
42826
42848
  var refColumn = /* @__PURE__ */ __name((ref3) => ref3 && Object.keys(ref3).length > 0 ? { providerRef: JSON.stringify(ref3) } : {}, "refColumn");
42827
42849
  var updatePlaced = /* @__PURE__ */ __name(({ orm }, chatKey, messageId, files2, change) => {
42828
42850
  const message3 = orm.select({ pk: messages.id }).from(messages).where(and(eq(messages.chatId, chatKey), eq(messages.externalId, messageId))).get();
@@ -42846,7 +42868,7 @@ var keepDownloads = /* @__PURE__ */ __name((context, chatKey, messageId, files2)
42846
42868
  })), "keepDownloads");
42847
42869
  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");
42848
42870
 
42849
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/attachments.js
42871
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/attachments.js
42850
42872
  var accountAttachmentsOver = /* @__PURE__ */ __name((context) => {
42851
42873
  const { database } = context;
42852
42874
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -42903,7 +42925,7 @@ var attachmentsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
42903
42925
  }, "keepAttachmentText")
42904
42926
  }), "attachmentsStoreOver");
42905
42927
 
42906
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
42928
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-rekey.js
42907
42929
  var chatRow = /* @__PURE__ */ __name((context, accountKey, chatId) => context.database.prepare("SELECT * FROM chats WHERE account_id = ? AND external_id = ?").get(accountKey, chatId), "chatRow");
42908
42930
  var pointerMover = /* @__PURE__ */ __name((context, type) => {
42909
42931
  const statements = pointerPairs(context.database).filter(({ table }) => table !== "involvements").map(({ table, pointer }) => {
@@ -43088,7 +43110,7 @@ var rekeyChats = /* @__PURE__ */ __name((context, key2, accountKey, pairs, lockM
43088
43110
  return done;
43089
43111
  }, "rekeyChats");
43090
43112
 
43091
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
43113
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/completeness.js
43092
43114
  var historyStartKey = /* @__PURE__ */ __name((chatId) => `history_start:${chatId}`, "historyStartKey");
43093
43115
  var fetchedKey = /* @__PURE__ */ __name((chatId) => `fetched:${chatId}`, "fetchedKey");
43094
43116
  var CHAT_LIST_KEY = "chat_list_complete";
@@ -43146,7 +43168,7 @@ var chatCoverage = /* @__PURE__ */ __name(({ database }, accountKey) => {
43146
43168
  return { ...coverage, oldestMessageAt: toIso(oldest) };
43147
43169
  }, "chatCoverage");
43148
43170
 
43149
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/chats.js
43171
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/chats.js
43150
43172
  var chatsStoreOver = /* @__PURE__ */ __name((context) => {
43151
43173
  const { database } = context;
43152
43174
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, writeState: writeState2 } = keysOver(context);
@@ -43295,7 +43317,7 @@ var chatsStoreOver = /* @__PURE__ */ __name((context) => {
43295
43317
  };
43296
43318
  }, "chatsStoreOver");
43297
43319
 
43298
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
43320
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/batches.js
43299
43321
  import { createHash as createHash7 } from "node:crypto";
43300
43322
  var BATCH_CONTEXT = 50;
43301
43323
  var replied = /* @__PURE__ */ __name((m) => sql`EXISTS (SELECT 1 FROM messages p WHERE p.chat_id = ${m}.chat_id
@@ -43435,7 +43457,7 @@ var saveAnswers = /* @__PURE__ */ __name((context, id2, answer) => {
43435
43457
  var clearAnswers = /* @__PURE__ */ __name(({ orm }, chatKey, model) => Number(orm.all(sql`DELETE FROM message_links WHERE chat_id = ${chatKey} AND source = 'agent'
43436
43458
  ${model === void 0 ? sql`` : sql`AND method = ${model}`} RETURNING 1 AS n`).length), "clearAnswers");
43437
43459
 
43438
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
43460
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/conversations.js
43439
43461
  import { setTimeout } from "node:timers/promises";
43440
43462
  var position = /* @__PURE__ */ __name((sentAt, pk) => `${sentAt}:${pk}`, "position");
43441
43463
  var linkInputs = /* @__PURE__ */ __name(({ orm }, chatKey, { after: after2, limit }) => {
@@ -43742,6 +43764,46 @@ var chunkRepliesOf = /* @__PURE__ */ __name(({ orm }, accountPk2, chunks2, limit
43742
43764
  }
43743
43765
  return found2;
43744
43766
  }, "chunkRepliesOf");
43767
+ var bestChunkOf = /* @__PURE__ */ __name(({ orm }, accountPk2, conversationPk, { model, vectors, stems, over }) => {
43768
+ const chunks2 = orm.all(sql`SELECT f.external_id AS first, l.external_id AS last, f.sent_at AS fs, f.id AS fi, l.sent_at AS ls, l.id AS li,
43769
+ v.vector
43770
+ FROM chunks k JOIN chunk_messages r ON r.chunk_id = k.id
43771
+ JOIN conversations c ON c.id = k.chunkable_id
43772
+ JOIN chats ch ON ch.id = c.chat_id AND ch.account_id = ${accountPk2}
43773
+ JOIN conversation_state s ON s.chat_id = c.chat_id AND s.current_build = c.build
43774
+ JOIN messages f ON f.id = r.first_message_id JOIN messages l ON l.id = r.last_message_id
43775
+ LEFT JOIN embeddings v ON v.model = ${model} AND v.content_hash = k.content_hash
43776
+ WHERE k.chunkable_type = 'conversation' AND k.chunkable_id = ${conversationPk} ORDER BY k.position`);
43777
+ if (chunks2.length <= over || !vectors.length)
43778
+ return void 0;
43779
+ const texts2 = chunks2.map(() => "");
43780
+ const rows = orm.all(sql`SELECT m.sent_at AS at, m.id AS pk, m.text FROM conversation_messages cm JOIN messages m ON m.id = cm.message_id
43781
+ WHERE cm.conversation_id = ${conversationPk} AND m.deleted_at IS NULL`);
43782
+ const after2 = /* @__PURE__ */ __name((at2, pk, than, thanPk) => at2 > than || at2 === than && pk >= thanPk, "after");
43783
+ for (const { at: at2, pk, text: text9 } of rows)
43784
+ chunks2.forEach(({ fs, fi, ls, li }, index2) => {
43785
+ if (after2(at2, pk, fs, fi) && after2(ls, li, at2, pk))
43786
+ texts2[index2] += ` ${(text9 ?? "").toLowerCase()}`;
43787
+ });
43788
+ const weights = /* @__PURE__ */ new Map();
43789
+ for (const { stem, weight } of stems)
43790
+ weights.set(stem, (weights.get(stem) ?? 0) + weight);
43791
+ const words4 = texts2.map(() => 0);
43792
+ for (const [stem, weight] of weights) {
43793
+ const holding = texts2.flatMap((text9, index2) => text9.includes(stem) ? [index2] : []);
43794
+ const rarity = Math.log(chunks2.length / holding.length);
43795
+ for (const index2 of holding)
43796
+ words4[index2] = words4[index2] + weight * rarity;
43797
+ }
43798
+ const meaning = chunks2.map(({ vector }) => vector ? vectors.reduce((sum, query) => sum + dot(query, vector), 0) : Number.NEGATIVE_INFINITY);
43799
+ const fused = chunks2.map(() => 0);
43800
+ for (const scores of [meaning, words4])
43801
+ scores.map((_, index2) => index2).sort((a, b) => scores[b] - scores[a] || a - b).forEach((index2, rank) => {
43802
+ fused[index2] = fused[index2] + 1 / (RRF_K + rank + 1);
43803
+ });
43804
+ const best = chunks2[fused.reduce((top, score, at2) => score > fused[top] ? at2 : top, 0)];
43805
+ return best && { firstMessageId: best.first, lastMessageId: best.last };
43806
+ }, "bestChunkOf");
43745
43807
  var staleLink = /* @__PURE__ */ __name((chatKey) => sql`(${messageLinks.staleAt} IS NOT NULL
43746
43808
  OR EXISTS (SELECT 1 FROM message_revisions r WHERE r.message_id IN (${messageLinks.messageId}, ${messageLinks.parentId})
43747
43809
  AND r.created_at >= ${messageLinks.createdAt})
@@ -43790,7 +43852,7 @@ var agentAnswers = /* @__PURE__ */ __name(({ orm }, chatKey) => new Map(orm.all(
43790
43852
  AND NOT EXISTS (SELECT 1 FROM messages d
43791
43853
  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");
43792
43854
 
43793
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/conversations.js
43855
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/conversations.js
43794
43856
  var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
43795
43857
  const { database } = context;
43796
43858
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -43843,6 +43905,11 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
43843
43905
  const accountPk2 = findAccountPk2(key2);
43844
43906
  return accountPk2 === void 0 ? chunks2.map(() => []) : chunkRepliesOf(context, accountPk2, chunks2, limit);
43845
43907
  }, "chunkReplies"),
43908
+ bestChunk: /* @__PURE__ */ __name(async (key2, conversationId, search2) => {
43909
+ const accountPk2 = findAccountPk2(key2);
43910
+ const pk = Number(conversationId);
43911
+ return accountPk2 === void 0 || !Number.isSafeInteger(pk) ? void 0 : bestChunkOf(context, accountPk2, pk, search2);
43912
+ }, "bestChunk"),
43846
43913
  links: /* @__PURE__ */ __name(async (key2, chatId, messageId, options) => {
43847
43914
  const chatKey = chatKeyOf(key2, chatId);
43848
43915
  return chatKey === void 0 ? [] : linksOf(context, chatKey, messageId, options?.limit);
@@ -43906,7 +43973,7 @@ var conversationsStoreOver = /* @__PURE__ */ __name((context) => {
43906
43973
  };
43907
43974
  }, "conversationsStoreOver");
43908
43975
 
43909
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/counters.js
43976
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/counters.js
43910
43977
  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";
43911
43978
  var accountCountersOver = /* @__PURE__ */ __name((context) => {
43912
43979
  const { database } = context;
@@ -43931,7 +43998,7 @@ var countersStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
43931
43998
  counterTargets: /* @__PURE__ */ __name(async (execution, options) => counterTargets(context, execution, options), "counterTargets")
43932
43999
  }), "countersStoreOver");
43933
44000
 
43934
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
44001
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/mentions.js
43935
44002
  var MENTION_STATUSES = ["found", "linked", "proposed", "dismissed"];
43936
44003
  var MENTION_QUERY = defineQuery({
43937
44004
  entity: "mention",
@@ -44150,7 +44217,7 @@ var listPlaces = /* @__PURE__ */ __name((database, { limit, offset }) => {
44150
44217
  return { items: hasMore ? rows.slice(0, limit) : rows, hasMore };
44151
44218
  }, "listPlaces");
44152
44219
 
44153
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/mentions.js
44220
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/mentions.js
44154
44221
  var accountMentionsOver = /* @__PURE__ */ __name((context) => {
44155
44222
  const { database } = context;
44156
44223
  const { findAccountPk: findAccountPk2 } = keysOver(context);
@@ -44185,7 +44252,7 @@ var mentionsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
44185
44252
  places: /* @__PURE__ */ __name(async (window) => listPlaces(context.database, window), "places")
44186
44253
  }), "mentionsStoreOver");
44187
44254
 
44188
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
44255
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/reply-times.js
44189
44256
  var FAR = Number.MAX_SAFE_INTEGER;
44190
44257
  var MUTED_NOW = "(coalesce(c.muted,0)=1 AND (c.muted_until IS NULL OR c.muted_until>?))";
44191
44258
  var chatsIn = /* @__PURE__ */ __name((scope3, kinds2, now2) => {
@@ -44284,7 +44351,7 @@ var waitingChats = /* @__PURE__ */ __name((context, scope3, waits, cap) => {
44284
44351
  });
44285
44352
  }, "waitingChats");
44286
44353
 
44287
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-activity-counts.js
44354
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-activity-counts.js
44288
44355
  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 = ?`;
44289
44356
  var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since, until, now: now2 }) => {
44290
44357
  const statement = database.prepare(SQL);
@@ -44304,7 +44371,7 @@ var chatActivityCounts = /* @__PURE__ */ __name(({ database }, chatKeys, { since
44304
44371
  return found2;
44305
44372
  }, "chatActivityCounts");
44306
44373
 
44307
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
44374
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/document-links.js
44308
44375
  var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messageId) => {
44309
44376
  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");
44310
44377
  const rows = messageId === void 0 ? read2.all(chatKey) : read2.all(chatKey, messageId);
@@ -44319,7 +44386,7 @@ var documentLinkMessages = /* @__PURE__ */ __name(({ database }, chatKey, messag
44319
44386
  }));
44320
44387
  }, "documentLinkMessages");
44321
44388
 
44322
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
44389
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/follow-ups.js
44323
44390
  var stemmerFor = stemmerCache();
44324
44391
  var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit }) => {
44325
44392
  if (wanted.length > 50 || !Number.isInteger(limit) || limit < 1 || limit > 100)
@@ -44363,7 +44430,7 @@ var laterSharingRare = /* @__PURE__ */ __name((context, wanted, { rareAt, limit
44363
44430
  });
44364
44431
  }, "laterSharingRare");
44365
44432
 
44366
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/messages.js
44433
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/messages.js
44367
44434
  var accountMessagesOver = /* @__PURE__ */ __name((context) => {
44368
44435
  const { database } = context;
44369
44436
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf, chatPkFor: chatPkFor2, answeredChatPk: answeredChatPk2, upsertMessage: upsertMessage2 } = keysOver(context);
@@ -44504,7 +44571,7 @@ var messagesStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
44504
44571
  laterSharingRare: /* @__PURE__ */ __name(async (wanted, options) => laterSharingRare(context, wanted, options), "laterSharingRare")
44505
44572
  }), "messagesStoreOver");
44506
44573
 
44507
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-links.js
44574
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-links.js
44508
44575
  var AGENT_METHOD = "agent";
44509
44576
  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");
44510
44577
  var weaknessOf = /* @__PURE__ */ __name((context, kind3, value, holders, sides, others) => {
@@ -44648,7 +44715,7 @@ var agentMerges = /* @__PURE__ */ __name((context, { limit, offset }) => {
44648
44715
  return { items: found2.slice(offset, offset + limit), hasMore: found2.length > offset + limit };
44649
44716
  }, "agentMerges");
44650
44717
 
44651
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-rekey.js
44718
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/identity-rekey.js
44652
44719
  var quoted2 = /* @__PURE__ */ __name((name) => `"${name.replace(/"/g, '""')}"`, "quoted");
44653
44720
  var columnsOf3 = /* @__PURE__ */ __name((database, table) => database.prepare("SELECT name, pk, type FROM pragma_table_info(?)").all(table), "columnsOf");
44654
44721
  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
@@ -44792,7 +44859,7 @@ var rekeyIdentities = /* @__PURE__ */ __name((context, provider, pairs, { lockMs
44792
44859
  return done;
44793
44860
  }, "rekeyIdentities");
44794
44861
 
44795
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/person-kinds.js
44862
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/person-kinds.js
44796
44863
  var PERSON_KINDS = ["person", "organization", "automated", "stranger", "unsorted", "test"];
44797
44864
  var AUTOMATED_WORDS = /* @__PURE__ */ new Set([
44798
44865
  "noreply",
@@ -44855,7 +44922,7 @@ var isCompanyName = /* @__PURE__ */ __name((name) => {
44855
44922
  return wordsOf3(name.replaceAll(".", "")).some((word2) => LEGAL_FORMS.has(word2) || COMPANY_WORDS.has(word2));
44856
44923
  }, "isCompanyName");
44857
44924
 
44858
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/person-ties.js
44925
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/person-ties.js
44859
44926
  var SMALL_GROUP_MEMBERS = 10;
44860
44927
  var PERSON_TIES = ["chat", "small-group", "mail", "meeting", "crm", "phone-book"];
44861
44928
  var ALWAYS_SHOWN = ["owner", "added", "task"];
@@ -44910,7 +44977,7 @@ var shownReasons = /* @__PURE__ */ __name((database, people2) => {
44910
44977
  return new Map([...found2].map(([person2, reasons]) => [person2, ORDER.filter((one2) => reasons.has(one2))]));
44911
44978
  }, "shownReasons");
44912
44979
 
44913
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/people-list.js
44980
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/people-list.js
44914
44981
  var PEOPLE_SORTS = ["interactions", "recent", "name", "tasks"];
44915
44982
  var MIN_QUERY = 3;
44916
44983
  var matching2 = /* @__PURE__ */ __name((query) => {
@@ -45255,7 +45322,7 @@ var similarPeople = /* @__PURE__ */ __name((database, typed, limit) => {
45255
45322
  return withLastContact(database, rows).map((person2, at2) => ({ ...person2, sameName: same[at2] === true }));
45256
45323
  }, "similarPeople");
45257
45324
 
45258
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/person-doubts.js
45325
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/person-doubts.js
45259
45326
  var DOUBT_REASONS = ["owner-other-name", "test-data", "shared-address", "mixed-names"];
45260
45327
  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";
45261
45328
  var text5 = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? value : null, "text");
@@ -45511,7 +45578,7 @@ var markTestData = /* @__PURE__ */ __name((context, uid, by) => {
45511
45578
  return { person: `person:${person2}`, identities: identities2 };
45512
45579
  }, "markTestData");
45513
45580
 
45514
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
45581
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/person-preparation.js
45515
45582
  var GLOBAL_PROJECT = "SELECT id FROM main.projects WHERE account_id IS NULL AND deleted_at IS NULL";
45516
45583
  var IN_SCOPES = "IN (SELECT value FROM json_each(?))";
45517
45584
  var projectScope = /* @__PURE__ */ __name((id2) => `(SELECT p.scope FROM main.projects p WHERE p.id=${id2})`, "projectScope");
@@ -45580,7 +45647,7 @@ var personPreparation = /* @__PURE__ */ __name(({ database, now: now2 }, uid, {
45580
45647
  });
45581
45648
  }, "personPreparation");
45582
45649
 
45583
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
45650
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/person-scope.js
45584
45651
  var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds) => {
45585
45652
  const id2 = Number(uid);
45586
45653
  if (!/^[1-9]\d*$/.test(uid) || !Number.isSafeInteger(id2) || !accountIds.length || accountIds.length > 1e3 || accountIds.some((account) => !Number.isSafeInteger(account) || account <= 0))
@@ -45588,7 +45655,7 @@ var personSeenInAccounts = /* @__PURE__ */ __name(({ database }, uid, accountIds
45588
45655
  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)));
45589
45656
  }, "personSeenInAccounts");
45590
45657
 
45591
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
45658
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/private-people.js
45592
45659
  var required2 = /* @__PURE__ */ __name(({ database }, key2, personId) => {
45593
45660
  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);
45594
45661
  if (!row2)
@@ -45655,7 +45722,7 @@ var removeNote = /* @__PURE__ */ __name((context, key2, personId, id2) => {
45655
45722
  return { id: id2, personId, removed: true };
45656
45723
  }, "removeNote");
45657
45724
 
45658
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/people.js
45725
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/people.js
45659
45726
  var accountPeopleOver = /* @__PURE__ */ __name((context) => {
45660
45727
  const { database } = context;
45661
45728
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, identityPk: identityPk2 } = keysOver(context);
@@ -45799,13 +45866,13 @@ var peopleStoreOver = /* @__PURE__ */ __name((context, keyed) => {
45799
45866
  };
45800
45867
  }, "peopleStoreOver");
45801
45868
 
45802
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
45869
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
45803
45870
  import { createHash as createHash9 } from "node:crypto";
45804
45871
 
45805
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
45872
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
45806
45873
  import { createHash as createHash8 } from "node:crypto";
45807
45874
 
45808
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
45875
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
45809
45876
  var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
45810
45877
  var AUTHOR_MEASURES = [
45811
45878
  "messages",
@@ -45945,7 +46012,7 @@ var withoutUrls = /* @__PURE__ */ __name((text9) => text9.replace(/\S+/gu, (toke
45945
46012
  var rankingWords = /* @__PURE__ */ __name((text9) => withoutUrls(text9).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
45946
46013
  var rankingQuestion = /* @__PURE__ */ __name((text9) => withoutUrls(text9).includes("?"), "rankingQuestion");
45947
46014
 
45948
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
46015
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/rankings-graph.js
45949
46016
  var RANKING_GRAPH_LIMITS = { nodes: 5e4, depth: 256, work: 1e7, bytes: 8388608 };
45950
46017
  var exhausted2 = /* @__PURE__ */ __name((budget) => {
45951
46018
  throw new CliError("validation_error", `ranking exceeded ${budget} \u2014 narrow its chat or date scope`, {
@@ -46167,7 +46234,7 @@ var rankReplyGraph = /* @__PURE__ */ __name((nodes, check3 = () => {
46167
46234
  };
46168
46235
  }, "rankReplyGraph");
46169
46236
 
46170
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
46237
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/admin-statistics.js
46171
46238
  var adminEntityKey = /* @__PURE__ */ __name((row2) => JSON.stringify([row2.account.provider, row2.account.account, row2.id]), "adminEntityKey");
46172
46239
  var personKey = /* @__PURE__ */ __name((node) => JSON.stringify([node.account.provider, node.account.account, node.sender]), "personKey");
46173
46240
  var locator = /* @__PURE__ */ __name((node) => formatLocator({ ...node.account, chat: node.chatId, message: node.id }), "locator");
@@ -46341,7 +46408,7 @@ var calculateAdminStatistics = /* @__PURE__ */ __name((nodes, stays, options, in
46341
46408
  return { items, evidence, summary, graph: graph.quality };
46342
46409
  }, "calculateAdminStatistics");
46343
46410
 
46344
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
46411
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/rankings-range.js
46345
46412
  var rankingContextRange = /* @__PURE__ */ __name((root) => {
46346
46413
  const dates = [];
46347
46414
  const visit = /* @__PURE__ */ __name((node, required3) => {
@@ -46363,7 +46430,7 @@ var rankingContextRange = /* @__PURE__ */ __name((root) => {
46363
46430
  return dates[0].node.resolution.date;
46364
46431
  }, "rankingContextRange");
46365
46432
 
46366
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
46433
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/rankings.js
46367
46434
  var reactionCounts = /* @__PURE__ */ __name((stored4) => {
46368
46435
  let counts;
46369
46436
  try {
@@ -46658,7 +46725,7 @@ var rankQuery = /* @__PURE__ */ __name((context, execution, request, inspect) =>
46658
46725
  });
46659
46726
  }, "rankQuery");
46660
46727
 
46661
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
46728
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/admin-statistics.js
46662
46729
  function fail2(message3, reason = "query.too-large") {
46663
46730
  throw new CliError("validation_error", message3, { reason, complete: false });
46664
46731
  }
@@ -46835,7 +46902,7 @@ var adminStatisticsQuery = /* @__PURE__ */ __name((context, execution, request)
46835
46902
  return result;
46836
46903
  }), "adminStatisticsQuery");
46837
46904
 
46838
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
46905
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/conversation-eligibility.js
46839
46906
  var conversationEligibility = /* @__PURE__ */ __name(async (context, execution) => {
46840
46907
  if (!execution.accounts.length)
46841
46908
  return { conversations: [], chats: [] };
@@ -46853,7 +46920,7 @@ var conversationEligibility = /* @__PURE__ */ __name(async (context, execution)
46853
46920
  return { conversations: conversations2, chats: chats2 };
46854
46921
  }, "conversationEligibility");
46855
46922
 
46856
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
46923
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/ranking-evidence.js
46857
46924
  import { createHash as createHash10 } from "node:crypto";
46858
46925
  var EVIDENCE_BYTES = 64 * 1024;
46859
46926
  var FINGERPRINT_BYTES = 8 * 1024 * 1024;
@@ -46877,8 +46944,8 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
46877
46944
  ...request.options.target === "messages" ? [target.chatId ?? ""] : [],
46878
46945
  target.id
46879
46946
  ];
46880
- const ranked = database.prepare(`${prefix}SELECT * FROM eligible WHERE ${identity}`).get(...params, ...identityParams);
46881
- if (!ranked)
46947
+ const ranked2 = database.prepare(`${prefix}SELECT * FROM eligible WHERE ${identity}`).get(...params, ...identityParams);
46948
+ if (!ranked2)
46882
46949
  throw new CliError("not_found", "ranking row is no longer eligible in this selection \u2014 run stats top again", {
46883
46950
  reason: "selection.changed"
46884
46951
  });
@@ -46994,7 +47061,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
46994
47061
  nextCursor: next < total ? Buffer.from(JSON.stringify({ version: 1, offset: next, fingerprint: fingerprint2 })).toString("base64url") : null,
46995
47062
  fingerprint: fingerprint2,
46996
47063
  component,
46997
- componentValue: typeof ranked[component] === "number" ? Number(ranked[component]) : null,
47064
+ componentValue: typeof ranked2[component] === "number" ? Number(ranked2[component]) : null,
46998
47065
  byteLimit: EVIDENCE_BYTES
46999
47066
  };
47000
47067
  });
@@ -47003,7 +47070,7 @@ var rankingEvidence = /* @__PURE__ */ __name((context, execution, request) => {
47003
47070
  return result;
47004
47071
  }, "rankingEvidence");
47005
47072
 
47006
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/queries.js
47073
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/queries.js
47007
47074
  var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
47008
47075
  const mailIndexed = /* @__PURE__ */ __name((execution) => {
47009
47076
  if (execution.corpus === "mail")
@@ -47024,7 +47091,7 @@ var queriesStoreOver = /* @__PURE__ */ __name((context, stemmerFor2) => {
47024
47091
  };
47025
47092
  }, "queriesStoreOver");
47026
47093
 
47027
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
47094
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/chat-events.js
47028
47095
  var saveChatEvents = /* @__PURE__ */ __name((context, accountKey, provider, chatKey, events3) => {
47029
47096
  const { database, now: now2 } = context;
47030
47097
  const insert = database.prepare(`INSERT INTO chat_events (chat_id, source_id, action, actor_identity_id, title, happened_at, created_at, updated_at)
@@ -47063,10 +47130,10 @@ var chatEventsOf = /* @__PURE__ */ __name(({ database }, chatKey, { since = 0, l
47063
47130
  }));
47064
47131
  }, "chatEventsOf");
47065
47132
 
47066
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
47133
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
47067
47134
  import { createHash as createHash11 } from "node:crypto";
47068
47135
 
47069
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/calendar.js
47136
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/calendar.js
47070
47137
  var calendarKey = /* @__PURE__ */ __name((zone, by) => {
47071
47138
  const format = new Intl.DateTimeFormat("en-CA", {
47072
47139
  timeZone: zone,
@@ -47086,7 +47153,7 @@ var weekKey = /* @__PURE__ */ __name((day3) => {
47086
47153
  return date3.toISOString().slice(0, 10);
47087
47154
  }, "weekKey");
47088
47155
 
47089
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/retention.js
47156
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/retention.js
47090
47157
  var RETENTION_TOLERANCE = 864e5;
47091
47158
  var validateRetentionOptions = /* @__PURE__ */ __name((options) => {
47092
47159
  const { since, until, cutoff, checkpoints, within, limit, by } = options;
@@ -47140,7 +47207,7 @@ var retentionCohorts = /* @__PURE__ */ __name((stays, options) => {
47140
47207
  return [...groups.values()].sort((a, b) => a.cohort.localeCompare(b.cohort));
47141
47208
  }, "retentionCohorts");
47142
47209
 
47143
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
47210
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/retention.js
47144
47211
  var iso11 = /* @__PURE__ */ __name((at2) => new Date(at2).toISOString(), "iso");
47145
47212
  var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId, options, evidence) => {
47146
47213
  validateRetentionOptions(options);
@@ -47271,7 +47338,7 @@ var retentionQuery = /* @__PURE__ */ __name((context, accountPk2, chatPk, chatId
47271
47338
  };
47272
47339
  }, "retentionQuery");
47273
47340
 
47274
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
47341
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/roster.js
47275
47342
  var iso12 = /* @__PURE__ */ __name((ms) => ms === null ? null : new Date(ms).toISOString(), "iso");
47276
47343
  var marksOf = /* @__PURE__ */ __name(({ isBot: isBot2, flagged, deleted, hasPhoto }) => ({
47277
47344
  ...isBot2 === void 0 ? {} : { bot: isBot2 },
@@ -47400,7 +47467,7 @@ var trackedChats = /* @__PURE__ */ __name((context, accountKey, where) => contex
47400
47467
  lastCount: memberCountsOf(context, pk).at(-1) ?? null
47401
47468
  })), "trackedChats");
47402
47469
 
47403
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/roster.js
47470
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/roster.js
47404
47471
  var rosterStoreOver = /* @__PURE__ */ __name((context) => {
47405
47472
  const { database } = context;
47406
47473
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, writeMembers: writeMembers2 } = keysOver(context);
@@ -47456,7 +47523,7 @@ var rosterStoreOver = /* @__PURE__ */ __name((context) => {
47456
47523
  };
47457
47524
  }, "rosterStoreOver");
47458
47525
 
47459
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
47526
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/backfill.js
47460
47527
  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");
47461
47528
  var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatch, until = /* @__PURE__ */ __name(() => false, "until") } = {}) => {
47462
47529
  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 ?`);
@@ -47480,7 +47547,7 @@ var backfillNormalized = /* @__PURE__ */ __name((database, { batch = 5e3, onBatc
47480
47547
  }
47481
47548
  }, "backfillNormalized");
47482
47549
 
47483
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
47550
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/search-index.js
47484
47551
  var INDEX2 = "message_words";
47485
47552
  var searchIndexState2 = /* @__PURE__ */ __name((database) => {
47486
47553
  const row2 = indexRow(database, INDEX2);
@@ -47607,7 +47674,7 @@ var resetSearchIndex = /* @__PURE__ */ __name((database) => {
47607
47674
  });
47608
47675
  }, "resetSearchIndex");
47609
47676
 
47610
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
47677
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/stems-fill.js
47611
47678
  var fillStems = /* @__PURE__ */ __name((database, { batch = 5e3, until = /* @__PURE__ */ __name(() => false, "until"), onBatch, now: now2 = Date.now } = {}) => {
47612
47679
  const filled = { stemmed: 0, drained: 0 };
47613
47680
  const before2 = stemsState(database);
@@ -47702,7 +47769,7 @@ var followDefaultStemmers = /* @__PURE__ */ __name((database, now2 = Date.now) =
47702
47769
  return resetStems(database, { now: now2 });
47703
47770
  }, "followDefaultStemmers");
47704
47771
 
47705
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
47772
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/words.js
47706
47773
  var VOCABULARY = "SELECT term, doc FROM message_words_vocab WHERE col = 'normalized_text'";
47707
47774
  var knownTerms = /* @__PURE__ */ __name(({ database }, terms) => {
47708
47775
  const lookup = database.prepare(`${VOCABULARY} AND term >= ? AND term <= ? LIMIT 1`);
@@ -47724,7 +47791,7 @@ var termCandidates = /* @__PURE__ */ __name(({ database }, pieces, { shortest, l
47724
47791
  });
47725
47792
  }, "termCandidates");
47726
47793
 
47727
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/search-index.js
47794
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/search-index.js
47728
47795
  var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
47729
47796
  const { database } = context;
47730
47797
  const stemmerFor2 = stemmerCache();
@@ -47749,7 +47816,7 @@ var searchIndexStoreOver = /* @__PURE__ */ __name((context) => {
47749
47816
  };
47750
47817
  }, "searchIndexStoreOver");
47751
47818
 
47752
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
47819
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/searches.js
47753
47820
  var HISTORY_KEPT = 1e3;
47754
47821
  var commandFilter = /* @__PURE__ */ __name((commands) => commands ? { sql: ` AND command IN (${commands.map(() => "?").join(", ")})`, values: [...commands] } : { sql: "", values: [] }, "commandFilter");
47755
47822
  var COLUMNS6 = "id, name, command, params, language, version, fields_version, created_at, updated_at, last_run_at, runs";
@@ -47819,7 +47886,7 @@ var clearHistory = /* @__PURE__ */ __name(({ database }, commands) => {
47819
47886
  return database.prepare(`DELETE FROM searches WHERE name IS NULL${only.sql}`).run(...only.values).changes;
47820
47887
  }, "clearHistory");
47821
47888
 
47822
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/searches.js
47889
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/searches.js
47823
47890
  var searchesStoreOver = /* @__PURE__ */ __name((context) => {
47824
47891
  const { database } = context;
47825
47892
  return {
@@ -47843,7 +47910,7 @@ var searchesStoreOver = /* @__PURE__ */ __name((context) => {
47843
47910
  };
47844
47911
  }, "searchesStoreOver");
47845
47912
 
47846
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/added-sources.js
47913
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/added-sources.js
47847
47914
  import { createHash as createHash12 } from "node:crypto";
47848
47915
  var ADDED_KINDS = ["text", "file", "page"];
47849
47916
  var TEXT_COLUMNS = "kind = ?, title = ?, file_name = ?, extension = ?, url = ?, mime = ?, size = ?, content_hash = ?, body = ?, extraction = ?, metadata = ?, language = ?";
@@ -48085,7 +48152,7 @@ var addedSourcesOver = /* @__PURE__ */ __name((context) => {
48085
48152
  };
48086
48153
  }, "addedSourcesOver");
48087
48154
 
48088
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
48155
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/agent-actions.js
48089
48156
  var ACTION_TIERS = ["read", "draft", "write-private", "write-public", "destructive", "admin"];
48090
48157
  var ACTION_OUTCOMES = ["ok", "refused", "failed"];
48091
48158
  var CODE = /^[a-z][a-z0-9_]{0,63}$/;
@@ -48133,7 +48200,7 @@ var agentActionsStoreOver = /* @__PURE__ */ __name((context, afterRecord = () =>
48133
48200
  };
48134
48201
  }, "agentActionsStoreOver");
48135
48202
 
48136
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/base-suggest.js
48203
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/base-suggest.js
48137
48204
  var baseSettingKey = /* @__PURE__ */ __name((kind3) => `stages.base.${kind3}`, "baseSettingKey");
48138
48205
  var storedPipeline = /* @__PURE__ */ __name((value) => {
48139
48206
  if (typeof value !== "string")
@@ -48179,11 +48246,11 @@ var suggestBaseStages = /* @__PURE__ */ __name((database, kind3, pipelines2, { o
48179
48246
  }
48180
48247
  }, "suggestBaseStages");
48181
48248
 
48182
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/copy-viewer.js
48249
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/copy-viewer.js
48183
48250
  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");
48184
48251
  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");
48185
48252
 
48186
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/records.js
48253
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/records.js
48187
48254
  import { createHash as createHash13 } from "node:crypto";
48188
48255
  var RECORDS_SCHEMA_VERSION = 1;
48189
48256
  var RECORD_OPERATIONS = ["upsert", "delete"];
@@ -48514,7 +48581,7 @@ var fieldReferences = /* @__PURE__ */ __name((record3, options = {}) => {
48514
48581
  return found2;
48515
48582
  }, "fieldReferences");
48516
48583
 
48517
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-rows.js
48584
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-rows.js
48518
48585
  var TABLES2 = { deal: "deals", lead: "leads" };
48519
48586
  var MONEY_REFUSALS = ["money.currency", "money.amount"];
48520
48587
  var amountFault = /* @__PURE__ */ __name((item, code) => {
@@ -48686,7 +48753,7 @@ var crmRowsOver = /* @__PURE__ */ __name((context) => {
48686
48753
  return { savePipeline, saveItemRow };
48687
48754
  }, "crmRowsOver");
48688
48755
 
48689
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-activities.js
48756
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-activities.js
48690
48757
  var ACTIVITY_RECORD = "crm.activity";
48691
48758
  var forgetActivitiesOn = /* @__PURE__ */ __name((database, accountId, kind3, externalIds, at2) => {
48692
48759
  const removed = "rr.target_type = ? AND rr.target_external_id IN (SELECT value FROM json_each(?))";
@@ -48874,7 +48941,7 @@ var seenSql = /* @__PURE__ */ __name((viewer) => {
48874
48941
  };
48875
48942
  }, "seenSql");
48876
48943
 
48877
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-stage-entries.js
48944
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-stage-entries.js
48878
48945
  var STAGE_ENTRY_RECORD = "crm.stage-entry";
48879
48946
  var STAGE_ENTRY_DAYS = 90;
48880
48947
  var STAGE_TASK_DAYS = 7;
@@ -48944,7 +49011,7 @@ var crmStageEntriesOver = /* @__PURE__ */ __name((context) => {
48944
49011
  return { save: save2, pending, handled, expire };
48945
49012
  }, "crmStageEntriesOver");
48946
49013
 
48947
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/stage-amounts.js
49014
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/stage-amounts.js
48948
49015
  var TABLES3 = { deal: "deals", lead: "leads" };
48949
49016
  var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, { since, until }, viewer) => {
48950
49017
  const seen = viewerSql("d", viewer);
@@ -48962,7 +49029,7 @@ var stageAmountsOf = /* @__PURE__ */ __name(({ database }, kind3, stageIds, { si
48962
49029
  });
48963
49030
  }, "stageAmountsOf");
48964
49031
 
48965
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/pipeline-period.js
49032
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/pipeline-period.js
48966
49033
  var TABLES4 = { deal: "deals", lead: "leads" };
48967
49034
  var DAY7 = 864e5;
48968
49035
  var LOST_REASONS = 10;
@@ -49119,7 +49186,7 @@ var pipelinePeriod = /* @__PURE__ */ __name((context, pipeline, window, zone, vi
49119
49186
  };
49120
49187
  }, "pipelinePeriod");
49121
49188
 
49122
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/deals.js
49189
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/deals.js
49123
49190
  var TABLES5 = { deal: "deals", lead: "leads" };
49124
49191
  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");
49125
49192
  var MAX_STAGES = 30;
@@ -49534,12 +49601,12 @@ var dealOperationsOver = /* @__PURE__ */ __name((context) => {
49534
49601
  found2 = search2(queryWith(fixes));
49535
49602
  }
49536
49603
  }
49537
- const ranked = found2.sort((a, b) => b.score - a.score || Number(b.row.updated_at) - Number(a.row.updated_at) || Number(b.row.id) - Number(a.row.id)).slice(offset, offset + most + 1).map(({ kind: kind3, row: row2, matched }) => ({
49604
+ const ranked2 = found2.sort((a, b) => b.score - a.score || Number(b.row.updated_at) - Number(a.row.updated_at) || Number(b.row.id) - Number(a.row.id)).slice(offset, offset + most + 1).map(({ kind: kind3, row: row2, matched }) => ({
49538
49605
  ...read2(`${kind3}:${row2.id}`),
49539
49606
  matched,
49540
49607
  ...corrections ? { corrections } : {}
49541
49608
  }));
49542
- return pageOfRows(ranked, most, offset);
49609
+ return pageOfRows(ranked2, most, offset);
49543
49610
  }, "find"),
49544
49611
  setProject: /* @__PURE__ */ __name((reference2, { project: project2, by }) => {
49545
49612
  authorActor(context, by);
@@ -49592,7 +49659,7 @@ var dealsStoreOver = /* @__PURE__ */ __name((context) => {
49592
49659
  };
49593
49660
  }, "dealsStoreOver");
49594
49661
 
49595
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/owner-languages.js
49662
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/owner-languages.js
49596
49663
  var KEY2 = "ownerLanguages";
49597
49664
  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(" "));
49598
49665
  var DEFAULT_OWNER_LANGUAGES = ["ru"];
@@ -49622,7 +49689,7 @@ var saveOwnerLanguages = /* @__PURE__ */ __name((database, languages, now2) => {
49622
49689
  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);
49623
49690
  }, "saveOwnerLanguages");
49624
49691
 
49625
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/base-stages.js
49692
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/base-stages.js
49626
49693
  var OUTCOMES = {
49627
49694
  lead: ["open", "open", "open", "won", "lost"],
49628
49695
  deal: ["open", "open", "open", "open", "won", "lost"]
@@ -49955,7 +50022,7 @@ var baseStagesStoreOver = /* @__PURE__ */ __name((context) => {
49955
50022
  };
49956
50023
  }, "baseStagesStoreOver");
49957
50024
 
49958
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
50025
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/bot-updates.js
49959
50026
  var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
49960
50027
  }) => {
49961
50028
  const { database, now: now2 } = context;
@@ -50014,7 +50081,7 @@ var botUpdateStoreOver = /* @__PURE__ */ __name((context, afterSave = () => {
50014
50081
  };
50015
50082
  }, "botUpdateStoreOver");
50016
50083
 
50017
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projection.js
50084
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projection.js
50018
50085
  var IMPORTER = { bot: "import" };
50019
50086
  var importersProposal = /* @__PURE__ */ __name((entity) => entity.review === "proposed" && entity.author.type === "bot" && entity.author.name === IMPORTER.bot, "importersProposal");
50020
50087
  var codeOf = /* @__PURE__ */ __name((error) => {
@@ -50059,7 +50126,7 @@ var moneyLinesOf = /* @__PURE__ */ __name((projection, list2) => (Array.isArray(
50059
50126
  };
50060
50127
  }), "moneyLinesOf");
50061
50128
 
50062
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/relation-role-labels.js
50129
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/relation-role-labels.js
50063
50130
  var label = /* @__PURE__ */ __name((en, ru, es) => ({ en, ru, es }), "label");
50064
50131
  var ROLE_LABELS = {
50065
50132
  organization: {
@@ -50100,7 +50167,7 @@ var ROLE_LABELS = {
50100
50167
  }
50101
50168
  };
50102
50169
 
50103
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-roles.js
50170
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-roles.js
50104
50171
  var settingOf = /* @__PURE__ */ __name((list2) => `relationships.roles.${list2}`, "settingOf");
50105
50172
  var isList = /* @__PURE__ */ __name((list2) => Object.hasOwn(ROLE_LISTS, list2), "isList");
50106
50173
  var listOf2 = /* @__PURE__ */ __name((list2) => {
@@ -50184,7 +50251,7 @@ var relationRolesOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
50184
50251
  };
50185
50252
  }, "relationRolesOver");
50186
50253
 
50187
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-settings.js
50254
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-settings.js
50188
50255
  var CRM_LINK_MODES = ["reported", "review"];
50189
50256
  var COMPANY_TYPE_MEANINGS = ["customer-of", "supplier", "partner-of"];
50190
50257
  var CRM_SCOPES = ["mine", "all"];
@@ -50415,7 +50482,7 @@ var crmSettingsOf = /* @__PURE__ */ __name((database) => database.prepare("SELEC
50415
50482
  return [{ setting: String(row2.key), value: settingValue(database, parsed5.key, parsed5.name) }];
50416
50483
  }), "crmSettingsOf");
50417
50484
 
50418
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
50485
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-proposals.js
50419
50486
  var isoOf = /* @__PURE__ */ __name((ms) => ms === void 0 ? null : new Date(ms).toISOString(), "isoOf");
50420
50487
  var relationOf = /* @__PURE__ */ __name((link3, now2) => ({
50421
50488
  id: link3.id,
@@ -50775,7 +50842,7 @@ var decidedOrigin = /* @__PURE__ */ __name((by) => by === "owner" ? { origin: "o
50775
50842
  provenance: `agent:${by.bot} for the owner: ${by.reason.trim()}`
50776
50843
  }, "decidedOrigin");
50777
50844
 
50778
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/reported-relations.js
50845
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/reported-relations.js
50779
50846
  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");
50780
50847
  var metadataOf = /* @__PURE__ */ __name((relation) => relation.metadata && Object.keys(relation.metadata).length ? JSON.stringify(relation.metadata) : null, "metadataOf");
50781
50848
  var syncReportedIn = /* @__PURE__ */ __name((context, key2, relationships, scope3, { source: source2 = "import", by = { bot: key2.provider, kind: "rule" }, onOutcome } = {}) => {
@@ -50913,7 +50980,7 @@ var relationsStoreOver = /* @__PURE__ */ __name((context) => ({
50913
50980
  syncReported: /* @__PURE__ */ __name(async (key2, relationships, scope3, options) => write(context.database, () => syncReportedIn(context, key2, relationships, scope3, options)), "syncReported")
50914
50981
  }), "relationsStoreOver");
50915
50982
 
50916
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relationships.js
50983
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relationships.js
50917
50984
  var importSource = /* @__PURE__ */ __name((provider) => `import:${provider}`, "importSource");
50918
50985
  var noRelationships = /* @__PURE__ */ __name(() => ({
50919
50986
  added: 0,
@@ -51103,7 +51170,7 @@ var recordRelationshipsOver = /* @__PURE__ */ __name((context) => {
51103
51170
  return { report, placeOf: placeOf2, withdrawFrom };
51104
51171
  }, "recordRelationshipsOver");
51105
51172
 
51106
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/business-contracts.js
51173
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/business-contracts.js
51107
51174
  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";
51108
51175
  var DAY_MS2 = 864e5;
51109
51176
  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");
@@ -51262,7 +51329,7 @@ var contractsStoreOver = /* @__PURE__ */ __name((context) => {
51262
51329
  };
51263
51330
  }, "contractsStoreOver");
51264
51331
 
51265
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/business-search.js
51332
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/business-search.js
51266
51333
  var BUSINESS_FIND_MAX = 2001;
51267
51334
  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");
51268
51335
  var partyName = /* @__PURE__ */ __name((as) => `coalesce(${as}p.name, ${as}o.name, ${as}j.name)`, "partyName");
@@ -51367,7 +51434,7 @@ var businessSearchOver = /* @__PURE__ */ __name(({ database }) => {
51367
51434
  };
51368
51435
  }, "businessSearchOver");
51369
51436
 
51370
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
51437
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/catalog.js
51371
51438
  var CATALOG_QUERY = defineQuery({
51372
51439
  entity: "document",
51373
51440
  backend: "sql",
@@ -51600,10 +51667,10 @@ var catalogStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
51600
51667
  };
51601
51668
  }, "catalogStoreOver");
51602
51669
 
51603
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/content.js
51670
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/content.js
51604
51671
  import { createHash as createHash14 } from "node:crypto";
51605
51672
 
51606
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-files.js
51673
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-files.js
51607
51674
  import { sep } from "node:path";
51608
51675
  var MOST = 500;
51609
51676
  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");
@@ -51728,7 +51795,7 @@ var crmFilesOver = /* @__PURE__ */ __name((context) => {
51728
51795
  };
51729
51796
  }, "crmFilesOver");
51730
51797
 
51731
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/content.js
51798
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/content.js
51732
51799
  var MOST2 = 500;
51733
51800
  var TABLE = {
51734
51801
  author: "content_authors",
@@ -52007,7 +52074,7 @@ var contentStoreOver = /* @__PURE__ */ __name((context) => {
52007
52074
  };
52008
52075
  }, "contentStoreOver");
52009
52076
 
52010
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
52077
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/context-document-source.js
52011
52078
  var remote = /* @__PURE__ */ __name(() => `CASE WHEN json_valid(n.front_matter) THEN json_extract(n.front_matter,'$.source') IN (${documentAccountProvidersSql()}) ELSE 0 END`, "remote");
52012
52079
  var field3 = /* @__PURE__ */ __name((name) => `CASE WHEN (${remote()}) THEN
52013
52080
  CASE WHEN json_type(n.front_matter,'$.${name}')='text' THEN json_extract(n.front_matter,'$.${name}') END END`, "field");
@@ -52020,7 +52087,7 @@ var contextDocumentTimeKind = /* @__PURE__ */ __name(() => `CASE WHEN (${remoteT
52020
52087
  THEN 'source-modified' ELSE 'stored-update' END`, "contextDocumentTimeKind");
52021
52088
  var contextDocumentUrl = /* @__PURE__ */ __name(() => `coalesce(${preferred("url")},n.url,${field3("sourceUrl")})`, "contextDocumentUrl");
52022
52089
 
52023
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
52090
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/context-meeting-source.js
52024
52091
  var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
52025
52092
  const { source: source2, words: words4, after: after2, before: before2, limit, maxReadBytes, cursor, signal } = request;
52026
52093
  signal?.throwIfAborted();
@@ -52119,7 +52186,7 @@ var readMeetingContextEvidence = /* @__PURE__ */ __name((database, request) => {
52119
52186
  });
52120
52187
  }, "readMeetingContextEvidence");
52121
52188
 
52122
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
52189
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/context-evidence.js
52123
52190
  var corpora = {
52124
52191
  message: {
52125
52192
  table: "messages",
@@ -52364,7 +52431,7 @@ var contextRecordsOver = /* @__PURE__ */ __name(({ database }) => ({
52364
52431
  }
52365
52432
  }), "contextRecordsOver");
52366
52433
 
52367
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-changes.js
52434
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-changes.js
52368
52435
  var CRM_CHANGES = [
52369
52436
  "created",
52370
52437
  "moved",
@@ -52507,7 +52574,7 @@ var crmReadsOver = /* @__PURE__ */ __name((context) => {
52507
52574
  };
52508
52575
  }, "crmReadsOver");
52509
52576
 
52510
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-contacts.js
52577
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/crm-contacts.js
52511
52578
  var PLACEHOLDER = /(?:^|\s)null(?:\s+#\d+)?(?=\s|$)/gi;
52512
52579
  var withoutPlaceholder = /* @__PURE__ */ __name((name) => name.replace(PLACEHOLDER, " ").replace(/\s+/g, " ").trim() || null, "withoutPlaceholder");
52513
52580
  var DryRun = class extends Error {
@@ -52586,7 +52653,7 @@ var removeCrmContacts = /* @__PURE__ */ __name((context, key2, { users, before:
52586
52653
  }
52587
52654
  }, "removeCrmContacts");
52588
52655
 
52589
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/crm.js
52656
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/crm.js
52590
52657
  var PENDING = "crm:pending-relations";
52591
52658
  var PENDING_DAYS = 30;
52592
52659
  var PENDING_MOST = 5e3;
@@ -53141,10 +53208,10 @@ var crmCopiesOver = /* @__PURE__ */ __name((context, people2) => {
53141
53208
  };
53142
53209
  }, "crmCopiesOver");
53143
53210
 
53144
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
53211
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
53145
53212
  import { createHash as createHash15, randomBytes as randomBytes2 } from "node:crypto";
53146
53213
 
53147
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/decision-requests.js
53214
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/decision-requests.js
53148
53215
  var DECISION_ACTIONS = ["confirm", "reject", "ask-confirm", "ask-reject", "back", "later"];
53149
53216
  var DECISION_TTL_MS = 72 * 60 * 60 * 1e3;
53150
53217
  var CALLBACK_PREFIX = "wcr1:";
@@ -53158,7 +53225,7 @@ var callbackDataOf = /* @__PURE__ */ __name((token) => {
53158
53225
  }, "callbackDataOf");
53159
53226
  var parseCallbackData = /* @__PURE__ */ __name((data) => typeof data === "string" ? CALLBACK.exec(data)?.[1] : void 0, "parseCallbackData");
53160
53227
 
53161
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
53228
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/decision-requests.js
53162
53229
  var digestOf = /* @__PURE__ */ __name((token) => createHash15("sha256").update(token).digest("hex"), "digestOf");
53163
53230
  var newToken = /* @__PURE__ */ __name(() => randomBytes2(16).toString("base64url"), "newToken");
53164
53231
  var requestOf = /* @__PURE__ */ __name((row2) => ({
@@ -53257,7 +53324,7 @@ var decisionRequestStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
53257
53324
  };
53258
53325
  }, "decisionRequestStoreOver");
53259
53326
 
53260
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-listing.js
53327
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-listing.js
53261
53328
  var MEETING_ROW_KINDS = ["meeting", "call", "event"];
53262
53329
  var DAY9 = 864e5;
53263
53330
  var JOINED = `(SELECT ce.event_id FROM calendar_entries ce JOIN events je ON je.id = ce.event_id
@@ -53644,7 +53711,7 @@ var meetingListingOver = /* @__PURE__ */ __name((context) => {
53644
53711
  };
53645
53712
  }, "meetingListingOver");
53646
53713
 
53647
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/document-listing.js
53714
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/document-listing.js
53648
53715
  var DOCUMENT_KINDS = [
53649
53716
  "transcript",
53650
53717
  "doc",
@@ -53820,11 +53887,11 @@ var documentListingOver = /* @__PURE__ */ __name((context) => {
53820
53887
  return { items: [], total: 0 };
53821
53888
  const where = scoped(filter, whereOf(filter.query, filter.zone, filter.now));
53822
53889
  const from2 = filter.ids ? `${FROM2} JOIN json_each(?) k ON k.value = d.id` : FROM2;
53823
- const ranked = filter.ids ? [JSON.stringify(filter.ids)] : [];
53890
+ const ranked2 = filter.ids ? [JSON.stringify(filter.ids)] : [];
53824
53891
  const order = filter.ids ? "k.key" : `${MODIFIED} DESC, d.id DESC`;
53825
53892
  return read(database, () => {
53826
- const total = Number(database.prepare(`SELECT count(*) AS n ${from2} WHERE ${where.sql}`).get(...ranked, ...where.params)?.n);
53827
- const page3 = database.prepare(`SELECT d.id ${from2} WHERE ${where.sql} ORDER BY ${order} LIMIT ? OFFSET ?`).all(...ranked, ...where.params, filter.limit, filter.offset).map(({ id: id2 }) => Number(id2));
53893
+ const total = Number(database.prepare(`SELECT count(*) AS n ${from2} WHERE ${where.sql}`).get(...ranked2, ...where.params)?.n);
53894
+ const page3 = database.prepare(`SELECT d.id ${from2} WHERE ${where.sql} ORDER BY ${order} LIMIT ? OFFSET ?`).all(...ranked2, ...where.params, filter.limit, filter.offset).map(({ id: id2 }) => Number(id2));
53828
53895
  const found2 = database.prepare(`SELECT ${COLUMNS8} ${FROM2} JOIN json_each(?) p ON p.value = d.id ORDER BY p.key`).all(JSON.stringify(page3));
53829
53896
  return { items: found2.map(rowOf3), total };
53830
53897
  });
@@ -53881,7 +53948,7 @@ var documentListingOver = /* @__PURE__ */ __name((context) => {
53881
53948
  };
53882
53949
  }, "documentListingOver");
53883
53950
 
53884
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
53951
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/note-search.js
53885
53952
  var NOTE_FIELDS = [
53886
53953
  "text",
53887
53954
  "exact",
@@ -54215,13 +54282,13 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
54215
54282
  return texts2.get(owner);
54216
54283
  };
54217
54284
  }, "textsOf");
54218
- const chunkOf = /* @__PURE__ */ __name((row2, textOf8) => {
54285
+ const chunkOf = /* @__PURE__ */ __name((row2, textOf9) => {
54219
54286
  if (Number(row2.position) === ENRICHMENT_POSITION) {
54220
54287
  const [type, id2] = String(row2.owner).split(":");
54221
54288
  const text10 = enrichmentText(database, String(type), Number(id2));
54222
54289
  return text10 === void 0 ? void 0 : { hash: String(row2.hash), text: text10 };
54223
54290
  }
54224
- const text9 = textOf8(String(row2.owner));
54291
+ const text9 = textOf9(String(row2.owner));
54225
54292
  return text9 === void 0 ? void 0 : { hash: String(row2.hash), text: text9.slice(Number(row2.start), Number(row2.end)) };
54226
54293
  }, "chunkOf");
54227
54294
  return {
@@ -54272,8 +54339,8 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
54272
54339
  return Number(row2?.left ?? 0);
54273
54340
  }, "chunksLeft"),
54274
54341
  chunksToEmbed: /* @__PURE__ */ __name(async (model, { after: after2, limit }) => {
54275
- const textOf8 = textsOf();
54276
- return pendingChunks(model, after2, limit).flatMap((row2) => chunkOf(row2, textOf8) ?? []);
54342
+ const textOf9 = textsOf();
54343
+ return pendingChunks(model, after2, limit).flatMap((row2) => chunkOf(row2, textOf9) ?? []);
54277
54344
  }, "chunksToEmbed"),
54278
54345
  embedded: /* @__PURE__ */ __name(async (model, { folderIds, withInternal, source: source2 }) => {
54279
54346
  drain();
@@ -54300,7 +54367,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
54300
54367
  end: Number(row2.end)
54301
54368
  });
54302
54369
  }, "keep");
54303
- const ranked = /* @__PURE__ */ __name((best) => [...best.entries()].sort(([, a], [, b]) => b.score - a.score || a.first - b.first).slice(0, limit), "ranked");
54370
+ const ranked2 = /* @__PURE__ */ __name((best) => [...best.entries()].sort(([, a], [, b]) => b.score - a.score || a.first - b.first).slice(0, limit), "ranked");
54304
54371
  const indexed = /* @__PURE__ */ __name(() => {
54305
54372
  const types = source2 === void 0 ? ["document", "note"] : source2 === "file" ? ["document"] : ["note"];
54306
54373
  const accounts2 = database.prepare("SELECT DISTINCT coalesce(account_id, 0) AS account FROM chunks WHERE chunkable_type = ?");
@@ -54323,7 +54390,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
54323
54390
  const [kind3, owner] = key2.split(":");
54324
54391
  held2.first = Number(first.get(model, String(kind3), Number(owner), ...scope3.params)?.first);
54325
54392
  }
54326
- const results = ranked(best);
54393
+ const results = ranked2(best);
54327
54394
  return { results, best: results.map(([, { chunk }]) => chunk) };
54328
54395
  });
54329
54396
  if (!found2)
@@ -54331,7 +54398,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
54331
54398
  for (const [key2, held2] of found2)
54332
54399
  merged2.set(key2, held2);
54333
54400
  }
54334
- return ranked(merged2);
54401
+ return ranked2(merged2);
54335
54402
  }, "indexed");
54336
54403
  const scanned = /* @__PURE__ */ __name(() => {
54337
54404
  const page3 = database.prepare(`SELECT ${columns2} WHERE k.id > ?${scope3.sql} ORDER BY k.id LIMIT ?`);
@@ -54346,7 +54413,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
54346
54413
  break;
54347
54414
  after2 = Number(last.id);
54348
54415
  }
54349
- return ranked(best);
54416
+ return ranked2(best);
54350
54417
  }, "scanned");
54351
54418
  return (indexed() ?? scanned()).flatMap(([key2, { score, start, end }]) => {
54352
54419
  const [type, id2] = key2.split(":");
@@ -54378,7 +54445,7 @@ var noteSearchOver = /* @__PURE__ */ __name((context) => {
54378
54445
  };
54379
54446
  }, "noteSearchOver");
54380
54447
 
54381
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
54448
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/event-search.js
54382
54449
  var EVENT_FIELDS = ["text", "exact", "body", "title", "date", "in"];
54383
54450
  var inEventAccounts = /* @__PURE__ */ __name((event2) => searchableCopy(event2, "c.account_id IN (SELECT CAST(value AS INTEGER) FROM json_each(?))"), "inEventAccounts");
54384
54451
  var EVENT_CORPUS = {
@@ -54512,13 +54579,13 @@ var eventSearchOver = /* @__PURE__ */ __name((context) => {
54512
54579
  break;
54513
54580
  after2 = Number(last.id);
54514
54581
  }
54515
- const ranked = [...best.entries()].map(([id2, score]) => ({ id: id2, score })).sort((a, b) => b.score - a.score);
54516
- return read(database, () => grouped(ranked, accountIds).slice(0, limit).map(({ first, hit }) => ({ ...hit, score: first.score })));
54582
+ const ranked2 = [...best.entries()].map(([id2, score]) => ({ id: id2, score })).sort((a, b) => b.score - a.score);
54583
+ return read(database, () => grouped(ranked2, accountIds).slice(0, limit).map(({ first, hit }) => ({ ...hit, score: first.score })));
54517
54584
  }, "nearest")
54518
54585
  };
54519
54586
  }, "eventSearchOver");
54520
54587
 
54521
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
54588
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/facts.js
54522
54589
  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";
54523
54590
  var iso14 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
54524
54591
  var oneOf5 = /* @__PURE__ */ __name((value, allowed, what) => {
@@ -54781,7 +54848,7 @@ var factsStoreOver = /* @__PURE__ */ __name((context) => {
54781
54848
  };
54782
54849
  }, "factsStoreOver");
54783
54850
 
54784
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
54851
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/findings-core.js
54785
54852
  var invalid6 = /* @__PURE__ */ __name((message3) => {
54786
54853
  throw new CliError("validation_error", message3);
54787
54854
  }, "invalid");
@@ -54949,7 +55016,7 @@ var findingsCoreOver = /* @__PURE__ */ __name((context, kind3) => {
54949
55016
  return { snapshot: snapshot2, snapshotParts, previous, settle, keepWaiting, named: named2, sameDecision, create };
54950
55017
  }, "findingsCoreOver");
54951
55018
 
54952
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
55019
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/evidence-findings.js
54953
55020
  var stale = /* @__PURE__ */ __name(() => {
54954
55021
  throw new CliError("validation_error", "evidence findings changed since they were read; stage a new batch", {
54955
55022
  reason: "evidence-findings.stale"
@@ -55213,7 +55280,7 @@ var evidenceFindingsStoreOver = /* @__PURE__ */ __name((context) => {
55213
55280
  };
55214
55281
  }, "evidenceFindingsStoreOver");
55215
55282
 
55216
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
55283
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/involvements.js
55217
55284
  var pendingInvolvements = /* @__PURE__ */ __name((database) => Number(database.prepare("SELECT count(*) AS n FROM involvement_pending").get()?.n ?? 0), "pendingInvolvements");
55218
55285
  var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => ({
55219
55286
  rebuild: /* @__PURE__ */ __name((personId) => write(database, () => {
@@ -55267,7 +55334,7 @@ var involvementStoreOver = /* @__PURE__ */ __name(({ database, now: now2 }) => (
55267
55334
  }, "forPerson")
55268
55335
  }), "involvementStoreOver");
55269
55336
 
55270
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/labelled.js
55337
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/labelled.js
55271
55338
  var LABELLED = {
55272
55339
  note: "note",
55273
55340
  document: "document",
@@ -55280,7 +55347,7 @@ var LABELLED = {
55280
55347
  };
55281
55348
  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");
55282
55349
 
55283
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
55350
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-projects.js
55284
55351
  import { createHash as createHash16 } from "node:crypto";
55285
55352
  var fields3 = "id,from_id,to_id,source,confirmed,updated_at,length(evidence) AS evidenceLength,substr(evidence,1,2000) AS evidence";
55286
55353
  var id = /* @__PURE__ */ __name((value) => {
@@ -55366,7 +55433,7 @@ var meetingProjectsStoreOver = /* @__PURE__ */ __name(({ database, now: now2 })
55366
55433
  };
55367
55434
  }, "meetingProjectsStoreOver");
55368
55435
 
55369
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
55436
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
55370
55437
  var ORGANIZATIONS_QUERY = {
55371
55438
  entity: "organization",
55372
55439
  backend: "sql",
@@ -55407,7 +55474,7 @@ var REMINDERS_QUERY = {
55407
55474
  })
55408
55475
  };
55409
55476
 
55410
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/organization-categories.js
55477
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/organization-categories.js
55411
55478
  var OWN2 = "(SELECT id FROM organizations WHERE deleted_at IS NULL AND json_extract(metadata, '$.own') = 1)";
55412
55479
  var EMPLOYED = "('employee', 'contractor', 'founder')";
55413
55480
  var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now2) => {
@@ -55428,7 +55495,7 @@ var categorySql = /* @__PURE__ */ __name(({ category, accounts: accounts2 }, now
55428
55495
  return { sql: `EXISTS (SELECT 1 FROM links l WHERE ${where} AND ${usable})`, params: keys };
55429
55496
  }, "categorySql");
55430
55497
 
55431
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
55498
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/organizations.js
55432
55499
  var organizationOf2 = /* @__PURE__ */ __name((row2) => ({
55433
55500
  id: String(row2.id),
55434
55501
  ref: `organization:${row2.id}`,
@@ -55477,7 +55544,7 @@ var organizationsReadsOver = /* @__PURE__ */ __name(({ database, now: now2 }) =>
55477
55544
  }), "setOwnOrganization")
55478
55545
  }), "organizationsReadsOver");
55479
55546
 
55480
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-list.js
55547
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-list.js
55481
55548
  var KINDS = RELATION_KINDS.map(linkKind).join(", ");
55482
55549
  var ACCOUNT_ENDS = [
55483
55550
  ["deal", "deals"],
@@ -55640,13 +55707,13 @@ var relationListOver = /* @__PURE__ */ __name((context) => {
55640
55707
  __name(proposalItem, "proposalItem");
55641
55708
  }, "relationListOver");
55642
55709
 
55643
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-reads.js
55710
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/relation-reads.js
55644
55711
  var relationReadsOver = /* @__PURE__ */ __name((context) => ({
55645
55712
  ...relationListOver(context),
55646
55713
  ...relationRolesOver(context)
55647
55714
  }), "relationReadsOver");
55648
55715
 
55649
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review.js
55716
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/source-review.js
55650
55717
  var TABLES6 = { memory: "memories", fact: "facts" };
55651
55718
  var RETIRED = /* @__PURE__ */ new Set(["superseded", "reversed", "rejected", "stale"]);
55652
55719
  var DEFAULT_LIMIT = 500;
@@ -55889,16 +55956,16 @@ var sourceReviewStoreOver = /* @__PURE__ */ __name((context) => {
55889
55956
  };
55890
55957
  }, "sourceReviewStoreOver");
55891
55958
 
55892
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
55959
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
55893
55960
  import { createHash as createHash19 } from "node:crypto";
55894
55961
 
55895
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
55962
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
55896
55963
  import { createHash as createHash18 } from "node:crypto";
55897
55964
 
55898
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
55965
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
55899
55966
  import { createHash as createHash17 } from "node:crypto";
55900
55967
 
55901
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
55968
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-input.js
55902
55969
  var consolidationId = /* @__PURE__ */ __name((value, field4) => {
55903
55970
  if (typeof value !== "string" || !/^[1-9]\d*$/.test(value) || !Number.isSafeInteger(Number(value)))
55904
55971
  throw new CliError("validation_error", `${field4} must be a positive canonical tag id`);
@@ -55949,7 +56016,7 @@ var consolidationApplyInput = /* @__PURE__ */ __name((options) => {
55949
56016
  return input;
55950
56017
  }, "consolidationApplyInput");
55951
56018
 
55952
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
56019
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation-apply.js
55953
56020
  var receiptOf = /* @__PURE__ */ __name((row2) => ({
55954
56021
  id: String(row2.id),
55955
56022
  sourceId: String(row2.source_id),
@@ -56024,7 +56091,7 @@ var applyTagConsolidation = /* @__PURE__ */ __name((context, preview, options) =
56024
56091
  }, { beforeCommit: check3 });
56025
56092
  }, "applyTagConsolidation");
56026
56093
 
56027
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
56094
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/tag-consolidation.js
56028
56095
  var selections = [
56029
56096
  ["taggings", "tag_id IN (SELECT value FROM json_each(?))"],
56030
56097
  ["aliases", "aliasable_type='tag' AND aliasable_id IN (SELECT value FROM json_each(?))"],
@@ -56168,7 +56235,7 @@ var previewRows = /* @__PURE__ */ __name((context, options, source2, survivor, m
56168
56235
  };
56169
56236
  }, "previewRows");
56170
56237
 
56171
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
56238
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/vocabulary.js
56172
56239
  var kinds = ["project", "tag", "topic"];
56173
56240
  var cancelled2 = /* @__PURE__ */ __name((signal) => {
56174
56241
  if (signal?.aborted)
@@ -56432,7 +56499,7 @@ var vocabularyStoreOver = /* @__PURE__ */ __name((context) => {
56432
56499
  };
56433
56500
  }, "vocabularyStoreOver");
56434
56501
 
56435
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
56502
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/knowledge.js
56436
56503
  var TYPED_KEY_PREFIXES = new Set(Object.values(TASK_KEY_PREFIXES));
56437
56504
  var ORGANIZATION_KINDS = ["company", "team", "family", "community"];
56438
56505
  var PROJECT_TYPES = ["work", "client", "personal", "oss", "other"];
@@ -56986,7 +57053,7 @@ var projectKey = /* @__PURE__ */ __name((name) => {
56986
57053
  return key2.padEnd(3, "X");
56987
57054
  }, "projectKey");
56988
57055
 
56989
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
57056
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/log-pruning.js
56990
57057
  var DAY10 = 864e5;
56991
57058
  var SETTING5 = "logs_pruned_at";
56992
57059
  var LOG_RETENTION = { agentActionsMs: 90 * DAY10, botUpdatePayloadsMs: 30 * DAY10 };
@@ -57013,7 +57080,7 @@ var logPruner = /* @__PURE__ */ __name((database, now2) => {
57013
57080
  };
57014
57081
  }, "logPruner");
57015
57082
 
57016
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/mail/findings.js
57083
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/mail/findings.js
57017
57084
  var MAIL_FINDINGS_PER_RUN = 30;
57018
57085
  var MAIL_FINDINGS_PER_SENDER = 5;
57019
57086
  var invalid8 = /* @__PURE__ */ __name((message3) => {
@@ -57389,7 +57456,7 @@ var checkMailFindings = /* @__PURE__ */ __name((input) => {
57389
57456
  }, "checkMailFindings");
57390
57457
  var mailFindingFingerprint = /* @__PURE__ */ __name(({ id: _id, ...finding }) => findingHash(finding), "mailFindingFingerprint");
57391
57458
 
57392
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
57459
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/orders.js
57393
57460
  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";
57394
57461
  var orderOperationsOver = /* @__PURE__ */ __name((context) => {
57395
57462
  const { database, now: now2 } = context;
@@ -57604,7 +57671,7 @@ var ordersStoreOver = /* @__PURE__ */ __name((context) => {
57604
57671
  };
57605
57672
  }, "ordersStoreOver");
57606
57673
 
57607
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
57674
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/mail-findings.js
57608
57675
  var MAIL_EDITS = {
57609
57676
  task: ["title", "type", "reason", "commitment", "project", "dueAt", "dueEvidence", "assignee", "assigneeEvidence"],
57610
57677
  fact: ["statement", "type", "reason", "subject", "project"],
@@ -58093,7 +58160,7 @@ ${evidence.join("\n")}`, agent);
58093
58160
  };
58094
58161
  }, "mailFindingsStoreOver");
58095
58162
 
58096
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
58163
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-findings.js
58097
58164
  var stale3 = /* @__PURE__ */ __name(() => {
58098
58165
  throw new CliError("validation_error", "meeting findings changed since they were read; stage a new batch", {
58099
58166
  reason: "meeting-findings.stale"
@@ -58306,7 +58373,7 @@ var meetingFindingsStoreOver = /* @__PURE__ */ __name((context) => {
58306
58373
  };
58307
58374
  }, "meetingFindingsStoreOver");
58308
58375
 
58309
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
58376
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/meeting-vectors.js
58310
58377
  var RANK_BATCH = 512;
58311
58378
  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";
58312
58379
  var limitOf2 = /* @__PURE__ */ __name((value, name, max = 1e3) => {
@@ -58577,7 +58644,7 @@ var meetingVectorsOver = /* @__PURE__ */ __name((context) => ({
58577
58644
  }
58578
58645
  }), "meetingVectorsOver");
58579
58646
 
58580
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
58647
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/mention-sources.js
58581
58648
  var OTHER_SOURCES = ["document", "note", "email"];
58582
58649
  var TEXTS = {
58583
58650
  document: "JOIN documents s ON mn.source_type = 'document' AND s.id = mn.source_id AND s.deleted_at IS NULL WHERE 1 ",
@@ -58678,7 +58745,7 @@ var sourceMentionStoreOver = /* @__PURE__ */ __name((context) => {
58678
58745
  };
58679
58746
  }, "sourceMentionStoreOver");
58680
58747
 
58681
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/money-transactions.js
58748
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/money-transactions.js
58682
58749
  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";
58683
58750
  var MAX_SPLITS = 100;
58684
58751
  var transactionOperationsOver = /* @__PURE__ */ __name((context) => {
@@ -58912,11 +58979,11 @@ var transactionsStoreOver = /* @__PURE__ */ __name((context) => {
58912
58979
  };
58913
58980
  }, "transactionsStoreOver");
58914
58981
 
58915
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
58982
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
58916
58983
  import { accessSync, constants, existsSync as existsSync2, mkdirSync as mkdirSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
58917
58984
  import { dirname as dirname2 } from "node:path";
58918
58985
 
58919
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
58986
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/clients.js
58920
58987
  import { readFileSync as readFileSync3 } from "node:fs";
58921
58988
  var CLIENTS_SETTING = "clients";
58922
58989
  var coreVersion = (() => {
@@ -58977,7 +59044,7 @@ var refusalAdvice = /* @__PURE__ */ __name((clients, command, schema) => {
58977
59044
  return mover ? `${own} (${mover.command} ${mover.version} moved the store to schema ${schema})` : own;
58978
59045
  }, "refusalAdvice");
58979
59046
 
58980
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
59047
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/migrations.generated.js
58981
59048
  var GENERATED = [
58982
59049
  {
58983
59050
  "name": "20261010184427_initial",
@@ -60437,7 +60504,7 @@ WHERE json_type(params, '$.selection') = 'object';`
60437
60504
  }
60438
60505
  ];
60439
60506
 
60440
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/rollback-copy.js
60507
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/rollback-copy.js
60441
60508
  import { mkdirSync, rmSync, statfsSync, writeFileSync } from "node:fs";
60442
60509
  import { basename, dirname, join as join3, parse } from "node:path";
60443
60510
  var DERIVED = /(_fts|_words|_stems|_trigrams|_pending)$|^(embeddings|chunks|chunk_messages|mentions|involvements|search_terms)$|^vector_index/;
@@ -60670,7 +60737,7 @@ var rollBack2 = /* @__PURE__ */ __name((database, path) => {
60670
60737
  return { ...result, foreignKeyViolations };
60671
60738
  }, "rollBack");
60672
60739
 
60673
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
60740
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/manifest.js
60674
60741
  var V31_TABLES = [
60675
60742
  "accounts",
60676
60743
  "account_identities",
@@ -60846,9 +60913,9 @@ var generatedMigrations = /* @__PURE__ */ __name((manifest = MANIFEST, generated
60846
60913
  return migrations;
60847
60914
  }, "generatedMigrations");
60848
60915
 
60849
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/migrations.js
60916
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/migrations.js
60850
60917
  var MIGRATIONS = generatedMigrations();
60851
- var HISTORY = `CREATE TABLE IF NOT EXISTS schema_migrations (
60918
+ var HISTORY2 = `CREATE TABLE IF NOT EXISTS schema_migrations (
60852
60919
  version INTEGER PRIMARY KEY,
60853
60920
  min_compatible INTEGER NOT NULL,
60854
60921
  applied_at INTEGER NOT NULL
@@ -60907,7 +60974,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
60907
60974
  let copy = rollback ? copyBeforeBreaking(database, migrations, { ownTable, now: now2 }, rollback) : void 0;
60908
60975
  beginImmediate(database);
60909
60976
  try {
60910
- database.exec(HISTORY);
60977
+ database.exec(HISTORY2);
60911
60978
  const file = fileState(database);
60912
60979
  if (copy && copy.from !== file.version) {
60913
60980
  discardRollbackCopy(copy);
@@ -60943,7 +61010,7 @@ var migrate = /* @__PURE__ */ __name((database, { migrations = MIGRATIONS, now:
60943
61010
  }
60944
61011
  }, "migrate");
60945
61012
 
60946
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
61013
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/join-keys.js
60947
61014
  var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
60948
61015
  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 ?");
60949
61016
  if (pending.get(0, 1) === void 0)
@@ -60965,7 +61032,7 @@ var fillJoinKeys = /* @__PURE__ */ __name((database, { batch = 2e3 } = {}) => {
60965
61032
  }
60966
61033
  }, "fillJoinKeys");
60967
61034
 
60968
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/slow-queries.js
61035
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/slow-queries.js
60969
61036
  var queryShape = /* @__PURE__ */ __name((sql2) => sql2.replace(/'(?:[^']|'')*'/g, "?").replace(/\b\d+(?:\.\d+)?\b/g, "?").replace(/\s+/g, " ").trim().slice(0, 400), "queryShape");
60970
61037
  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");
60971
61038
  var timeQueries = /* @__PURE__ */ __name((client, methods) => {
@@ -60999,7 +61066,7 @@ var timeQueries = /* @__PURE__ */ __name((client, methods) => {
60999
61066
  return client;
61000
61067
  }, "timeQueries");
61001
61068
 
61002
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
61069
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/open.js
61003
61070
  var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
61004
61071
  refuseOwnerStoreInTests(path);
61005
61072
  const opened = "Bun" in globalThis ? await openUnderBun(path, readOnly) : await openUnderNode(path, readOnly);
@@ -61013,8 +61080,8 @@ var openSqlite = /* @__PURE__ */ __name(async (path, { readOnly = false } = {})
61013
61080
  }, "openSqlite");
61014
61081
  var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
61015
61082
  quietSqliteWarning();
61016
- const { drizzle } = await import("./node-NLJINXVQ.js");
61017
- const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-KDFQDYVZ.js");
61083
+ const { drizzle } = await import("./node-MPZ3SVB4.js");
61084
+ const { cacheOverNodeSqlite, nodeClient } = await import("./node-sqlite-VL5BMY34.js");
61018
61085
  const client = await nodeClient(path, { readOnly });
61019
61086
  try {
61020
61087
  if (!readOnly)
@@ -61029,8 +61096,8 @@ var openUnderNode = /* @__PURE__ */ __name(async (path, readOnly) => {
61029
61096
  }
61030
61097
  }, "openUnderNode");
61031
61098
  var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
61032
- const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-KSKWRLLO.js");
61033
- const { drizzle } = await import("./bun-NS5YLOQT.js");
61099
+ const { bunClient, cacheOverBunSqlite } = await import("./bun-sqlite-5MW2BWV4.js");
61100
+ const { drizzle } = await import("./bun-AFA5HULK.js");
61034
61101
  const client = await bunClient(path, readOnly ? { readonly: true, create: false } : void 0);
61035
61102
  try {
61036
61103
  if (!readOnly)
@@ -61045,7 +61112,7 @@ var openUnderBun = /* @__PURE__ */ __name(async (path, readOnly) => {
61045
61112
  }
61046
61113
  }, "openUnderBun");
61047
61114
 
61048
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
61115
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/payment-facts.js
61049
61116
  var PAYMENT_FACTS_TO_MOVE = "payment_facts_to_move";
61050
61117
  var paymentOf = /* @__PURE__ */ __name((metadata3) => {
61051
61118
  try {
@@ -61113,7 +61180,7 @@ var movePaymentFacts = /* @__PURE__ */ __name((context) => {
61113
61180
  });
61114
61181
  }, "movePaymentFacts");
61115
61182
 
61116
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
61183
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/read-compatibility.js
61117
61184
  var readCompatibility = /* @__PURE__ */ __name((database, command) => {
61118
61185
  const ours = MIGRATIONS.at(-1)?.version ?? 0;
61119
61186
  if (!database.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_migrations'").get())
@@ -61131,7 +61198,7 @@ var assertReadCompatible = /* @__PURE__ */ __name((database, command) => {
61131
61198
  throw new CliError("configuration_error", `The store needs schema ${MIGRATIONS.at(-1)?.version ?? 0} maintenance before a read-only open`);
61132
61199
  }, "assertReadCompatible");
61133
61200
 
61134
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
61201
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/suggested-links.js
61135
61202
  var SUGGESTED_LINKS_TO_MOVE = "suggested_links_to_move";
61136
61203
  var proposerOf2 = /* @__PURE__ */ __name((provenance2) => {
61137
61204
  if (provenance2?.startsWith("rule:"))
@@ -61177,7 +61244,7 @@ var moveSuggestedLinks = /* @__PURE__ */ __name((database, now2) => {
61177
61244
  });
61178
61245
  }, "moveSuggestedLinks");
61179
61246
 
61180
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
61247
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/test-accounts.js
61181
61248
  var TEST_ACCOUNTS_TO_PURGE = "test_accounts_to_purge";
61182
61249
  var TEST_PROVIDER = "chat";
61183
61250
  var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
@@ -61198,7 +61265,7 @@ var purgeTestAccounts = /* @__PURE__ */ __name((context, warn) => {
61198
61265
  }
61199
61266
  }, "purgeTestAccounts");
61200
61267
 
61201
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
61268
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/open-store.js
61202
61269
  var BACKFILL_ON_OPEN = 5e3;
61203
61270
  var NOT_WRITABLE = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EROFS"]);
61204
61271
  var createWritable = /* @__PURE__ */ __name((file) => {
@@ -61310,7 +61377,7 @@ var openStoreContext = /* @__PURE__ */ __name(async (options = {}) => {
61310
61377
  }
61311
61378
  }, "openStoreContext");
61312
61379
 
61313
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/products.js
61380
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/products.js
61314
61381
  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";
61315
61382
  var productOperationsOver = /* @__PURE__ */ __name((context) => {
61316
61383
  const { database, now: now2 } = context;
@@ -61418,13 +61485,13 @@ var productsStoreOver = /* @__PURE__ */ __name((context) => {
61418
61485
  };
61419
61486
  }, "productsStoreOver");
61420
61487
 
61421
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
61488
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
61422
61489
  import { createHash as createHash21 } from "node:crypto";
61423
61490
 
61424
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
61491
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
61425
61492
  import { createHash as createHash20 } from "node:crypto";
61426
61493
 
61427
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
61494
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/project-transfer/schema.js
61428
61495
  var text7 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
61429
61496
  var ref = text7(2048);
61430
61497
  var timestamp2 = pipe(number(), safeInteger(), minValue(0));
@@ -61494,7 +61561,7 @@ var projectAnnotationsSchema = strictObject({
61494
61561
  }))
61495
61562
  });
61496
61563
 
61497
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
61564
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/project-transfer/manifest.js
61498
61565
  var PROJECT_ANNOTATIONS_MAX_BYTES = 4 * 1024 * 1024;
61499
61566
  var invalid11 = /* @__PURE__ */ __name((field4) => {
61500
61567
  throw new CliError("validation_error", `invalid project annotations.${field4}`);
@@ -61627,7 +61694,7 @@ var projectAnnotationsFingerprint = /* @__PURE__ */ __name((json4) => {
61627
61694
  return createHash20("sha256").update(JSON.stringify(normalized)).digest("hex");
61628
61695
  }, "projectAnnotationsFingerprint");
61629
61696
 
61630
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
61697
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/project-transfer/plan.js
61631
61698
  var hash = pipe(string(), regex(/^[a-f0-9]{64}$/));
61632
61699
  var ref2 = pipe(string(), minLength(1), maxLength(2048));
61633
61700
  var targetSchema = strictObject({
@@ -61734,7 +61801,7 @@ var planBoundProjectAnnotations = /* @__PURE__ */ __name((manifest, manifest_fin
61734
61801
  }, "planBoundProjectAnnotations");
61735
61802
  var planProjectAnnotations = /* @__PURE__ */ __name((json4, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotations(json4), projectAnnotationsFingerprint(json4), target, bindings), "planProjectAnnotations");
61736
61803
 
61737
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
61804
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-model.js
61738
61805
  import { createHash as createHash22 } from "node:crypto";
61739
61806
  var text8 = /* @__PURE__ */ __name((max) => pipe(string(), minLength(1), maxLength(max)), "text");
61740
61807
  var timestamp3 = pipe(number(), safeInteger(), minValue(0));
@@ -61828,7 +61895,7 @@ var projectAnnotationSnapshotFingerprint = /* @__PURE__ */ __name((json4) => {
61828
61895
  })).digest("hex");
61829
61896
  }, "projectAnnotationSnapshotFingerprint");
61830
61897
 
61831
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
61898
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/project-transfer/request.js
61832
61899
  var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false) => {
61833
61900
  if (!request || typeof request !== "object" || Array.isArray(request))
61834
61901
  throw new CliError("validation_error", "project annotation request is required");
@@ -61845,7 +61912,7 @@ var projectAnnotationRequest = /* @__PURE__ */ __name((request, restore = false)
61845
61912
  return { snapshot: snapshot2, projectId: Number(request.project.slice(8)) };
61846
61913
  }, "projectAnnotationRequest");
61847
61914
 
61848
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
61915
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/budget.js
61849
61916
  var SnapshotBudget = class {
61850
61917
  static {
61851
61918
  __name(this, "SnapshotBudget");
@@ -61871,13 +61938,13 @@ var SnapshotBudget = class {
61871
61938
  }
61872
61939
  };
61873
61940
 
61874
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
61941
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
61875
61942
  import { createHash as createHash24 } from "node:crypto";
61876
61943
 
61877
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
61944
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot-plan.js
61878
61945
  var planProjectAnnotationSnapshot = /* @__PURE__ */ __name((json4, target, bindings) => planBoundProjectAnnotations(decodeProjectAnnotationSnapshot(json4), projectAnnotationSnapshotFingerprint(json4), target, bindings), "planProjectAnnotationSnapshot");
61879
61946
 
61880
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
61947
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/sources.js
61881
61948
  import { createHash as createHash23 } from "node:crypto";
61882
61949
  var invalid13 = /* @__PURE__ */ __name(() => {
61883
61950
  throw new CliError("configuration_error", "project snapshot has an unavailable or unsupported dependency");
@@ -62020,7 +62087,7 @@ var ProjectSnapshotSources = class {
62020
62087
  }
62021
62088
  };
62022
62089
 
62023
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
62090
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/snapshot.js
62024
62091
  var unsupported = /* @__PURE__ */ __name(() => {
62025
62092
  throw new CliError("configuration_error", "project snapshot has unsupported metadata, deletion or account scope");
62026
62093
  }, "unsupported");
@@ -62198,7 +62265,7 @@ var projectAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, bu
62198
62265
  return { snapshot: snapshot2, read_bytes: budget.bytes, records: budget.records };
62199
62266
  }), "projectAnnotationSnapshot");
62200
62267
 
62201
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
62268
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/preview.js
62202
62269
  var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, manifest, bindings, budget) => read(database, () => {
62203
62270
  const current2 = projectAnnotationSnapshot(database, projectId2, budget).snapshot;
62204
62271
  const sources = new ProjectSnapshotSources(database, budget);
@@ -62260,7 +62327,7 @@ var previewAnnotationSnapshot = /* @__PURE__ */ __name((database, projectId2, ma
62260
62327
  };
62261
62328
  }), "previewAnnotationSnapshot");
62262
62329
 
62263
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
62330
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/records.js
62264
62331
  var metadataOf2 = /* @__PURE__ */ __name((database, link3, to) => {
62265
62332
  const provenance2 = link3.provenance === null ? {} : { provenance: link3.provenance };
62266
62333
  if (link3.kind === "evidence" && to)
@@ -62327,7 +62394,7 @@ var restoreAnnotationRecords = /* @__PURE__ */ __name((database, projectId2, sna
62327
62394
  return mappings;
62328
62395
  }, "restoreAnnotationRecords");
62329
62396
 
62330
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
62397
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/project-transfer/store.js
62331
62398
  var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
62332
62399
  async preview(request) {
62333
62400
  const { snapshot: snapshot2, projectId: projectId2 } = projectAnnotationRequest(request);
@@ -62357,7 +62424,7 @@ var projectAnnotationStoreOver = /* @__PURE__ */ __name(({ database }) => ({
62357
62424
  }
62358
62425
  }), "projectAnnotationStoreOver");
62359
62426
 
62360
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relations.js
62427
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/record-relations.js
62361
62428
  var isDerived = /* @__PURE__ */ __name((role) => role.startsWith("fields."), "isDerived");
62362
62429
  var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
62363
62430
  const sql2 = /* @__PURE__ */ __name((text9) => database.prepare(text9), "sql");
@@ -62428,7 +62495,7 @@ var recordRelationsOver = /* @__PURE__ */ __name(({ database }) => {
62428
62495
  return { entityRef, relatedOf, storedRelations, relate, missingOf };
62429
62496
  }, "recordRelationsOver");
62430
62497
 
62431
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/record-remap.js
62498
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/record-remap.js
62432
62499
  var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
62433
62500
  const pointedAt = /* @__PURE__ */ __name((type, id2) => {
62434
62501
  for (const { table, pointer } of pointerPairs(database))
@@ -62482,7 +62549,7 @@ var recordRemapOver = /* @__PURE__ */ __name(({ database, now: now2 }) => {
62482
62549
  return { pointedAt, remap };
62483
62550
  }, "recordRemapOver");
62484
62551
 
62485
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/record-run.js
62552
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/record-run.js
62486
62553
  var runs = 0;
62487
62554
  var PAGE = 500;
62488
62555
  var recordRunOver = /* @__PURE__ */ __name((context, writes) => {
@@ -62695,7 +62762,7 @@ var waitingPointer = /* @__PURE__ */ __name((index2, missing4) => {
62695
62762
  return pointerOf("records", index2, "fields", key2);
62696
62763
  }, "waitingPointer");
62697
62764
 
62698
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/record-matching.js
62765
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/record-matching.js
62699
62766
  var valuesOf = /* @__PURE__ */ __name((value) => (Array.isArray(value) ? value : [value]).filter((one2) => typeof one2 === "string"), "valuesOf");
62700
62767
  var SCHEME = /^(email|domain|tax-id:[a-z]{2}|registration:[a-z]{2})$/;
62701
62768
  var ORG_EMAIL = "org-email";
@@ -62861,7 +62928,7 @@ var renameMade = /* @__PURE__ */ __name(({ database, now: now2 }, type, id2, nam
62861
62928
  ]);
62862
62929
  }, "renameMade");
62863
62930
 
62864
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-direct.js
62931
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-direct.js
62865
62932
  var productFields = /* @__PURE__ */ __name((fields4) => ({
62866
62933
  name: given2(fields4, "name"),
62867
62934
  unit: given2(fields4, "unit"),
@@ -62984,7 +63051,7 @@ var DIRECT_PROJECTORS = {
62984
63051
  lead: dealProjector("lead")
62985
63052
  };
62986
63053
 
62987
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-document.js
63054
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-document.js
62988
63055
  var TEXT_ONLY = { storage: "text", localPath: null };
62989
63056
  var textOf7 = /* @__PURE__ */ __name(({ fields: fields4, externalId }) => {
62990
63057
  const text9 = String(fields4.text ?? "");
@@ -63053,7 +63120,7 @@ var DOCUMENT_PROJECTORS = {
63053
63120
  }
63054
63121
  };
63055
63122
 
63056
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-money.js
63123
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-money.js
63057
63124
  var allocatedByOthers = /* @__PURE__ */ __name((context, paymentId) => {
63058
63125
  const importer = authorActor(context, IMPORTER).actor;
63059
63126
  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;
@@ -63263,7 +63330,7 @@ var MONEY_PROJECTORS = {
63263
63330
  }
63264
63331
  };
63265
63332
 
63266
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-phone.js
63333
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors-phone.js
63267
63334
  var CALLS_CALENDAR = "calls";
63268
63335
  var importOnly = /* @__PURE__ */ __name((source2, type) => {
63269
63336
  if (!isImportedProvider(source2.provider))
@@ -63438,7 +63505,7 @@ var PHONE_PROJECTORS = {
63438
63505
  }
63439
63506
  };
63440
63507
 
63441
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors.js
63508
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/record-projectors.js
63442
63509
  var RECORD_PROJECTORS = {
63443
63510
  ...MONEY_PROJECTORS,
63444
63511
  ...DIRECT_PROJECTORS,
@@ -63449,7 +63516,7 @@ var RECORD_PROJECTORS = {
63449
63516
  project: null
63450
63517
  };
63451
63518
 
63452
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/record-settling.js
63519
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/record-settling.js
63453
63520
  var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
63454
63521
  const sql2 = /* @__PURE__ */ __name((text9) => database.prepare(text9), "sql");
63455
63522
  const freeOn = /* @__PURE__ */ __name((invoice, payment) => {
@@ -63511,7 +63578,7 @@ var recordSettlingOver = /* @__PURE__ */ __name(({ database }, finance) => {
63511
63578
  return { settle, checkShares };
63512
63579
  }, "recordSettlingOver");
63513
63580
 
63514
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/record-stamps.js
63581
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/record-stamps.js
63515
63582
  import { createHash as createHash25 } from "node:crypto";
63516
63583
  var VOLATILE = /* @__PURE__ */ new Set(["id", "created_at", "updated_at", "metadata"]);
63517
63584
  var content = /* @__PURE__ */ __name((row2) => row2 === void 0 ? null : Object.fromEntries(Object.entries(row2).filter(([column2]) => !VOLATILE.has(column2))), "content");
@@ -63527,7 +63594,7 @@ var importStampsOver = /* @__PURE__ */ __name(({ database }) => {
63527
63594
  return { stamp, untouched };
63528
63595
  }, "importStampsOver");
63529
63596
 
63530
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/subscriptions.js
63597
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/subscriptions.js
63531
63598
  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";
63532
63599
  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";
63533
63600
  var PRICE_REF = /^subscription_price:([1-9]\d{0,15})$/;
@@ -63764,7 +63831,7 @@ var subscriptionsStoreOver = /* @__PURE__ */ __name((context) => {
63764
63831
  };
63765
63832
  }, "subscriptionsStoreOver");
63766
63833
 
63767
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/wallets.js
63834
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/wallets.js
63768
63835
  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";
63769
63836
  var SIGNED = "CASE t.direction WHEN 'in' THEN t.amount ELSE -t.amount END";
63770
63837
  var walletOperationsOver = /* @__PURE__ */ __name((context) => {
@@ -63889,7 +63956,7 @@ var walletsStoreOver = /* @__PURE__ */ __name((context) => {
63889
63956
  };
63890
63957
  }, "walletsStoreOver");
63891
63958
 
63892
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/record-writes.js
63959
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/record-writes.js
63893
63960
  var specOf = /* @__PURE__ */ __name((type) => RECORD_TYPES[type], "specOf");
63894
63961
  var unsettled = /* @__PURE__ */ __name((fields4, relations) => recordFingerprint(fields4, relations.filter((relation) => !AMOUNT_ROLES.includes(relation.role))), "unsettled");
63895
63962
  var tableOf2 = /* @__PURE__ */ __name((type) => typeof type === "string" && Object.hasOwn(DECIDED_TABLES, type) ? DECIDED_TABLES[type] : void 0, "tableOf");
@@ -64148,7 +64215,7 @@ var recordWritesOver = /* @__PURE__ */ __name((context) => {
64148
64215
  return { writeOne, project: project2, completeDependents, entityRef, missingOf: relations.missingOf };
64149
64216
  }, "recordWritesOver");
64150
64217
 
64151
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
64218
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/records.js
64152
64219
  var LIMIT = 1e3;
64153
64220
  var iso17 = /* @__PURE__ */ __name((value) => new Date(Number(value)).toISOString(), "iso");
64154
64221
  var checkLimit = /* @__PURE__ */ __name((limit) => {
@@ -64372,7 +64439,7 @@ var recordStoreOver = /* @__PURE__ */ __name((context) => {
64372
64439
  };
64373
64440
  }, "recordStoreOver");
64374
64441
 
64375
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/templates.js
64442
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/templates.js
64376
64443
  var templateOf = /* @__PURE__ */ __name((row2) => ({
64377
64444
  key: row2.key,
64378
64445
  channel: row2.channel,
@@ -64427,12 +64494,162 @@ var storedTemplateBodies = /* @__PURE__ */ __name((database, key2, language) =>
64427
64494
  return Object.fromEntries(rows.map((row2) => [row2.channel, row2.body]));
64428
64495
  }, "storedTemplateBodies");
64429
64496
 
64430
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/tracker.js
64497
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/domain/tracker.js
64431
64498
  var trackerTitleOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "issue" ? record3.title : kind3 === "comment" ? record3.body.split("\n")[0]?.slice(0, 120) || "(comment)" : record3.name, "trackerTitleOf");
64432
64499
  var trackerBodyOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "comment" ? record3.body : kind3 === "issue" || kind3 === "project" ? record3.description : null, "trackerBodyOf");
64433
64500
  var trackerParentOf = /* @__PURE__ */ __name((kind3, record3) => kind3 === "comment" ? record3.issue : kind3 === "state" || kind3 === "label" ? record3.team : kind3 === "issue" ? record3.team : null, "trackerParentOf");
64434
64501
 
64435
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/tracker.js
64502
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/tracker-chunks.js
64503
+ var TRACKER_CHUNK = "tracker_item";
64504
+ var CHUNKED = /* @__PURE__ */ new Set(["issue", "project", "comment"]);
64505
+ var CHUNKED_SQL = "('issue', 'project', 'comment')";
64506
+ var isChunkedTrackerKind = /* @__PURE__ */ __name((kind3) => CHUNKED.has(kind3), "isChunkedTrackerKind");
64507
+ var textOf8 = /* @__PURE__ */ __name((kind3, title2, body2) => kind3 === "comment" ? body2 ?? "" : noteIndexText(title2, body2 ?? ""), "textOf");
64508
+ var piecesOf = /* @__PURE__ */ __name((kind3, title2, body2) => {
64509
+ if (!CHUNKED.has(kind3))
64510
+ return [];
64511
+ const text9 = textOf8(kind3, title2, body2);
64512
+ if (!text9.trim())
64513
+ return [];
64514
+ return splitText(text9, CHUNK_CHARS).map(({ start, end }) => ({ start, end, hash: chunkHash(text9.slice(start, end)) }));
64515
+ }, "piecesOf");
64516
+ var trackerChunkWriter = /* @__PURE__ */ __name((database) => {
64517
+ const held2 = database.prepare(`SELECT start_offset AS start, end_offset AS end, content_hash AS hash FROM chunks
64518
+ WHERE chunkable_type = '${TRACKER_CHUNK}' AND chunkable_id = ? ORDER BY position`);
64519
+ const drop = database.prepare(`DELETE FROM chunks WHERE chunkable_type = '${TRACKER_CHUNK}' AND chunkable_id = ?`);
64520
+ const insert = database.prepare(`INSERT INTO chunks (chunkable_type, chunkable_id, position, start_offset, end_offset, content_hash, scope, account_id, occurred_at, created_at, updated_at) VALUES ('${TRACKER_CHUNK}', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`);
64521
+ return (item, at2) => {
64522
+ const wanted = piecesOf(item.kind, item.title, item.body);
64523
+ const before2 = held2.all(item.id).map((row2) => ({
64524
+ start: Number(row2.start),
64525
+ end: Number(row2.end),
64526
+ hash: String(row2.hash)
64527
+ }));
64528
+ const same = before2.length === wanted.length && before2.every((one2, at3) => {
64529
+ const other = wanted[at3];
64530
+ return other !== void 0 && one2.start === other.start && one2.end === other.end && one2.hash === other.hash;
64531
+ });
64532
+ if (same)
64533
+ return void 0;
64534
+ drop.run(item.id);
64535
+ wanted.forEach(({ start, end, hash: hash2 }, position2) => {
64536
+ insert.run(item.id, position2, start, end, hash2, item.scope, item.accountId, item.occurredAt, at2, at2);
64537
+ });
64538
+ return before2.map(({ hash: hash2 }) => hash2);
64539
+ };
64540
+ }, "trackerChunkWriter");
64541
+ var dropTrackerChunks = /* @__PURE__ */ __name((database, ids3) => {
64542
+ if (!ids3.length)
64543
+ return;
64544
+ const released = database.prepare(`DELETE FROM chunks WHERE chunkable_type = '${TRACKER_CHUNK}' AND chunkable_id IN (SELECT value FROM json_each(?))
64545
+ RETURNING content_hash AS hash`).all(JSON.stringify(ids3)).map(({ hash: hash2 }) => String(hash2));
64546
+ dropUnusedVectors(database, released);
64547
+ }, "dropTrackerChunks");
64548
+ var BACKFILL = 200;
64549
+ var refreshTrackerChunks = /* @__PURE__ */ __name((database, now2, until = () => false) => {
64550
+ if (isQueryOnly(database))
64551
+ return { dropped: 0, added: 0, left: false };
64552
+ const dropped = write(database, () => {
64553
+ const gone = database.prepare(`DELETE FROM chunks WHERE chunkable_type = '${TRACKER_CHUNK}' AND NOT EXISTS (SELECT 1 FROM tracker_items t
64554
+ WHERE t.id = chunkable_id AND t.deleted_at IS NULL AND t.kind IN ${CHUNKED_SQL})
64555
+ RETURNING content_hash AS hash`).all().map(({ hash: hash2 }) => String(hash2));
64556
+ dropUnusedVectors(database, gone);
64557
+ return gone.length;
64558
+ });
64559
+ const page3 = database.prepare(`SELECT t.id, t.account_id, t.kind, t.title, t.body, coalesce(t.source_updated_at, t.synced_at) AS at, a.scope
64560
+ FROM tracker_items t JOIN accounts a ON a.id = t.account_id
64561
+ WHERE t.id > ? AND t.deleted_at IS NULL AND t.kind IN ${CHUNKED_SQL}
64562
+ AND trim(CASE t.kind WHEN 'comment' THEN coalesce(t.body, '') ELSE t.title || coalesce(t.body, '') END) <> ''
64563
+ AND NOT EXISTS (SELECT 1 FROM chunks k WHERE k.chunkable_type = '${TRACKER_CHUNK}' AND k.chunkable_id = t.id)
64564
+ ORDER BY t.id LIMIT ?`);
64565
+ const chunk = trackerChunkWriter(database);
64566
+ let added = 0;
64567
+ let after2 = 0;
64568
+ for (; ; ) {
64569
+ if (until())
64570
+ return { dropped, added, left: page3.all(after2, 1).length > 0 };
64571
+ const rows = write(database, () => {
64572
+ const found2 = page3.all(after2, BACKFILL);
64573
+ for (const row2 of found2) {
64574
+ const written = chunk({
64575
+ id: Number(row2.id),
64576
+ accountId: Number(row2.account_id),
64577
+ kind: String(row2.kind),
64578
+ title: String(row2.title),
64579
+ body: row2.body == null ? null : String(row2.body),
64580
+ occurredAt: Number(row2.at),
64581
+ scope: row2.scope == null ? null : String(row2.scope)
64582
+ }, now2);
64583
+ if (written)
64584
+ added += 1;
64585
+ }
64586
+ return found2;
64587
+ });
64588
+ const last = rows.at(-1);
64589
+ if (!last || rows.length < BACKFILL)
64590
+ break;
64591
+ after2 = Number(last.id);
64592
+ }
64593
+ return { dropped, added, left: false };
64594
+ }, "refreshTrackerChunks");
64595
+ var LIVE7 = `k.chunkable_type = '${TRACKER_CHUNK}' AND EXISTS (SELECT 1 FROM tracker_items t WHERE t.id = k.chunkable_id AND t.deleted_at IS NULL)`;
64596
+ var UNEMBEDDED = `${LIVE7} AND NOT EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ? AND v.content_hash = k.content_hash)`;
64597
+ var trackerChunksLeft = /* @__PURE__ */ __name((database, model) => Number(database.prepare(`SELECT count(DISTINCT k.content_hash) AS n FROM chunks k WHERE ${UNEMBEDDED}`).get(model)?.n ?? 0), "trackerChunksLeft");
64598
+ var trackerChunksToEmbed = /* @__PURE__ */ __name((database, model, { after: after2, limit }) => {
64599
+ const item = database.prepare("SELECT kind, title, body FROM tracker_items WHERE id = ?");
64600
+ return database.prepare(`SELECT k.content_hash AS hash, min(k.chunkable_id) AS owner, k.start_offset AS start, k.end_offset AS end
64601
+ FROM chunks k WHERE k.content_hash > ? AND ${UNEMBEDDED}
64602
+ GROUP BY k.content_hash ORDER BY k.content_hash LIMIT ?`).all(after2 ?? "", model, limit).flatMap((row2) => {
64603
+ const found2 = item.get(Number(row2.owner));
64604
+ if (!found2)
64605
+ return [];
64606
+ const text9 = textOf8(String(found2.kind), String(found2.title), found2.body == null ? null : String(found2.body));
64607
+ return [{ hash: String(row2.hash), text: text9.slice(Number(row2.start), Number(row2.end)) }];
64608
+ });
64609
+ }, "trackerChunksToEmbed");
64610
+ var trackerEmbedded = /* @__PURE__ */ __name((database, model, accountIds) => accountIds.length > 0 && database.prepare(`SELECT 1 FROM chunks k JOIN embeddings v ON v.model = ? AND v.content_hash = k.content_hash
64611
+ WHERE ${LIVE7} AND k.account_id IN (SELECT value FROM json_each(?)) LIMIT 1`).get(model, JSON.stringify(accountIds)) !== void 0, "trackerEmbedded");
64612
+ var SCAN_PAGE5 = 5e3;
64613
+ var ranked = /* @__PURE__ */ __name((best, limit) => [...best.values()].sort((a, b) => b.score - a.score || a.owner - b.owner).slice(0, limit), "ranked");
64614
+ var nearestTrackerItems = /* @__PURE__ */ __name((database, model, query, { accountId, limit }) => {
64615
+ const columns2 = `k.id, k.chunkable_id AS owner, k.content_hash AS hash, v.vector
64616
+ FROM chunks k JOIN embeddings v ON v.model = ? AND v.content_hash = k.content_hash
64617
+ WHERE ${LIVE7} AND k.account_id = ?`;
64618
+ const keep2 = /* @__PURE__ */ __name((best2, row2) => {
64619
+ const score = dot(query, row2.vector);
64620
+ const owner = Number(row2.owner);
64621
+ if (score > (best2.get(owner)?.score ?? Number.NEGATIVE_INFINITY))
64622
+ best2.set(owner, { owner, chunk: Number(row2.id), score });
64623
+ }, "keep");
64624
+ const candidates = database.prepare(`SELECT ${columns2} AND k.id IN (SELECT value FROM json_each(?)) ORDER BY k.id`);
64625
+ const indexed = searchIndex(database, model, { kind: TRACKER_CHUNK, account: accountId }, query, limit, (near2) => {
64626
+ const hashes = new Map(near2.map(({ id: id2, hash: hash2 }) => [id2, hash2]));
64627
+ const best2 = /* @__PURE__ */ new Map();
64628
+ for (const row2 of candidates.all(model, accountId, JSON.stringify([...hashes.keys()])))
64629
+ if (hashes.get(Number(row2.id)) === row2.hash)
64630
+ keep2(best2, row2);
64631
+ const results = ranked(best2, limit);
64632
+ return { results, best: results.map(({ chunk }) => chunk) };
64633
+ });
64634
+ const plain2 = /* @__PURE__ */ __name((found2) => found2.map(({ owner, score }) => ({ owner, score })), "plain");
64635
+ if (indexed)
64636
+ return plain2(indexed);
64637
+ const page3 = database.prepare(`SELECT ${columns2} AND k.id > ? ORDER BY k.id LIMIT ?`);
64638
+ const best = /* @__PURE__ */ new Map();
64639
+ let after2 = 0;
64640
+ for (; ; ) {
64641
+ const rows = page3.all(model, accountId, after2, SCAN_PAGE5);
64642
+ for (const row2 of rows)
64643
+ keep2(best, row2);
64644
+ const last = rows.at(-1);
64645
+ if (!last || rows.length < SCAN_PAGE5)
64646
+ break;
64647
+ after2 = Number(last.id);
64648
+ }
64649
+ return plain2(ranked(best, limit));
64650
+ }, "nearestTrackerItems");
64651
+
64652
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/tracker.js
64436
64653
  var MOST3 = 500;
64437
64654
  var itemOf2 = /* @__PURE__ */ __name((row2) => ({
64438
64655
  kind: String(row2.kind),
@@ -64462,8 +64679,12 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
64462
64679
  const { database } = context;
64463
64680
  const save2 = /* @__PURE__ */ __name((key2, kind3, records2, now2) => write(database, () => {
64464
64681
  const accountId = accountPk(context, key2);
64465
- const stored4 = database.prepare("SELECT data FROM tracker_items WHERE account_id = ? AND kind = ? AND external_id = ?");
64466
- const upsert2 = database.prepare("INSERT INTO tracker_items (account_id, kind, external_id, parent_id, title, title_folded, body, normalized_text, data, source_created_at, source_updated_at, archived_at, deleted_at, synced_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NULL, ?) ON CONFLICT (account_id, kind, external_id) DO UPDATE SET parent_id = excluded.parent_id, title = excluded.title, title_folded = excluded.title_folded, body = excluded.body, normalized_text = excluded.normalized_text, data = excluded.data, source_created_at = excluded.source_created_at, source_updated_at = excluded.source_updated_at, archived_at = excluded.archived_at, deleted_at = NULL, synced_at = excluded.synced_at");
64682
+ const stored4 = database.prepare("SELECT data, title, body, deleted_at FROM tracker_items WHERE account_id = ? AND kind = ? AND external_id = ?");
64683
+ const scope3 = database.prepare("SELECT scope FROM accounts WHERE id = ?").get(accountId)?.scope;
64684
+ const chunked = isChunkedTrackerKind(kind3);
64685
+ const chunk = trackerChunkWriter(database);
64686
+ const released = [];
64687
+ const upsert2 = database.prepare("INSERT INTO tracker_items (account_id, kind, external_id, parent_id, title, title_folded, body, normalized_text, data, source_created_at, source_updated_at, archived_at, deleted_at, synced_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, NULL, ?) ON CONFLICT (account_id, kind, external_id) DO UPDATE SET parent_id = excluded.parent_id, title = excluded.title, title_folded = excluded.title_folded, body = excluded.body, normalized_text = excluded.normalized_text, data = excluded.data, source_created_at = excluded.source_created_at, source_updated_at = excluded.source_updated_at, archived_at = excluded.archived_at, deleted_at = NULL, synced_at = excluded.synced_at RETURNING id");
64467
64688
  for (const record3 of records2) {
64468
64689
  const before2 = stored4.get(accountId, kind3, record3.externalId);
64469
64690
  const merged2 = {
@@ -64472,8 +64693,23 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
64472
64693
  };
64473
64694
  const title2 = trackerTitleOf(kind3, merged2);
64474
64695
  const body2 = trackerBodyOf(kind3, merged2) ?? null;
64475
- upsert2.run(accountId, kind3, merged2.externalId, trackerParentOf(kind3, merged2) ?? null, title2, fold(title2), body2, normalize([title2, body2].filter(Boolean).join("\n")), JSON.stringify(merged2), merged2.createdAt ?? null, merged2.updatedAt ?? null, merged2.archivedAt ?? null, now2);
64696
+ const saved = upsert2.get(accountId, kind3, merged2.externalId, trackerParentOf(kind3, merged2) ?? null, title2, fold(title2), body2, normalize([title2, body2].filter(Boolean).join("\n")), JSON.stringify(merged2), merged2.createdAt ?? null, merged2.updatedAt ?? null, merged2.archivedAt ?? null, now2);
64697
+ const same = before2?.deleted_at == null && before2?.title === title2 && (before2?.body ?? null) === body2;
64698
+ if (!chunked || same)
64699
+ continue;
64700
+ const freed = chunk({
64701
+ id: Number(saved?.id),
64702
+ accountId,
64703
+ kind: kind3,
64704
+ title: title2,
64705
+ body: body2,
64706
+ occurredAt: merged2.updatedAt ?? now2,
64707
+ scope: scope3 == null ? null : String(scope3)
64708
+ }, now2);
64709
+ for (const hash2 of freed ?? [])
64710
+ released.push(hash2);
64476
64711
  }
64712
+ dropUnusedVectors(database, released);
64477
64713
  return records2.length;
64478
64714
  }), "save");
64479
64715
  const removeUnlisted = /* @__PURE__ */ __name((key2, kind3, listed, before2, now2, { dryRun = false } = {}) => {
@@ -64484,13 +64720,18 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
64484
64720
  return write(database, () => {
64485
64721
  const mark = database.prepare("UPDATE tracker_items SET deleted_at = ? WHERE id = ?");
64486
64722
  let removed = 0;
64723
+ const marked = [];
64487
64724
  for (const row2 of database.prepare("SELECT id, external_id FROM tracker_items WHERE account_id = ? AND kind = ? AND deleted_at IS NULL AND synced_at < ?").all(accountId, kind3, before2)) {
64488
64725
  if (keep2.has(String(row2.external_id)))
64489
64726
  continue;
64490
- if (!dryRun)
64727
+ if (!dryRun) {
64491
64728
  mark.run(now2, Number(row2.id));
64729
+ marked.push(Number(row2.id));
64730
+ }
64492
64731
  removed += 1;
64493
64732
  }
64733
+ if (isChunkedTrackerKind(kind3))
64734
+ dropTrackerChunks(database, marked);
64494
64735
  return removed;
64495
64736
  });
64496
64737
  }, "removeUnlisted");
@@ -64564,6 +64805,17 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
64564
64805
  hasMore: rows.length > most
64565
64806
  };
64566
64807
  }, "find");
64808
+ const accountIdsOf = /* @__PURE__ */ __name((accounts2) => accounts2.flatMap((one2) => {
64809
+ const id2 = findAccountPk(context, one2);
64810
+ return id2 === void 0 ? [] : [{ id: id2, key: { provider: one2.provider, account: one2.account } }];
64811
+ }), "accountIdsOf");
64812
+ const nearest = /* @__PURE__ */ __name((model, query, limit, accounts2) => {
64813
+ const item = database.prepare(`SELECT ${COLUMNS10} FROM tracker_items t WHERE t.id = ?`);
64814
+ return accountIdsOf(accounts2).flatMap(({ id: id2, key: key2 }) => nearestTrackerItems(database, model, query, { accountId: id2, limit }).flatMap(({ owner, score }) => {
64815
+ const row2 = item.get(owner);
64816
+ return row2 ? [{ account: key2, item: itemOf2(row2), score }] : [];
64817
+ })).sort((a, b) => b.score - a.score).slice(0, limit);
64818
+ }, "nearest");
64567
64819
  return {
64568
64820
  save: /* @__PURE__ */ __name(async (key2, kind3, records2, now2) => save2(key2, kind3, records2, now2), "save"),
64569
64821
  removeUnlisted: /* @__PURE__ */ __name(async (key2, kind3, listed, before2, now2, options) => removeUnlisted(key2, kind3, listed, before2, now2, options), "removeUnlisted"),
@@ -64598,11 +64850,16 @@ var trackerStoreOver = /* @__PURE__ */ __name((context) => {
64598
64850
  person: `person:${String(row2.person)}`,
64599
64851
  name: row2.name == null ? null : String(row2.name)
64600
64852
  }));
64601
- }, "people")
64853
+ }, "people"),
64854
+ refreshChunks: /* @__PURE__ */ __name(async ({ until } = {}) => refreshTrackerChunks(database, context.now(), until), "refreshChunks"),
64855
+ chunksToEmbed: /* @__PURE__ */ __name(async (model, options) => trackerChunksToEmbed(database, model, options), "chunksToEmbed"),
64856
+ chunksLeft: /* @__PURE__ */ __name(async (model) => trackerChunksLeft(database, model), "chunksLeft"),
64857
+ embedded: /* @__PURE__ */ __name(async (model, accounts2) => trackerEmbedded(database, model, accountIdsOf(accounts2).map(({ id: id2 }) => id2)), "embedded"),
64858
+ nearest: /* @__PURE__ */ __name(async (model, query, { limit, accounts: accounts2 }) => nearest(model, query, limit, accounts2), "nearest")
64602
64859
  };
64603
64860
  }, "trackerStoreOver");
64604
64861
 
64605
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/store-errors.js
64862
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/store-errors.js
64606
64863
  var refusalOf2 = /* @__PURE__ */ __name((error) => error instanceof Error && error.name === "DrizzleQueryError" && error.cause instanceof CliError ? error.cause : error, "refusalOf");
64607
64864
  var wrapped2 = /* @__PURE__ */ new WeakMap();
64608
64865
  var storeErrors = /* @__PURE__ */ __name((area) => {
@@ -64637,7 +64894,7 @@ var storeErrors = /* @__PURE__ */ __name((area) => {
64637
64894
  return proxy;
64638
64895
  }, "storeErrors");
64639
64896
 
64640
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
64897
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/ranges.js
64641
64898
  var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to) => {
64642
64899
  const touching = and(eq(syncRanges.chatId, chatKey), lte(syncRanges.fromKey, to + 1), gte(syncRanges.toKey, from2 - 1));
64643
64900
  let merged2 = { from: from2, to };
@@ -64650,7 +64907,7 @@ var markRange = /* @__PURE__ */ __name(({ orm, now: now2 }, chatKey, from2, to)
64650
64907
  }, "markRange");
64651
64908
  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");
64652
64909
 
64653
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
64910
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/task-analysis-marks.js
64654
64911
  var prefixOf2 = /* @__PURE__ */ __name(({ provider, account }) => `task_analysis:${provider}:${account}:`, "prefixOf");
64655
64912
  var markOf = /* @__PURE__ */ __name((prefix, row2) => ({
64656
64913
  chatId: String(row2.key).slice(prefix.length),
@@ -64671,7 +64928,7 @@ var setTaskAnalysisMark = /* @__PURE__ */ __name((database, account, { chatId, c
64671
64928
  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);
64672
64929
  }, "setTaskAnalysisMark");
64673
64930
 
64674
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
64931
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/task-rule-stops.js
64675
64932
  var keyOf6 = /* @__PURE__ */ __name(({ provider, account }) => `task_rules_until:${provider}:${account}`, "keyOf");
64676
64933
  var taskRulesStop = /* @__PURE__ */ __name((database, account) => {
64677
64934
  const row2 = database.prepare("SELECT value FROM store_settings WHERE key = ?").get(keyOf6(account));
@@ -64681,7 +64938,7 @@ var setTaskRulesStop = /* @__PURE__ */ __name((database, account, until, now2) =
64681
64938
  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);
64682
64939
  }, "setTaskRulesStop");
64683
64940
 
64684
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sync.js
64941
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sync.js
64685
64942
  var syncStoreOver = /* @__PURE__ */ __name((context) => {
64686
64943
  const { database } = context;
64687
64944
  const { accountPk: accountPk2, findAccountPk: findAccountPk2, chatKeyOf, chatPkFor: chatPkFor2, identityPk: identityPk2, writeMembers: writeMembers2, writeState: writeState2 } = keysOver(context);
@@ -64740,7 +64997,7 @@ var syncStoreOver = /* @__PURE__ */ __name((context) => {
64740
64997
  };
64741
64998
  }, "syncStoreOver");
64742
64999
 
64743
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/tags.js
65000
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/tags.js
64744
65001
  var tagsStoreOver = /* @__PURE__ */ __name((context) => {
64745
65002
  const { database } = context;
64746
65003
  return {
@@ -64762,7 +65019,7 @@ var tagsStoreOver = /* @__PURE__ */ __name((context) => {
64762
65019
  };
64763
65020
  }, "tagsStoreOver");
64764
65021
 
64765
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
65022
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/image-chunks.js
64766
65023
  var IS_IMAGE = sql`(a.kind = 'photo' OR a.mime LIKE 'image/%')`;
64767
65024
  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
64768
65025
  WHERE chat_id = ${chatKey} AND deleted_at IS NULL AND trim(text) <> '' AND id <> ${messagePk}
@@ -64809,7 +65066,7 @@ var saveImageChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, acco
64809
65066
  }, "saveImageChunks");
64810
65067
  var embeddedHashes = /* @__PURE__ */ __name(({ orm }, model, hashes) => new Set(hashes.length === 0 ? [] : orm.all(sql`SELECT content_hash AS hash FROM embeddings
64811
65068
  WHERE model = ${model} AND content_hash IN (SELECT value FROM json_each(${JSON.stringify(hashes)}))`).map(({ hash: hash2 }) => hash2)), "embeddedHashes");
64812
- var SCAN_PAGE5 = 5e3;
65069
+ var SCAN_PAGE6 = 5e3;
64813
65070
  var imageRows = /* @__PURE__ */ __name(({ orm }, accountPk2, { chatKey, model, since, position: position2 }, rows) => orm.all(sql`SELECT k.id, k.content_hash AS hash, ch.external_id AS chatId, m.external_id AS messageId, v.vector
64814
65071
  FROM chunks k CROSS JOIN attachments a ON a.id = k.chunkable_id AND a.attachable_type = 'message'
64815
65072
  JOIN messages m ON m.id = a.attachable_id AND m.deleted_at IS NULL
@@ -64818,7 +65075,7 @@ var imageRows = /* @__PURE__ */ __name(({ orm }, accountPk2, { chatKey, model, s
64818
65075
  WHERE k.chunkable_type = 'image' AND k.position = ${position2} AND ch.account_id = ${accountPk2}
64819
65076
  ${chatKey === void 0 ? sql`AND ch.searchable = 1` : sql`AND m.chat_id = ${chatKey}`}
64820
65077
  ${since === void 0 ? sql`` : sql`AND k.occurred_at >= ${since}`}
64821
- ${"ids" in rows ? sql`AND k.id IN (SELECT value FROM json_each(${JSON.stringify(rows.ids)})) ORDER BY k.id` : sql`AND k.id > ${rows.after} ORDER BY k.id LIMIT ${SCAN_PAGE5}`}`), "imageRows");
65078
+ ${"ids" in rows ? sql`AND k.id IN (SELECT value FROM json_each(${JSON.stringify(rows.ids)})) ORDER BY k.id` : sql`AND k.id > ${rows.after} ORDER BY k.id LIMIT ${SCAN_PAGE6}`}`), "imageRows");
64822
65079
  var nearestImages = /* @__PURE__ */ __name((context, accountPk2, { chatKey, model, since, limit, query, position: position2 = 0 }) => {
64823
65080
  const filter = {
64824
65081
  model,
@@ -64853,7 +65110,7 @@ var nearestImages = /* @__PURE__ */ __name((context, accountPk2, { chatKey, mode
64853
65110
  for (const row2 of rows)
64854
65111
  found2.push(score(row2));
64855
65112
  const last = rows.at(-1);
64856
- if (!last || rows.length < SCAN_PAGE5)
65113
+ if (!last || rows.length < SCAN_PAGE6)
64857
65114
  break;
64858
65115
  after2 = last.id;
64859
65116
  }
@@ -64889,7 +65146,7 @@ var savePictureChunks = /* @__PURE__ */ __name(({ orm, now: now2, database }, ac
64889
65146
  dropUnusedVectors(database, released.map(({ hash: hash2 }) => hash2));
64890
65147
  }, "savePictureChunks");
64891
65148
 
64892
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
65149
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/message-chunks.js
64893
65150
  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,
64894
65151
  EXISTS (SELECT 1 FROM embeddings v WHERE v.model = ${model} AND v.content_hash = k.content_hash) AS embedded
64895
65152
  FROM messages m
@@ -64926,7 +65183,7 @@ var dropGoneMessageChunks = /* @__PURE__ */ __name((context, accountPk2) => {
64926
65183
  }, "dropGoneMessageChunks");
64927
65184
  var hasMessageVectors = /* @__PURE__ */ __name(({ orm }, accountPk2, model) => orm.get(sql`SELECT 1 FROM chunks k JOIN embeddings v ON v.model = ${model} AND v.content_hash = k.content_hash
64928
65185
  WHERE k.chunkable_type = 'message' AND k.account_id = ${accountPk2} LIMIT 1`) !== void 0, "hasMessageVectors");
64929
- var SCAN_PAGE6 = 5e3;
65186
+ var SCAN_PAGE7 = 5e3;
64930
65187
  var messageRows = /* @__PURE__ */ __name(({ orm }, accountPk2, { chatKey, model, since, before: before2 }, rows) => orm.all(sql`SELECT k.id, k.content_hash AS hash, ch.external_id AS chatId, m.external_id AS messageId, v.vector
64931
65188
  FROM chunks k CROSS JOIN messages m ON m.id = k.chunkable_id AND m.deleted_at IS NULL
64932
65189
  JOIN chats ch ON ch.id = m.chat_id
@@ -64935,7 +65192,7 @@ var messageRows = /* @__PURE__ */ __name(({ orm }, accountPk2, { chatKey, model,
64935
65192
  ${chatKey === void 0 ? sql`AND ch.searchable = 1` : sql`AND m.chat_id = ${chatKey}`}
64936
65193
  ${since === void 0 ? sql`` : sql`AND m.sent_at >= ${since}`}
64937
65194
  ${before2 === void 0 ? sql`` : sql`AND m.sent_at < ${before2}`}
64938
- ${"ids" in rows ? sql`AND k.id IN (SELECT value FROM json_each(${JSON.stringify(rows.ids)})) ORDER BY k.id` : sql`AND k.id > ${rows.after} ORDER BY k.id LIMIT ${SCAN_PAGE6}`}`), "messageRows");
65195
+ ${"ids" in rows ? sql`AND k.id IN (SELECT value FROM json_each(${JSON.stringify(rows.ids)})) ORDER BY k.id` : sql`AND k.id > ${rows.after} ORDER BY k.id LIMIT ${SCAN_PAGE7}`}`), "messageRows");
64939
65196
  var scoreMessages = /* @__PURE__ */ __name(({ orm }, accountPk2, { model, query, pks }) => orm.all(sql`SELECT ch.external_id AS chatId, m.external_id AS messageId, v.vector
64940
65197
  FROM chunks k CROSS JOIN messages m ON m.id = k.chunkable_id AND m.deleted_at IS NULL
64941
65198
  JOIN chats ch ON ch.id = m.chat_id AND ch.searchable = 1
@@ -64971,14 +65228,14 @@ var nearestMessages = /* @__PURE__ */ __name((context, accountPk2, { limit, quer
64971
65228
  for (const row2 of rows)
64972
65229
  found2.push(score(row2));
64973
65230
  const last = rows.at(-1);
64974
- if (!last || rows.length < SCAN_PAGE6)
65231
+ if (!last || rows.length < SCAN_PAGE7)
64975
65232
  break;
64976
65233
  after2 = last.id;
64977
65234
  }
64978
65235
  return plain2(best(found2));
64979
65236
  }, "nearestMessages");
64980
65237
 
64981
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/vectors.js
65238
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/vectors.js
64982
65239
  var accountVectorsOver = /* @__PURE__ */ __name((context, mail) => {
64983
65240
  const { database } = context;
64984
65241
  const { findAccountPk: findAccountPk2, findChatPk: findChatPk2, chatKeyOf } = keysOver(context);
@@ -65242,7 +65499,7 @@ var vectorsStoreOver = /* @__PURE__ */ __name((context, keyed) => ({
65242
65499
  vectorCounts: /* @__PURE__ */ __name(async (models) => vectorCounts(context, models), "vectorCounts")
65243
65500
  }), "vectorsStoreOver");
65244
65501
 
65245
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
65502
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/store-tables.js
65246
65503
  import { existsSync as existsSync3, readFileSync as readFileSync4 } from "node:fs";
65247
65504
  import { dirname as dirname3, join as join4 } from "node:path";
65248
65505
  var BOOKKEEPING2 = ["schema_migrations", "store_settings"];
@@ -65330,10 +65587,10 @@ var lastBackup = /* @__PURE__ */ __name((path) => {
65330
65587
  }
65331
65588
  }, "lastBackup");
65332
65589
 
65333
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/providers.js
65590
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/providers.js
65334
65591
  var registerProvider2 = /* @__PURE__ */ __name((store, entry2) => store.accounts.registerProvider(entry2), "registerProvider");
65335
65592
 
65336
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
65593
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/sqlite/store-contents.js
65337
65594
  var COUNTED_TABLES = [
65338
65595
  "accounts",
65339
65596
  "chats",
@@ -65418,7 +65675,7 @@ var storeContents = /* @__PURE__ */ __name((database) => {
65418
65675
  };
65419
65676
  }, "storeContents");
65420
65677
 
65421
- // node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/store/store.js
65678
+ // node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/store/store.js
65422
65679
  var openStore = /* @__PURE__ */ __name(async (options = {}) => {
65423
65680
  const context = await openStoreContext(options);
65424
65681
  try {
@@ -65893,6 +66150,8 @@ export {
65893
66150
  previewAnnotationSnapshot,
65894
66151
  waitingPointer,
65895
66152
  storedTemplateBodies,
66153
+ trackerTitleOf,
66154
+ trackerBodyOf,
65896
66155
  resetTrackerItemWords,
65897
66156
  readStoreTables,
65898
66157
  fileFacts,