@wirecat/drive-cli 0.55.0 → 0.57.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 (132) hide show
  1. package/dist/bin/drive.js +2 -2
  2. package/dist/bundle/{all-profiles-I5KJKZPF.js → all-profiles-7LSZ3CC3.js} +9 -9
  3. package/dist/bundle/{anthropic-DPM7BRKX.js → anthropic-3QRM4QXB.js} +5 -5
  4. package/dist/bundle/{app-server-FTGLOZ2K.js → app-server-WWNMUHID.js} +48 -48
  5. package/dist/bundle/{bun-XRO6XJHQ.js → bun-NIIYUR5F.js} +2 -2
  6. package/dist/bundle/{bun-sqlite-7JJX6OUT.js → bun-sqlite-GSLSN3OT.js} +4 -4
  7. package/dist/bundle/{chunk-NPMVPKBD.js → chunk-2QLLKDE5.js} +48 -47
  8. package/dist/bundle/{chunk-P4ABC6C4.js → chunk-2ULJW5BA.js} +2 -2
  9. package/dist/bundle/{chunk-AR2HRFQO.js → chunk-373WJIHE.js} +2 -2
  10. package/dist/bundle/{chunk-K2DMCTTF.js → chunk-3BXSLNWW.js} +129 -97
  11. package/dist/bundle/{chunk-BO7ZKZCH.js → chunk-4F2VRJZE.js} +121 -46
  12. package/dist/bundle/{chunk-NDUYK676.js → chunk-4UQLL6RJ.js} +10 -9
  13. package/dist/bundle/{chunk-NFOUG7ES.js → chunk-566W4Q6L.js} +2 -2
  14. package/dist/bundle/{chunk-E7RDXCV2.js → chunk-5KNIVHP6.js} +5 -5
  15. package/dist/bundle/{chunk-VXZULAWV.js → chunk-64E6QXXQ.js} +14 -13
  16. package/dist/bundle/{chunk-FNDQFFLP.js → chunk-6CFSDU56.js} +11 -11
  17. package/dist/bundle/{chunk-ORRQDSDH.js → chunk-6ZA4NR5H.js} +3 -3
  18. package/dist/bundle/{chunk-PFTIYWOK.js → chunk-7SNS443B.js} +4 -4
  19. package/dist/bundle/{chunk-JPFF6MNK.js → chunk-AHBUTDS7.js} +8 -8
  20. package/dist/bundle/{chunk-TIEEVT2Z.js → chunk-AKPFH3KC.js} +1 -1
  21. package/dist/bundle/{chunk-FDCGTODC.js → chunk-AL7MY7MW.js} +1 -1
  22. package/dist/bundle/{chunk-RMQGFLT2.js → chunk-B3TPS7BW.js} +6 -6
  23. package/dist/bundle/{chunk-2DZMGPUC.js → chunk-B64EY2SC.js} +123 -34
  24. package/dist/bundle/{chunk-2OGANEKA.js → chunk-CD736BG3.js} +2 -2
  25. package/dist/bundle/{chunk-C4QKY33N.js → chunk-CGCQNYB3.js} +2 -2
  26. package/dist/bundle/{chunk-2KARCTUU.js → chunk-EE7R457T.js} +949 -581
  27. package/dist/bundle/{chunk-TQFCPUIM.js → chunk-EFEI724Z.js} +1 -1
  28. package/dist/bundle/{chunk-JBBZCTTF.js → chunk-EFX6FIDM.js} +1 -1
  29. package/dist/bundle/{chunk-DNJ43DT5.js → chunk-ELIYJXIY.js} +2 -2
  30. package/dist/bundle/{chunk-NPKFXGYG.js → chunk-EN7OZ5JH.js} +41 -23
  31. package/dist/bundle/{chunk-IXXVCKWL.js → chunk-G34Y5RAC.js} +26 -26
  32. package/dist/bundle/{chunk-TBD362SJ.js → chunk-GIQFBXQN.js} +11 -7
  33. package/dist/bundle/{chunk-KWKRTYRL.js → chunk-GKHUHRSL.js} +4 -4
  34. package/dist/bundle/{chunk-VGTDXEYD.js → chunk-HNUSPNUQ.js} +26 -13
  35. package/dist/bundle/{chunk-XTNEYXAQ.js → chunk-IJ2S53WJ.js} +5 -5
  36. package/dist/bundle/{chunk-FUKJQZED.js → chunk-ISK4K7UE.js} +1 -1
  37. package/dist/bundle/{chunk-YP5FDMTG.js → chunk-J2HGHSLX.js} +2 -2
  38. package/dist/bundle/{chunk-ULPS2OAL.js → chunk-JIGMCW4C.js} +4 -4
  39. package/dist/bundle/{chunk-ALMQEGYO.js → chunk-JLKNUFL2.js} +2 -2
  40. package/dist/bundle/{chunk-UDWMRZL6.js → chunk-JUKVJ7M2.js} +21 -21
  41. package/dist/bundle/{chunk-LAVWTS4P.js → chunk-KHNDZNQA.js} +5333 -5108
  42. package/dist/bundle/{chunk-GB5YM5HK.js → chunk-KM4Y55ZE.js} +5 -5
  43. package/dist/bundle/{chunk-CP6M5P4X.js → chunk-KYNTSA6K.js} +3 -3
  44. package/dist/bundle/{chunk-4XRLPQ3N.js → chunk-L4BBK7UX.js} +2 -2
  45. package/dist/bundle/chunk-LBFFI6FE.js +247 -0
  46. package/dist/bundle/{chunk-EOEDICIE.js → chunk-LSSIVBQI.js} +1 -1
  47. package/dist/bundle/{chunk-D6SRTPCV.js → chunk-NLLWLCUZ.js} +2 -2
  48. package/dist/bundle/{chunk-6OJMA4ZT.js → chunk-O5KDIVGE.js} +389 -255
  49. package/dist/bundle/{chunk-2LLNPNMB.js → chunk-OOR6PEHV.js} +1 -1
  50. package/dist/bundle/{chunk-UIPT6IAU.js → chunk-OYNSFQ7K.js} +1 -1
  51. package/dist/bundle/{chunk-67A2YFAT.js → chunk-OZJMZSFB.js} +4 -4
  52. package/dist/bundle/{chunk-GC4JNVYF.js → chunk-Q3TMNETS.js} +98 -37
  53. package/dist/bundle/{chunk-5DEEBWDI.js → chunk-QAT6UXZZ.js} +38 -37
  54. package/dist/bundle/{chunk-VY3TYRCK.js → chunk-R5GJZPRF.js} +114 -59
  55. package/dist/bundle/{chunk-4I7EBJJV.js → chunk-RAEKC6TV.js} +6 -6
  56. package/dist/bundle/{chunk-HNR2BJJU.js → chunk-RB674T6L.js} +75 -17
  57. package/dist/bundle/{chunk-NCCL4QWR.js → chunk-SRNXTXJN.js} +3 -3
  58. package/dist/bundle/{chunk-TD4RAOMZ.js → chunk-TKVSJV5P.js} +3 -3
  59. package/dist/bundle/{chunk-W6DMCGMK.js → chunk-TR5656OS.js} +47 -22
  60. package/dist/bundle/{chunk-VY2AUZMJ.js → chunk-TZHCS5MG.js} +2 -2
  61. package/dist/bundle/{chunk-KM7Q67Z3.js → chunk-U2RSVKR5.js} +1 -1
  62. package/dist/bundle/{chunk-IDK5QUBJ.js → chunk-UKMFPBAO.js} +4 -4
  63. package/dist/bundle/{chunk-GIRVMZD3.js → chunk-VTJF2L5E.js} +16 -16
  64. package/dist/bundle/{chunk-AQNY57J2.js → chunk-W5FOPSJZ.js} +7 -7
  65. package/dist/bundle/{chunk-FKHWVVMV.js → chunk-W6FYYQ2J.js} +3 -3
  66. package/dist/bundle/{chunk-VVMCGF5X.js → chunk-WAVJWGUC.js} +1811 -883
  67. package/dist/bundle/{chunk-FDM3JMQZ.js → chunk-WBYCUBYM.js} +89 -36
  68. package/dist/bundle/{chunk-TIVC4DB5.js → chunk-WJOKTIOJ.js} +2 -2
  69. package/dist/bundle/{chunk-7MVKSPEG.js → chunk-WJPVGXKA.js} +6 -6
  70. package/dist/bundle/{chunk-N4VNUOOD.js → chunk-XGNADVIA.js} +18 -18
  71. package/dist/bundle/{chunk-J6XLM4QW.js → chunk-XJVK7ETL.js} +28 -10
  72. package/dist/bundle/{chunk-3K4H2DTA.js → chunk-YZ6SYLDC.js} +12 -3
  73. package/dist/bundle/command-contract-XIACCAZL.js +35 -0
  74. package/dist/bundle/{decode-3LX3BLZM.js → decode-5MHMPYKE.js} +4 -4
  75. package/dist/bundle/drive.js +6 -6
  76. package/dist/bundle/{echarts-YNGCOYHW.js → echarts-CLB22SZS.js} +2 -2
  77. package/dist/bundle/{embed-FICTRZJL.js → embed-TF66ODAR.js} +5 -5
  78. package/dist/bundle/{embedder-DSMRCRSH.js → embedder-EDWOIAC2.js} +8 -8
  79. package/dist/bundle/{entry-4ZX3BNXK.js → entry-CWYCQ53A.js} +8 -6
  80. package/dist/bundle/{first-run-GRBQ3SQ5.js → first-run-YIH7EHJI.js} +9 -9
  81. package/dist/bundle/first-screen-THH3XD5Y.js +33 -0
  82. package/dist/bundle/{google-QV2B2KZA.js → google-A4F2WFO4.js} +9 -9
  83. package/dist/bundle/{google-api-EVO7F3WB.js → google-api-ZXGQOJUI.js} +51 -51
  84. package/dist/bundle/grants-3Z7DG3W3.js +98 -0
  85. package/dist/bundle/{identity-TKAX75OT.js → identity-4IO7WGG4.js} +4 -4
  86. package/dist/bundle/{instructions-GJHHFV64.js → instructions-BXZZNAMS.js} +1 -1
  87. package/dist/bundle/{login-R2YEAKEM.js → login-A4QHJ5DA.js} +57 -57
  88. package/dist/bundle/{mcp-EMNFFY4N.js → mcp-VVMPUDSL.js} +2 -2
  89. package/dist/bundle/{node-GFOH6FKP.js → node-R6ZNQ3NT.js} +2 -2
  90. package/dist/bundle/{node-sqlite-NZIBED3C.js → node-sqlite-AFQTE4XZ.js} +4 -4
  91. package/dist/bundle/{oauth-WUHT2JII.js → oauth-46XBJBML.js} +6 -6
  92. package/dist/bundle/{open-INBNHORD.js → open-WJCRBIP7.js} +3 -3
  93. package/dist/bundle/{openai-BMREUGJP.js → openai-3TIBDWZA.js} +13 -13
  94. package/dist/bundle/{process-XVDX4SPD.js → process-P36JP33R.js} +1 -1
  95. package/dist/bundle/{program-DUWFQOSL.js → program-AHZH65IT.js} +85 -77
  96. package/dist/bundle/{prompt-S7GHCPGR.js → prompt-FFGBIT4A.js} +4 -4
  97. package/dist/bundle/{reasons-T24V3AYS.js → reasons-VHCVYH54.js} +3 -3
  98. package/dist/bundle/{recognize-T3DABMW5.js → recognize-4EAKIMON.js} +3 -3
  99. package/dist/bundle/{remote-ASYGFT6E.js → remote-HX3JP4EH.js} +6 -6
  100. package/dist/bundle/{rerank-BQ5U252K.js → rerank-BW3A4PUU.js} +6 -6
  101. package/dist/bundle/{serve-JMLNKCUZ.js → serve-YYOOLIBS.js} +8 -8
  102. package/dist/bundle/{server-5E6RC7GZ.js → server-G6XTEEFI.js} +38 -38
  103. package/dist/bundle/server-YKYEUIJT.js +63 -0
  104. package/dist/bundle/{services-NFB3XSON.js → services-OAPILZOW.js} +45 -25
  105. package/dist/bundle/{sqlite-runtime-TAMYMQFR.js → sqlite-runtime-GTXDK4PE.js} +4 -4
  106. package/dist/bundle/{state-DS4G3ZXV.js → state-XG335LGZ.js} +5 -5
  107. package/dist/bundle/{store-MLMKYJLC.js → store-7KOXJNQP.js} +14 -12
  108. package/dist/bundle/{store-HAS2LRFE.js → store-N53SJOPS.js} +33 -15
  109. package/dist/bundle/store-maintenance-command-W3TI52X2.js +52 -0
  110. package/dist/bundle/tokens-P7TEHKDD.js +96 -0
  111. package/dist/commands/knowledge.d.ts.map +1 -1
  112. package/dist/commands/knowledge.js +10 -2
  113. package/dist/commands/knowledge.js.map +1 -1
  114. package/dist/config.d.ts +6 -0
  115. package/dist/config.d.ts.map +1 -1
  116. package/dist/config.js +4 -12
  117. package/dist/config.js.map +1 -1
  118. package/dist/profile-lock.js +2 -2
  119. package/dist/profile-lock.js.map +1 -1
  120. package/dist/reasons.js +1 -1
  121. package/dist/reasons.js.map +1 -1
  122. package/dist/version.d.ts +1 -1
  123. package/dist/version.js +1 -1
  124. package/package.json +3 -3
  125. package/dist/bundle/chunk-3NAVOBGH.js +0 -331
  126. package/dist/bundle/command-contract-VXLGE6NV.js +0 -35
  127. package/dist/bundle/first-screen-JK3MZVCU.js +0 -33
  128. package/dist/bundle/grants-B642KK5M.js +0 -98
  129. package/dist/bundle/server-QI4C3CQT.js +0 -63
  130. package/dist/bundle/store-maintenance-command-LI3JR22B.js +0 -52
  131. package/dist/bundle/tokens-UMSAYGOH.js +0 -96
  132. /package/dist/bundle/{chunk-NPGVOZVK.js → chunk-HPXYN7F3.js} +0 -0
