@wirecat/tg-cli 0.111.0 → 0.113.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 (111) hide show
  1. package/README.md +3 -0
  2. package/dist/bin/tg.js +2 -2
  3. package/dist/bundle/{adapter-WFC2JAD4.js → adapter-EQKEFGPB.js} +70 -50
  4. package/dist/bundle/{all-profiles-FEUSGHT7.js → all-profiles-TTBFF663.js} +8 -8
  5. package/dist/bundle/{anthropic-O646SJIJ.js → anthropic-XPZS7267.js} +5 -5
  6. package/dist/bundle/{app-server-7P23Y45A.js → app-server-ZSZ7KRAY.js} +42 -42
  7. package/dist/bundle/{bot-api-WTJCL6VF.js → bot-api-X7BOVNIO.js} +46 -46
  8. package/dist/bundle/{bot-history-5J2Q4SPC.js → bot-history-DWIUIPN5.js} +15 -15
  9. package/dist/bundle/{bun-KUKVEKDW.js → bun-ZGZVAJU2.js} +2 -2
  10. package/dist/bundle/{bun-sqlite-2G5TXHYE.js → bun-sqlite-UN2UJ6SI.js} +4 -4
  11. package/dist/bundle/{chunk-UDYCZ5KB.js → chunk-3MAYYFKY.js} +1 -1
  12. package/dist/bundle/{chunk-3BD24JYK.js → chunk-452UZ2PU.js} +121 -95
  13. package/dist/bundle/{chunk-EB44Z44U.js → chunk-4GLMEES6.js} +1 -1
  14. package/dist/bundle/{chunk-J2Z5E7TO.js → chunk-4SQB5VKL.js} +1 -1
  15. package/dist/bundle/{chunk-BNQOUCL2.js → chunk-5NF7M4MN.js} +1 -1
  16. package/dist/bundle/{chunk-VIEVOF3O.js → chunk-6F6K3LWV.js} +11 -11
  17. package/dist/bundle/{chunk-QLLPZWYZ.js → chunk-6OKGHHRL.js} +4 -4
  18. package/dist/bundle/{chunk-QVM2HKJP.js → chunk-6WJ5M2Q4.js} +4 -4
  19. package/dist/bundle/{chunk-OYVDWHP5.js → chunk-7IWDS2CM.js} +2 -2
  20. package/dist/bundle/{chunk-ABVHA4K6.js → chunk-AGUCXSSM.js} +5 -5
  21. package/dist/bundle/{chunk-2ZH3PUQX.js → chunk-AVUIWZTP.js} +2 -2
  22. package/dist/bundle/{chunk-LLAZSGS7.js → chunk-BI5YJZJB.js} +31 -27
  23. package/dist/bundle/{chunk-COHMFCHD.js → chunk-EGR5IJCG.js} +95 -34
  24. package/dist/bundle/{chunk-7665YBJ7.js → chunk-ENXO43TV.js} +6 -6
  25. package/dist/bundle/{chunk-MSGYLWCH.js → chunk-G74QMORP.js} +2 -2
  26. package/dist/bundle/{chunk-KLHLWKWC.js → chunk-GX4LRLVD.js} +80 -60
  27. package/dist/bundle/{chunk-DREEXESG.js → chunk-HNN7EKIM.js} +114 -79
  28. package/dist/bundle/{chunk-2K6IGVSI.js → chunk-HO53POQG.js} +5 -5
  29. package/dist/bundle/{chunk-43ZFY6TW.js → chunk-IDUYRTPF.js} +2 -2
  30. package/dist/bundle/{chunk-WDRNVSWF.js → chunk-IYKRHDX6.js} +45 -44
  31. package/dist/bundle/{chunk-KE47Y4PW.js → chunk-J6USEBA6.js} +699 -379
  32. package/dist/bundle/{chunk-5ZPLOYTP.js → chunk-JDQSX2JQ.js} +453 -358
  33. package/dist/bundle/{chunk-NIKYFRDQ.js → chunk-JO45BOYE.js} +2 -2
  34. package/dist/bundle/{chunk-ONHHBPV3.js → chunk-JRTZ5I6M.js} +2 -2
  35. package/dist/bundle/{chunk-YG4BO7N3.js → chunk-JW7BMJ6O.js} +2 -2
  36. package/dist/bundle/{chunk-J4QVXR5I.js → chunk-K3F46QVN.js} +2 -2
  37. package/dist/bundle/{chunk-XXOJ7PQY.js → chunk-KK3JVOOV.js} +30 -30
  38. package/dist/bundle/{chunk-UPRYEDAV.js → chunk-KOWQVHXI.js} +3 -3
  39. package/dist/bundle/{chunk-BWRCPMMC.js → chunk-KQ23JWLJ.js} +20 -18
  40. package/dist/bundle/{chunk-ZCV4UEVH.js → chunk-KVLCIZUK.js} +3 -3
  41. package/dist/bundle/{chunk-DEG4JJHG.js → chunk-MTX5EDYJ.js} +813 -542
  42. package/dist/bundle/{chunk-UFIUMPXP.js → chunk-OC4RRFKH.js} +4 -4
  43. package/dist/bundle/{chunk-PNUHAHTF.js → chunk-OQR442B6.js} +1 -1
  44. package/dist/bundle/{chunk-TWZTQHP6.js → chunk-OSBAISA5.js} +6 -6
  45. package/dist/bundle/{chunk-UIPT6IAU.js → chunk-OYNSFQ7K.js} +1 -1
  46. package/dist/bundle/{chunk-EO563SUX.js → chunk-PCRLXJRH.js} +11 -7
  47. package/dist/bundle/{chunk-XIRASTVS.js → chunk-PHPNA2HU.js} +11 -11
  48. package/dist/bundle/{chunk-7GQLD5TJ.js → chunk-PHYDBR5M.js} +2 -2
  49. package/dist/bundle/{chunk-T6DSAROY.js → chunk-Q264PYGE.js} +51 -14
  50. package/dist/bundle/{chunk-QEAMO2TS.js → chunk-T4TTRFP5.js} +7 -7
  51. package/dist/bundle/{chunk-UMUJHC4M.js → chunk-T5RM4Y35.js} +3 -3
  52. package/dist/bundle/{chunk-ITSSCYLP.js → chunk-TQ6EA7TB.js} +11 -11
  53. package/dist/bundle/{chunk-QAC6Z675.js → chunk-TUD4MU7S.js} +2 -2
  54. package/dist/bundle/{chunk-ZCHC7TYO.js → chunk-U3MJQLZQ.js} +26 -13
  55. package/dist/bundle/{chunk-YFK3DNNP.js → chunk-UE75KPAC.js} +4 -4
  56. package/dist/bundle/{chunk-HN6ZMUAS.js → chunk-UIVLDKWT.js} +1 -1
  57. package/dist/bundle/{chunk-3WUTBGZE.js → chunk-VDATXIO4.js} +6 -6
  58. package/dist/bundle/{chunk-AUWYMMYL.js → chunk-VDEXNNMH.js} +4 -4
  59. package/dist/bundle/{chunk-33HEHPIK.js → chunk-VVA4555T.js} +8 -8
  60. package/dist/bundle/{chunk-PQGWEFJ2.js → chunk-WSAHUQ6K.js} +3 -3
  61. package/dist/bundle/{chunk-K457FHD4.js → chunk-XXNJF3ZM.js} +32 -26
  62. package/dist/bundle/{chunk-NQAV7U7C.js → chunk-XZ2ZHIAO.js} +1 -1
  63. package/dist/bundle/{chunk-5FJQG5UZ.js → chunk-Z6TRIW2O.js} +8 -8
  64. package/dist/bundle/{chunk-CJUSP5X2.js → chunk-ZID2Y4XU.js} +2 -2
  65. package/dist/bundle/command-contract-GV67H22L.js +32 -0
  66. package/dist/bundle/{decode-QJNVAAKJ.js → decode-AMQVTEMW.js} +4 -4
  67. package/dist/bundle/{echarts-2EDY7OUX.js → echarts-ECYONFQJ.js} +2 -2
  68. package/dist/bundle/{embed-PZSXOQJO.js → embed-VZYBZEWI.js} +5 -5
  69. package/dist/bundle/{embedder-O4EGMMUU.js → embedder-GSWBGHRK.js} +8 -8
  70. package/dist/bundle/{entry-DVLMQM6J.js → entry-LALZILY4.js} +5 -5
  71. package/dist/bundle/{first-run-J67KTUWA.js → first-run-LEAI623Q.js} +9 -9
  72. package/dist/bundle/first-screen-MOCVLE23.js +30 -0
  73. package/dist/bundle/{identity-DSYY4FLQ.js → identity-54HA5GN6.js} +3 -3
  74. package/dist/bundle/{instructions-O535XB2L.js → instructions-AXLQQS3G.js} +1 -1
  75. package/dist/bundle/{mcp-EMNFFY4N.js → mcp-VVMPUDSL.js} +2 -2
  76. package/dist/bundle/{node-S3VEQNTE.js → node-7JHC5K77.js} +2 -2
  77. package/dist/bundle/{node-sqlite-3DNWF2BW.js → node-sqlite-LYJEK46T.js} +4 -4
  78. package/dist/bundle/{oauth-IU2RAZ3D.js → oauth-BROPKI3K.js} +6 -6
  79. package/dist/bundle/{open-M2IPPXMI.js → open-C6XQ46JK.js} +3 -3
  80. package/dist/bundle/{openai-GDI7HISL.js → openai-VWSU7ZDD.js} +13 -13
  81. package/dist/bundle/{process-3IGMEATV.js → process-QKEFL5HL.js} +1 -1
  82. package/dist/bundle/{program-P7YPHVLD.js → program-ACY7O33O.js} +48 -48
  83. package/dist/bundle/{prompt-S6R7IHDK.js → prompt-EGULVW2F.js} +4 -4
  84. package/dist/bundle/{proxy-transport-OROEVBCG.js → proxy-transport-KIMADLQ2.js} +4 -4
  85. package/dist/bundle/{recognize-PFZRQ3P4.js → recognize-UMTKLWVR.js} +3 -3
  86. package/dist/bundle/{remote-Q37V7LUX.js → remote-DABI7PSQ.js} +6 -6
  87. package/dist/bundle/{rerank-V5YQQQAM.js → rerank-ZFATWWBE.js} +6 -6
  88. package/dist/bundle/{serve-5CAD2UVG.js → serve-B7YYCMGN.js} +8 -8
  89. package/dist/bundle/{server-R6YAO2SG.js → server-DGKZISZH.js} +32 -32
  90. package/dist/bundle/server-UC7UWUIS.js +56 -0
  91. package/dist/bundle/{state-Y3A2NEM3.js → state-AQ2PABA5.js} +5 -5
  92. package/dist/bundle/{store-H5K32CNI.js → store-46GJTFLJ.js} +12 -10
  93. package/dist/bundle/store-maintenance-command-FCFKHGRM.js +45 -0
  94. package/dist/bundle/tg.js +4 -4
  95. package/dist/telegram/adapter.d.ts +2 -0
  96. package/dist/telegram/adapter.d.ts.map +1 -1
  97. package/dist/telegram/adapter.js +3 -0
  98. package/dist/telegram/adapter.js.map +1 -1
  99. package/dist/telegram/topics.d.ts +4 -2
  100. package/dist/telegram/topics.d.ts.map +1 -1
  101. package/dist/telegram/topics.js +21 -3
  102. package/dist/telegram/topics.js.map +1 -1
  103. package/dist/version.d.ts +1 -1
  104. package/dist/version.js +1 -1
  105. package/package.json +3 -3
  106. package/skills/tg-cli/SKILL.md +2 -0
  107. package/dist/bundle/command-contract-JCRVVL7P.js +0 -32
  108. package/dist/bundle/first-screen-PYEE5NMQ.js +0 -30
  109. package/dist/bundle/server-RUQLAWWS.js +0 -56
  110. package/dist/bundle/store-maintenance-command-QZDC4WKW.js +0 -45
  111. /package/dist/bundle/{chunk-NPGVOZVK.js → chunk-HPXYN7F3.js} +0 -0
