@wirecat/tg-cli 0.101.0 → 0.103.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 (126) hide show
  1. package/dist/bin/tg.js +31 -19
  2. package/dist/bot/transport.d.ts.map +1 -1
  3. package/dist/bot/transport.js +14 -17
  4. package/dist/bot/transport.js.map +1 -1
  5. package/dist/bundle/{adapter-A3VD4Y6Z.js → adapter-QG3YFFOY.js} +101 -38
  6. package/dist/bundle/{all-profiles-UPVNHXB2.js → all-profiles-ECXH3TBF.js} +32 -11
  7. package/dist/bundle/{anthropic-IRKNWPIB.js → anthropic-5MKO3QX7.js} +10 -10
  8. package/dist/bundle/{bot-api-UNTQG2M5.js → bot-api-4DQPIOMK.js} +55 -58
  9. package/dist/bundle/{bot-history-V4RTY5K7.js → bot-history-UN74XXLU.js} +19 -19
  10. package/dist/bundle/{bun-2JZPG2NL.js → bun-PS73VF2C.js} +5 -5
  11. package/dist/bundle/{bun-sqlite-TZHKM225.js → bun-sqlite-RAWGPH23.js} +8 -8
  12. package/dist/bundle/{chunk-ZZLKX62Z.js → chunk-2ABQZVK4.js} +3 -3
  13. package/dist/bundle/{chunk-MLLJ74LM.js → chunk-3CP7RK5R.js} +4 -4
  14. package/dist/bundle/{chunk-BXQS5RCE.js → chunk-3IXKDIPH.js} +258 -83
  15. package/dist/bundle/{chunk-W2336E7Y.js → chunk-3QX6SOEO.js} +9 -9
  16. package/dist/bundle/{chunk-F7TDFWXY.js → chunk-537O7OVE.js} +6 -6
  17. package/dist/bundle/{chunk-N5UFBWDM.js → chunk-57XGUIXA.js} +9 -11
  18. package/dist/bundle/{chunk-3KHKYYCR.js → chunk-5D4AEUVA.js} +4 -3
  19. package/dist/bundle/{chunk-ODSVNH3H.js → chunk-5HPAPVCB.js} +2415 -1292
  20. package/dist/bundle/{chunk-OEJ5DMCX.js → chunk-67SRVSPU.js} +10 -10
  21. package/dist/bundle/{chunk-XCKD54TN.js → chunk-6N25NZOE.js} +9 -9
  22. package/dist/bundle/chunk-AAMJZJYC.js +922 -0
  23. package/dist/bundle/{chunk-AVWK4NCW.js → chunk-ADLS6FVG.js} +13 -13
  24. package/dist/bundle/{chunk-ZV24I2UJ.js → chunk-AUKAZRF6.js} +5 -5
  25. package/dist/bundle/{chunk-S7ZNLLY5.js → chunk-BV4N333Y.js} +6 -6
  26. package/dist/bundle/{chunk-UN6CKIBN.js → chunk-BYYSVINK.js} +11 -8
  27. package/dist/bundle/{chunk-54R2GDQ3.js → chunk-CMQ34EZL.js} +6 -6
  28. package/dist/bundle/{chunk-G2US6LJB.js → chunk-COZ74WW4.js} +4 -4
  29. package/dist/bundle/{chunk-7BFO3DY6.js → chunk-DFDN6AUB.js} +2 -2
  30. package/dist/bundle/{chunk-VA5YEJS3.js → chunk-DLF3H6NP.js} +7 -7
  31. package/dist/bundle/{chunk-QOWSVDPZ.js → chunk-DWQ4QT6X.js} +111 -100
  32. package/dist/bundle/chunk-EMC57SOZ.js +440 -0
  33. package/dist/bundle/{chunk-RVCS7Q3A.js → chunk-EQHQ2AX3.js} +1390 -522
  34. package/dist/bundle/{chunk-64DK7S4F.js → chunk-F27OI4J2.js} +4 -4
  35. package/dist/bundle/{chunk-2XBSVRT2.js → chunk-FG2QTYEF.js} +4 -4
  36. package/dist/bundle/{chunk-BX6HH4F6.js → chunk-FSPDODVT.js} +14 -14
  37. package/dist/bundle/{chunk-4ZS73HTJ.js → chunk-G5IMOOPB.js} +4 -4
  38. package/dist/bundle/{chunk-VCGL2ETF.js → chunk-GO354DJ5.js} +4 -4
  39. package/dist/bundle/{chunk-5TPT2S2Z.js → chunk-H2UTBYFC.js} +4 -4
  40. package/dist/bundle/{chunk-U46UNBMT.js → chunk-HCDZWFXO.js} +244 -21
  41. package/dist/bundle/{chunk-TGREFJVA.js → chunk-KCVDWZWS.js} +11 -11
  42. package/dist/bundle/{chunk-PUBS2F5J.js → chunk-KQ5BUI5T.js} +248 -248
  43. package/dist/bundle/{chunk-ACGTFLEB.js → chunk-LAYPLF7G.js} +35 -282
  44. package/dist/bundle/{chunk-5KU4UQBM.js → chunk-MFS52LTZ.js} +4 -4
  45. package/dist/bundle/{chunk-DYNSP6FW.js → chunk-MHHDVR4G.js} +1449 -832
  46. package/dist/bundle/{chunk-S2JSZWEC.js → chunk-NIVZHTN4.js} +15 -15
  47. package/dist/bundle/{chunk-A5JSTZZZ.js → chunk-NKN54EDN.js} +6 -6
  48. package/dist/bundle/chunk-O5EHUB2V.js +2 -0
  49. package/dist/bundle/{chunk-5GKXETRP.js → chunk-OGVBRRWY.js} +615 -56
  50. package/dist/bundle/{chunk-VYDTI254.js → chunk-Q2LBOPKO.js} +99 -50
  51. package/dist/bundle/{chunk-LPB2MDUW.js → chunk-QF7VVIF4.js} +11 -11
  52. package/dist/bundle/{chunk-VRSN7VLO.js → chunk-RD7SSY7H.js} +4 -4
  53. package/dist/bundle/{chunk-ZEOCU24Z.js → chunk-RKQIEJFR.js} +5 -5
  54. package/dist/bundle/chunk-RMC2S3F4.js +264 -0
  55. package/dist/bundle/{chunk-2DGOFLDA.js → chunk-S5M4HFOZ.js} +6 -6
  56. package/dist/bundle/{chunk-X4Y2ROJI.js → chunk-SSALGKMJ.js} +94 -5
  57. package/dist/bundle/{chunk-G3ZRY436.js → chunk-SSV37M5T.js} +59 -59
  58. package/dist/bundle/{chunk-DG62L57H.js → chunk-T4SDOYPY.js} +20 -20
  59. package/dist/bundle/{chunk-6IPY2QRG.js → chunk-TEO2KP52.js} +5 -5
  60. package/dist/bundle/{chunk-G77QOTXE.js → chunk-TPFLD4OM.js} +5 -5
  61. package/dist/bundle/{chunk-PYTOIDSM.js → chunk-VMU4SGCE.js} +7 -7
  62. package/dist/bundle/{chunk-QYVVRQTN.js → chunk-VZN5LD26.js} +6 -6
  63. package/dist/bundle/{chunk-ZJVZXJOG.js → chunk-WAGDZB62.js} +5 -5
  64. package/dist/bundle/{chunk-7CBUCTB6.js → chunk-WULARSC4.js} +33 -39
  65. package/dist/bundle/{chunk-BJG6JA5U.js → chunk-Y5E2WNWB.js} +4 -4
  66. package/dist/bundle/{chunk-H6OXALTJ.js → chunk-YI72UVTJ.js} +5 -5
  67. package/dist/bundle/{chunk-NC5WS7OP.js → chunk-Z2DPNTSU.js} +5 -5
  68. package/dist/bundle/{chunk-RF54YDBB.js → chunk-ZHXSRYJ5.js} +6 -6
  69. package/dist/bundle/{chunk-AFV74GK3.js → chunk-ZVVMGPBJ.js} +2 -2
  70. package/dist/bundle/command-contract-ZGFJTLB2.js +32 -0
  71. package/dist/bundle/{dist-RJMT44PL.js → dist-I7OZPHAZ.js} +3 -3
  72. package/dist/bundle/{echarts-QZ6PR3VC.js → echarts-UEQDIHVQ.js} +5 -5
  73. package/dist/bundle/{embed-UBXCXSRD.js → embed-5DPZKRW5.js} +9 -8
  74. package/dist/bundle/{embedder-B4ZTKC23.js → embedder-NBQXDXAO.js} +12 -11
  75. package/dist/bundle/entry-EE6YRAP4.js +14 -0
  76. package/dist/bundle/first-run-OSEVVWNT.js +24 -0
  77. package/dist/bundle/first-screen-753THOU6.js +30 -0
  78. package/dist/bundle/identity-LNH33PN3.js +11 -0
  79. package/dist/bundle/instructions-PYGVIT7I.js +9 -0
  80. package/dist/bundle/{mcp-4Y37G2UY.js → mcp-OQBZXELQ.js} +5 -5
  81. package/dist/bundle/{node-LZZX22VR.js → node-3OBKCX6M.js} +5 -5
  82. package/dist/bundle/{node-IUL5HSYI.js → node-P4E63KXA.js} +5 -5
  83. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  84. package/dist/bundle/{node-sqlite-BPGT6T5U.js → node-sqlite-DMMTDRFB.js} +8 -8
  85. package/dist/bundle/oauth-FX5DDCRS.js +18 -0
  86. package/dist/bundle/open-G6QRQAAL.js +20 -0
  87. package/dist/bundle/{process-GPUXC4PG.js → process-47MMIFIJ.js} +5 -5
  88. package/dist/bundle/{program-NEXEAL7T.js → program-LBHBWRK5.js} +67 -71
  89. package/dist/bundle/prompt-CJ6Y4JYC.js +13 -0
  90. package/dist/bundle/proxy-transport-YSBYG26I.js +17 -0
  91. package/dist/bundle/{recognize-UJBXORVD.js → recognize-7BLTOI45.js} +9 -9
  92. package/dist/bundle/remote-Q4A4JY6U.js +27 -0
  93. package/dist/bundle/{rerank-3Y2VZM3J.js → rerank-CQAR46L3.js} +10 -9
  94. package/dist/bundle/{serve-VDZIVOPR.js → serve-2UO2YMMG.js} +13 -13
  95. package/dist/bundle/{server-BERXP4GW.js → server-6XYURULQ.js} +80 -68
  96. package/dist/bundle/{server-ZFHN4GUF.js → server-FMKC4RLL.js} +46 -41
  97. package/dist/bundle/{state-DGR4EE3E.js → state-RNWN2RDY.js} +9 -9
  98. package/dist/bundle/{store-MRCFSCZD.js → store-BBHTR477.js} +14 -14
  99. package/dist/bundle/store-maintenance-command-GD6OLRXH.js +44 -0
  100. package/dist/bundle/tg.js +8 -8
  101. package/dist/telegram/sending.d.ts.map +1 -1
  102. package/dist/telegram/sending.js +52 -3
  103. package/dist/telegram/sending.js.map +1 -1
  104. package/dist/version.d.ts +1 -1
  105. package/dist/version.js +1 -1
  106. package/package.json +4 -4
  107. package/dist/bundle/chunk-22PQUX72.js +0 -190
  108. package/dist/bundle/chunk-2SJOUK6J.js +0 -2
  109. package/dist/bundle/chunk-CJ6IYCYP.js +0 -583
  110. package/dist/bundle/chunk-NKJJJAIJ.js +0 -237
  111. package/dist/bundle/chunk-NMGO6LW6.js +0 -1950
  112. package/dist/bundle/chunk-OILBDLWL.js +0 -724
  113. package/dist/bundle/chunk-OPBTNQ35.js +0 -1007
  114. package/dist/bundle/command-contract-TKDI7E56.js +0 -31
  115. package/dist/bundle/entry-BTUTHO5M.js +0 -14
  116. package/dist/bundle/first-run-UC4HRIFV.js +0 -24
  117. package/dist/bundle/first-screen-SMCX6YKY.js +0 -29
  118. package/dist/bundle/identity-QSDEGDH7.js +0 -11
  119. package/dist/bundle/instructions-BBGLZKO3.js +0 -9
  120. package/dist/bundle/node-UPPL626U.js +0 -21
  121. package/dist/bundle/oauth-XNE2KPKJ.js +0 -18
  122. package/dist/bundle/open-SXGYZLB5.js +0 -20
  123. package/dist/bundle/prompt-SORGLEYI.js +0 -13
  124. package/dist/bundle/proxy-transport-G4MA6BGU.js +0 -17
  125. package/dist/bundle/remote-W72AR7KH.js +0 -26
  126. package/dist/bundle/store-maintenance-command-DCMZDMYS.js +0 -46