@@ -2,34 +2,38 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  refuseLacking
5
- } from "./chunk-NPKFXGYG.js";
5
+ } from "./chunk-EN7OZ5JH.js";
6
6
  import {
7
7
  servingProfiles
8
- } from "./chunk-NCCL4QWR.js";
8
+ } from "./chunk-SRNXTXJN.js";
9
9
  import {
10
10
  OFFLINE,
11
11
  capability,
12
12
  chatIdIn,
13
+ chatReferenceOf,
14
+ ensureAccount,
13
15
  foldName,
14
16
  isId,
15
17
  pickPerson,
18
+ profilesOnAccount,
16
19
  servicesFor,
17
20
  throughWrapper
18
- } from "./chunk-LAVWTS4P.js";
21
+ } from "./chunk-KHNDZNQA.js";
19
22
  import {
20
23
  asFirstWord,
21
24
  baseContext,
22
25
  environmentOf,
23
26
  issueMessage,
27
+ limitBatch,
24
28
  permissionIssues,
25
29
  publicIssue,
26
30
  recalledAccount,
27
31
  rememberAccount,
28
32
  rootOf2 as rootOf
29
- } from "./chunk-BO7ZKZCH.js";
33
+ } from "./chunk-4F2VRJZE.js";
30
34
  import {
31
35
  providerErrorKey
32
- } from "./chunk-NDUYK676.js";
36
+ } from "./chunk-4UQLL6RJ.js";
33
37
  import {
34
38
  AUTHORITY_KEY,
35
39
  CEILING_KEY,
@@ -46,31 +50,31 @@ import {
46
50
  logAttributes,
47
51
  readKeysForCommand,
48
52
  skipFlagFor
49
- } from "./chunk-W6DMCGMK.js";
53
+ } from "./chunk-TR5656OS.js";
50
54
  import {
51
55
  isCliFailure
52
- } from "./chunk-P4ABC6C4.js";
56
+ } from "./chunk-2ULJW5BA.js";
53
57
  import {
54
58
  MESSENGER_CHANGE_REFUSAL,
55
59
  readOnlyRefusal
56
- } from "./chunk-ALMQEGYO.js";
60
+ } from "./chunk-JLKNUFL2.js";
57
61
  import {
58
62
  openStore
59
- } from "./chunk-VVMCGF5X.js";
63
+ } from "./chunk-WAVJWGUC.js";
60
64
  import {
61
65
  logRecordOf,
62
66
  realSleep,
63
67
  resolvePaths,
64
68
  writeSecurely
65
- } from "./chunk-N4VNUOOD.js";
69
+ } from "./chunk-XGNADVIA.js";
66
70
  import {
67
71
  CliError
68
- } from "./chunk-TBD362SJ.js";
72
+ } from "./chunk-GIQFBXQN.js";
69
73
  import {
70
74
  __name
71
75
  } from "./chunk-ZVVMGPBJ.js";