@@ -5,7 +5,7 @@ import {
5
5
  check,
6
6
  pipe,
7
7
  string
8
- } from "./chunk-EO563SUX.js";
8
+ } from "./chunk-PCRLXJRH.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/mcp/bot/instructions.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/mcp/bot/instructions.js
8
8
  var botInstructions = /* @__PURE__ */ __name(({ command, name, profile, writes, skill }) => [
9
9
  `The owner's ${name} bot "${profile}", through the official Bot API \u2014 not the owner's personal account. What it writes, people see as the bot.`,
10
10
  "Use these tools to read the chats this bot is in, find a message or a person, and \u2014 when the profile allows \u2014 write as the bot.",
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/mcp/instructions.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/mcp/instructions.js
8
8
  var instructions = /* @__PURE__ */ __name(({ command, name, profile, writes, skill }) => {
9
9
  const all = typeof profile !== "string";
10
10
  const offers = /* @__PURE__ */ __name((key) => all || writes.includes(key), "offers");
@@ -13,40 +13,40 @@ import {
13
13
  privateFiles,
14
14
  providerRequest,
15
15
  withSqliteSidecars
16
- } from "./chunk-DEG4JJHG.js";
16
+ } from "./chunk-MTX5EDYJ.js";
17
17
  import {
18
18
  parseProxy,
19
19
  proxyAddress,
20
20
  proxyError,
21
21
  proxyLabel,
22
22
  proxySetting
23
- } from "./chunk-EB44Z44U.js";
23
+ } from "./chunk-4GLMEES6.js";
24
24
  import {
25
25
  messengerContext
26
- } from "./chunk-LLAZSGS7.js";
26
+ } from "./chunk-BI5YJZJB.js";
27
27
  import {
28
28
  uploadBlob
29
- } from "./chunk-5ZPLOYTP.js";
29
+ } from "./chunk-JDQSX2JQ.js";
30
30
  import {
31
31
  asFirstWord,
32
32
  currentAttempt,
33
33
  environmentOf,
34
34
  fromFile,
35
35
  settingsFor
36
- } from "./chunk-KLHLWKWC.js";
36
+ } from "./chunk-GX4LRLVD.js";
37
37
  import {
38
38
  TG
39
- } from "./chunk-NIKYFRDQ.js";
39
+ } from "./chunk-JO45BOYE.js";
40
40
  import {
41
41
  Credentials,
42
42
  pathsAreOverridden,
43
43
  resolvePaths
44
- } from "./chunk-BWRCPMMC.js";
44
+ } from "./chunk-KQ23JWLJ.js";
45
45
  import {
46
46
  CliError,
47
47
  isCliError,
48
48
  optional
49
- } from "./chunk-EO563SUX.js";
49
+ } from "./chunk-PCRLXJRH.js";
50
50
  import {
51
51
  importFrom
52
52
  } from "./chunk-Y5E2WNWB.js";