@@ -1,17 +1,15 @@
1
- import { createRequire as __tgRequire } from "node:module";
2
- const require = __tgRequire(import.meta.url);
3
- import {
4
- renderMessages
5
- } from "./chunk-22PQUX72.js";
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
6
3
  import {
7
4
  answerOf,
8
5
  messengerContext
9
- } from "./chunk-5GKXETRP.js";
6
+ } from "./chunk-OGVBRRWY.js";
10
7
  import {
11
8
  RULES_VERSION,
12
9
  applyTaskRulesOnArrival,
13
10
  chatEventAnswer,
14
11
  memberAnswer,
12
+ newSendId,
15
13
  onlineDeps,
16
14
  openRequestTask,
17
15
  pollVoteAnswer,
@@ -21,10 +19,11 @@ import {
21
19
  syncsOneChat,
22
20
  typedQuery,
23
21
  withQuery
24
- } from "./chunk-DYNSP6FW.js";
22
+ } from "./chunk-MHHDVR4G.js";
25
23
  import {
26
- newSendId
27
- } from "./chunk-OILBDLWL.js";
24
+ stringWidth,
25
+ wrapAnsi
26
+ } from "./chunk-2ABQZVK4.js";
28
27
  import {
29
28
  Command,
30
29
  LOCAL_READ,
@@ -32,12 +31,14 @@ import {
32
31
  REMOTE_READ,
33
32
  REMOTE_WRITE,
34
33
  annotate,
34
+ codeOf,
35
+ currentRun,
35
36
  destroysNothing,
36
37
  endpoint,
37
38
  environmentOf,
38
- failureKey,
39
39
  itemOf,
40
40
  jsonlRecords,
41
+ levelFor,
41
42
  lineOf,
42
43
  listOf,
43
44
  modelTarget,
@@ -49,34 +50,32 @@ import {
49
50
  snakeKeys,
50
51
  storeTable,
51
52
  withoutProviderRefs
52
- } from "./chunk-RVCS7Q3A.js";
53
+ } from "./chunk-EQHQ2AX3.js";
53
54
  import {
54
- codeOf,
55
- currentRun,
56
- levelFor
57
- } from "./chunk-OPBTNQ35.js";
55
+ failureKey
56
+ } from "./chunk-EMC57SOZ.js";
58
57
  import {
59
58
  envName
60
- } from "./chunk-ZV24I2UJ.js";
59
+ } from "./chunk-AUKAZRF6.js";
61
60
  import {
62
61
  holdLock,
63
62
  lockPath,
64
63
  releaseLock,
65
64
  servingProfiles,
66
65
  takeLock
67
- } from "./chunk-QYVVRQTN.js";
66
+ } from "./chunk-VZN5LD26.js";
68
67
  import {
69
68
  holdersOf
70
- } from "./chunk-VRSN7VLO.js";
69
+ } from "./chunk-RD7SSY7H.js";
71
70
  import {
72
71
  checkedOptions,
73
72
  range
74
- } from "./chunk-NC5WS7OP.js";
73
+ } from "./chunk-Z2DPNTSU.js";
75
74
  import {
76
75
  messagesFor,
77
76
  systemFor,
78
77
  validateImages
79
- } from "./chunk-H6OXALTJ.js";
78
+ } from "./chunk-YI72UVTJ.js";
80
79
  import {
81
80
  MIGRATIONS,
82
81
  drainNoteIndex,
@@ -105,25 +104,27 @@ import {
105
104
  storeClients,
106
105
  storeContents,
107
106
  vectorIndexCounts
108
- } from "./chunk-PUBS2F5J.js";
107
+ } from "./chunk-KQ5BUI5T.js";
109
108
  import {
110
109
  queryFieldsOf
111
- } from "./chunk-G3ZRY436.js";
110
+ } from "./chunk-SSV37M5T.js";
112
111
  import {
113
112
  storePath
114
- } from "./chunk-G77QOTXE.js";
113
+ } from "./chunk-TPFLD4OM.js";
115
114
  import {
116
115
  openCache
117
- } from "./chunk-XCKD54TN.js";
116
+ } from "./chunk-6N25NZOE.js";
118
117
  import {
119
118
  readSecret
120
- } from "./chunk-F7TDFWXY.js";
119
+ } from "./chunk-537O7OVE.js";
121
120
  import {
122
121
  Credentials,
123
122
  pathsAreOverridden,
124
123
  resolvePaths,
124
+ singleLine,
125
+ visibleControls,
125
126
  writeSecurely
126
- } from "./chunk-DG62L57H.js";
127
+ } from "./chunk-T4SDOYPY.js";
127
128
  import {
128
129
  CliError,
129
130
  array,
@@ -148,13 +149,13 @@ import {
148
149
  transform,
149
150
  trim,
150
151
  union
151
- } from "./chunk-OEJ5DMCX.js";
152
+ } from "./chunk-67SRVSPU.js";
152
153
  import {
153
154
  __commonJS,
154
155
  __name,
155
156
  __require,
156
157
  __toESM
157
- } from "./chunk-AFV74GK3.js";
158
+ } from "./chunk-ZVVMGPBJ.js";
158
159
 
