@wirecat/mail-cli 0.36.0 → 0.37.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 (177) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/bin/mail.js +2 -2
  3. package/dist/bundle/agent-OU4K7TKQ.js +40 -0
  4. package/dist/bundle/{all-profiles-RS6OV3YO.js → all-profiles-ICGWDPUU.js} +11 -11
  5. package/dist/bundle/{anthropic-PPQ7DTXN.js → anthropic-TL4WFWGU.js} +5 -5
  6. package/dist/bundle/{app-server-EBFBMFQC.js → app-server-YAR5EFOO.js} +69 -67
  7. package/dist/bundle/{bun-J7HAT7MW.js → bun-OPDGMZZQ.js} +2 -2
  8. package/dist/bundle/{bun-sqlite-PCSNAXIQ.js → bun-sqlite-WI3ZPANS.js} +6 -6
  9. package/dist/bundle/{chunk-U3BO342P.js → chunk-2JHVQMVC.js} +1 -1
  10. package/dist/bundle/{chunk-JCILSTFK.js → chunk-2XBDILVW.js} +1 -1
  11. package/dist/bundle/{chunk-WZFGZBGD.js → chunk-2YO3PLOE.js} +19 -19
  12. package/dist/bundle/{chunk-KVFBSOCV.js → chunk-3DHJF57U.js} +9 -9
  13. package/dist/bundle/{chunk-NJZR3OFK.js → chunk-3HC5F3P7.js} +1 -1
  14. package/dist/bundle/{chunk-4WSTWZUB.js → chunk-3SKTQ2HC.js} +2 -2
  15. package/dist/bundle/{chunk-3NOXZZJV.js → chunk-3YM4B2GT.js} +1 -1
  16. package/dist/bundle/{chunk-L4QLZDBZ.js → chunk-3ZOOTTFW.js} +6 -6
  17. package/dist/bundle/{chunk-2UNZ3L2H.js → chunk-4FTIHADB.js} +6 -6
  18. package/dist/bundle/{chunk-KTVQIKU5.js → chunk-4IZ6R5FS.js} +19 -15
  19. package/dist/bundle/{chunk-6NDPOY4N.js → chunk-4N7PP76S.js} +1 -1
  20. package/dist/bundle/{chunk-KP7JHJVP.js → chunk-7HRKUKKY.js} +23 -23
  21. package/dist/bundle/{chunk-42XY6D5C.js → chunk-7PDGZFXD.js} +5 -5
  22. package/dist/bundle/{chunk-REWV37HQ.js → chunk-7YKWFERX.js} +6 -6
  23. package/dist/bundle/{chunk-PF7ZNIVP.js → chunk-BNURKCQG.js} +2 -3
  24. package/dist/bundle/{chunk-ZRSLG3B3.js → chunk-BNVISIHP.js} +6 -6
  25. package/dist/bundle/{chunk-KLPFPNZP.js → chunk-BQMJYSA4.js} +11 -11
  26. package/dist/bundle/{chunk-NYYMMIVW.js → chunk-BYITYTRL.js} +16 -3
  27. package/dist/bundle/{chunk-ZV57PIPE.js → chunk-CICUPYHT.js} +2 -2
  28. package/dist/bundle/{chunk-CJHO6B3M.js → chunk-CQHLWMKK.js} +33 -28
  29. package/dist/bundle/{chunk-MRWV5VNQ.js → chunk-CUW7Y2HJ.js} +6 -6
  30. package/dist/bundle/{chunk-BBQERXQX.js → chunk-DJZIFZOT.js} +3 -3
  31. package/dist/bundle/{chunk-HPSESLOZ.js → chunk-DNCLQPOM.js} +1 -1
  32. package/dist/bundle/{chunk-EGR3YUWD.js → chunk-DPV53EZC.js} +4 -4
  33. package/dist/bundle/{chunk-GI6DNX7Q.js → chunk-DTR7JO2M.js} +35 -35
  34. package/dist/bundle/{chunk-5JEKBYIH.js → chunk-ES2FF42M.js} +14 -14
  35. package/dist/bundle/{chunk-GCTHVCJU.js → chunk-EV72K4IU.js} +4 -4
  36. package/dist/bundle/{chunk-3BYKGMRM.js → chunk-EZQ5BYNL.js} +6 -6
  37. package/dist/bundle/{chunk-QI2XGTFH.js → chunk-F2D3J5DR.js} +8 -8
  38. package/dist/bundle/{chunk-NYR7PIAG.js → chunk-FTT7UDYV.js} +3 -3
  39. package/dist/bundle/{chunk-GEU3WR75.js → chunk-FXNCKPQ7.js} +3 -3
  40. package/dist/bundle/{chunk-5TIWO6AR.js → chunk-G4VJN75G.js} +37 -18
  41. package/dist/bundle/{chunk-CMOO4INK.js → chunk-GGMAIIVE.js} +1 -1
  42. package/dist/bundle/{chunk-SJNFPBPF.js → chunk-GPUC3FTU.js} +2 -2
  43. package/dist/bundle/{chunk-XRVZMM5B.js → chunk-GQIMVR7C.js} +164 -36
  44. package/dist/bundle/{chunk-437UHSIO.js → chunk-HCRUGAIN.js} +190 -62
  45. package/dist/bundle/{chunk-OEL4DQTT.js → chunk-HES6YMYN.js} +4 -4
  46. package/dist/bundle/{chunk-LQQIYBHN.js → chunk-HFY7536N.js} +196 -110
  47. package/dist/bundle/{chunk-2VEFNFYZ.js → chunk-IA7LLLEI.js} +3 -3
  48. package/dist/bundle/{chunk-RJUVWJTA.js → chunk-IUJDWEGJ.js} +7 -7
  49. package/dist/bundle/{chunk-PMSZBUC7.js → chunk-IWFWWO37.js} +8 -8
  50. package/dist/bundle/{chunk-DVJPEZGV.js → chunk-JG6LCSEX.js} +13 -13
  51. package/dist/bundle/{chunk-3ZKNXKM7.js → chunk-JLXXUEAM.js} +2 -2
  52. package/dist/bundle/{chunk-645FQC4G.js → chunk-JNP3XGJI.js} +16 -16
  53. package/dist/bundle/{chunk-2RV4V55B.js → chunk-JZUYZ2XJ.js} +38 -24
  54. package/dist/bundle/chunk-K4DEQAEW.js +1291 -0
  55. package/dist/bundle/{chunk-PPIMXOBT.js → chunk-KCM3WSER.js} +6 -6
  56. package/dist/bundle/{chunk-C3JSQ7UJ.js → chunk-KP5JDYY6.js} +27 -8
  57. package/dist/bundle/{chunk-SCJVKWMV.js → chunk-KUX54EGR.js} +1981 -802
  58. package/dist/bundle/chunk-KXJ3JEDH.js +2 -0
  59. package/dist/bundle/{chunk-V5I7QP4T.js → chunk-KZD3H5QA.js} +2 -2
  60. package/dist/bundle/{chunk-RMWS7IQ4.js → chunk-LKH3UKLO.js} +4 -4
  61. package/dist/bundle/{chunk-ROK7Z5LQ.js → chunk-NAOLBEFX.js} +220 -163
  62. package/dist/bundle/{chunk-5G4MDFZ2.js → chunk-NB52JKLR.js} +13 -9
  63. package/dist/bundle/{chunk-NTUP5RCP.js → chunk-NB7EOAUZ.js} +8 -1
  64. package/dist/bundle/{chunk-5VPLQS4S.js → chunk-NISH4UXM.js} +2 -2
  65. package/dist/bundle/{chunk-6UYIWQLU.js → chunk-NQSKI7XK.js} +4 -4
  66. package/dist/bundle/{chunk-NSH2UHJR.js → chunk-OWPRJLHV.js} +8 -8
  67. package/dist/bundle/{chunk-U67XMAEE.js → chunk-OZKZT3ZI.js} +10 -3
  68. package/dist/bundle/{chunk-774VG5WZ.js → chunk-Q7ICVP25.js} +1 -1
  69. package/dist/bundle/{chunk-HH34WRQE.js → chunk-QLJGYDWG.js} +7 -7
  70. package/dist/bundle/{chunk-6VMJLOYO.js → chunk-R44KVISE.js} +12 -12
  71. package/dist/bundle/{chunk-AVR4FPYG.js → chunk-R73VWPNL.js} +8 -8
  72. package/dist/bundle/{chunk-6LJIENVT.js → chunk-RRTMPSQR.js} +2 -2
  73. package/dist/bundle/{chunk-PMGAU6AP.js → chunk-S6JG4YUH.js} +2 -2
  74. package/dist/bundle/{chunk-WNQECDIP.js → chunk-TMJLGR4A.js} +61 -61
  75. package/dist/bundle/{chunk-VIJV474N.js → chunk-TXDR6YSF.js} +1 -1
  76. package/dist/bundle/{chunk-QDNYJOWJ.js → chunk-TY7NDMFY.js} +1 -1
  77. package/dist/bundle/{chunk-CJMZQ2MZ.js → chunk-UDSL3MUU.js} +8 -8
  78. package/dist/bundle/{chunk-VIDPFLFM.js → chunk-UTS5NMR3.js} +2 -2
  79. package/dist/bundle/{chunk-TV634B6T.js → chunk-VB7FZOYX.js} +1 -1
  80. package/dist/bundle/{chunk-WPPPO427.js → chunk-VK24UQSD.js} +4 -4
  81. package/dist/bundle/{chunk-NCY55XIT.js → chunk-VYCB5EVI.js} +8 -8
  82. package/dist/bundle/{chunk-IBOWSQ7X.js → chunk-VZ5PPYDG.js} +1 -1
  83. package/dist/bundle/chunk-WOPVBRPV.js +29 -0
  84. package/dist/bundle/{chunk-6PKMUKUF.js → chunk-XEQQJBBO.js} +1 -1
  85. package/dist/bundle/{chunk-MQ6DQRRI.js → chunk-XWBTD2WP.js} +4 -4
  86. package/dist/bundle/chunk-XXPJF2VD.js +2 -0
  87. package/dist/bundle/{chunk-6FZPFNEU.js → chunk-YODGIMMM.js} +9 -9
  88. package/dist/bundle/{chunk-YPB5BEAD.js → chunk-YWDFYQOU.js} +2 -2
  89. package/dist/bundle/{chunk-MT3LYU4T.js → chunk-Z4BLNAWI.js} +15062 -11852
  90. package/dist/bundle/{chunk-Q6TPXXOS.js → chunk-ZSAPOC7B.js} +27 -176
  91. package/dist/bundle/{chunk-GBZIWCEP.js → chunk-ZTWTEXB2.js} +3 -3
  92. package/dist/bundle/command-contract-UC6IGCCM.js +39 -0
  93. package/dist/bundle/{command-server-entry-73RJELAV.js → command-server-entry-RA3ZX2KV.js} +28 -28
  94. package/dist/bundle/{decode-7BUWBDPT.js → decode-QVKRSRVF.js} +5 -5
  95. package/dist/bundle/{dispatch-IBOMVWZA.js → dispatch-USKS7J74.js} +8 -8
  96. package/dist/bundle/{dist-MULVCVSR.js → dist-ITIXJAXK.js} +20 -20
  97. package/dist/bundle/{echarts-VLWFC322.js → echarts-O3TNDAXJ.js} +2 -2
  98. package/dist/bundle/{embed-W3VH4HPY.js → embed-2HOODFQT.js} +6 -6
  99. package/dist/bundle/{embedder-I7ERQZJV.js → embedder-22AJGCZX.js} +9 -9
  100. package/dist/bundle/{failure-QMAPSQ7X.js → failure-D4FGOIWF.js} +2 -2
  101. package/dist/bundle/{first-run-LCVER6QN.js → first-run-FU4MFXOA.js} +12 -12
  102. package/dist/bundle/first-screen-A7SEI2ON.js +40 -0
  103. package/dist/bundle/{instructions-BNCVLSYQ.js → instructions-AMH5RWVJ.js} +1 -1
  104. package/dist/bundle/mail.js +12 -12
  105. package/dist/bundle/{mcp-Z2KZNCXB.js → mcp-5HFPWC3W.js} +2 -2
  106. package/dist/bundle/meeting-combined-KC6YGWA7.js +24 -0
  107. package/dist/bundle/{meeting-model-BWLSTNXA.js → meeting-model-QWGAOQHL.js} +11 -11
  108. package/dist/bundle/{meeting-semantic-ZIEHXN2R.js → meeting-semantic-7PVO6RNB.js} +6 -6
  109. package/dist/bundle/{node-RYFTRSG4.js → node-EGMCBAO7.js} +2 -2
  110. package/dist/bundle/{node-sqlite-XCHVNTGQ.js → node-sqlite-JXUELLMP.js} +7 -7
  111. package/dist/bundle/{oauth-FNUJSKKJ.js → oauth-OYAYWH4K.js} +7 -7
  112. package/dist/bundle/{open-WVWSJ3WI.js → open-GLEUJGNA.js} +5 -5
  113. package/dist/bundle/{openai-QOUTYYTF.js → openai-PYTVNB6L.js} +15 -15
  114. package/dist/bundle/{process-W5KPID53.js → process-SGHEN6MQ.js} +1 -1
  115. package/dist/bundle/{program-L5UANM3I.js → program-7CFNZ2DF.js} +2001 -2222
  116. package/dist/bundle/{prompt-JSBAPNJE.js → prompt-CYTILD7N.js} +5 -5
  117. package/dist/bundle/public-XWMXEGEF.js +196 -0
  118. package/dist/bundle/{recognize-FDX4SJ6Q.js → recognize-26UNETSQ.js} +4 -4
  119. package/dist/bundle/{remote-MYOXOQHM.js → remote-PKXBQA5N.js} +9 -9
  120. package/dist/bundle/{rerank-NY5MSZCR.js → rerank-LLKP7M6Q.js} +7 -7
  121. package/dist/bundle/{serve-URI6NZA3.js → serve-ZRJEAPJI.js} +9 -9
  122. package/dist/bundle/{server-HQ25RHQM.js → server-4OQ4G5JY.js} +61 -59
  123. package/dist/bundle/server-VVRQ4A34.js +86 -0
  124. package/dist/bundle/{sqlite-runtime-6UUPSSKG.js → sqlite-runtime-667VV4VY.js} +6 -6
  125. package/dist/bundle/{state-NDDVFPCI.js → state-V3CAAJBE.js} +6 -6
  126. package/dist/bundle/{store-2RDOICVN.js → store-BJCIMIAH.js} +31 -24
  127. package/dist/bundle/{store-PKYWPKKR.js → store-GLBBY4OZ.js} +22 -22
  128. package/dist/bundle/store-maintenance-command-N7L5OVUE.js +73 -0
  129. package/dist/bundle/surface-26EUQNDT.js +72 -0
  130. package/dist/commands/import.js +2 -2
  131. package/dist/commands/import.js.map +1 -1
  132. package/dist/commands/messages.js +3 -3
  133. package/dist/commands/messages.js.map +1 -1
  134. package/dist/commands/read.js +2 -2
  135. package/dist/commands/read.js.map +1 -1
  136. package/dist/commands/send.d.ts.map +1 -1
  137. package/dist/commands/send.js +1 -0
  138. package/dist/commands/send.js.map +1 -1
  139. package/dist/commands/session.d.ts.map +1 -1
  140. package/dist/commands/session.js +2 -2
  141. package/dist/commands/session.js.map +1 -1
  142. package/dist/commands/sync.js +1 -1
  143. package/dist/commands/sync.js.map +1 -1
  144. package/dist/commands/tags.d.ts.map +1 -1
  145. package/dist/commands/tags.js.map +1 -1
  146. package/dist/commands/words.js +1 -1
  147. package/dist/commands/words.js.map +1 -1
  148. package/dist/config.d.ts +2 -0
  149. package/dist/config.d.ts.map +1 -1
  150. package/dist/config.js +7 -0
  151. package/dist/config.js.map +1 -1
  152. package/dist/mail/imap/account.d.ts.map +1 -1
  153. package/dist/mail/imap/account.js +2 -1
  154. package/dist/mail/imap/account.js.map +1 -1
  155. package/dist/mail/send.d.ts +2 -0
  156. package/dist/mail/send.d.ts.map +1 -1
  157. package/dist/mail/send.js +1 -1
  158. package/dist/mail/send.js.map +1 -1
  159. package/dist/profile.js +1 -1
  160. package/dist/profile.js.map +1 -1
  161. package/dist/program.d.ts.map +1 -1
  162. package/dist/program.js +4 -4
  163. package/dist/program.js.map +1 -1
  164. package/dist/reasons.d.ts.map +1 -1
  165. package/dist/reasons.js +0 -1
  166. package/dist/reasons.js.map +1 -1
  167. package/dist/version.d.ts +1 -1
  168. package/dist/version.js +1 -1
  169. package/package.json +3 -3
  170. package/dist/bundle/agent-MW7YWUIY.js +0 -39
  171. package/dist/bundle/chunk-6TT62IUW.js +0 -1264
  172. package/dist/bundle/command-contract-WFTIRPL5.js +0 -39
  173. package/dist/bundle/first-screen-DCTHI4NQ.js +0 -39
  174. package/dist/bundle/meeting-combined-ITU7SZ7E.js +0 -24
  175. package/dist/bundle/server-UVYFU2JN.js +0 -84
  176. package/dist/bundle/store-maintenance-command-Y5XTO47X.js +0 -71
  177. package/dist/bundle/surface-3XKM3MQ2.js +0 -70
