@wirecat/tg-cli 0.116.0 → 0.117.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 (125) hide show
  1. package/dist/bin/tg.js +2 -2
  2. package/dist/bot/transport.d.ts +1 -1
  3. package/dist/bot/transport.d.ts.map +1 -1
  4. package/dist/bot/transport.js +42 -30
  5. package/dist/bot/transport.js.map +1 -1
  6. package/dist/bundle/{adapter-6CLMTQOV.js → adapter-VNQ72MBK.js} +70 -61
  7. package/dist/bundle/{all-profiles-R2UZMH24.js → all-profiles-3W2UQTCK.js} +10 -10
  8. package/dist/bundle/{anthropic-QKIPHV2Z.js → anthropic-DFUW2KTG.js} +6 -6
  9. package/dist/bundle/{app-server-AZB2MFK6.js → app-server-5XJIMLHB.js} +49 -46
  10. package/dist/bundle/{bot-api-2IM243J4.js → bot-api-HRRBF3W6.js} +49 -49
  11. package/dist/bundle/{bot-history-G6CRVCL2.js → bot-history-GBH5XE4N.js} +18 -18
  12. package/dist/bundle/{bun-JDKPISPX.js → bun-ZMOYGG6F.js} +2 -2
  13. package/dist/bundle/{bun-sqlite-X5PY5IQT.js → bun-sqlite-6FZFMA7K.js} +5 -5
  14. package/dist/bundle/{chunk-577MFPCP.js → chunk-2452HCIV.js} +3 -3
  15. package/dist/bundle/{chunk-H72UEHNG.js → chunk-2XLKZL6K.js} +34 -28
  16. package/dist/bundle/{chunk-RSDIPQXP.js → chunk-3GRX7WP6.js} +2 -2
  17. package/dist/bundle/{chunk-PPLFOIYX.js → chunk-3MQOLYAN.js} +4 -4
  18. package/dist/bundle/{chunk-JFTCOV37.js → chunk-3RJYLN5V.js} +73 -21
  19. package/dist/bundle/{chunk-BGMV66FC.js → chunk-4JDGN6OD.js} +1 -1
  20. package/dist/bundle/{chunk-MQ7MCVZV.js → chunk-56Q5JV3Z.js} +2 -2
  21. package/dist/bundle/{chunk-4IQZRW4O.js → chunk-66FZBLRJ.js} +13 -13
  22. package/dist/bundle/{chunk-QHBVGKC3.js → chunk-6GFUL4OU.js} +206 -81
  23. package/dist/bundle/{chunk-5FCONCJO.js → chunk-6HRN7BW6.js} +1 -1
  24. package/dist/bundle/{chunk-I6JF43YP.js → chunk-7NBUT62O.js} +3 -3
  25. package/dist/bundle/{chunk-VQPLHOVQ.js → chunk-7Y3RUEVY.js} +6 -6
  26. package/dist/bundle/chunk-AG6HWPQP.js +64 -0
  27. package/dist/bundle/{chunk-HK6SIIGG.js → chunk-AUBRELCM.js} +3 -3
  28. package/dist/bundle/{chunk-4D5AUWAY.js → chunk-B2YPB5AE.js} +43 -25
  29. package/dist/bundle/{chunk-EB2IULWB.js → chunk-BXTDAGM4.js} +2 -2
  30. package/dist/bundle/{chunk-QGL2UGML.js → chunk-C6TUVV7E.js} +466 -224
  31. package/dist/bundle/{chunk-42GK3XRS.js → chunk-EA2PGDER.js} +2 -2
  32. package/dist/bundle/{chunk-N6TIFJHW.js → chunk-EL6I4WTB.js} +1 -1
  33. package/dist/bundle/{chunk-76CX2YPT.js → chunk-EPCFXKTX.js} +8 -8
  34. package/dist/bundle/{chunk-Y6VWGJ4Q.js → chunk-EZTYJ43A.js} +4 -2
  35. package/dist/bundle/{chunk-T7CDLV33.js → chunk-F6KBVIJP.js} +4 -4
  36. package/dist/bundle/{chunk-PXMHBTK3.js → chunk-FAHHERJ7.js} +4 -4
  37. package/dist/bundle/{chunk-DP5LRU7K.js → chunk-FEKXHILZ.js} +1 -1
  38. package/dist/bundle/chunk-G7B5UIE7.js +182 -0
  39. package/dist/bundle/{chunk-YLRTLZF6.js → chunk-GFHNQBD2.js} +1 -1
  40. package/dist/bundle/{chunk-SD5PUYKF.js → chunk-HORGORHK.js} +12 -12
  41. package/dist/bundle/{chunk-N42VUNTO.js → chunk-HWYSRB64.js} +2 -2
  42. package/dist/bundle/{chunk-5VFPUOJO.js → chunk-HZZGOLGP.js} +11 -11
  43. package/dist/bundle/{chunk-B4UOCWM4.js → chunk-JWIUK3SK.js} +2 -2
  44. package/dist/bundle/{chunk-NL3PAFAE.js → chunk-KVTLT4V7.js} +6 -6
  45. package/dist/bundle/{chunk-KA6EGOJY.js → chunk-L5WNE4WS.js} +2 -2
  46. package/dist/bundle/{chunk-PPSUA3IZ.js → chunk-M7V5XRM6.js} +3 -3
  47. package/dist/bundle/{chunk-XQUTJITP.js → chunk-MLHKQDUN.js} +647 -129
  48. package/dist/bundle/{chunk-RSNGMNU5.js → chunk-MP7M6FFU.js} +6 -6
  49. package/dist/bundle/{chunk-5ZIBAYIZ.js → chunk-NUCDEOFC.js} +2 -2
  50. package/dist/bundle/{chunk-KV4267S4.js → chunk-P3ASN72F.js} +1 -1
  51. package/dist/bundle/{chunk-QAKL3GXB.js → chunk-PTIB7NEE.js} +1 -1
  52. package/dist/bundle/{chunk-TZVL4U7U.js → chunk-Q7O4CQDO.js} +4 -2
  53. package/dist/bundle/{chunk-XBIPSSKI.js → chunk-QOGYHU3Q.js} +4 -4
  54. package/dist/bundle/{chunk-R52RMHWF.js → chunk-RDH2QBUE.js} +3 -3
  55. package/dist/bundle/{chunk-NUYRMU56.js → chunk-RDSLSV4M.js} +2 -2
  56. package/dist/bundle/{chunk-UCSFO5GW.js → chunk-SQXB5ZUZ.js} +3 -3
  57. package/dist/bundle/{chunk-K62YATVD.js → chunk-TFBHDIGY.js} +4 -4
  58. package/dist/bundle/{chunk-IR4S7POE.js → chunk-TG6ZYL4B.js} +8 -8
  59. package/dist/bundle/{chunk-FDI4GOIP.js → chunk-UGPZCNYC.js} +329 -291
  60. package/dist/bundle/{chunk-GV7ZJ33M.js → chunk-UYK5AXSW.js} +4 -4
  61. package/dist/bundle/{chunk-HUOXUI2M.js → chunk-V2T7NYNU.js} +55 -46
  62. package/dist/bundle/{chunk-HBUJNNZD.js → chunk-V47NPSSV.js} +28 -28
  63. package/dist/bundle/{chunk-YYKJN6H5.js → chunk-VMCQGZIA.js} +1390 -690
  64. package/dist/bundle/{chunk-LXH3SKY3.js → chunk-VRDVXXXD.js} +8 -8
  65. package/dist/bundle/{chunk-YPF6OS37.js → chunk-VW6BF6M7.js} +1 -1
  66. package/dist/bundle/{chunk-LFKEKSI5.js → chunk-X3CD475M.js} +470 -234
  67. package/dist/bundle/{chunk-SKZ2E3WC.js → chunk-XW5C4TI7.js} +1 -1
  68. package/dist/bundle/{chunk-OX6EWGSG.js → chunk-YHZFGUAP.js} +19 -19
  69. package/dist/bundle/{chunk-HLNYJPAB.js → chunk-YIXXH74F.js} +2 -2
  70. package/dist/bundle/{chunk-LSKGCJWD.js → chunk-Z4QKLHJW.js} +13617 -1795
  71. package/dist/bundle/{chunk-JJMQA272.js → chunk-ZPILMEFY.js} +9 -9
  72. package/dist/bundle/command-contract-KMMHARMR.js +33 -0
  73. package/dist/bundle/{decode-W6YPTGJA.js → decode-YMSOY2AY.js} +5 -5
  74. package/dist/bundle/{dispatch-H7EFNBEH.js → dispatch-OP27MWX5.js} +8 -8
  75. package/dist/bundle/{echarts-YAWDIC5D.js → echarts-7XS55TQY.js} +2 -2
  76. package/dist/bundle/{embed-EN4UTLV5.js → embed-QTOE7NN3.js} +6 -6
  77. package/dist/bundle/{embedder-HEKHRL7E.js → embedder-KBBRYSNH.js} +9 -9
  78. package/dist/bundle/{entry-2KB6MTCG.js → entry-HGEUYYMX.js} +7 -7
  79. package/dist/bundle/{failure-3DU3HLBQ.js → failure-4JUQFXJT.js} +2 -2
  80. package/dist/bundle/{first-run-LBG26WWO.js → first-run-CSGMEJXY.js} +11 -11
  81. package/dist/bundle/first-screen-K2PBNJNE.js +31 -0
  82. package/dist/bundle/{instructions-HA62QNPR.js → instructions-S6ZXCTFH.js} +1 -1
  83. package/dist/bundle/{mcp-PPVOM4SE.js → mcp-M4QN2E7R.js} +2 -2
  84. package/dist/bundle/{node-MZ2VWSQQ.js → node-LCIUWXXG.js} +2 -2
  85. package/dist/bundle/{node-sqlite-KNNS6DCM.js → node-sqlite-HL4WY4N2.js} +6 -6
  86. package/dist/bundle/{oauth-KWUABBSQ.js → oauth-U4KIMDKG.js} +7 -7
  87. package/dist/bundle/{open-JXMCYCIV.js → open-EH7OS7M7.js} +5 -5
  88. package/dist/bundle/{openai-HL3IR4VT.js → openai-W5TB3NA5.js} +14 -14
  89. package/dist/bundle/{process-K2FICLWY.js → process-3CVLTCTA.js} +1 -1
  90. package/dist/bundle/{program-IFOMT4JS.js → program-LOIZTK2P.js} +51 -51
  91. package/dist/bundle/{prompt-HVD3Q77P.js → prompt-IDNH7N3W.js} +5 -5
  92. package/dist/bundle/{proxy-transport-PA5SGMRY.js → proxy-transport-4DPZB2W2.js} +5 -5
  93. package/dist/bundle/{recognize-HHLVETKI.js → recognize-G5EWYXIF.js} +4 -4
  94. package/dist/bundle/{remote-HUAKXJCS.js → remote-4XTBZVZD.js} +7 -7
  95. package/dist/bundle/{rerank-NWFIV7OF.js → rerank-OWSTDLZN.js} +7 -7
  96. package/dist/bundle/{serve-ANUKAJJN.js → serve-YCPSEWP3.js} +9 -9
  97. package/dist/bundle/server-KELKX6S3.js +60 -0
  98. package/dist/bundle/{server-7Q7WAOHO.js → server-ODG4A2KK.js} +35 -35
  99. package/dist/bundle/{state-Y2AJ5XTP.js → state-OL2235G5.js} +6 -6
  100. package/dist/bundle/{store-S3IG5KWL.js → store-5AACYNDM.js} +15 -13
  101. package/dist/bundle/store-maintenance-command-3J7WZYVN.js +50 -0
  102. package/dist/bundle/tg.js +13 -13
  103. package/dist/telegram/account.d.ts.map +1 -1
  104. package/dist/telegram/account.js +4 -1
  105. package/dist/telegram/account.js.map +1 -1
  106. package/dist/telegram/errors.d.ts.map +1 -1
  107. package/dist/telegram/errors.js +2 -1
  108. package/dist/telegram/errors.js.map +1 -1
  109. package/dist/telegram/feature.d.ts +4 -1
  110. package/dist/telegram/feature.d.ts.map +1 -1
  111. package/dist/telegram/feature.js +5 -2
  112. package/dist/telegram/feature.js.map +1 -1
  113. package/dist/telegram/sending.d.ts.map +1 -1
  114. package/dist/telegram/sending.js +24 -10
  115. package/dist/telegram/sending.js.map +1 -1
  116. package/dist/version.d.ts +1 -1
  117. package/dist/version.js +1 -1
  118. package/package.json +3 -3
  119. package/dist/bundle/chunk-K2RYCCTP.js +0 -48
  120. package/dist/bundle/chunk-ZDIAPICE.js +0 -132
  121. package/dist/bundle/command-contract-DPXM4SZT.js +0 -33
  122. package/dist/bundle/first-screen-TGTSLUI6.js +0 -31
  123. package/dist/bundle/server-HCQS4YDQ.js +0 -60
  124. package/dist/bundle/store-maintenance-command-V2WC4G6J.js +0 -50
  125. /package/dist/bundle/{chunk-LU3WKZBA.js → chunk-VOXIGICJ.js} +0 -0