@@ -178,7 +178,7 @@ var telegramOf = /* @__PURE__ */ __name((command, base) => {
178
178
  throw new CliError(unreachable, loggedIn ? `no Telegram app credentials found for profile "${profile}", although it has logged in on this machine \u2014 the keyring is probably out of reach (cron, ssh, an MCP client that trims the environment: set XDG_RUNTIME_DIR); \`tg ${asFirstWord(profile)}doctor\` shows it. Log in again only if they were removed` : `no Telegram app credentials for profile "${profile}" \u2014 run ${setup} in a local terminal first, or sign in from ${desktop}; agents: read \`tg skill show\``);
179
179
  }
180
180
  const options = { credentials: resolved, sessionPath, ...connecting };
181
- return environment.adapter ? await environment.adapter(options) : await (await import("./adapter-WFC2JAD4.js")).TelegramAdapter.open({
181
+ return environment.adapter ? await environment.adapter(options) : await (await import("./adapter-EQKEFGPB.js")).TelegramAdapter.open({
182
182
  ...options,
183
183
  ...proxyOption(proxy()),
184
184
  diagnostic: /* @__PURE__ */ __name((line) => base.streams.diagnostic(line), "diagnostic"),
@@ -864,7 +864,7 @@ var TELEGRAM_BOT = {
864
864
  const botId = token.split(":", 1)[0] ?? "";
865
865
  if (!/^\d+$/.test(botId))
866
866
  throw new CliError("authentication_error", "the bot token has no valid bot id");
867
- const reader = await (environment.botHistory ?? (await import("./bot-history-5J2Q4SPC.js")).openBotHistory)({
867
+ const reader = await (environment.botHistory ?? (await import("./bot-history-DWIUIPN5.js")).openBotHistory)({
868
868
  credentials,
869
869
  sessionPath: botSessionFile(profile, botId, env),
870
870
  token,
@@ -884,7 +884,7 @@ var TELEGRAM_BOT = {
884
884
  return void 0;
885
885
  let personal;
886
886
  try {
887
- personal = environment.adapter ? await environment.adapter({ credentials, sessionPath: personalPath }) : await (await import("./adapter-WFC2JAD4.js")).TelegramAdapter.open({
887
+ personal = environment.adapter ? await environment.adapter({ credentials, sessionPath: personalPath }) : await (await import("./adapter-EQKEFGPB.js")).TelegramAdapter.open({
888
888
  credentials,
889
889
  sessionPath: personalPath,
890
890
  checks: words,
@@ -18,9 +18,9 @@ import {
18
18
  strictObject,
19
19
  string,
20
20
  unknown
21
- } from "./chunk-EO563SUX.js";
21
+ } from "./chunk-PCRLXJRH.js";
22
22
 
23
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/entities/fields.js
23
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/entities/fields.js
24
24
  var text = string();
25
25
  var id = pipe(string(), minLength(1));
26
26
  var time = isoTime;
@@ -44,7 +44,7 @@ var author = strictObject({
44
44
  name: nullable(text)
45
45
  });
46
46
 
47
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/entities/note.js
47
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/entities/note.js
48
48
  var link = {
49
49
  target_text: nullable(text),
50
50
  kind: text,
@@ -85,7 +85,7 @@ var note = strictObject({
85
85
  backlinks: optional(array(strictObject({ from: reference, ...link })))
86
86
  });
87
87
 
88
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/entities/knowledge-lists.js
88
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/entities/knowledge-lists.js
89
89
  var organization = strictObject({
90
90
  id,
91
91
  ref: reference,
@@ -4,15 +4,15 @@ import {
4
4
  organization,
5
5
  project,
6
6
  reminder
7
- } from "./chunk-QLLPZWYZ.js";
7
+ } from "./chunk-6OKGHHRL.js";
8
8
  import {
9
9
  queryFieldsOf
10
- } from "./chunk-DREEXESG.js";
10
+ } from "./chunk-HNN7EKIM.js";
11
11
 
12
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/snapshot.js
12
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/snapshot.js
13
13
  var MAX_BYTES = 16 * 1024 * 1024;
14
14
 
15
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
15
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
16
16
  var ORGANIZATIONS_QUERY = {
17
17
  entity: "organization",
18
18
  backend: "sql",
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError
5
- } from "./chunk-EO563SUX.js";
5
+ } from "./chunk-PCRLXJRH.js";
6
6
  import {
7
7
  importFrom
8
8
  } from "./chunk-Y5E2WNWB.js";
@@ -10,7 +10,7 @@ import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/store/vector-extension.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/store/vector-extension.js
14
14
  import { readFileSync } from "node:fs";
15
15
  var musl = /* @__PURE__ */ __name(() => {
16
16
  if (process.platform !== "linux")
@@ -4,23 +4,23 @@ import {
4
4
  executableEnvironment,
5
5
  executableOnPath,
6
6
  require_cross_spawn
7
- } from "./chunk-UIPT6IAU.js";
7
+ } from "./chunk-OYNSFQ7K.js";
8
8
  import {
9
9
  loadConfigFile,
10
10
  saveConfigFile
11
- } from "./chunk-BWRCPMMC.js";
11
+ } from "./chunk-KQ23JWLJ.js";
12
12
  import {
13
13
  number,
14
14
  object,
15
15
  optional,
16
16
  string
17
- } from "./chunk-EO563SUX.js";
17
+ } from "./chunk-PCRLXJRH.js";
18
18
  import {
19
19
  __name,
20
20
  __toESM
21
21
  } from "./chunk-ZVVMGPBJ.js";
22
22
 
23
- // node_modules/.pnpm/@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/installer.js
23
+ // node_modules/.pnpm/@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/installer.js
24
24
  var installerOf = /* @__PURE__ */ __name((scriptPath) => {
25
25
  const path = scriptPath.replaceAll("\\", "/");
26
26
  if (path.includes("/_npx/"))
@@ -34,7 +34,7 @@ var installerOf = /* @__PURE__ */ __name((scriptPath) => {
34
34
  return path.includes("/dist/") ? "checkout" : "unknown";
35
35
  }, "installerOf");
36
36
 
37
- // node_modules/.pnpm/@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/update/index.js
37
+ // node_modules/.pnpm/@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/update/index.js
38
38
  var import_cross_spawn = __toESM(require_cross_spawn(), 1);
39
39
  import { existsSync } from "node:fs";
40
40
  var updateCommand = /* @__PURE__ */ __name((installer, packageName) => {
@@ -2,12 +2,12 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError
5
- } from "./chunk-EO563SUX.js";
5
+ } from "./chunk-PCRLXJRH.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/cli/input-policy.js
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/input-policy.js
11
11
  var MAX_BUFFERED_INPUT = 16 * 1024 * 1024;
12
12
  var MAX_SECRET_INPUT = 64 * 1024;
13
13
  var policies = /* @__PURE__ */ new WeakMap();
@@ -10,7 +10,7 @@ import {
10
10
  refuseLacking,
11
11
  servicesFor,
12
12
  throughWrapper
13
- } from "./chunk-5ZPLOYTP.js";
13
+ } from "./chunk-JDQSX2JQ.js";
14
14
  import {
15
15
  CEILING_KEY,
16
16
  LOG_ATTRIBUTES,
@@ -34,35 +34,35 @@ import {
34
34
  rememberAccount,
35
35
  rootOf2 as rootOf,
36
36
  skipFlagFor
37
- } from "./chunk-KLHLWKWC.js";
37
+ } from "./chunk-GX4LRLVD.js";
38
38
  import {
39
39
  isCliFailure,
40
40
  providerErrorKey
41
- } from "./chunk-5FJQG5UZ.js";
41
+ } from "./chunk-Z6TRIW2O.js";
42
42
  import {
43
43
  MESSENGER_CHANGE_REFUSAL,
44
44
  readOnlyRefusal
45
- } from "./chunk-43ZFY6TW.js";
45
+ } from "./chunk-IDUYRTPF.js";
46
46
  import {
47
47
  servingProfiles
48
- } from "./chunk-UPRYEDAV.js";
48
+ } from "./chunk-KOWQVHXI.js";
49
49
  import {
50
50
  openStore
51
- } from "./chunk-KE47Y4PW.js";
51
+ } from "./chunk-J6USEBA6.js";
52
52
  import {
53
53
  logRecordOf,
54
54
  realSleep,
55
55
  resolvePaths,
56
56
  writeSecurely
57
- } from "./chunk-BWRCPMMC.js";
57
+ } from "./chunk-KQ23JWLJ.js";
58
58
  import {
59
59
  CliError
60
- } from "./chunk-EO563SUX.js";
60
+ } from "./chunk-PCRLXJRH.js";
61
61
  import {
62
62
  __name
63
63
  } from "./chunk-ZVVMGPBJ.js";
64
64
 
65
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/cli/messenger/ask.js
65
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/messenger/ask.js
66
66
  import { openSync } from "node:fs";
67
67
  import { createInterface } from "node:readline";
68
68
  import { ReadStream } from "node:tty";
@@ -117,10 +117,10 @@ var terminalAsker = /* @__PURE__ */ __name((command) => async (key, request) =>
117
117
  throw new CliError("cancelled", `${key}: not done \u2014 the answer was no`);
118
118
  }, "terminalAsker");
119
119
 
120
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/sends/guard.js
120
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/sends/guard.js
121
121
  import { randomUUID } from "node:crypto";
122
122
 
123
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/sends/flood.js
123
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/sends/flood.js
124
124
  import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
125
125
  import { dirname, join } from "node:path";
126
126
  var MOST_DEADLINES = 50;
@@ -204,11 +204,11 @@ var FloodMemory = class {
204
204
  }
205
205
  };
206
206
 
207
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/sends/journal.js
207
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/sends/journal.js
208
208
  import { appendFileSync, mkdirSync as mkdirSync3, readFileSync as readFileSync2 } from "node:fs";
209
209
  import { dirname as dirname3, join as join2 } from "node:path";
210
210
 
211
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/sends/file-lock.js
211
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/sends/file-lock.js
212
212
  import { closeSync, mkdirSync as mkdirSync2, openSync as openSync2, statSync, unlinkSync } from "node:fs";
213
213
  import { dirname as dirname2 } from "node:path";
214
214
  var LOCK_WAIT_MS = 5e3;
@@ -275,7 +275,7 @@ var lockTime = /* @__PURE__ */ __name((lock) => {
275
275
  }
276
276
  }, "lockTime");
277
277
 
278
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/sends/journal.js
278
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/sends/journal.js
279
279
  var sendsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "sends", `${profile}.jsonl`), "sendsPathFor");
280
280
  var SendJournal = class {
281
281
  static {
@@ -352,7 +352,7 @@ var withSendId = /* @__PURE__ */ __name((entry) => {
352
352
  return cid === void 0 || rest.sendId !== void 0 ? rest : { ...rest, sendId: String(cid) };
353
353
  }, "withSendId");
354
354
 
355
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/sends/recipients.js
355
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/sends/recipients.js
356
356
  import { existsSync, readFileSync as readFileSync3, rmSync } from "node:fs";
357
357
  import { join as join3 } from "node:path";
358
358
  var recipientsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "profiles", `${profile}.recipients.json`), "recipientsPathFor");
@@ -464,7 +464,7 @@ var RecipientList = class {
464
464
  }
465
465
  };
466
466
 
467
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/sends/guard.js
467
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/sends/guard.js
468
468
  var HOUR_MS = 60 * 60 * 1e3;
469
469
  var READS_UNDER_HOLD = /* @__PURE__ */ new Set([
470
470
  "attachments.extract",
@@ -657,7 +657,7 @@ var guardFor = /* @__PURE__ */ __name((app, settings, warn, env = process.env, a
657
657
  }), "guardFor");
658
658
  var journalFailure = /* @__PURE__ */ __name((error) => error?.code ?? (error instanceof Error ? error.name : "error"), "journalFailure");
659
659
 
660
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/sends/pace.js
660
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/sends/pace.js
661
661
  import { readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
662
662
  import { join as join4 } from "node:path";
663
663
  var DEFAULT_PACE = { perMinute: 60, burst: 20 };
@@ -716,7 +716,7 @@ var Pacer = class {
716
716
  }
717
717
  };
718
718
 
719
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
719
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
720
720
  var pathOf = /* @__PURE__ */ __name((command) => {
721
721
  const words = [];
722
722
  for (let at = command; at?.parent; at = at.parent)
@@ -776,7 +776,7 @@ var refuseUnknownPermissionKeys = /* @__PURE__ */ __name((command, settings, too
776
776
  throw new CliError("validation_error", `--permission ${key} names no command`, { permission: key });
777
777
  }, "refuseUnknownPermissionKeys");
778
778
 
779
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/cli/messenger/flooded.js
779
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/messenger/flooded.js
780
780
  var LONG_LIVED = /* @__PURE__ */ new Set(["self", "newSendId", "close", "formatMarkdown", "formatHtml", "storedChats"]);
781
781
  var LISTENING = /* @__PURE__ */ new Set(["watch", "feed", "listen", "listenHistory"]);
782
782
  var BLOCKING = /* @__PURE__ */ new Set(["frozen", "limited", "banned"]);
@@ -895,7 +895,7 @@ var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer })
895
895
  });
896
896
  }, "flooded");