72
76
 
73
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/cli/messenger/ask.js
77
+ // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/messenger/ask.js
74
78
  import { openSync } from "node:fs";
75
79
  import { createInterface } from "node:readline";
76
80
  import { ReadStream } from "node:tty";
@@ -125,10 +129,10 @@ var terminalAsker = /* @__PURE__ */ __name((command) => async (key, request) =>
125
129
  throw new CliError("cancelled", `${key}: not done \u2014 the answer was no`);
126
130
  }, "terminalAsker");
127
131
 
128
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/sends/guard.js
132
+ // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/sends/guard.js
129
133
  import { randomUUID } from "node:crypto";
130
134
 
131
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/sends/flood.js
135
+ // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/sends/flood.js
132
136
  import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
133
137
  import { dirname, join } from "node:path";
134
138
  var MOST_DEADLINES = 50;
@@ -212,11 +216,11 @@ var FloodMemory = class {
212
216
  }
213
217
  };
214
218
 
215
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/sends/journal.js
219
+ // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/sends/journal.js
216
220
  import { appendFileSync, mkdirSync as mkdirSync3, readFileSync as readFileSync2 } from "node:fs";
217
221
  import { dirname as dirname3, join as join2 } from "node:path";
218
222
 
219
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/sends/file-lock.js
223
+ // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/sends/file-lock.js
220
224
  import { closeSync, mkdirSync as mkdirSync2, openSync as openSync2, statSync, unlinkSync } from "node:fs";