@@ -7,18 +7,18 @@ import {
7
7
  describeOptions,
8
8
  keyForCommand,
9
9
  metaOf
10
- } from "./chunk-LFKEKSI5.js";
10
+ } from "./chunk-X3CD475M.js";
11
11
  import {
12
12
  jsonSchemaOf
13
- } from "./chunk-76CX2YPT.js";
13
+ } from "./chunk-EPCFXKTX.js";
14
14
  import {
15
15
  CliError
16
- } from "./chunk-EB2IULWB.js";
16
+ } from "./chunk-BXTDAGM4.js";
17
17
  import {
18
18
  __name
19
19
  } from "./chunk-ZVVMGPBJ.js";
20
20
 
21
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/cli/command-contract.js
21
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/cli/command-contract.js
22
22
  var SCHEMA_DIALECT = "https://json-schema.org/draft/2020-12/schema";
23
23
  var outputOf = /* @__PURE__ */ __name((command) => {
24
24
  const entity = answerEntitySchema(command);
@@ -13,7 +13,7 @@ import {
13
13
  refuseLacking,
14
14
  servicesFor,
15
15
  throughWrapper
16
- } from "./chunk-FDI4GOIP.js";
16
+ } from "./chunk-UGPZCNYC.js";
17
17
  import {
18
18
  CEILING_KEY,
19
19
  LOG_ATTRIBUTES,
@@ -38,35 +38,35 @@ import {
38
38
  rememberAccount,
39
39
  rootOf2 as rootOf,
40
40
  skipFlagFor
41
- } from "./chunk-LFKEKSI5.js";
41
+ } from "./chunk-X3CD475M.js";
42
42
  import {
43
43
  isCliFailure,
44
44
  providerErrorKey
45
- } from "./chunk-JJMQA272.js";
45
+ } from "./chunk-ZPILMEFY.js";
46
46
  import {
47
47
  MESSENGER_CHANGE_REFUSAL,
48
48
  readOnlyRefusal
49
- } from "./chunk-TZVL4U7U.js";
49
+ } from "./chunk-Q7O4CQDO.js";
50
50
  import {
51
51
  servingProfiles
52
- } from "./chunk-HK6SIIGG.js";
52
+ } from "./chunk-AUBRELCM.js";
53
53
  import {
54
54
  openStore
55
- } from "./chunk-LSKGCJWD.js";
55
+ } from "./chunk-Z4QKLHJW.js";
56
56
  import {
57
57
  logRecordOf,
58
58
  realSleep,
59
59
  resolvePaths,
60
60
  writeSecurely
61
- } from "./chunk-OX6EWGSG.js";
61
+ } from "./chunk-YHZFGUAP.js";
62
62
  import {
63
63
  CliError
64
- } from "./chunk-EB2IULWB.js";
64
+ } from "./chunk-BXTDAGM4.js";
65
65
  import {
66
66
  __name
67
67
  } from "./chunk-ZVVMGPBJ.js";