897
897
 
898
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/cli/messenger/observed.js
898
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/messenger/observed.js
899
899
  var observed = /* @__PURE__ */ __name((messenger, events) => {
900
900
  const timed = /* @__PURE__ */ __name(async (operation, named, work, after) => {
901
901
  const write = currentOperation();
@@ -933,7 +933,7 @@ var observed = /* @__PURE__ */ __name((messenger, events) => {
933
933
  const counts = {};
934
934
  await timed(operation, {}, () => work((item) => {
935
935
  count(item, counts);
936
- onItem(item);
936
+ return onItem(item);
937
937
  }), () => ({ counts }));
938
938
  }, "counted");
939
939
  const mint = messenger.newSendId;
@@ -994,7 +994,7 @@ var byPart = /* @__PURE__ */ __name((batch, counts) => {
994
994
  counts[part] = (counts[part] ?? 0) + items.length;
995
995
  }, "byPart");
996
996
 
997
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/cli/messenger/stored.js
997
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/messenger/stored.js
998
998
  var REKEY_PACING = { lockMs: 50, pauseMs: 25 };
999
999
  var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events, pending, announcing, deletedWithoutChat, profile, rekeyed, rekeyPacing = REKEY_PACING, closing, namesFromStore, recipientIds, countsUnread = false }) => {
1000
1000
  let warned = false;
@@ -1009,15 +1009,18 @@ var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events,
1009
1009
  const attempt = /* @__PURE__ */ __name(async (operation, write) => {
1010
1010
  try {
1011
1011
  const opened = await store();
1012
- if (opened)
1013
- await write(opened);
1012
+ if (!opened)
1013
+ return false;
1014
+ await write(opened);
1014
1015
  if (opened && !recorded && profile) {
1015
1016
  recorded = true;
1016
1017
  await Promise.resolve().then(() => opened.accounts.saveProfile(profile.app, profile.name, account)).catch(() => {
1017
1018
  });
1018
1019
  }
1020
+ return true;
1019
1021
  } catch (error) {
1020
1022
  notWritten(operation, error);
1023
+ return false;
1021
1024
  }
1022
1025
  }, "attempt");
1023
1026
  const save = /* @__PURE__ */ __name((operation, writing) => {
@@ -1115,7 +1118,7 @@ var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events,
1115
1118
  rekeysQueued += rekeys.length;
1116
1119
  const saving = previous.then(async () => {
1117
1120
  await saveRekeys(rekeys, round);
1118
- await attempt(operation, (opened) => fill(opened, account, batch));
1121
+ return attempt(operation, (opened) => fill(opened, account, batch));
1119
1122
  });
1120
1123
  previous = saving;
1121
1124
  pending?.add(saving);
@@ -1125,7 +1128,8 @@ var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events,
1125
1128
  pending?.delete(saving);
1126
1129
  rekeysOnly.delete(saving);
1127
1130
  });
1128
- onBatch(batch);
1131
+ void onBatch(batch);
1132
+ return saving;
1129
1133
  };
1130
1134
  }, "saveBatches");
1131
1135
  return throughWrapper(messenger, {
@@ -1486,7 +1490,7 @@ var keep = /* @__PURE__ */ __name(async (store, account, event, seenAt, among, c
1486
1490
  }
1487
1491
  }, "keep");
1488
1492
 
1489
- // node_modules/.pnpm/@wirecat+cli-core@0.517.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.68.1_commander@15._6629eebba461c30d3c69d5318744d1d9/node_modules/@wirecat/cli-core/dist/cli/messenger/context.js
1493
+ // node_modules/.pnpm/@wirecat+cli-core@0.544.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.73.0_commander@15._14d279ae6bc0fc41a3606e009c109ba5/node_modules/@wirecat/cli-core/dist/cli/messenger/context.js
1490
1494
  var lazyStore = /* @__PURE__ */ __name((env, command, version) => {
1491
1495
  let opened;
1492
1496
  return {