221
225
  import { dirname as dirname2 } from "node:path";
222
226
  var LOCK_WAIT_MS = 5e3;
@@ -283,7 +287,7 @@ var lockTime = /* @__PURE__ */ __name((lock) => {
283
287
  }
284
288
  }, "lockTime");
285
289
 
286
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/sends/journal.js
290
+ // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/sends/journal.js
287
291
  var sendsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join2(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "sends", `${profile}.jsonl`), "sendsPathFor");
288
292
  var SendJournal = class {
289
293
  static {
@@ -360,7 +364,7 @@ var withSendId = /* @__PURE__ */ __name((entry) => {
360
364
  return cid === void 0 || rest.sendId !== void 0 ? rest : { ...rest, sendId: String(cid) };
361
365
  }, "withSendId");
362
366
 
363
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/sends/recipients.js
367
+ // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/sends/recipients.js
364
368
  import { existsSync, readFileSync as readFileSync3, rmSync } from "node:fs";
365
369
  import { join as join3 } from "node:path";
366
370
  var recipientsPathFor = /* @__PURE__ */ __name((app, profile, env = process.env) => join3(resolvePaths({ appName: app.appName, prefix: app.envPrefix, env }).state, "profiles", `${profile}.recipients.json`), "recipientsPathFor");
@@ -472,7 +476,7 @@ var RecipientList = class {
472
476
  }
473
477
  };
474
478
 
475
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/sends/guard.js
479
+ // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/sends/guard.js
476
480
  var HOUR_MS = 60 * 60 * 1e3;
477
481
  var READS_UNDER_HOLD = /* @__PURE__ */ new Set([
478
482
  "attachments.extract",
@@ -665,7 +669,7 @@ var guardFor = /* @__PURE__ */ __name((app, settings, warn, env = process.env, a
665
669
  }), "guardFor");
666
670
  var journalFailure = /* @__PURE__ */ __name((error) => error?.code ?? (error instanceof Error ? error.name : "error"), "journalFailure");
667
671
 
668
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/sends/pace.js
672
+ // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/sends/pace.js
669
673
  import { readFileSync as readFileSync4, renameSync as renameSync2, writeFileSync as writeFileSync2 } from "node:fs";
670
674
  import { join as join4 } from "node:path";
671
675
  var DEFAULT_PACE = { perMinute: 60, burst: 20 };
@@ -724,7 +728,7 @@ var Pacer = class {
724
728
  }
725
729
  };
726
730
 
727
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
731
+ // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/permission-keys.js
728
732
  var HOUSEKEEPING = /* @__PURE__ */ new Set([
729
733
  "help",
730
734
  "guide",
@@ -803,7 +807,7 @@ var refuseUnknownPermissionKeys = /* @__PURE__ */ __name((command, settings, too
803
807
  throw new CliError("validation_error", `--permission ${key} names no command`, { permission: key });
804
808
  }, "refuseUnknownPermissionKeys");
805
809
 
806
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/cli/messenger/flooded.js
810
+ // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/messenger/flooded.js
807
811
  var LONG_LIVED = /* @__PURE__ */ new Set(["self", "newSendId", "close", "formatMarkdown", "formatHtml", "storedChats"]);
808
812
  var LISTENING = /* @__PURE__ */ new Set(["watch", "feed", "listen", "listenHistory"]);
809
813
  var BLOCKING = /* @__PURE__ */ new Set(["frozen", "limited", "banned"]);
@@ -922,7 +926,7 @@ var flooded = /* @__PURE__ */ __name((messenger, memory, { name, warn, pacer })
922
926
  });
923
927
  }, "flooded");