68
68
 
69
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/cli/messenger/ask.js
69
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/cli/messenger/ask.js
70
70
  import { openSync } from "node:fs";
71
71
  import { createInterface } from "node:readline";
72
72
  import { ReadStream } from "node:tty";
@@ -121,10 +121,10 @@ var terminalAsker = /* @__PURE__ */ __name((command) => async (key, request) =>
121
121
  throw new CliError("cancelled", `${key}: not done \u2014 the answer was no`);
122
122
  }, "terminalAsker");
123
123
 
124
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/sends/guard.js
124
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/sends/guard.js
125
125
  import { randomUUID } from "node:crypto";
126
126
 
127
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/sends/flood.js
127
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/sends/flood.js
128
128
  import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
129
129
  import { dirname, join } from "node:path";
130
130
  var MOST_DEADLINES = 50;
@@ -208,11 +208,11 @@ var FloodMemory = class {
208
208
  }
209
209
  };
210
210
 
211
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/sends/journal.js
211
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/sends/journal.js
212
212
  import { appendFileSync, mkdirSync as mkdirSync3, readFileSync as readFileSync2 } from "node:fs";
213
213
  import { dirname as dirname3, join as join2 } from "node:path";
214
214
 
215
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/sends/file-lock.js
215
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/sends/file-lock.js
216
216
  import { closeSync, mkdirSync as mkdirSync2, openSync as openSync2, statSync, unlinkSync } from "node:fs";