@@ -2,49 +2,53 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  renderMessages
5
- } from "./chunk-SJNFPBPF.js";
5
+ } from "./chunk-GPUC3FTU.js";
6
6
  import {
7
- answerOf,
8
7
  messengerContext
9
- } from "./chunk-Q6TPXXOS.js";
8
+ } from "./chunk-ZSAPOC7B.js";
10
9
  import {
11
10
  chatEventAnswer,
12
11
  memberAnswer,
13
12
  pollVoteAnswer
14
- } from "./chunk-NSH2UHJR.js";
13
+ } from "./chunk-OWPRJLHV.js";
15
14
  import {
16
15
  serveRelay
17
- } from "./chunk-3BYKGMRM.js";
16
+ } from "./chunk-EZQ5BYNL.js";
18
17
  import {
19
18
  FETCHING,
20
19
  RULES_VERSION,
20
+ answerOf,
21
21
  applyTaskRulesOnArrival,
22
22
  embeddingKeys,
23
23
  endpointKeyName,
24
+ inside,
24
25
  modelGateway,
25
26
  newSendId,
26
27
  onlineDeps,
27
28
  openRequestTask,
28
29
  patiently,
30
+ realPathOf,
29
31
  refuseLockedOutput,
32
+ refusedPlace,
30
33
  senderIsMe,
31
34
  servicesFor,
32
35
  syncsOneChat,
33
36
  withTimeLimit
34
- } from "./chunk-SCJVKWMV.js";
37
+ } from "./chunk-KUX54EGR.js";
35
38
  import {
36
39
  capability,
37
40
  queryTerms,
38
41
  typedQuery,
39
42
  withQuery
40
- } from "./chunk-KTVQIKU5.js";
43
+ } from "./chunk-4IZ6R5FS.js";
41
44
  import {
42
45
  holdLock,
43
46
  lockPath,
47
+ markCurrent,
44
48
  releaseLock,
45
49
  servingProfiles,
46
50
  takeLock
47
- } from "./chunk-NYYMMIVW.js";
51
+ } from "./chunk-BYITYTRL.js";
48
52
  import {
49
53
  Command,
50
54
  LOCAL_READ,
@@ -71,16 +75,16 @@ import {
71
75
  snakeKeys,
72
76
  storeTable,
73
77
  withoutProviderRefs
74
- } from "./chunk-ROK7Z5LQ.js";
78
+ } from "./chunk-NAOLBEFX.js";
75
79
  import {
76
80
  levelFor
77
- } from "./chunk-RJUVWJTA.js";
81
+ } from "./chunk-IUJDWEGJ.js";
78
82
  import {
79
83
  holdersOf
80
- } from "./chunk-3NOXZZJV.js";
84
+ } from "./chunk-3YM4B2GT.js";
81
85
  import {
82
86
  readSecret
83
- } from "./chunk-2VEFNFYZ.js";
87
+ } from "./chunk-IA7LLLEI.js";
84
88
  import {
85
89
  QUICK_HEALTH_CHECKS,
86
90
  fts5Tables,
@@ -88,7 +92,7 @@ import {
88
92
  lossUnknown,
89
93
  storeDamageReport,
90
94
  storeHealth
91
- } from "./chunk-KP7JHJVP.js";
95
+ } from "./chunk-7HRKUKKY.js";
92
96
  import {
93
97
  CORPORA,
94
98
  MIGRATIONS,
@@ -126,46 +130,46 @@ import {
126
130
  storeClients,
127
131
  storeContents,
128
132
  vectorIndexCounts
129
- } from "./chunk-MT3LYU4T.js";
133
+ } from "./chunk-Z4BLNAWI.js";
130
134
  import {
131
135
  currentRun,
132
136
  readDamageMark,
133
137
  readHealthMark,
134
138
  readJournalMark,
135
139
  recordDeepCheck
136
- } from "./chunk-6TT62IUW.js";
140
+ } from "./chunk-K4DEQAEW.js";
137
141
  import {
138
142
  formatLocator,
139
143
  parseLocator
140
- } from "./chunk-5TIWO6AR.js";
144
+ } from "./chunk-G4VJN75G.js";
141
145
  import {
142
146
  failureKey,
143
147
  isStoreDamage
144
- } from "./chunk-3ZKNXKM7.js";
148
+ } from "./chunk-JLXXUEAM.js";
145
149
  import {
146
150
  queryFieldsOf
147
- } from "./chunk-WNQECDIP.js";
151
+ } from "./chunk-TMJLGR4A.js";
148
152
  import {
149
153
  modelAddressAllowed,
150
154
  onThisComputer
151
- } from "./chunk-REWV37HQ.js";
155
+ } from "./chunk-7YKWFERX.js";
152
156
  import {
153
157
  readSharedSection,
154
158
  sharedConfigPath,
155
159
  writeSharedSection
156
- } from "./chunk-HH34WRQE.js";
160
+ } from "./chunk-QLJGYDWG.js";
157
161
  import {
158
162
  storePath
159
- } from "./chunk-VIDPFLFM.js";
163
+ } from "./chunk-UTS5NMR3.js";
160
164
  import {
161
165
  openCache
162
- } from "./chunk-ZRSLG3B3.js";
166
+ } from "./chunk-BNVISIHP.js";
163
167
  import {
164
168
  Credentials,
165
169
  isMovedRun,
166
170
  resolvePaths,
167
171
  writeSecurely
168
- } from "./chunk-WZFGZBGD.js";
172
+ } from "./chunk-2YO3PLOE.js";
169
173
  import {
170
174
  array,
171
175
  boolean,
@@ -187,10 +191,10 @@ import {
187
191
  string,
188
192
  transform,
189
193
  trim
190
- } from "./chunk-C3JSQ7UJ.js";
194
+ } from "./chunk-KP5JDYY6.js";
191
195
  import {
192
196
  CliError
193
- } from "./chunk-PMGAU6AP.js";
197
+ } from "./chunk-S6JG4YUH.js";
194
198
  import {
195
199
  __commonJS,
196
200
  __name,
@@ -265,9 +269,9 @@ var require_liquid_node = __commonJS({
265
269
  __name(isIterator, "isIterator");
266
270
  function promisify(fn) {
267
271
  return function(...args) {
268
- return new Promise((resolve3, reject2) => {
272
+ return new Promise((resolve4, reject2) => {
269
273
  fn(...args, (err, result2) => {
270
- err ? reject2(err) : resolve3(result2);
274
+ err ? reject2(err) : resolve4(result2);
271
275
  });
272
276
  });
273
277
  };
@@ -1857,12 +1861,12 @@ var require_liquid_node = __commonJS({
1857
1861
  return fs$1.readFileSync(filepath, "utf8");
1858
1862
  }
1859
1863
  __name(readFileSync6, "readFileSync");
1860
- function resolve2(root, file2, ext) {
1864
+ function resolve3(root, file2, ext) {
1861
1865
  if (!path.extname(file2))
1862
1866
  file2 += ext;
1863
1867
  return path.resolve(root, file2);
1864
1868
  }
1865
- __name(resolve2, "resolve");
1869
+ __name(resolve3, "resolve");
1866
1870
  function fallback(file2) {
1867
1871
  try {
1868
1872
  return requireResolve(file2);
@@ -1870,10 +1874,10 @@ var require_liquid_node = __commonJS({
1870
1874
  }
1871
1875
  }
1872
1876
  __name(fallback, "fallback");
1873
- function dirname4(filepath) {
1877
+ function dirname5(filepath) {
1874
1878
  return path.dirname(filepath);
1875
1879
  }
1876
- __name(dirname4, "dirname");
1880
+ __name(dirname5, "dirname");
1877
1881
  var realpathAsync = promisify(fs$1.realpath);
1878
1882
  async function contains(root, file2) {
1879
1883
  try {
@@ -1903,9 +1907,9 @@ var require_liquid_node = __commonJS({
1903
1907
  readFile,
1904
1908
  existsSync: existsSync11,
1905
1909
  readFileSync: readFileSync6,
1906
- resolve: resolve2,
1910
+ resolve: resolve3,
1907
1911
  fallback,
1908
- dirname: dirname4,
1912
+ dirname: dirname5,
1909
1913
  contains,
1910
1914
  containsSync,
1911
1915
  sep: path.sep
@@ -3630,7 +3634,7 @@ var require_liquid_node = __commonJS({
3630
3634
  uri_escape,
3631
3635
  slugify
3632
3636
  });
3633
- var join6 = argumentsToValue(function(v, arg) {
3637
+ var join7 = argumentsToValue(function(v, arg) {
3634
3638
  const array2 = toArray(v);
3635
3639
  const sep = isNil(arg) ? " " : stringify(arg);
3636
3640
  let outputSize = sep.length * Math.max(array2.length - 1, 0);
@@ -3906,7 +3910,7 @@ var require_liquid_node = __commonJS({
3906
3910
  __name(sample, "sample");
3907
3911
  var arrayFilters = /* @__PURE__ */ Object.freeze({
3908
3912
  __proto__: null,
3909
- join: join6,
3913
+ join: join7,
3910
3914
  last,
3911
3915
  first,
3912
3916
  reverse,
@@ -5530,11 +5534,11 @@ var require_liquid_node = __commonJS({
5530
5534
  }
5531
5535
  });
5532
5536
 
5533
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5537
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5534
5538
  import { chmodSync, constants, copyFileSync, existsSync as existsSync10, mkdirSync, realpathSync as realpathSync3, renameSync as renameSync3, rmSync as rmSync3, statfsSync as statfsSync2, statSync as statSync4, writeFileSync as writeFileSync2 } from "node:fs";
5535
- import { dirname as dirname3, resolve } from "node:path";
5539
+ import { dirname as dirname4, resolve as resolve2 } from "node:path";
5536
5540
 
5537
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/sealed.js
5541
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/sealed.js
5538
5542
  import { createCipheriv, createDecipheriv, createHash, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
5539
5543
  import { closeSync, createReadStream, createWriteStream, existsSync, openSync, readSync, renameSync, rmSync, statSync } from "node:fs";
5540
5544
  import { Transform } from "node:stream";
@@ -5546,7 +5550,7 @@ var NONCE = 12;
5546
5550
  var TAG = 16;
5547
5551
  var HEADER = MAGIC.length + 3 + SALT + NONCE;
5548
5552
  var COST = { log2N: 17, r: 8, p: 1 };
5549
- var keyOf = /* @__PURE__ */ __name((password, salt, { log2N, r, p }) => new Promise((resolve2, reject) => scrypt(password, salt, 32, { N: 2 ** log2N, r, p, maxmem: 2 * 128 * r * 2 ** log2N }, (error, key) => error ? reject(error) : resolve2(key))), "keyOf");
5553
+ var keyOf = /* @__PURE__ */ __name((password, salt, { log2N, r, p }) => new Promise((resolve3, reject) => scrypt(password, salt, 32, { N: 2 ** log2N, r, p, maxmem: 2 * 128 * r * 2 ** log2N }, (error, key) => error ? reject(error) : resolve3(key))), "keyOf");
5550
5554
  var checkFor = /* @__PURE__ */ __name(async (password, cost = COST) => {
5551
5555
  refuseEmpty(password);
5552
5556
  const salt = randomBytes(SALT);
@@ -5641,7 +5645,7 @@ var unsealFile = /* @__PURE__ */ __name(async (from, to, password) => {
5641
5645
  renameSync(pending, to);
5642
5646
  }, "unsealFile");
5643
5647
 
5644
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5648
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5645
5649
  var SPEAKS = MIGRATIONS.at(-1)?.version ?? 0;
5646
5650
  var fileSchemaOf = /* @__PURE__ */ __name((database) => {
5647
5651
  const tracked = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'schema_migrations'").get();
@@ -5665,7 +5669,7 @@ var compatibilityOf = /* @__PURE__ */ __name((file2, migrations = MIGRATIONS) =>
5665
5669
  };
5666
5670
  }, "compatibilityOf");
5667
5671
 
5668
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/store/repair.js
5672
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/store/repair.js
5669
5673
  import { createHash as createHash2 } from "node:crypto";
5670
5674
  var COPY_MARK = "__repair_";
5671
5675
  var COPY_NAME = /__repair_[0-9a-f]{8}(_\d+)?$/;
@@ -5919,19 +5923,79 @@ var deleteCopy = /* @__PURE__ */ __name((database, name) => {
5919
5923
  return found;
5920
5924
  }, "deleteCopy");
5921
5925
 
5922
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5926
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/path-options.js
5927
+ import { dirname, isAbsolute, join, resolve } from "node:path";
5928
+ var PATH_NAME = /^([a-z]+-)*(file|path|dir|directory|folder)s?$/;
5929
+ var PATH_PLACEHOLDER = /[<[]([a-z]+-)*(file|path|dir|directory|folder)s?(\.\.\.)?[>\]]/;
5930
+ var NOT_LOCAL = /* @__PURE__ */ new WeakMap();
5931
+ var IN_BACKUPS = /* @__PURE__ */ new WeakMap();
5932
+ var mark = /* @__PURE__ */ __name((marks, command, names) => {
5933
+ marks.set(command, /* @__PURE__ */ new Set([...marks.get(command) ?? [], ...names]));
5934
+ return command;
5935
+ }, "mark");
5936
+ var notLocalPaths = /* @__PURE__ */ __name((command, ...names) => mark(NOT_LOCAL, command, names), "notLocalPaths");
5937
+ var inStoreBackups = /* @__PURE__ */ __name((command, ...names) => mark(IN_BACKUPS, command, names), "inStoreBackups");
5938
+ var marked = /* @__PURE__ */ __name((marks, command, name) => {
5939
+ for (let at = command; at; at = at.parent)
5940
+ if (marks.get(at)?.has(name))
5941
+ return true;
5942
+ return false;
5943
+ }, "marked");
5944
+ var isLocalPathOption = /* @__PURE__ */ __name((command, option) => PATH_PLACEHOLDER.test(option.flags) && !marked(NOT_LOCAL, command, option.attributeName()), "isLocalPathOption");
5945
+ var isLocalPathArgument = /* @__PURE__ */ __name((command, argument) => PATH_NAME.test(argument.name()) && !marked(NOT_LOCAL, command, argument.name()), "isLocalPathArgument");
5946
+ var isNamed = /* @__PURE__ */ __name((value) => value !== "" && value !== "-" && !value.includes("://"), "isNamed");
5947
+ var valuesOf = /* @__PURE__ */ __name((value) => (Array.isArray(value) ? value : [value]).filter((one) => typeof one === "string" && isNamed(one)), "valuesOf");
5948
+ var localPathsOf = /* @__PURE__ */ __name((action) => {
5949
+ const found = [];
5950
+ for (let at = action; at; at = at.parent) {
5951
+ for (const option of at.options) {
5952
+ const key = option.attributeName();
5953
+ if (!isLocalPathOption(at, option) || at.getOptionValueSource(key) !== "cli")
5954
+ continue;
5955
+ const flag = option.long ?? option.flags;
5956
+ for (const value of valuesOf(at.getOptionValue(key)))
5957
+ found.push({ flag, value, inBackups: marked(IN_BACKUPS, at, key) });
5958
+ }
5959
+ }
5960
+ action.registeredArguments.forEach((argument, index) => {
5961
+ const value = action.processedArgs[index];
5962
+ if (!isLocalPathArgument(action, argument) || value === argument.defaultValue)
5963
+ return;
5964
+ for (const one of valuesOf(value))
5965
+ found.push({ flag: `<${argument.name()}>`, value: one, inBackups: marked(IN_BACKUPS, action, argument.name()) });
5966
+ });
5967
+ return found;
5968
+ }, "localPathsOf");
5969
+ var refuseAgentPaths = /* @__PURE__ */ __name((action, app, env) => {
5970
+ const backups = join(dirname(resolve(storePath(env))), "backups");
5971
+ for (const { flag, value, inBackups } of localPathsOf(action)) {
5972
+ if (inBackups && inside(realPathOf(value), realPathOf(backups)))
5973
+ continue;
5974
+ if (refusedPlace(value, app, env))
5975
+ throw new CliError("permission_error", `${flag} ${value}: an agent's call reads and writes no credential folder, no folder of a WireCat tool and not the message store \u2014 the owner runs it in a terminal`, { param: flag, sent: false });
5976
+ }
5977
+ }, "refuseAgentPaths");
5978
+ var absoluteFrom = /* @__PURE__ */ __name((cwd, value) => {
5979
+ if (Array.isArray(value))
5980
+ return value.map((one) => absoluteFrom(cwd, one));
5981
+ if (typeof value !== "string" || !isNamed(value) || isAbsolute(value))
5982
+ return value;
5983
+ return resolve(cwd, value);
5984
+ }, "absoluteFrom");
5985
+
5986
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5923
5987
  import { existsSync as existsSync4, statSync as statSync3 } from "node:fs";
5924
5988
 
5925
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
5989
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
5926
5990
  import { existsSync as existsSync3 } from "node:fs";
5927
5991
 
5928
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/store/recover.js
5992
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/store/recover.js
5929
5993
  import { execFileSync, spawn } from "node:child_process";
5930
5994
  import { existsSync as existsSync2, readFileSync, realpathSync, renameSync as renameSync2, rmSync as rmSync2, statfsSync, statSync as statSync2, writeFileSync } from "node:fs";
5931
- import { basename, dirname, join } from "node:path";
5995
+ import { basename, dirname as dirname2, join as join2 } from "node:path";
5932
5996
  import { Transform as Transform2 } from "node:stream";
5933
5997
 
5934
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/store/refill.js
5998
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/store/refill.js
5935
5999
  var REFILL_MARGIN_MS = 864e5;
5936
6000
  var TIME_KEYS = 1e12;
5937
6001
  var integerId = `external_id GLOB '[0-9]*' AND NOT external_id GLOB '*[^0-9]*'`;
@@ -6011,7 +6075,7 @@ var forgetMail = /* @__PURE__ */ __name((database, cutoff, now) => {
6011
6075
  return [...folders].map(([account, count3]) => ({ account, folders: count3 }));
6012
6076
  }, "forgetMail");
6013
6077
 
6014
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/store/recover.js
6078
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/store/recover.js
6015
6079
  var SQLITE3_MINIMUM = [3, 43, 0];
6016
6080
  var STORE_PARTS = ["", "-wal", "-shm"];
6017
6081
  var RECOVER_LOCK = ".recover-lock";
@@ -6087,8 +6151,8 @@ var takeRecoverLock = /* @__PURE__ */ __name((path) => {
6087
6151
  return () => rmSync2(lock, { force: true });
6088
6152
  }, "takeRecoverLock");
6089
6153
  var storeHolders = /* @__PURE__ */ __name((path) => {
6090
- const folder = realpathSync(dirname(path));
6091
- const files = STORE_PARTS.map((suffix) => join(folder, `${basename(path)}${suffix}`));
6154
+ const folder = realpathSync(dirname2(path));
6155
+ const files = STORE_PARTS.map((suffix) => join2(folder, `${basename(path)}${suffix}`));
6092
6156
  const wanted = process.platform === "linux" ? files.flatMap((file2) => [file2, `${file2} (deleted)`]) : files.filter(existsSync2);
6093
6157
  const recovering = runningRecovery(path);
6094
6158
  const pids = holdersOf(wanted);
@@ -6231,7 +6295,7 @@ var placeLostRows = /* @__PURE__ */ __name((database) => {
6231
6295
  }
6232
6296
  return Object.fromEntries(Object.entries(placed).filter(([, rows2]) => rows2 > 0));
6233
6297
  }, "placeLostRows");
6234
- var copyReadableRows = /* @__PURE__ */ __name((path, target, program = "sqlite3") => new Promise((resolve2, reject) => {
6298
+ var copyReadableRows = /* @__PURE__ */ __name((path, target, program = "sqlite3") => new Promise((resolve3, reject) => {
6235
6299
  const reader = spawn(program, ["-readonly", path, `.recover --ignore-freelist --lost-and-found ${LOST_AND_FOUND}`], {
6236
6300
  stdio: ["ignore", "pipe", "pipe"]
6237
6301
  });
@@ -6268,7 +6332,7 @@ var copyReadableRows = /* @__PURE__ */ __name((path, target, program = "sqlite3"
6268
6332
  if (readerCode !== 0)
6269
6333
  reject(new CliError("validation_error", `sqlite3 could not read the store: ${errors.join("; ")}`));
6270
6334
  else
6271
- resolve2({ errors, read });
6335
+ resolve3({ errors, read });
6272
6336
  }, "exited");
6273
6337
  reader.on("error", reject);
6274
6338
  writer.on("error", reject);
@@ -6404,7 +6468,7 @@ var recoverStore = /* @__PURE__ */ __name(async ({ path, command, version, sqlit
6404
6468
  try {
6405
6469
  refuseInUse(path);
6406
6470
  const bytes = STORE_PARTS.reduce((sum, suffix) => sum + (statSync2(`${path}${suffix}`, { throwIfNoEntry: false })?.size ?? 0), 0);
6407
- const { bavail, bsize } = statfsSync(dirname(path));
6471
+ const { bavail, bsize } = statfsSync(dirname2(path));
6408
6472
  if (Number(bavail) * Number(bsize) < bytes * 1.2)
6409
6473
  throw new CliError("validation_error", `the recovery needs about ${Math.ceil(bytes * 1.2 / 1e9)} GB free beside the store`);
6410
6474
  return await recoverLocked({ path, command, version, sqlite3, now, note, copy, started, program });
@@ -6542,7 +6606,7 @@ var recoverLocked = /* @__PURE__ */ __name(async ({ path, command, version, sqli
6542
6606
  }
6543
6607
  }, "recoverLocked");
6544
6608
 
6545
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
6609
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/store-recover.js
6546
6610
  var COUNTED = [
6547
6611
  "accounts",
6548
6612
  "chats",
@@ -6577,7 +6641,7 @@ var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command, version) =>
6577
6641
  }
6578
6642
  const journal = readJournalMark(path);
6579
6643
  recordDeepCheck(path, health, { cli: command, ...version ? { version } : {}, schema });
6580
- const mark = readDamageMark(path);
6644
+ const mark2 = readDamageMark(path);
6581
6645
  const lastKnownGood = readHealthMark(path)?.last_ok_at ?? null;
6582
6646
  const inUse = storeHolders(path) ?? null;
6583
6647
  const timers = activeTimers() ?? null;
@@ -6585,7 +6649,7 @@ var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command, version) =>
6585
6649
  const report = storeDamageReport({
6586
6650
  health,
6587
6651
  command,
6588
- mark,
6652
+ mark: mark2,
6589
6653
  journal,
6590
6654
  lastOkAt: lastKnownGood,
6591
6655
  holders: inUse,
@@ -6603,7 +6667,7 @@ var storeRecoveryCheck = /* @__PURE__ */ __name(async (env, command, version) =>
6603
6667
  invalidJson: health.invalidJson ?? [],
6604
6668
  rows,
6605
6669
  report,
6606
- damageMark: mark ? (({ inode: _, ...seen }) => seen)(mark) : null,
6670
+ damageMark: mark2 ? (({ inode: _, ...seen }) => seen)(mark2) : null,
6607
6671
  lastKnownGood,
6608
6672
  inUse,
6609
6673
  timers,
@@ -6636,12 +6700,12 @@ var storeRecoveryRun = /* @__PURE__ */ __name(async (env, { command, version, no
6636
6700
  }, "storeRecoveryRun");
6637
6701
  var refetchNotes = /* @__PURE__ */ __name(({ since, chats, mail }) => {
6638
6702
  const from = since === null ? "from the start" : `from ${since} on`;
6639
- const marked = [
6703
+ const marked2 = [
6640
6704
  ...chats.map(({ provider, account, chats: chats2 }) => `${chats2} chats of ${provider} ${account}`),
6641
6705
  ...mail.map(({ account, folders }) => `${folders} mail folders of ${account}`)
6642
6706
  ];
6643
6707
  return [
6644
- marked.length > 0 ? `marked as not fetched ${from}, so the next sync or serve fetches it again: ${marked.join(", ")}` : `nothing held ${from} was marked as fetched, so there is nothing to fetch again`,
6708
+ marked2.length > 0 ? `marked as not fetched ${from}, so the next sync or serve fetches it again: ${marked2.join(", ")}` : `nothing held ${from} was marked as fetched, so there is nothing to fetch again`,
6645
6709
  ...chats.filter(({ provider }) => provider === "whatsapp").map(({ account }) => `whatsapp ${account}: WhatsApp cannot be asked for its chats, so only what the phone pushes while serve runs comes back`),
6646
6710
  "notes, memories, tags and whatever else only this store held cannot be fetched again"
6647
6711
  ];
@@ -6698,7 +6762,7 @@ var storeRecoverCommand = /* @__PURE__ */ __name(({ command, version }) => {
6698
6762
  return recover;
6699
6763
  }, "storeRecoverCommand");
6700
6764
 
6701
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/store-info.js
6765
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/store-info.js
6702
6766
  var pendingIfKnown = /* @__PURE__ */ __name((database) => database.prepare("SELECT 1 FROM pragma_table_info('messages') WHERE name = 'normalized_text'").get() ? pendingNormalization(database) : null, "pendingIfKnown");
6703
6767
  var bytesOf = /* @__PURE__ */ __name((path) => existsSync4(path) ? statSync3(path).size : 0, "bytesOf");
6704
6768
  var messageOf = /* @__PURE__ */ __name((error) => error instanceof Error ? error.message : String(error), "messageOf");
@@ -6744,7 +6808,7 @@ var storeInfoCommand = /* @__PURE__ */ __name(() => annotate(new Command("info")
6744
6808
  renderAnswer(this, outputFor(this), itemOf(answer));
6745
6809
  }), "storeInfoCommand");
6746
6810
 
6747
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
6811
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
6748
6812
  var ENCRYPT_OPTION = [
6749
6813
  "--encrypt",
6750
6814
  "compress and encrypt with a password, typed at a hidden prompt or piped on stdin; it is never kept \u2014 lose it and the file cannot be opened"
@@ -6763,9 +6827,9 @@ var passwordOf = /* @__PURE__ */ __name(async (command, { twice }) => {
6763
6827
  return password;
6764
6828
  }, "passwordOf");
6765
6829
 
6766
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/replies/rules.js
6830
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/rules.js
6767
6831
  import { existsSync as existsSync5, readFileSync as readFileSync2 } from "node:fs";
6768
- import { join as join2 } from "node:path";
6832
+ import { join as join3 } from "node:path";
6769
6833
  var REPLY_ACTIONS = ["reply", "task"];
6770
6834
  var REPLY_MODELS = ["fill-only", "may-reword"];
6771
6835
  var REPLY_KINDS = ["dialog", "group"];
@@ -6851,7 +6915,7 @@ var defaultRule = /* @__PURE__ */ __name((id) => ({
6851
6915
  reply: { template: "", asReply: true },
6852
6916
  limits: { perChat: "1/1d", perPerson: "1/1d" }
6853
6917
  }), "defaultRule");
6854
- var repliesPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).config, `${profile}.replies.json`), "repliesPathFor");
6918
+ var repliesPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).config, `${profile}.replies.json`), "repliesPathFor");
6855
6919
  var EVERYONE = { reply: "all", allow: { people: [], chats: [] }, deny: { people: [], chats: [] } };
6856
6920
  var outsideAudience = /* @__PURE__ */ __name((audience, person, chat) => {
6857
6921
  if (person !== null && audience.deny.people.includes(person))
@@ -6934,9 +6998,9 @@ var problem = /* @__PURE__ */ __name((issue) => {
6934
6998
  }, "problem");
6935
6999
  var broken = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply rules ${path} cannot be read (${why}) \u2014 fix the file`), "broken");
6936
7000
 
6937
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/replies/state.js
7001
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/state.js
6938
7002
  import { existsSync as existsSync6, readFileSync as readFileSync3 } from "node:fs";
6939
- import { join as join3 } from "node:path";
7003
+ import { join as join4 } from "node:path";
6940
7004
  var ANSWERED_KEPT = 1e3;
6941
7005
  var times = record(string(), array(string()));
6942
7006
  var stateFile = object({
@@ -6948,7 +7012,7 @@ var stateFile = object({
6948
7012
  });
6949
7013
  var emptyState = /* @__PURE__ */ __name(() => ({ paused: false, answered: [], sent: {} }), "emptyState");
6950
7014
  var answeredKey = /* @__PURE__ */ __name((message) => `${message.chatId}:${message.id}`, "answeredKey");
6951
- var repliesStatePathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, `${profile}.replies-state.json`), "repliesStatePathFor");
7015
+ var repliesStatePathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join4(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, `${profile}.replies-state.json`), "repliesStatePathFor");
6952
7016
  var readRepliesState = /* @__PURE__ */ __name((path) => {
6953
7017
  if (!existsSync6(path))
6954
7018
  return emptyState();
@@ -6987,7 +7051,7 @@ var recordReply = /* @__PURE__ */ __name((state, rule2, message, now) => {
6987
7051
  }, "recordReply");
6988
7052
  var broken2 = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply state ${path} cannot be read (${why}) \u2014 fix or move the file`), "broken");
6989
7053
 
6990
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/replies/decide.js
7054
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/decide.js
6991
7055
  var skip = /* @__PURE__ */ __name((why) => ({ skip: why }), "skip");
6992
7056
  var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
6993
7057
  const { message, chat, owner, sender } = incoming;
@@ -7093,10 +7157,10 @@ var filled = /* @__PURE__ */ __name((template2, senderName) => {
7093
7157
  return template2.replaceAll("{firstName}", name.split(/\s+/)[0] ?? name).replaceAll("{name}", name);
7094
7158
  }, "filled");
7095
7159
 
7096
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/replies/template.js
7160
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/template.js
7097
7161
  var import_liquidjs2 = __toESM(require_liquid_node(), 1);
7098
7162
 
7099
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/render/liquid.js
7163
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/render/liquid.js
7100
7164
  var import_liquidjs = __toESM(require_liquid_node(), 1);
7101
7165
  var safeLiquid = /* @__PURE__ */ __name((limits) => {
7102
7166
  const engine = new import_liquidjs.Liquid({
@@ -7123,7 +7187,7 @@ var safeLiquid = /* @__PURE__ */ __name((limits) => {
7123
7187
  return engine;
7124
7188
  }, "safeLiquid");
7125
7189
 
7126
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/replies/template.js
7190
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/template.js
7127
7191
  var TEMPLATE_LIMITS = {
7128
7192
  parse: 32768,
7129
7193
  renders: 2e3,
@@ -7262,7 +7326,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
7262
7326
  }
7263
7327
  }, "renderReplyTemplate");
7264
7328
 
7265
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
7329
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
7266
7330
  var DRY_RUN_DAYS = 7;
7267
7331
  var PAGE = 500;
7268
7332
  var dryRun = /* @__PURE__ */ __name(async (store, account, rules, { since, until = Date.now(), only, audience, render }) => {
@@ -7376,7 +7440,7 @@ var storedSince = /* @__PURE__ */ __name(async (store, account, chat, since) =>
7376
7440
  }
7377
7441
  }, "storedSince");
7378
7442
 
7379
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/models/ai.js
7443
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/models/ai.js
7380
7444
  var AI_PROVIDERS = ["anthropic", "openai", "ollama"];
7381
7445
  var DEFAULT_BASE_URL = {
7382
7446
  anthropic: "https://api.anthropic.com",
@@ -7544,7 +7608,7 @@ var checkAi = /* @__PURE__ */ __name(async (deps) => {
7544
7608
  }
7545
7609
  }, "checkAi");
7546
7610
 
7547
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/models/purpose.js
7611
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/models/purpose.js
7548
7612
  var HOSTED = {
7549
7613
  openai: "https://api.openai.com/v1",
7550
7614
  anthropic: "https://api.anthropic.com"
@@ -7565,14 +7629,14 @@ var purposeModel = /* @__PURE__ */ __name((settings, purpose, deps) => {
7565
7629
  return shared ? { target: shared.target, key: /* @__PURE__ */ __name(() => shared.key, "key"), shared: shared.setting } : void 0;
7566
7630
  }, "purposeModel");
7567
7631
 
7568
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/replies/consents.js
7632
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/consents.js
7569
7633
  import { existsSync as existsSync7, readFileSync as readFileSync4 } from "node:fs";
7570
- import { join as join4 } from "node:path";
7634
+ import { join as join5 } from "node:path";
7571
7635
  var shape = strictObject({
7572
7636
  provider: nullable(pipe(string(), minLength(1))),
7573
7637
  deniedChats: array(pipe(string(), minLength(1)))
7574
7638
  });
7575
- var replyConsentPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join4(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).config, `${profile}.replies-consents.json`), "replyConsentPathFor");
7639
+ var replyConsentPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join5(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).config, `${profile}.replies-consents.json`), "replyConsentPathFor");
7576
7640
  var readReplyConsent = /* @__PURE__ */ __name((path) => {
7577
7641
  if (!existsSync7(path))
7578
7642
  return { provider: null, deniedChats: [] };
@@ -7590,7 +7654,7 @@ var mayModelReply = /* @__PURE__ */ __name((path, provider, chat) => {
7590
7654
  return consent.provider === provider && !consent.deniedChats.includes(chat);
7591
7655
  }, "mayModelReply");
7592
7656
 
7593
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/replies/rendering.js
7657
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/rendering.js
7594
7658
  var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, options = {
7595
7659
  ai: true
7596
7660
  }) => async (rule2, message, chat, now) => {
@@ -7638,7 +7702,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
7638
7702
  return result2;
7639
7703
  }, "replyRenderer");
7640
7704
 
7641
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/replies/serve.js
7705
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/replies/serve.js
7642
7706
  var NOT_ALLOWED = "replies.send is not allow";
7643
7707
  var NO_RULES = "no rules";
7644
7708
  var ONLY_TASK = "opened a task, sent nothing";
@@ -7731,7 +7795,7 @@ var replyTo = /* @__PURE__ */ __name(async (deps, message) => {
7731
7795
  return { skip: why };
7732
7796
  }, "replyTo");
7733
7797
 
7734
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
7798
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-catch-up.js
7735
7799
  var START_SYNC_DELAY_MS = 3e4;
7736
7800
  var START_SYNC_BUDGET_MS = 5 * 6e4;
7737
7801
  var START_SYNC_WINDOW_MS = 7 * 864e5;
@@ -7808,7 +7872,7 @@ var startSync = /* @__PURE__ */ __name(({ chats, newestHeld, fetch, note, warn,
7808
7872
  };
7809
7873
  }, "startSync");
7810
7874
 
7811
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
7875
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
7812
7876
  var FIRST_FETCH_MS = 6e4;
7813
7877
  var DAY_MS = 864e5;
7814
7878
  var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch, warn, firstMs = FIRST_FETCH_MS, everyMs = DAY_MS }) => {
@@ -7862,7 +7926,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch, warn, firstMs =
7862
7926
  };
7863
7927
  }, "memberFetches");
7864
7928
 
7865
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
7929
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
7866
7930
  var record2 = /* @__PURE__ */ __name((context, app, severity, attributes) => recordLogFor(context.streams.diagnostic, app, { command: currentRun().command || "serve" })[severity](attributes), "record");
7867
7931
  var noticeFor = /* @__PURE__ */ __name((context, app, severity = "warn") => ({ text, ...attributes }) => {
7868
7932
  if (context.format === "pretty") {
@@ -7895,22 +7959,22 @@ var recordDiagnostics = /* @__PURE__ */ __name((context, app) => {
7895
7959
  return context;
7896
7960
  }, "recordDiagnostics");
7897
7961
 
7898
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-outdated.js
7962
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-outdated.js
7899
7963
  import { existsSync as existsSync8, readFileSync as readFileSync5, realpathSync as realpathSync2 } from "node:fs";
7900
- import { dirname as dirname2, join as join5 } from "node:path";
7964
+ import { dirname as dirname3, join as join6 } from "node:path";
7901
7965
  var OUTDATED_CHECK_MS = 6e4;
7902
7966
  var ownPackageRoot = /* @__PURE__ */ __name((running, script = process.argv[1]) => {
7903
7967
  let dir;
7904
7968
  try {
7905
- dir = dirname2(realpathSync2(script ?? ""));
7969
+ dir = dirname3(realpathSync2(script ?? ""));
7906
7970
  } catch {
7907
7971
  return void 0;
7908
7972
  }
7909
7973
  for (let up = 0; up < 8; up++) {
7910
- const manifest = join5(dir, "package.json");
7974
+ const manifest = join6(dir, "package.json");
7911
7975
  if (existsSync8(manifest))
7912
7976
  return installedVersion(dir) === running ? dir : void 0;
7913
- const parent = dirname2(dir);
7977
+ const parent = dirname3(dir);
7914
7978
  if (parent === dir)
7915
7979
  return void 0;
7916
7980
  dir = parent;
@@ -7919,7 +7983,7 @@ var ownPackageRoot = /* @__PURE__ */ __name((running, script = process.argv[1])
7919
7983
  }, "ownPackageRoot");
7920
7984
  var installedVersion = /* @__PURE__ */ __name((root) => {
7921
7985
  try {
7922
- const { version } = JSON.parse(readFileSync5(join5(root, "package.json"), "utf8"));
7986
+ const { version } = JSON.parse(readFileSync5(join6(root, "package.json"), "utf8"));
7923
7987
  return typeof version === "string" ? version : void 0;
7924
7988
  } catch {
7925
7989
  return void 0;
@@ -7981,7 +8045,7 @@ var watchOutdated = /* @__PURE__ */ __name(({ check: check2, onOutdated, everyMs
7981
8045
  };
7982
8046
  }, "watchOutdated");
7983
8047
 
7984
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
8048
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
7985
8049
  var STEMS_EVERY_MS = 3e4;
7986
8050
  var STEMS_SLICE_MS = 2e3;
7987
8051
  var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY_MS, sliceMs = STEMS_SLICE_MS }) => {
@@ -8021,7 +8085,7 @@ var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY
8021
8085
  };
8022
8086
  }, "stemFills");
8023
8087
 
8024
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
8088
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
8025
8089
  var defined = /* @__PURE__ */ __name((value) => Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0)), "defined");
8026
8090
  var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
8027
8091
  kind: attachment.kind,
@@ -8117,7 +8181,7 @@ var viewOf = /* @__PURE__ */ __name((context, messenger) => ({
8117
8181
  locale: messenger.app.locale
8118
8182
  }), "viewOf");
8119
8183
 
8120
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
8184
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
8121
8185
  var observed = /* @__PURE__ */ __name((value) => ({
8122
8186
  value: value.value,
8123
8187
  observed_at: value.observedAt,
@@ -8184,7 +8248,7 @@ var watchEventItem = /* @__PURE__ */ __name((value, account) => {
8184
8248
  }
8185
8249
  }, "watchEventItem");
8186
8250
 
8187
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
8251
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
8188
8252
  var watchCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("watch"), {
8189
8253
  output: { entity: "watch_item" },
8190
8254
  effects: REMOTE_READ,
@@ -8339,7 +8403,8 @@ var describe = /* @__PURE__ */ __name((event, render) => {
8339
8403
  }
8340
8404
  }, "describe");
8341
8405
 
8342
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
8406
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
8407
+ var CURRENT_EVERY_MS = 6e4;
8343
8408
  var serveCommand = /* @__PURE__ */ __name((messenger) => {
8344
8409
  const command = annotate(new Command("serve"), {
8345
8410
  output: { entity: "serve_summary" },
@@ -8362,9 +8427,18 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
8362
8427
  throw new CliError("validation_error", `${messenger.app.command} serve is already running for profile ${context.profile} (PID ${held.pid}, since ${held.startedAt})`);
8363
8428
  }
8364
8429
  let relaying;
8430
+ let current;
8431
+ const stamp = /* @__PURE__ */ __name(() => {
8432
+ try {
8433
+ markCurrent(path);
8434
+ } catch {
8435
+ }
8436
+ }, "stamp");
8365
8437
  const onReady = /* @__PURE__ */ __name(() => {
8366
8438
  const listening2 = { pid: process.pid, startedAt, version, listeningAt: (/* @__PURE__ */ new Date()).toISOString() };
8367
8439
  holdLock(path, listening2);
8440
+ stamp();
8441
+ current ??= setInterval(stamp, CURRENT_EVERY_MS).unref();
8368
8442
  note({
8369
8443
  code: "listening",
8370
8444
  text: `listening for profile ${context.profile}, catching up on what arrived while it was down`
@@ -8485,6 +8559,10 @@ var serveCommand = /* @__PURE__ */ __name((messenger) => {
8485
8559
  }, "connected")
8486
8560
  });
8487
8561
  } finally {
8562
+ if (current) {
8563
+ clearInterval(current);
8564
+ stamp();
8565
+ }
8488
8566
  watch.stop();
8489
8567
  await relaying;
8490
8568
  await relay?.close();
@@ -8625,7 +8703,7 @@ var tasking = /* @__PURE__ */ __name((context, warn) => {
8625
8703
  };
8626
8704
  }, "tasking");
8627
8705
 
8628
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
8706
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
8629
8707
  import { existsSync as existsSync9 } from "node:fs";
8630
8708
  var PATH = "store tables list";
8631
8709
  var STORE_TABLES_QUERY = {
@@ -8668,7 +8746,7 @@ var storeTablesCommand = /* @__PURE__ */ __name((owner) => {
8668
8746
  return tables;
8669
8747
  }, "storeTablesCommand");
8670
8748
 
8671
- // node_modules/.pnpm/@wirecat+cli-core@0.713.0_@wirecat+cli-base@0.125.1_commander@15.0.0_esbuild@0.28.2_typ_29dc9b659505b9f83a43774498347dd2/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
8749
+ // node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
8672
8750
  var SEARCH_INDEXES = ["messages_fts", "chats_fts", "identities_fts"];
8673
8751
  var WORD_INDEX = "message_words";
8674
8752
  var schemaOf = /* @__PURE__ */ __name((database) => {
@@ -8694,7 +8772,7 @@ var readingOnly = /* @__PURE__ */ __name(async (path, read) => {
8694
8772
  database.close();
8695
8773
  }
8696
8774
  }, "readingOnly");
8697
- var withoutInode = /* @__PURE__ */ __name(({ inode: _, ...mark }) => mark, "withoutInode");
8775
+ var withoutInode = /* @__PURE__ */ __name(({ inode: _, ...mark2 }) => mark2, "withoutInode");
8698
8776
  var fileSchema = /* @__PURE__ */ __name(async (path) => {
8699
8777
  try {
8700
8778
  return await readingOnly(path, (database) => fileSchemaOf(database).version);
@@ -8713,7 +8791,7 @@ var storeSummary = /* @__PURE__ */ __name(async (env, { deep = false, command, v
8713
8791
  ...version ? { version } : {},
8714
8792
  schema: await fileSchema(path)
8715
8793
  }) : null;
8716
- const mark = readDamageMark(path);
8794
+ const mark2 = readDamageMark(path);
8717
8795
  const lastKnownGood = readHealthMark(path)?.last_ok_at ?? null;
8718
8796
  const health = {
8719
8797
  checked: checked.checked,
@@ -8725,11 +8803,11 @@ var storeSummary = /* @__PURE__ */ __name(async (env, { deep = false, command, v
8725
8803
  ...checked.invalidJson?.length ? { invalidJson: checked.invalidJson } : {},
8726
8804
  ...checked.searchIndexes?.some((index) => !index.ok) ? { damagedSearchIndexes: checked.searchIndexes.filter((index) => !index.ok).map((index) => index.name) } : {}
8727
8805
  };
8728
- const damage = command ? storeDamageReport({ health: checked, command, mark, journal, lastOkAt: lastKnownGood }) : null;
8806
+ const damage = command ? storeDamageReport({ health: checked, command, mark: mark2, journal, lastOkAt: lastKnownGood }) : null;
8729
8807
  const healthOf = {
8730
8808
  health,
8731
8809
  lastKnownGood,
8732
- ...mark ? { damageMark: withoutInode(mark) } : {},
8810
+ ...mark2 ? { damageMark: withoutInode(mark2) } : {},
8733
8811
  ...journal ? { journalMark: journal } : {},
8734
8812
  ...recorded?.cleared ? { damageMarkCleared: withoutInode(recorded.cleared) } : {},
8735
8813
  // `what` keeps memo's doctor, which reads it, compiling until it moves to `whatHappened`.
@@ -8916,7 +8994,7 @@ var inspect = /* @__PURE__ */ __name((path) => reading(path, (database) => {
8916
8994
  ...schema.version >= 71 ? [["content_post_words", indexIntegrity(database, "content_post_words", 0)]] : []
8917
8995
  ]);
8918
8996
  const size = bytesOf2(path) + bytesOf2(`${path}-wal`);
8919
- const { bavail, bsize } = statfsSync2(dirname3(path));
8997
+ const { bavail, bsize } = statfsSync2(dirname4(path));
8920
8998
  const free = Number(bavail) * Number(bsize);
8921
8999
  const behind = schema.version > 0 ? chatsBehind(database) : [];
8922
9000
  const vectorIndexes = schema.version >= 34 ? vectorIndexCounts(database) : [];
@@ -9001,8 +9079,9 @@ var chatsBehind = /* @__PURE__ */ __name((database) => database.prepare(`SELECT
9001
9079
  held: row.held === null ? null : isoOf(row.held),
9002
9080
  refreshed: isoOf(row.refreshed)
9003
9081
  })), "chatsBehind");
9004
- var migrateCommand = /* @__PURE__ */ __name((owner) => annotate(new Command("migrate"), { output: { entity: "store_migration" }, effects: LOCAL_WRITE }).summary(`migrate an older ${archive(owner)}`).description("bring the store up to this build's schema, then normalize, index and stem the messages and notes stored before it").action(async function() {
9082
+ var migrateCommand = /* @__PURE__ */ __name((owner) => annotate(new Command("migrate"), { output: { entity: "store_migration" }, effects: LOCAL_WRITE }).summary(`migrate an older ${archive(owner)}`).description("bring the store up to this build's schema, then normalize, index and stem the messages and notes stored before it").option("--no-backup", "migrate even when no rollback copy can be written; older tools then cannot open the store again").action(async function() {
9005
9083
  const { renderer } = outputFor(this);
9084
+ const { backup = true } = this.opts();
9006
9085
  const path = storePath(environmentOf(this).env ?? process.env);
9007
9086
  if (!existsSync10(path)) {
9008
9087
  result(this, { path, exists: false });
@@ -9011,11 +9090,13 @@ var migrateCommand = /* @__PURE__ */ __name((owner) => annotate(new Command("mig
9011
9090
  }
9012
9091
  const answer = await reading(path, (database) => {
9013
9092
  const from = schemaOf(database).version;
9014
- migrate(database, {
9093
+ const notice = migrate(database, {
9015
9094
  command: owner.app.command,
9016
9095
  version: owner.app.version,
9017
- rollback: { store: path, warn: /* @__PURE__ */ __name((line) => renderer.warn(line), "warn") }
9096
+ rollback: { store: path, warn: /* @__PURE__ */ __name((line) => renderer.warn(line), "warn"), withoutCopy: !backup }
9018
9097
  });
9098
+ if (notice)
9099
+ renderer.warn(notice);
9019
9100
  const { normalized, indexed, terms } = buildWordIndex(database, (note) => renderer.note(note));
9020
9101
  const stemmed = buildStems(database, (note) => renderer.note(note));
9021
9102
  const notes = buildNoteIndex(database, (note) => renderer.note(note));
@@ -9106,10 +9187,10 @@ var vacuumInto = /* @__PURE__ */ __name(async (path, target) => {
9106
9187
  }
9107
9188
  }, "vacuumInto");
9108
9189
  var stampNow = /* @__PURE__ */ __name(() => (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-"), "stampNow");
9109
- var backupCommand = /* @__PURE__ */ __name(() => destroysNothing(annotate(new Command("backup"), { output: { entity: "store_backup" }, effects: LOCAL_WRITE })).description("copy the store into a new file, while it is in use; never overwrites a file").argument("<file>", "the new file").option(...ENCRYPT_OPTION).action(async function(file2) {
9190
+ var backupCommand = /* @__PURE__ */ __name(() => inStoreBackups(destroysNothing(annotate(new Command("backup"), { output: { entity: "store_backup" }, effects: LOCAL_WRITE })), "file").description("copy the store into a new file, while it is in use; never overwrites a file").argument("<file>", "the new file").option(...ENCRYPT_OPTION).action(async function(file2) {
9110
9191
  const { encrypt } = this.opts();
9111
9192
  const path = storePath(environmentOf(this).env ?? process.env);
9112
- const target = resolve(file2);
9193
+ const target = resolve2(file2);
9113
9194
  const { app, env } = environmentOf(this);
9114
9195
  if (app)
9115
9196
  refuseLockedOutput(target, app, env ?? process.env, "<file>");
@@ -9146,8 +9227,8 @@ var backupCommand = /* @__PURE__ */ __name(() => destroysNothing(annotate(new Co
9146
9227
  }), "backupCommand");
9147
9228
  var decryptCommand = /* @__PURE__ */ __name(() => annotate(new Command("decrypt"), { output: { entity: "store_decrypt" }, effects: LOCAL_WRITE }).description("open a file written with --encrypt into a new file; asks for its password").argument("<file>", "a file `store backup --encrypt` or `store export --encrypt` wrote").requiredOption("--output <file>", "the new file, readable only by you").action(async function(file2) {
9148
9229
  const { output } = this.opts();
9149
- const from = resolve(file2);
9150
- const to = resolve(output);
9230
+ const from = resolve2(file2);
9231
+ const to = resolve2(output);
9151
9232
  if (!existsSync10(from))
9152
9233
  throw new CliError("not_found", `no file at ${from}`);
9153
9234
  if (!isSealed(from))
@@ -9157,16 +9238,16 @@ var decryptCommand = /* @__PURE__ */ __name(() => annotate(new Command("decrypt"
9157
9238
  await unsealFile(from, to, await passwordOf(this, { twice: false }));
9158
9239
  result(this, { path: to, from, bytes: bytesOf2(to) });
9159
9240
  }), "decryptCommand");
9160
- var restoreCommand = /* @__PURE__ */ __name((owner) => grantsAuthority(annotate(new Command("restore"), { output: { entity: "store_restore" }, effects: LOCAL_WRITE })).summary("restore a backup and keep the current store, or roll back a breaking upgrade").description("put a backup in place of the store; the store it replaces is kept beside it, never deleted. Given a rollback copy (backups/<store>-rollback-schema-<version>-<time>.db, kept for a day before an upgrade older tools cannot open), put its tables back in the store and return it to that version instead").argument("<file>", "a file `store backup` wrote, or a rollback copy; one written with --encrypt asks for its password").action(async function(file2) {
9241
+ var restoreCommand = /* @__PURE__ */ __name((owner) => inStoreBackups(grantsAuthority(annotate(new Command("restore"), { output: { entity: "store_restore" }, effects: LOCAL_WRITE })), "file").summary("restore a backup and keep the current store, or roll back a breaking upgrade").description("put a backup in place of the store; the store it replaces is kept beside it, never deleted. Given a rollback copy (backups/<store>-rollback-schema-<version>-<time>.db, kept for a day before an upgrade older tools cannot open), put its tables back in the store and return it to that version instead").argument("<file>", "a file `store backup` wrote, or a rollback copy; one written with --encrypt asks for its password").action(async function(file2) {
9161
9242
  const path = storePath(environmentOf(this).env ?? process.env);
9162
- const given = resolve(file2);
9243
+ const given = resolve2(file2);
9163
9244
  if (!existsSync10(given))
9164
9245
  throw new CliError("not_found", `no file at ${given}`);
9165
9246
  refuseWhileServing(this, owner);
9166
9247
  if (!isSealed(given))
9167
9248
  return restoreFrom(this, owner, given, given);
9168
9249
  const opened = `${path}.unsealing-${process.pid}`;
9169
- mkdirSync(dirname3(path), { recursive: true, mode: 448 });
9250
+ mkdirSync(dirname4(path), { recursive: true, mode: 448 });
9170
9251
  try {
9171
9252
  await unsealFile(given, opened, await passwordOf(this, { twice: false }));
9172
9253
  await restoreFrom(this, owner, opened, given);
@@ -9189,7 +9270,7 @@ var restoreFrom = /* @__PURE__ */ __name(async (command, owner, backup, given) =
9189
9270
  const waitMs = environmentOf(command).storeLockWaitMs;
9190
9271
  await quiesce(path, owner, "restore", (message) => renderer.warn(message), waitMs);
9191
9272
  } else
9192
- mkdirSync(dirname3(path), { recursive: true, mode: 448 });
9273
+ mkdirSync(dirname4(path), { recursive: true, mode: 448 });
9193
9274
  const incoming = `${path}.restoring-${stamp}`;
9194
9275
  copyFileSync(backup, incoming, constants.COPYFILE_EXCL);
9195
9276
  chmodSync(incoming, 384);
@@ -9407,6 +9488,11 @@ export {
9407
9488
  checkFor,
9408
9489
  passes,
9409
9490
  seal,
9491
+ notLocalPaths,
9492
+ isLocalPathOption,
9493
+ isLocalPathArgument,
9494
+ refuseAgentPaths,
9495
+ absoluteFrom,
9410
9496
  ENCRYPT_OPTION,
9411
9497
  passwordOf,
9412
9498
  DAY_MS,