924
928
 
925
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/cli/messenger/observed.js
929
+ // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/messenger/observed.js
926
930
  var observed = /* @__PURE__ */ __name((messenger, events) => {
927
931
  const timed = /* @__PURE__ */ __name(async (operation, named, work, after) => {
928
932
  const write = currentOperation();
@@ -958,9 +962,9 @@ var observed = /* @__PURE__ */ __name((messenger, events) => {
958
962
  }, "timed");
959
963
  const counted = /* @__PURE__ */ __name(async (operation, onItem, work, count) => {
960
964
  const counts = {};
961
- await timed(operation, {}, () => work((item) => {
965
+ await timed(operation, {}, () => work((item, ...rest) => {
962
966
  count(item, counts);
963
- onItem(item);
967
+ return onItem(item, ...rest);
964
968
  }), () => ({ counts }));
965
969
  }, "counted");
966
970
  const mint = messenger.newSendId;
@@ -1021,10 +1025,37 @@ var byPart = /* @__PURE__ */ __name((batch, counts) => {
1021
1025
  counts[part] = (counts[part] ?? 0) + items.length;
1022
1026
  }, "byPart");
1023
1027
 
1024
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/cli/messenger/stored.js
1028
+ // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/messenger/stored.js
1025
1029
  var REKEY_PACING = { lockMs: 50, pauseMs: 25 };
1026
- var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events, pending, announcing, deletedWithoutChat, profile, rekeyed, rekeyPacing = REKEY_PACING, closing, namesFromStore, recipientIds, countsUnread = false }) => {
1030
+ 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" }) => {
1027
1031
  let warned = false;
1032
+ let limitedNoted = false;
1033
+ const limited = /* @__PURE__ */ __name(async (opened, batch) => {
1034
+ if (!historyLimits || !batch.messages?.length)
1035
+ return { batch, skipped: /* @__PURE__ */ new Map() };
1036
+ const shapes = await opened.chats.historyShapes(account, [...new Set(batch.messages.map((one) => one.chatId))]);
1037
+ return limitBatch(batch, (chatId) => shapes.get(chatId), (chatId) => shapes.get(chatId)?.included === true, historyLimits);
1038
+ }, "limited");
1039
+ const noteLimited = /* @__PURE__ */ __name((skipped) => {
1040
+ if (skipped.size === 0)
1041
+ return;
1042
+ const counts = {
1043
+ chats: skipped.size,
1044
+ messages: 0,
1045
+ group_too_large: 0,
1046
+ older_than_window: 0
1047
+ };
1048
+ for (const skip of skipped.values()) {
1049
+ counts.messages = (counts.messages ?? 0) + skip.messages;
1050
+ counts[skip.reason] = (counts[skip.reason] ?? 0) + 1;
1051
+ }
1052
+ const warning = { event: "warning", code: "history_limited", operation: "history.save", counts };
1053
+ events(warning);
1054
+ if (limitedNoted)
1055
+ return;
1056
+ limitedNoted = true;
1057
+ warn(`history limits left out ${counts.messages} pushed messages of ${skipped.size} chats (big groups, older than the window) \u2014 \`${command} store status\` lists them; \`${command} messages sync <chat> --full-history\` fetches one and keeps it in full`, warning);
1058
+ }, "noteLimited");
1028
1059
  let recorded = profile === void 0;
1029
1060
  const notWritten = /* @__PURE__ */ __name((operation, error) => {
1030
1061
  const warning = { event: "warning", code: "store_not_written", operation };
@@ -1036,15 +1067,18 @@ var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events,
1036
1067
  const attempt = /* @__PURE__ */ __name(async (operation, write) => {
1037
1068
  try {
1038
1069
  const opened = await store();
1039
- if (opened)
1040
- await write(opened);
1070
+ if (!opened)
1071
+ return false;
1072
+ await write(opened);
1041
1073
  if (opened && !recorded && profile) {
1042
1074
  recorded = true;
1043
1075
  await Promise.resolve().then(() => opened.accounts.saveProfile(profile.app, profile.name, account)).catch(() => {
1044
1076
  });
1045
1077
  }
1078
+ return true;
1046
1079
  } catch (error) {
1047
1080
  notWritten(operation, error);
1081
+ return false;
1048
1082
  }
1049
1083
  }, "attempt");
1050
1084
  const save = /* @__PURE__ */ __name((operation, writing) => {
@@ -1142,7 +1176,13 @@ var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events,
1142
1176
  rekeysQueued += rekeys.length;
1143
1177
  const saving = previous.then(async () => {
1144
1178
  await saveRekeys(rekeys, round);
1145
- await attempt(operation, (opened) => fill(opened, account, batch));
1179
+ return attempt(operation, async (opened) => {
1180
+ const { batch: kept, skipped } = await limited(opened, batch);
1181
+ await fill(opened, account, kept);
1182
+ if (skipped.size > 0)
1183
+ await opened.chats.recordHistorySkips(account, skipped);
1184
+ noteLimited(skipped);
1185
+ });
1146
1186
  });
1147
1187
  previous = saving;
1148
1188
  pending?.add(saving);
@@ -1152,10 +1192,11 @@ var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events,
1152
1192
  pending?.delete(saving);
1153
1193
  rekeysOnly.delete(saving);
1154
1194
  });
1155
- onBatch(batch);
1195
+ void onBatch(batch, saving);
1196
+ return saving;
1156
1197
  };
1157
1198
  }, "saveBatches");
1158
- return throughWrapper(messenger, {
1199
+ const wrapped = throughWrapper(messenger, {
1159
1200
  ...messenger.forumState ? {
1160
1201
  forumState: /* @__PURE__ */ __name(async (chatId) => {
1161
1202
  const state = await capability(messenger, "forumState", "read forum settings")(chatId);
@@ -1376,7 +1417,54 @@ var stored = /* @__PURE__ */ __name((messenger, { account, store, warn, events,
1376
1417
  return sent;
1377
1418
  }, "send")
1378
1419
  });
1420
+ const chatOf2 = /* @__PURE__ */ __name(async (typed) => {
1421
+ const named = chatReferenceOf(typed, account.provider);
1422
+ if (!named)
1423
+ return typed;
1424
+ let known;
1425
+ try {
1426
+ known = account.account;
1427
+ } catch {
1428
+ }
1429
+ await ensureAccount(named, { account: known, ...profile ? { profile: profile.name } : {} }, async (other) => {
1430
+ const opened = await store();
1431
+ return opened && profilesOnAccount(opened, profile?.app, account.provider)(other);
1432
+ });
1433
+ return named.chat;
1434
+ }, "chatOf");
1435
+ return withChatReferences(wrapped, chatOf2);
1379
1436
  }, "stored");
1437
+ var TYPED_CHAT = [
1438
+ "resolve",
1439
+ "chat",
1440
+ "history",
1441
+ "around",
1442
+ "historyAfter",
1443
+ "historyBefore",
1444
+ "historyFrom",
1445
+ "topics",
1446
+ "topic",
1447
+ "topicHistory",
1448
+ "download",
1449
+ "transcribe",
1450
+ "scheduled",
1451
+ "admins",
1452
+ "chatEvents",
1453
+ "leave",
1454
+ "group",
1455
+ "officialChatStats"
1456
+ ];
1457
+ var withChatReferences = /* @__PURE__ */ __name((adapter, chatOf2) => {
1458
+ const methods = adapter;
1459
+ const own = Object.fromEntries(TYPED_CHAT.flatMap((name) => {
1460
+ const method = methods[name];
1461
+ if (typeof method !== "function")
1462
+ return [];
1463
+ const call = /* @__PURE__ */ __name(async (typed, ...rest) => method.call(adapter, await chatOf2(typed), ...rest), "call");
1464
+ return [[name, call]];
1465
+ }));
1466
+ return throughWrapper(adapter, own);
1467
+ }, "withChatReferences");
1380
1468
  var saveSent = /* @__PURE__ */ __name((opened, account, typed, message, options, into = message.chatId || typed) => opened.messages.saveMessages(account, into, [message], { ...options, typedChatId: typed }), "saveSent");
1381
1469
  var storedChat = /* @__PURE__ */ __name(async (store, account, traits, reference) => {
1382
1470
  const bound = store.forAccount(account);
@@ -1513,7 +1601,7 @@ var keep = /* @__PURE__ */ __name(async (store, account, event, seenAt, among, c
1513
1601
  }
1514
1602
  }, "keep");
1515
1603
 
1516
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/cli/messenger/context.js
1604
+ // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/cli/messenger/context.js
1517
1605
  var lazyStore = /* @__PURE__ */ __name((env, command, version) => {
1518
1606
  let opened;
1519
1607
  return {
@@ -1691,7 +1779,8 @@ var connected = /* @__PURE__ */ __name((connection, { app, provider, name, delet
1691
1779
  rekeyed: /* @__PURE__ */ __name((from, to) => rekeyRecipients(app, settings.profile, env, renderer.warn, from, to), "rekeyed"),
1692
1780
  recipientIds: /* @__PURE__ */ __name(() => (new RecipientList(recipientsPathFor(app, settings.profile, env), app.command).read() ?? []).flatMap((recipient) => [recipient.id, ...recipient.partnerId ? [recipient.partnerId] : []]), "recipientIds"),
1693
1781
  ...history === "store" ? { namesFromStore: savedChatId ? { savedChatId } : {} } : {},
1694
- ...unreadCounts === "store" ? { countsUnread: true } : {}
1782
+ ...unreadCounts === "store" ? { countsUnread: true } : {},
1783
+ ...history === "store" && settings.historyLimits ? { historyLimits: settings.historyLimits, command: `${app.command} ${settings.profile}` } : {}
1695
1784
  });
1696
1785
  const passives = history === "store" && self !== null && !watching ? passivesOf(saving).map((passive) => listened(passive, events, renderer.warn, closeWaitMs)) : [];
1697
1786
  return {
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  defineReasons
5
- } from "./chunk-TBD362SJ.js";
5
+ } from "./chunk-GIQFBXQN.js";
6
6
 
7
7
  // dist/reasons.js
8
8
  var ENTRIES = [
@@ -46,7 +46,7 @@ var ENTRIES = [
46
46
  ["permission"]
47
47
  ],
48
48
  ["policy.unknown-key", "configuration_error", "permission {permission} names no drive command", ["permission"]],
49
- ["profile.locked", "provider_unavailable", "another drive command holds this profile; retry later"],
49
+ ["profile.busy", "provider_unavailable", "another drive command holds this profile; retry later"],
50
50
  ["profile.unknown", "validation_error", "no such profile here; see the profiles listed", ["profiles"]],
51
51
  ["profile.lock-refused", "permission_error", "this process is locked to another profile (DRIVE_PROFILE_LOCK)"],
52
52
  ["profile.required", "validation_error", "choose a profile: drive <profile> <command>", ["profiles"]],
@@ -2,12 +2,12 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  resolvePaths
5
- } from "./chunk-N4VNUOOD.js";
5
+ } from "./chunk-XGNADVIA.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.507.0_@wirecat+cli-base@0.68.1_commander@15.0.0_esbuild@0.28.2_type_d5beb0101c7a90701cc33879a5be8d28/node_modules/@wirecat/cli-core/dist/store/path.js
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.546.0_@wirecat+cli-base@0.73.0_commander@15.0.0_esbuild@0.28.2_type_6245070bff0a7c29971e74a96fde145c/node_modules/@wirecat/cli-core/dist/store/path.js
11
11
  import { join } from "node:path";
12
12
  var wirecatDirectory = /* @__PURE__ */ __name((env = process.env, platform) => resolvePaths({ appName: "WireCat", prefix: "WIRECAT", env, ...platform ? { platform } : {} }).state, "wirecatDirectory");
13
13
  var storePath = /* @__PURE__ */ __name((env = process.env) => env.MESSAGING_STORE ?? join(wirecatDirectory(env), "wirecat.db"), "storePath");