217
217
  import { dirname as dirname2 } from "node:path";
218
218
  var LOCK_WAIT_MS = 5e3;
@@ -279,7 +279,7 @@ var lockTime = /* @__PURE__ */ __name((lock) => {
279
279
  }
280
280
  }, "lockTime");
281
281
 
282
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/sends/journal.js
282
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/sends/journal.js
283
283
  var sendsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "sends", `${profile}.jsonl`), "sendsPathFor");
284
284
  var SendJournal = class {
285
285
  static {
@@ -356,7 +356,7 @@ var withSendId = /* @__PURE__ */ __name((entry) => {
356
356
  return cid === void 0 || rest.sendId !== void 0 ? rest : { ...rest, sendId: String(cid) };
357
357
  }, "withSendId");
358
358
 
359
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/sends/recipients.js
359
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/sends/recipients.js
360
360
  import { existsSync, readFileSync as readFileSync3, rmSync } from "node:fs";
361
361
  import { join as join3 } from "node:path";
362
362
  var recipientsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "profiles", `${profile}.recipients.json`), "recipientsPathFor");
@@ -468,7 +468,7 @@ var RecipientList = class {
468
468
  }
469
469
  };
470
470
 
471
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/sends/guard.js
471
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/sends/guard.js
472
472
  var HOUR_MS = 60 * 60 * 1e3;