159
160
  // node_modules/.pnpm/liquidjs@10.30.0/node_modules/liquidjs/dist/liquid.node.js
160
161
  var require_liquid_node = __commonJS({
@@ -2433,10 +2434,10 @@ var require_liquid_node = __commonJS({
2433
2434
  readHashes(jekyllStyle) {
2434
2435
  const hashes = [];
2435
2436
  while (true) {
2436
- const hash = this.readHash(jekyllStyle);
2437
- if (!hash)
2437
+ const hash2 = this.readHash(jekyllStyle);
2438
+ if (!hash2)
2438
2439
  return hashes;
2439
- hashes.push(hash);
2440
+ hashes.push(hash2);
2440
2441
  }
2441
2442
  }
2442
2443
  readHash(jekyllStyle) {
@@ -2705,16 +2706,16 @@ var require_liquid_node = __commonJS({
2705
2706
  constructor(input, jekyllStyle) {
2706
2707
  this.hash = {};
2707
2708
  const tokenizer = input instanceof Tokenizer ? input : new Tokenizer(input, {});
2708
- for (const hash of tokenizer.readHashes(jekyllStyle)) {
2709
- this.hash[hash.name.content] = hash.value;
2709
+ for (const hash2 of tokenizer.readHashes(jekyllStyle)) {
2710
+ this.hash[hash2.name.content] = hash2.value;
2710
2711
  }
2711
2712
  }
2712
2713
  *render(ctx) {
2713
- const hash = {};
2714
+ const hash2 = {};
2714
2715
  for (const key of Object.keys(this.hash)) {
2715
- hash[key] = this.hash[key] === void 0 ? true : yield evalToken(this.hash[key], ctx);
2716
+ hash2[key] = this.hash[key] === void 0 ? true : yield evalToken(this.hash[key], ctx);
2716
2717
  }
2717
- return hash;
2718
+ return hash2;
2718
2719
  }
2719
2720
  };
2720
2721
  function createTagClass(options2) {
@@ -2726,8 +2727,8 @@ var require_liquid_node = __commonJS({
2726
2727
  }
2727
2728
  }
2728
2729
  *render(ctx, emitter) {
2729
- const hash = yield new Hash(this.token.args, ctx.opts.keyValueSeparator).render(ctx);
2730
- return yield options2.render.call(this, ctx, emitter, hash);
2730
+ const hash2 = yield new Hash(this.token.args, ctx.opts.keyValueSeparator).render(ctx);
2731
+ return yield options2.render.call(this, ctx, emitter, hash2);
2731
2732
  }
2732
2733
  };
2733
2734
  }
@@ -4108,10 +4109,10 @@ var require_liquid_node = __commonJS({
4108
4109
  const str = stringify(v);
4109
4110
  pattern = stringify(pattern);
4110
4111
  replacement = stringify(replacement);
4111
- const parts = str.split(pattern);
4112
- const outputSize = str.length + (parts.length - 1) * (replacement.length - pattern.length);
4112
+ const parts2 = str.split(pattern);
4113
+ const outputSize = str.length + (parts2.length - 1) * (replacement.length - pattern.length);
4113
4114
  this.context.memoryLimit.use(outputSize);
4114
- return parts.join(replacement);
4115
+ return parts2.join(replacement);
4115
4116
  }
4116
4117
  __name(replace, "replace");
4117
4118
  function replace_first(v, arg1, arg2) {
@@ -4349,17 +4350,17 @@ var require_liquid_node = __commonJS({
4349
4350
  }
4350
4351
  const continueKey = "continue-" + this.variable + "-" + this.collection.getText();
4351
4352
  ctx.push(createScope({ continue: ctx.getRegister(continueKey, {}) }));
4352
- const hash = yield this.hash.render(ctx);
4353
+ const hash2 = yield this.hash.render(ctx);
4353
4354
  ctx.pop();
4354
- const modifiers = this.liquid.options.orderedFilterParameters ? Object.keys(hash).filter((x) => MODIFIERS.includes(x)) : MODIFIERS.filter((x) => hash[x] !== void 0);
4355
+ const modifiers = this.liquid.options.orderedFilterParameters ? Object.keys(hash2).filter((x) => MODIFIERS.includes(x)) : MODIFIERS.filter((x) => hash2[x] !== void 0);
4355
4356
  collection = modifiers.reduce((collection2, modifier) => {
4356
4357
  if (modifier === "offset")
4357
- return offset(collection2, hash["offset"]);
4358
+ return offset(collection2, hash2["offset"]);
4358
4359
  if (modifier === "limit")
4359
- return limit2(collection2, hash["limit"]);
4360
+ return limit2(collection2, hash2["limit"]);
4360
4361
  return reversed(collection2);
4361
4362
  }, collection);
4362
- ctx.setRegister(continueKey, (hash["offset"] || 0) + collection.length);
4363
+ ctx.setRegister(continueKey, (hash2["offset"] || 0) + collection.length);
4363
4364
  const scope = createScope({ forloop: new ForloopDrop(collection.length, this.collection.getText(), this.variable) });
4364
4365
  ctx.push(scope);
4365
4366
  for (const item of collection) {
@@ -4574,12 +4575,12 @@ var require_liquid_node = __commonJS({
4574
4575
  this.hash = new Hash(tokenizer, liquid.options.keyValueSeparator);
4575
4576
  }
4576
4577
  *render(ctx, emitter) {
4577
- const { liquid, hash } = this;
4578
+ const { liquid, hash: hash2 } = this;
4578
4579
  const filepath = yield renderFilePath(this.file, ctx, liquid);
4579
4580
  assert(filepath, () => `illegal file path "${filepath}"`);
4580
4581
  const childCtx = ctx.spawn();
4581
4582
  const scope = childCtx.bottom();
4582
- __assign(scope, yield hash.render(ctx));
4583
+ __assign(scope, yield hash2.render(ctx));
4583
4584
  if (this.with) {
4584
4585
  const { value, alias } = this.with;
4585
4586
  scope[alias || filepath] = yield evalToken(value, ctx);
@@ -4700,14 +4701,14 @@ var require_liquid_node = __commonJS({
4700
4701
  this.hash = new Hash(tokenizer, liquid.options.jekyllInclude || liquid.options.keyValueSeparator);
4701
4702
  }
4702
4703
  *render(ctx, emitter) {
4703
- const { liquid, hash, withVar } = this;
4704
+ const { liquid, hash: hash2, withVar } = this;
4704
4705
  const { renderer } = liquid;
4705
4706
  const filepath = yield renderFilePath(this.file, ctx, liquid);
4706
4707
  assert(filepath, () => `illegal file path "${filepath}"`);
4707
4708
  const saved = ctx.saveRegister("blocks", "blockMode");
4708
4709
  ctx.setRegister("blocks", {});
4709
4710
  ctx.setRegister("blockMode", BlockMode.OUTPUT);
4710
- const scope = createScope(yield hash.render(ctx));
4711
+ const scope = createScope(yield hash2.render(ctx));
4711
4712
  if (withVar)
4712
4713
  scope[filepath] = yield evalToken(withVar, ctx);
4713
4714
  const templates = yield liquid._parsePartialFile(filepath, ctx.sync, this.currentFile);
@@ -5488,11 +5489,11 @@ var require_liquid_node = __commonJS({
5488
5489
  }
5489
5490
  });
5490
5491
 
5491
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5492
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
5492
5493
  import { chmodSync, constants, copyFileSync, existsSync as existsSync7, mkdirSync, realpathSync, renameSync as renameSync2, rmSync as rmSync2, statfsSync, statSync as statSync3, writeFileSync } from "node:fs";
5493
5494
  import { dirname, resolve } from "node:path";
5494
5495
 
5495
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/sealed.js
5496
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/sealed.js
5496
5497
  import { createCipheriv, createDecipheriv, createHash, randomBytes, scrypt, timingSafeEqual } from "node:crypto";
5497
5498
  import { closeSync, createReadStream, createWriteStream, existsSync, openSync, readSync, renameSync, rmSync, statSync } from "node:fs";
5498
5499
  import { Transform } from "node:stream";
@@ -5508,8 +5509,8 @@ var keyOf = /* @__PURE__ */ __name((password, salt, { log2N, r, p }) => new Prom
5508
5509
  var checkFor = /* @__PURE__ */ __name(async (password, cost = COST) => {
5509
5510
  refuseEmpty(password);
5510
5511
  const salt = randomBytes(SALT);
5511
- const hash = createHash("sha256").update(await keyOf(password, salt, cost)).digest("hex");
5512
- return { salt: salt.toString("hex"), ...cost, hash };
5512
+ const hash2 = createHash("sha256").update(await keyOf(password, salt, cost)).digest("hex");
5513
+ return { salt: salt.toString("hex"), ...cost, hash: hash2 };
5513
5514
  }, "checkFor");
5514
5515
  var passes = /* @__PURE__ */ __name(async (password, check2) => {
5515
5516
  refuseCost(check2);
@@ -5599,7 +5600,7 @@ var unsealFile = /* @__PURE__ */ __name(async (from, to, password) => {
5599
5600
  renameSync(pending, to);
5600
5601
  }, "unsealFile");
5601
5602
 
5602
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5603
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/store/compatibility.js
5603
5604
  var SPEAKS = MIGRATIONS.at(-1)?.version ?? 0;
5604
5605
  var fileSchemaOf = /* @__PURE__ */ __name((database) => {
5605
5606
  const tracked = database.prepare("SELECT 1 FROM sqlite_master WHERE name = 'schema_migrations'").get();
@@ -5623,7 +5624,7 @@ var compatibilityOf = /* @__PURE__ */ __name((file2, migrations = MIGRATIONS) =>
5623
5624
  };
5624
5625
  }, "compatibilityOf");
5625
5626
 
5626
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/store/repair.js
5627
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/store/repair.js
5627
5628
  import { createHash as createHash2 } from "node:crypto";
5628
5629
  var COPY_MARK = "__repair_";
5629
5630
  var COPY_NAME = /__repair_[0-9a-f]{8}(_\d+)?$/;
@@ -5877,7 +5878,7 @@ var deleteCopy = /* @__PURE__ */ __name((database, name) => {
5877
5878
  return found;
5878
5879
  }, "deleteCopy");
5879
5880
 
5880
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5881
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/cli/store-info.js
5881
5882
  import { existsSync as existsSync2, statSync as statSync2 } from "node:fs";
5882
5883
  var pendingIfKnown = /* @__PURE__ */ __name((database) => database.prepare("SELECT 1 FROM pragma_table_info('messages') WHERE name = 'normalized_text'").get() ? pendingNormalization(database) : null, "pendingIfKnown");
5883
5884
  var bytesOf = /* @__PURE__ */ __name((path) => existsSync2(path) ? statSync2(path).size : 0, "bytesOf");
@@ -5924,7 +5925,7 @@ var storeInfoCommand = /* @__PURE__ */ __name(() => annotate(new Command("info")
5924
5925
  renderAnswer(this, outputFor(this), itemOf(answer));
5925
5926
  }), "storeInfoCommand");
5926
5927
 
5927
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
5928
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/cli/messenger/password.js
5928
5929
  var ENCRYPT_OPTION = [
5929
5930
  "--encrypt",
5930
5931
  "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"
@@ -5943,7 +5944,7 @@ var passwordOf = /* @__PURE__ */ __name(async (command, { twice }) => {
5943
5944
  return password;
5944
5945
  }, "passwordOf");
5945
5946
 
5946
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/replies/rules.js
5947
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/replies/rules.js
5947
5948
  import { existsSync as existsSync3, readFileSync } from "node:fs";
5948
5949
  import { join } from "node:path";
5949
5950
  var REPLY_ACTIONS = ["reply", "task"];
@@ -6114,7 +6115,7 @@ var problem = /* @__PURE__ */ __name((issue) => {
6114
6115
  }, "problem");
6115
6116
  var broken = /* @__PURE__ */ __name((path, why) => new CliError("configuration_error", `the reply rules ${path} cannot be read (${why}) \u2014 fix the file`), "broken");
6116
6117
 
6117
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/replies/state.js
6118
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/replies/state.js
6118
6119
  import { existsSync as existsSync4, readFileSync as readFileSync2 } from "node:fs";
6119
6120
  import { join as join2 } from "node:path";
6120
6121
  var ANSWERED_KEPT = 1e3;
@@ -6167,7 +6168,7 @@ var recordReply = /* @__PURE__ */ __name((state, rule2, message, now) => {
6167
6168
  }, "recordReply");
6168
6169
  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");
6169
6170
 
6170
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/replies/decide.js
6171
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/replies/decide.js
6171
6172
  var skip = /* @__PURE__ */ __name((why) => ({ skip: why }), "skip");
6172
6173
  var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
6173
6174
  const { message, chat, owner, sender } = incoming;
@@ -6242,14 +6243,14 @@ var decide = /* @__PURE__ */ __name((rule2, incoming, state, now) => {
6242
6243
  }, "decide");
6243
6244
  var mentionsOwner = /* @__PURE__ */ __name((message, owner) => message.replyTo?.outgoing === true || owner.id !== null && (message.mentions ?? []).includes(owner.id) || owner.username !== void 0 && hasWord(message.text, `@${owner.username}`), "mentionsOwner");
6244
6245
  var local = /* @__PURE__ */ __name((zone, now) => {
6245
- const parts = new Intl.DateTimeFormat("en-US", {
6246
+ const parts2 = new Intl.DateTimeFormat("en-US", {
6246
6247
  timeZone: zone,
6247
6248
  weekday: "short",
6248
6249
  hour: "2-digit",
6249
6250
  minute: "2-digit",
6250
6251
  hourCycle: "h23"
6251
6252
  }).formatToParts(now);
6252
- const part = /* @__PURE__ */ __name((type) => parts.find((one) => one.type === type)?.value ?? "", "part");
6253
+ const part = /* @__PURE__ */ __name((type) => parts2.find((one) => one.type === type)?.value ?? "", "part");
6253
6254
  return {
6254
6255
  day: part("weekday").toLowerCase(),
6255
6256
  minute: Number(part("hour")) * 60 + Number(part("minute"))
@@ -6273,7 +6274,7 @@ var filled = /* @__PURE__ */ __name((template2, senderName) => {
6273
6274
  return template2.replaceAll("{firstName}", name.split(/\s+/)[0] ?? name).replaceAll("{name}", name);
6274
6275
  }, "filled");
6275
6276
 
6276
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/replies/template.js
6277
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/replies/template.js
6277
6278
  var import_liquidjs = __toESM(require_liquid_node(), 1);
6278
6279
  var TEMPLATE_LIMITS = {
6279
6280
  parse: 32768,
@@ -6316,7 +6317,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
6316
6317
  let parsingAI = false;
6317
6318
  try {
6318
6319
  const zone = input.timezone ?? "UTC";
6319
- const parts = Object.fromEntries(new Intl.DateTimeFormat("en-CA", {
6320
+ const parts2 = Object.fromEntries(new Intl.DateTimeFormat("en-CA", {
6320
6321
  timeZone: zone,
6321
6322
  year: "numeric",
6322
6323
  month: "2-digit",
@@ -6327,7 +6328,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
6327
6328
  timeZoneName: "longOffset",
6328
6329
  hourCycle: "h23"
6329
6330
  }).formatToParts(input.now).map(({ type, value }) => [type, value]));
6330
- const localTime = `${parts.year}-${parts.month}-${parts.day}T${parts.hour}:${parts.minute}:${parts.second}${parts.timeZoneName?.replace("GMT", "") || "+00:00"}`;
6331
+ const localTime = `${parts2.year}-${parts2.month}-${parts2.day}T${parts2.hour}:${parts2.minute}:${parts2.second}${parts2.timeZoneName?.replace("GMT", "") || "+00:00"}`;
6331
6332
  const engine = new import_liquidjs.Liquid({
6332
6333
  ownPropertyOnly: true,
6333
6334
  strictVariables: true,
@@ -6433,7 +6434,7 @@ var renderReplyTemplate = /* @__PURE__ */ __name(async (reply, input) => {
6433
6434
  }
6434
6435
  }, "renderReplyTemplate");
6435
6436
 
6436
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
6437
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/replies/dry-run.js
6437
6438
  var DRY_RUN_DAYS = 7;
6438
6439
  var PAGE = 500;
6439
6440
  var dryRun = /* @__PURE__ */ __name(async (store, account, rules, { since, until = Date.now(), only, audience, render }) => {
@@ -6547,7 +6548,7 @@ var storedSince = /* @__PURE__ */ __name(async (store, account, chat, since) =>
6547
6548
  }
6548
6549
  }, "storedSince");
6549
6550
 
6550
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
6551
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/embeddings/keys.js
6551
6552
  var endpointKeyName = /* @__PURE__ */ __name((baseUrl) => {
6552
6553
  const host = new URL(baseUrl).host;
6553
6554
  return ["openai", "anthropic"].includes(host) ? `endpoint:${host}` : host;
@@ -6578,7 +6579,7 @@ var embeddingKeys = /* @__PURE__ */ __name((app, env = process.env, keyring) =>
6578
6579
  };
6579
6580
  }, "embeddingKeys");
6580
6581
 
6581
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/models/openai.js
6582
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/models/openai.js
6582
6583
  var options = strictObject({
6583
6584
  temperature: range(0, 2),
6584
6585
  top_p: range(0, 1),
@@ -6627,7 +6628,7 @@ var openai = {
6627
6628
  }, "complete")
6628
6629
  };
6629
6630
 
6630
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/models/index.js
6631
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/models/index.js
6631
6632
  var modelGateway = /* @__PURE__ */ __name((deps) => ({
6632
6633
  complete: /* @__PURE__ */ __name(async (request) => {
6633
6634
  if (deps.signal?.aborted)
@@ -6642,7 +6643,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
6642
6643
  if (!adapter && target.provider === "openai")
6643
6644
  adapter = openai;
6644
6645
  if (!adapter && target.provider === "anthropic")
6645
- adapter = (await import("./anthropic-IRKNWPIB.js")).anthropic;
6646
+ adapter = (await import("./anthropic-5MKO3QX7.js")).anthropic;
6646
6647
  if (!adapter)
6647
6648
  throw new CliError("validation_error", `no model adapter for ${target.provider}`);
6648
6649
  if (request.images !== void 0 && adapter.images !== true)
@@ -6683,7 +6684,7 @@ var modelGateway = /* @__PURE__ */ __name((deps) => ({
6683
6684
  }, "complete")
6684
6685
  }), "modelGateway");
6685
6686
 
6686
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/replies/consents.js
6687
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/replies/consents.js
6687
6688
  import { existsSync as existsSync5, readFileSync as readFileSync3 } from "node:fs";
6688
6689
  import { join as join3 } from "node:path";
6689
6690
  var shape = strictObject({
@@ -6708,7 +6709,7 @@ var mayModelReply = /* @__PURE__ */ __name((path, provider, chat) => {
6708
6709
  return consent.provider === provider && !consent.deniedChats.includes(chat);
6709
6710
  }, "mayModelReply");
6710
6711
 
6711
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/replies/rendering.js
6712
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/replies/rendering.js
6712
6713
  var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, options2 = {
6713
6714
  ai: true
6714
6715
  }) => async (rule2, message, chat, now) => {
@@ -6755,7 +6756,7 @@ var replyRenderer = /* @__PURE__ */ __name((app, profile, settings, env, warn, o
6755
6756
  return result2;
6756
6757
  }, "replyRenderer");
6757
6758
 
6758
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/replies/serve.js
6759
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/replies/serve.js
6759
6760
  var NOT_ALLOWED = "replies.send is not allow";
6760
6761
  var NO_RULES = "no rules";
6761
6762
  var ONLY_TASK = "opened a task, sent nothing";
@@ -6848,7 +6849,7 @@ var replyTo = /* @__PURE__ */ __name(async (deps, message) => {
6848
6849
  return { skip: why };
6849
6850
  }, "replyTo");
6850
6851
 
6851
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
6852
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-members.js
6852
6853
  var FIRST_FETCH_MS = 6e4;
6853
6854
  var DAY_MS = 864e5;
6854
6855
  var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, firstMs = FIRST_FETCH_MS, everyMs = DAY_MS }) => {
@@ -6902,7 +6903,7 @@ var memberFetches = /* @__PURE__ */ __name(({ withStore, fetch: fetch2, warn, fi
6902
6903
  };
6903
6904
  }, "memberFetches");
6904
6905
 
6905
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
6906
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-notice.js
6906
6907
  var record2 = /* @__PURE__ */ __name((context, app, severity, attributes) => recordLogFor(context.streams.diagnostic, app, { command: currentRun().command || "serve" })[severity](attributes), "record");
6907
6908
  var noticeFor = /* @__PURE__ */ __name((context, app, severity = "warn") => ({ text, ...attributes }) => {
6908
6909
  if (context.format === "pretty") {
@@ -6935,7 +6936,7 @@ var recordDiagnostics = /* @__PURE__ */ __name((context, app) => {
6935
6936
  return context;
6936
6937
  }, "recordDiagnostics");
6937
6938
 
6938
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
6939
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-stems.js
6939
6940
  var STEMS_EVERY_MS = 3e4;
6940
6941
  var STEMS_SLICE_MS = 2e3;
6941
6942
  var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY_MS, sliceMs = STEMS_SLICE_MS }) => {
@@ -6975,7 +6976,180 @@ var stemFills = /* @__PURE__ */ __name(({ withStore, warn, everyMs = STEMS_EVERY
6975
6976
  };
6976
6977
  }, "stemFills");
6977
6978
 
6978
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
6979
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/render/messages.js
6980
+ import { styleText } from "node:util";
6981
+ var TIME_WIDTH = 8;
6982
+ var INDENT = " ".repeat(TIME_WIDTH + 2);
6983
+ var MIN_WIDTH = 40;
6984
+ var SENDER_COLOURS = ["green", "yellow", "magenta", "blue", "red"];
6985
+ var renderMessages = /* @__PURE__ */ __name((messages, options2 = {}) => {
6986
+ if (messages.length === 0)
6987
+ return "(nothing)";
6988
+ const day = dayFormatter(options2);
6989
+ const paint = painter(options2);
6990
+ let previous;
6991
+ const blocks = [];
6992
+ for (const message of messages) {
6993
+ const date = day(message.timestamp);
6994
+ if (date !== previous)
6995
+ blocks.push(paint("dim", `\u2500\u2500 ${date} \u2500\u2500`));
6996
+ previous = date;
6997
+ blocks.push(renderMessage(message, options2));
6998
+ }
6999
+ return blocks.join("\n\n");
7000
+ }, "renderMessages");
7001
+ var renderMessage = /* @__PURE__ */ __name((message, options2 = {}) => {
7002
+ const paint = painter(options2);
7003
+ const width = Math.max(MIN_WIDTH, options2.width ?? 80);
7004
+ const room = width - INDENT.length;
7005
+ const time = timeFormatter(options2);
7006
+ const verbosity = options2.verbosity ?? 0;
7007
+ const chat = "chatTitle" in message ? paint("dim", ` \xB7 ${singleLine(message.chatTitle ?? message.chatId)}`) : "";
7008
+ const mark = "anchor" in message && message.anchor ? paint("bold", " \u25C0") : "";
7009
+ const lines = [`${paint("dim", time(message.timestamp))} ${senderOf(message, options2)}${chat}${mark}`];
7010
+ const body = /* @__PURE__ */ __name((text) => wrapAnsi(visibleControls(text), room, { hard: true }).split("\n"), "body");
7011
+ const email = message.email;
7012
+ if (email)
7013
+ lines.push(paint("dim", mailLine(email)));
7014
+ if (message.replyTo)
7015
+ lines.push(paint("dim", preview("\u21B3", message.replyTo, room, options2)));
7016
+ if (message.forwardedFrom) {
7017
+ lines.push(paint("dim", `\u21AA ${nameOf(message.forwardedFrom, options2)}`));
7018
+ if (message.forwardedFrom.text)
7019
+ for (const line of body(message.forwardedFrom.text))
7020
+ lines.push(line);
7021
+ lines.push(...attachmentLines(message.forwardedFrom.attachments, paint, options2));
7022
+ }
7023
+ if (message.text)
7024
+ for (const line of body(message.text))
7025
+ lines.push(line);
7026
+ lines.push(...attachmentLines(message.attachments, paint, options2));
7027
+ if (message.reactions && message.reactions.total > 0)
7028
+ lines.push(paint("dim", reactionLine(message.reactions)));
7029
+ if (message.editedAt)
7030
+ lines.push(paint("dim", `edited ${editedAt(message, options2)}`));
7031
+ if (verbosity >= 1) {
7032
+ const fields = [
7033
+ ["message", message.id],
7034
+ ["sender", message.senderId],
7035
+ ["chat", message.chatId],
7036
+ ["reply to", message.replyTo?.id ?? message.replyToId],
7037
+ ["thread", message.threadId],
7038
+ ["forward of", message.forwardedFrom?.id],
7039
+ ...message.attachments.map((a) => ["link", a.url])
7040
+ ];
7041
+ if (verbosity >= 2) {
7042
+ fields.push(["provider", options2.provider], ["profile", options2.profile], ["sent", message.timestamp], ["edited", message.editedAt], ["outgoing", message.outgoing === null ? "unknown" : String(message.outgoing)], ...message.attachments.map((a) => ["attachment", JSON.stringify(a)]), ["metadata", message.providerMetadata && JSON.stringify(message.providerMetadata)]);
7043
+ }
7044
+ const shown = fields.filter((field) => typeof field[1] === "string");
7045
+ const label = Math.max(...shown.map(([key]) => key.length));
7046
+ lines.push("", ...shown.map(([key, value]) => paint("dim", `${key.padEnd(label)} ${singleLine(value)}`)));
7047
+ }
7048
+ return lines.map((line, index) => index === 0 || line === "" ? line : `${INDENT}${line}`).join("\n");
7049
+ }, "renderMessage");
7050
+ var mailLine = /* @__PURE__ */ __name(({ to, cc, labels }) => {
7051
+ const names = /* @__PURE__ */ __name((people) => people.map(({ name, address }) => singleLine(name ?? address)).join(", "), "names");
7052
+ return [to.length ? `to ${names(to)}` : "", cc.length ? `cc ${names(cc)}` : "", labels.join(", ")].filter(Boolean).join(" \xB7 ");
7053
+ }, "mailLine");
7054
+ var painter = /* @__PURE__ */ __name(({ color = false }) => (style, text) => color ? styleText(style, text, { validateStream: false }) : text, "painter");
7055
+ var senderOf = /* @__PURE__ */ __name((message, options2) => {
7056
+ const paint = painter(options2);
7057
+ if (message.outgoing === true)
7058
+ return paint(["bold", "cyan"], you(options2));
7059
+ const name = nameOf(message, options2);
7060
+ if (!options2.senderColors)
7061
+ return paint("bold", name);
7062
+ const colour = SENDER_COLOURS[hash(message.senderId ?? name) % SENDER_COLOURS.length] ?? "green";
7063
+ return paint(["bold", colour], name);
7064
+ }, "senderOf");
7065
+ var nameOf = /* @__PURE__ */ __name(({ senderName, senderId, outgoing }, options2) => outgoing === true ? you(options2) : singleLine(senderName ?? senderId ?? "unknown"), "nameOf");
7066
+ var DEFAULT_LOCALE = "ru-RU";
7067
+ var you = /* @__PURE__ */ __name(({ locale = DEFAULT_LOCALE }) => locale.startsWith("ru") ? "\u0432\u044B" : "you", "you");
7068
+ var hash = /* @__PURE__ */ __name((value) => [...value].reduce((sum, char) => sum * 31 + char.charCodeAt(0) >>> 0, 7), "hash");
7069
+ var preview = /* @__PURE__ */ __name((mark, quoted, room, options2) => {
7070
+ const text = singleLine(quoted.text.split("\n")[0] ?? "") || (quoted.attachments[0] ? `\u{1F4CE} ${quoted.attachments[0].kind}` : "");
7071
+ const line = text ? `${mark} ${nameOf(quoted, options2)}: ${text}` : `${mark} message ${quoted.id}`;
7072
+ if (stringWidth(line) <= room)
7073
+ return line;
7074
+ return `${wrapAnsi(line, room - 1, { hard: true }).split("\n")[0]}\u2026`;
7075
+ }, "preview");
7076
+ var attachmentLines = /* @__PURE__ */ __name((attachments, paint, options2) => {
7077
+ const link = /* @__PURE__ */ __name((label, raw) => {
7078
+ if (raw === void 0)
7079
+ return label;
7080
+ const url = singleLine(raw);
7081
+ return options2.color ? `\x1B]8;;${url}\x07${label}\x1B]8;;\x07` : `${label} ${url}`;
7082
+ }, "link");
7083
+ let number2 = 0;
7084
+ const keyboard = attachments.flatMap((attachment) => attachment.buttons ?? []).map((row) => paint("dim", row.map((button) => link(`[${++number2} ${singleLine(button.text)}]`, button.url)).join(" ")));
7085
+ const polls = attachments.flatMap((attachment) => attachment.poll ? pollLines(attachment.poll) : []);
7086
+ const groups = /* @__PURE__ */ new Map();
7087
+ for (const attachment of attachments) {
7088
+ if (attachment.buttons || attachment.poll)
7089
+ continue;
7090
+ const key = singleLine(attachment.name ?? attachment.title ?? attachment.kind);
7091
+ groups.set(key, [...groups.get(key) ?? [], attachment]);
7092
+ }
7093
+ const files = [...groups].map(([label, same2]) => {
7094
+ const first = same2[0];
7095
+ const size = first?.size === void 0 ? "" : ` \xB7 ${megabytes(first.size)}`;
7096
+ if (same2.length === 1)
7097
+ return paint("dim", `\u{1F4CE} ${link(`${label}${size}`, first?.url)}`);
7098
+ const each = same2.map((attachment, index) => link(String(index + 1), attachment.url)).join(" ");
7099
+ return paint("dim", `\u{1F4CE} ${label} \xD7${same2.length} ${each}`);
7100
+ });
7101
+ return [...polls, ...files, ...keyboard];
7102
+ }, "attachmentLines");
7103
+ var pollLines = /* @__PURE__ */ __name((poll) => {
7104
+ const kind = [
7105
+ poll.closed ? "closed" : "",
7106
+ poll.multiple ? "several answers" : "",
7107
+ poll.anonymous ? "anonymous" : "",
7108
+ poll.quiz ? "quiz" : ""
7109
+ ].filter(Boolean);
7110
+ const count3 = /* @__PURE__ */ __name((voters) => voters === null ? "?" : String(voters), "count");
7111
+ return [
7112
+ `\u{1F4CA} ${visibleControls(poll.question)}`,
7113
+ ...poll.answers.map((answer) => ` [${answer.id}] ${visibleControls(answer.text)} \u2014 ${count3(answer.voters)}${answer.chosen ? " \u2713" : ""}`),
7114
+ ` ${[`${count3(poll.voters)} voted`, ...kind].join(" \xB7 ")}`
7115
+ ];
7116
+ }, "pollLines");
7117
+ var megabytes = /* @__PURE__ */ __name((bytes) => bytes >= 1e6 ? `${Math.round(bytes / 1e6)} MB` : `${Math.max(1, Math.round(bytes / 1e3))} KB`, "megabytes");
7118
+ var parts = /* @__PURE__ */ __name((format, iso) => Object.fromEntries(format.formatToParts(new Date(iso)).map(({ type, value }) => [type, value])), "parts");
7119
+ var timeFormatter = /* @__PURE__ */ __name(({ timeZone }) => {
7120
+ const format = new Intl.DateTimeFormat("en-GB", {
7121
+ hour: "2-digit",
7122
+ minute: "2-digit",
7123
+ second: "2-digit",
7124
+ hourCycle: "h23",
7125
+ ...timeZone ? { timeZone } : {}
7126
+ });
7127
+ return (iso) => {
7128
+ const { hour, minute, second } = parts(format, iso);
7129
+ return `${hour}:${minute}:${second}`;
7130
+ };
7131
+ }, "timeFormatter");
7132
+ var dayFormatter = /* @__PURE__ */ __name(({ locale = DEFAULT_LOCALE, timeZone }) => {
7133
+ const format = new Intl.DateTimeFormat(locale, {
7134
+ day: "numeric",
7135
+ month: "long",
7136
+ year: "numeric",
7137
+ ...timeZone ? { timeZone } : {}
7138
+ });
7139
+ return (iso) => format.format(new Date(iso)).replace(/\s*г\.$/, "");
7140
+ }, "dayFormatter");
7141
+ var reactionLine = /* @__PURE__ */ __name(({ counts, mine }) => {
7142
+ const shown = counts.map(({ reaction, count: count3 }) => `${singleLine(reaction)} ${count3}`).join(" ");
7143
+ return mine ? `${shown} (you: ${singleLine(mine)})` : shown;
7144
+ }, "reactionLine");
7145
+ var editedAt = /* @__PURE__ */ __name((message, options2) => {
7146
+ const edited = message.editedAt ?? message.timestamp;
7147
+ const time = timeFormatter(options2)(edited);
7148
+ const day = dayFormatter(options2);
7149
+ return day(edited) === day(message.timestamp) ? time : `${day(edited)} ${time}`;
7150
+ }, "editedAt");
7151
+
7152
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/cli/messenger/message-items.js
6979
7153
  var defined = /* @__PURE__ */ __name((value) => Object.fromEntries(Object.entries(value).filter(([, one]) => one !== void 0)), "defined");
6980
7154
  var attachmentItem = /* @__PURE__ */ __name((attachment) => defined({
6981
7155
  kind: attachment.kind,
@@ -7062,7 +7236,7 @@ var viewOf = /* @__PURE__ */ __name((context, messenger) => ({
7062
7236
  locale: messenger.app.locale
7063
7237
  }), "viewOf");
7064
7238
 
7065
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
7239
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-answers.js
7066
7240
  var observed = /* @__PURE__ */ __name((value) => ({
7067
7241
  value: value.value,
7068
7242
  observed_at: value.observedAt,
@@ -7129,7 +7303,7 @@ var watchEventItem = /* @__PURE__ */ __name((value, account) => {
7129
7303
  }
7130
7304
  }, "watchEventItem");
7131
7305
 
7132
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
7306
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/cli/messenger/watch-command.js
7133
7307
  var watchCommand = /* @__PURE__ */ __name((messenger) => annotate(new Command("watch"), {
7134
7308
  output: { entity: "watch_item" },
7135
7309
  effects: REMOTE_READ,
@@ -7284,7 +7458,7 @@ var describe = /* @__PURE__ */ __name((event, render) => {
7284
7458
  }
7285
7459
  }, "describe");
7286
7460
 
7287
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
7461
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-command.js
7288
7462
  var serveCommand = /* @__PURE__ */ __name((messenger) => {
7289
7463
  const command = annotate(new Command("serve"), {
7290
7464
  output: { entity: "serve_summary" },
@@ -7500,7 +7674,7 @@ var tasking = /* @__PURE__ */ __name((context, warn) => {
7500
7674
  };
7501
7675
  }, "tasking");
7502
7676
 
7503
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
7677
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/cli/messenger/store-tables-command.js
7504
7678
  import { existsSync as existsSync6 } from "node:fs";
7505
7679
  var PATH = "store tables list";
7506
7680
  var STORE_TABLES_QUERY = {
@@ -7543,7 +7717,7 @@ var storeTablesCommand = /* @__PURE__ */ __name((messenger) => {
7543
7717
  return tables;
7544
7718
  }, "storeTablesCommand");
7545
7719
 
7546
- // node_modules/.pnpm/@wirecat+cli-core@0.466.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.64.0_commander@15._f7e4048410ccbe1e801fd184c043d197/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
7720
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.65.0_commander@15._2a6ca8de460e41c79b470c9aa59440d5/node_modules/@wirecat/cli-core/dist/cli/messenger/store-maintenance-command.js
7547
7721
  var SEARCH_INDEXES = ["messages_fts", "chats_fts", "identities_fts"];
7548
7722
  var WORD_INDEX = "message_words";
7549
7723
  var schemaOf = /* @__PURE__ */ __name((database) => {
@@ -8158,6 +8332,7 @@ export {
8158
8332
  writeReplyConsent,
8159
8333
  replyModelIdentity,
8160
8334
  replyRenderer,
8335
+ renderMessages,
8161
8336
  messageItem,
8162
8337
  messageItems,
8163
8338
  selfOf,