473
473
  var READS_UNDER_HOLD = /* @__PURE__ */ new Set([
474
474
  "attachments.extract",
@@ -661,7 +661,7 @@ var guardFor = /* @__PURE__ */ __name((app, settings, warn, env = process.env, a
661
661
  }), "guardFor");
662
662
  var journalFailure = /* @__PURE__ */ __name((error) => error?.code ?? (error instanceof Error ? error.name : "error"), "journalFailure");
663
663
 
664
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/sends/pace.js
664
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/sends/pace.js
665
665
  import { readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
666
666
  import { join as join4 } from "node:path";
667
667
  var DEFAULT_PACE = { perMinute: 60, burst: 20 };
@@ -719,8 +719,39 @@ var Pacer = class {
719
719
  renameSync2(temporary, this.path);
720
720
  }
721
721
  };
722
+ var ANNOUNCE_WAIT_MS = 5e3;
723
+ var LONGEST_PACE_WAIT_MS = 5 * 6e4;
724
+ var waitForTurn = /* @__PURE__ */ __name(async (pacer, options) => {
725
+ const { name, operation, warn } = options;
726
+ const now = options.now ?? Date.now;
727
+ let at = now();
728
+ try {
729
+ at = await pacer.reserve();
730
+ } catch (error) {
731
+ warn?.(`could not remember ${name}'s wait (${error instanceof Error ? error.message : String(error)})`, {
732
+ event: "warning",
733
+ code: "wait_not_remembered",
734
+ operation
735
+ });
736
+ }
737
+ const waitMs = at - now();
738
+ if (waitMs <= 0)
739
+ return;
740
+ if (waitMs > LONGEST_PACE_WAIT_MS)
741
+ throw new CliError("rate_limited", `${name} asked this profile to wait, ${Math.ceil(waitMs / 1e3)} s are left \u2014 nothing was sent to ${name}`, { retry_after_ms: waitMs, retry_at: new Date(at).toISOString(), remembered: true });
742
+ if (waitMs >= ANNOUNCE_WAIT_MS) {
743
+ const seconds = Math.ceil(waitMs / 1e3);
744
+ warn?.(`waiting ${seconds} s to keep this profile's pace with ${name}`, {
745
+ event: "warning",
746
+ code: "pace_wait",
747
+ operation,
748
+ counts: { seconds }
749
+ });
750
+ }
751
+ await (options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms))))(waitMs);
752
+ }, "waitForTurn");
722
753
 
723
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
754
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
724
755
  var pathOf = /* @__PURE__ */ __name((command) => {
725
756
  const words = [];
726
757
  for (let at = command; at?.parent; at = at.parent)
@@ -780,12 +811,10 @@ var refuseUnknownPermissionKeys = /* @__PURE__ */ __name((command, settings, too
780
811
  throw new CliError("validation_error", `--permission ${key} names no command`, { permission: key });
781
812
  }, "refuseUnknownPermissionKeys");
782
813
 
783
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/cli/messenger/flooded.js
814
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/cli/messenger/flooded.js
784
815
  var LONG_LIVED = /* @__PURE__ */ new Set(["self", "newSendId", "close", "formatMarkdown", "formatHtml", "storedChats"]);
785
816
  var LISTENING = /* @__PURE__ */ new Set(["watch", "feed", "listen", "listenHistory"]);
786
817
  var BLOCKING = /* @__PURE__ */ new Set(["frozen", "limited", "banned"]);
787
- var ANNOUNCE_WAIT_MS = 5e3;
788
- var LONGEST_PACE_WAIT_MS = 5 * 6e4;
789
818
  var chatOf = /* @__PURE__ */ __name((args) => typeof args[0] === "string" && /^-?\d+$/.test(args[0]) ? args[0] : void 0, "chatOf");
790
819
  var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer }) => {
791
820
  const kept = /* @__PURE__ */ __name(async (operation, what2) => {
@@ -841,28 +870,8 @@ var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer })
841
870
  await kept(operation, () => pacer.holdFor(waitMs));
842
871
  }, "noted");
843
872
  const turn = /* @__PURE__ */ __name(async (operation) => {
844
- if (!pacer)
845
- return;
846
- let at = Date.now();
847
- await kept(operation, async () => {
848
- at = await pacer.reserve();
849
- });
850
- const waitMs = at - Date.now();
851
- if (waitMs <= 0)
852
- return;
853
- if (waitMs > LONGEST_PACE_WAIT_MS) {
854
- throw new CliError("rate_limited", `${name} asked this profile to wait, ${Math.ceil(waitMs / 1e3)} s are left \u2014 nothing was sent to ${name}`, { retry_after_ms: waitMs, retry_at: new Date(at).toISOString(), remembered: true });
855
- }
856
- if (waitMs >= ANNOUNCE_WAIT_MS) {
857
- const seconds = Math.ceil(waitMs / 1e3);
858
- warn(`waiting ${seconds} s to keep this profile's pace with ${name}`, {
859
- event: "warning",
860
- code: "pace_wait",
861
- operation,
862
- counts: { seconds }
863
- });
864
- }
865
- await new Promise((resolve) => setTimeout(resolve, waitMs));
873
+ if (pacer)
874
+ await waitForTurn(pacer, { name, operation, warn });
866
875
  }, "turn");
867
876
  return throughWrapper(messenger, {}, (operation, call) => {
868
877
  if (LONG_LIVED.has(operation))
@@ -899,7 +908,7 @@ var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer })
899
908
  });
900
909
  }, "flooded");
901
910
 
902
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/cli/messenger/observed.js
911
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/cli/messenger/observed.js
903
912
  var observed = /* @__PURE__ */ __name((messenger, events) => {
904
913
  const timed = /* @__PURE__ */ __name(async (operation, named, work, after) => {
905
914
  const write = currentOperation();
@@ -998,7 +1007,7 @@ var byPart = /* @__PURE__ */ __name((batch, counts) => {
998
1007
  counts[part] = (counts[part] ?? 0) + items.length;
999
1008
  }, "byPart");
1000
1009
 
1001
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/cli/messenger/stored.js
1010
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/cli/messenger/stored.js
1002
1011
  var REKEY_PACING = { lockMs: 50, pauseMs: 25 };
1003
1012
  var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events, pending, announcing, deletedWithoutChat, profile, rekeyed, rekeyPacing = REKEY_PACING, closing, namesFromStore, recipientIds, countsUnread = false, historyLimits, command = "cli" }) => {
1004
1013
  let warned = false;
@@ -1574,7 +1583,7 @@ var keep = /* @__PURE__ */ __name(async (store, account, event, seenAt, among, c
1574
1583
  }
1575
1584
  }, "keep");
1576
1585
 
1577
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/cli/messenger/context.js
1586
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/cli/messenger/context.js
1578
1587
  var lazyStore = /* @__PURE__ */ __name((env, command, version) => {
1579
1588
  let opened;
1580
1589
  return {
@@ -20,7 +20,7 @@ import {
20
20
  tool,
21
21
  toolKey,
22
22
  toolsFromCommands
23
- } from "./chunk-QHBVGKC3.js";
23
+ } from "./chunk-6GFUL4OU.js";
24
24
  import {
25
25
  CHART_KINDS,
26
26
  CHART_SIZE,
@@ -34,23 +34,23 @@ import {
34
34
  registerPrompts,
35
35
  stdinFieldOf,
36
36
  syncsFirst
37
- } from "./chunk-H72UEHNG.js";
37
+ } from "./chunk-2XLKZL6K.js";
38
38
  import {
39
39
  agentJson,
40
40
  skillResource
41
- } from "./chunk-JFTCOV37.js";
41
+ } from "./chunk-3RJYLN5V.js";
42
42
  import {
43
43
  instructions
44
- } from "./chunk-YLRTLZF6.js";
44
+ } from "./chunk-GFHNQBD2.js";
45
45
  import {
46
46
  answeredWire
47
- } from "./chunk-QAKL3GXB.js";
47
+ } from "./chunk-PTIB7NEE.js";
48
48
  import {
49
49
  StdioServerTransport,
50
50
  callerOf,
51
51
  callingAgent,
52
52
  serveStdio
53
- } from "./chunk-42GK3XRS.js";
53
+ } from "./chunk-EA2PGDER.js";
54
54
  import {
55
55
  McpServer,
56
56
  ResourceTemplate
@@ -58,7 +58,7 @@ import {
58
58
  import {
59
59
  connectedFor,
60
60
  guardFor
61
- } from "./chunk-HUOXUI2M.js";
61
+ } from "./chunk-V2T7NYNU.js";
62
62
  import {
63
63
  capability,
64
64
  dateWindow,
@@ -67,10 +67,10 @@ import {
67
67
  servicesFor,
68
68
  storedDeps,
69
69
  wholeList
70
- } from "./chunk-FDI4GOIP.js";
70
+ } from "./chunk-UGPZCNYC.js";
71
71
  import {
72
72
  findCommand
73
- } from "./chunk-GV7ZJ33M.js";
73
+ } from "./chunk-UYK5AXSW.js";
74
74
  import {
75
75
  DEFAULT_OUTPUT_BYTES,
76
76
  changesAuthorityAt,
@@ -86,27 +86,27 @@ import {
86
86
  sealed,
87
87
  snakeKeys,
88
88
  typedCommand
89
- } from "./chunk-LFKEKSI5.js";
89
+ } from "./chunk-X3CD475M.js";
90
90
  import {
91
91
  isCliFailure,
92
92
  withCaller
93
- } from "./chunk-JJMQA272.js";
93
+ } from "./chunk-ZPILMEFY.js";
94
94
  import {
95
95
  readOnlyLockOf
96
- } from "./chunk-TZVL4U7U.js";
96
+ } from "./chunk-Q7O4CQDO.js";
97
97
  import {
98
98
  mcpHttpMarker
99
- } from "./chunk-PXMHBTK3.js";
99
+ } from "./chunk-FAHHERJ7.js";
100
100
  import {
101
101
  openStore,
102
102
  pdfPreviewLimits
103
- } from "./chunk-LSKGCJWD.js";
103
+ } from "./chunk-Z4QKLHJW.js";
104
104
  import {
105
105
  timezoneOf
106
- } from "./chunk-QGL2UGML.js";
106
+ } from "./chunk-C6TUVV7E.js";
107
107
  import {
108
108
  warmEmbedders
109
- } from "./chunk-NL3PAFAE.js";
109
+ } from "./chunk-KVTLT4V7.js";
110
110
  import {
111
111
  description,
112
112
  integer,
@@ -122,19 +122,19 @@ import {
122
122
  regex,
123
123
  strictObject,
124
124
  string
125
- } from "./chunk-76CX2YPT.js";
125
+ } from "./chunk-EPCFXKTX.js";
126
126
  import {
127
127
  CliError,
128
128
  visibleControls
129
- } from "./chunk-EB2IULWB.js";
129
+ } from "./chunk-BXTDAGM4.js";
130
130
  import {
131
131
  __name
132
132
  } from "./chunk-ZVVMGPBJ.js";
133
133
 
134
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/mcp/server.js
134
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/server.js
135
135
  import { randomUUID } from "node:crypto";
136
136
 
137
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/mcp/agent-log.js
137
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/agent-log.js
138
138
  var agentLog = /* @__PURE__ */ __name((open) => {
139
139
  let held;
140
140
  return {
@@ -153,7 +153,7 @@ var agentLog = /* @__PURE__ */ __name((open) => {
153
153
  };
154
154
  }, "agentLog");
155
155
 
156
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/mcp/resources.js
156
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/resources.js
157
157
  var LISTED = 100;
158
158
  var registerResources = /* @__PURE__ */ __name((server, session, { command, name, limit, recorded, withStore, messenger, guard, assertRead }) => {
159
159
  server.registerResource("chat", new ResourceTemplate(`${command}://chat/{id}`, {
@@ -191,7 +191,7 @@ var registerResources = /* @__PURE__ */ __name((server, session, { command, name
191
191
  });
192
192
  }, "registerResources");
193
193
 
194
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/mcp/session.js
194
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/session.js
195
195
  var HARMLESS = /* @__PURE__ */ new Set(["validation_error", "not_found", "permission_error", "confirmation_required", "rate_limited"]);
196
196
  var harmless = /* @__PURE__ */ __name((code) => HARMLESS.has(code), "harmless");
197
197
  var MessengerSession = class {
@@ -266,7 +266,7 @@ var MessengerSession = class {
266
266
  }
267
267
  };
268
268
 
269
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/mcp/tools/attachments.js
269
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/tools/attachments.js
270
270
  var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
271
271
  const _command = messenger.app.command;
272
272
  return {
@@ -320,7 +320,7 @@ var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
320
320
  };
321
321
  }, "attachmentsTools");
322
322
 
323
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/mcp/tools/messages-photo.js
323
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/tools/messages-photo.js
324
324
  var PHOTO_LIMIT = 512 * 1024;
325
325
  var IMAGE_TYPES = [
326
326
  ["image/jpeg", (b) => b[0] === 255 && b[1] === 216 && b[2] === 255],
@@ -374,7 +374,7 @@ var readUpTo = /* @__PURE__ */ __name(async (file, limit, saveIt) => {
374
374
  return new Uint8Array(Buffer.concat(chunks));
375
375
  }, "readUpTo");
376
376
 
377
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/mcp/tools/stats.js
377
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/tools/stats.js
378
378
  var statsTools = /* @__PURE__ */ __name((messenger) => ({
379
379
  stats_charts: tool({
380
380
  title: "A chart from a chat's statistics",
@@ -411,14 +411,14 @@ var statsTools = /* @__PURE__ */ __name((messenger) => ({
411
411
  })
412
412
  }), "statsTools");
413
413
 
414
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/mcp/tools.js
414
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/tools.js
415
415
  var pictureTools = /* @__PURE__ */ __name((messenger) => Object.fromEntries(Object.entries({
416
416
  ...messagesPhotoTools(messenger),
417
417
  ...attachmentsTools(messenger),
418
418
  ...statsTools(messenger)
419
419
  }).map(([name, definition]) => [name, { ...definition, input: strictObject(definition.input.entries) }])), "pictureTools");
420
420
 
421
- // node_modules/.pnpm/@wirecat+cli-core@0.567.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.77.1_commander@15._f1cdf35b93ce465cee2c32ebaca13ce7/node_modules/@wirecat/cli-core/dist/mcp/server.js
421
+ // node_modules/.pnpm/@wirecat+cli-core@0.600.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.80.8_commander@15._6a3165a3e9bffd3483d86046d9ef2956/node_modules/@wirecat/cli-core/dist/mcp/server.js
422
422
  var PER_RUN = /* @__PURE__ */ new Set([
423
423
  "streams",
424
424
  "stdin",
@@ -742,7 +742,7 @@ var serveOverStdio = /* @__PURE__ */ __name(async (command, context, messenger,
742
742
  }, "serveOverStdio");
743
743
  var serveOverHttpUntilStopped = /* @__PURE__ */ __name(async (command, context, messenger, options, http) => {
744
744
  const { session, embedders, build, log } = createServer(command, context, messenger, options);
745
- const { serveOverHttp } = await import("./serve-ANUKAJJN.js");
745
+ const { serveOverHttp } = await import("./serve-YCPSEWP3.js");
746
746
  const appName = messenger.app.command;
747
747
  const appEnvPrefix = messenger.app.envPrefix;
748
748
  const listening = await serveOverHttp(build, {