@wirecat/tg-cli 0.109.0 → 0.110.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 (104) hide show
  1. package/dist/bin/tg.js +2 -2
  2. package/dist/bundle/{adapter-6JLFYFL5.js → adapter-JWUCHTXU.js} +45 -45
  3. package/dist/bundle/{all-profiles-X7Y3T5S4.js → all-profiles-OMRCKP54.js} +8 -8
  4. package/dist/bundle/{anthropic-LGVXAADT.js → anthropic-WXFHH74P.js} +5 -5
  5. package/dist/bundle/{app-server-UI3AFSJX.js → app-server-ILIPNO6T.js} +40 -40
  6. package/dist/bundle/{bot-api-TQYRNYJQ.js → bot-api-KV765AZK.js} +46 -46
  7. package/dist/bundle/{bot-history-DDNTNMNB.js → bot-history-3P6EIM5L.js} +15 -15
  8. package/dist/bundle/{bun-WXGS6HML.js → bun-MJOYPPEN.js} +2 -2
  9. package/dist/bundle/{bun-sqlite-M6JEXKRT.js → bun-sqlite-GFRVRRDZ.js} +4 -4
  10. package/dist/bundle/{chunk-C3RX3UOE.js → chunk-2YWQEG2P.js} +11 -11
  11. package/dist/bundle/{chunk-UIPBAT2T.js → chunk-32HEOKI2.js} +15 -14
  12. package/dist/bundle/{chunk-BZIZLEJN.js → chunk-3KOF5T4N.js} +4 -4
  13. package/dist/bundle/{chunk-WHYS6OSG.js → chunk-3L2JTAVD.js} +2 -2
  14. package/dist/bundle/{chunk-XJVGCCQE.js → chunk-3XTMVGTS.js} +1904 -624
  15. package/dist/bundle/{chunk-P5ILJ7MN.js → chunk-4BMXELWN.js} +5 -5
  16. package/dist/bundle/{chunk-ZMZKZL3Y.js → chunk-4GOF43MW.js} +1 -1
  17. package/dist/bundle/{chunk-7AJ2IESO.js → chunk-4I6HTOCM.js} +1 -1
  18. package/dist/bundle/{chunk-4R4AH6FM.js → chunk-4YOPRYEY.js} +94 -94
  19. package/dist/bundle/{chunk-AGVKIJB7.js → chunk-54CWOD7V.js} +6 -6
  20. package/dist/bundle/{chunk-76C5SSMR.js → chunk-5ASW5BNM.js} +12 -12
  21. package/dist/bundle/{chunk-P57R2P75.js → chunk-5CMOXHQS.js} +7 -7
  22. package/dist/bundle/{chunk-N56WXUCW.js → chunk-6KESAYMZ.js} +2 -2
  23. package/dist/bundle/{chunk-YYOIULA2.js → chunk-6WTLP2SI.js} +8 -8
  24. package/dist/bundle/{chunk-TMXNMO66.js → chunk-7ABA4EXC.js} +3 -3
  25. package/dist/bundle/{chunk-RD2NLJSU.js → chunk-7LZBMZQM.js} +4 -4
  26. package/dist/bundle/{chunk-VFVMB3NV.js → chunk-ABVHA4K6.js} +5 -5
  27. package/dist/bundle/{chunk-BESIMQ5U.js → chunk-AXNBGLO5.js} +1 -1
  28. package/dist/bundle/{chunk-INYO2QFW.js → chunk-AZYVTDAE.js} +3 -3
  29. package/dist/bundle/{chunk-N5FSRC6H.js → chunk-BWRCPMMC.js} +41 -31
  30. package/dist/bundle/{chunk-2ILQYCBY.js → chunk-BYOEVYY2.js} +553 -291
  31. package/dist/bundle/{chunk-NAVNCM5K.js → chunk-EB44Z44U.js} +1 -1
  32. package/dist/bundle/{chunk-XMMWKHNY.js → chunk-EO563SUX.js} +7 -7
  33. package/dist/bundle/{chunk-OHLMHBDI.js → chunk-F24EAGOU.js} +32 -31
  34. package/dist/bundle/{chunk-WNTXIQMB.js → chunk-F7RWNBC2.js} +2 -2
  35. package/dist/bundle/{chunk-IGIPIO4J.js → chunk-FYAHTTOB.js} +11 -11
  36. package/dist/bundle/{chunk-SH63Q4QR.js → chunk-GPIORQAD.js} +22 -22
  37. package/dist/bundle/{chunk-BHPCZCX7.js → chunk-HCAYTAJN.js} +2 -2
  38. package/dist/bundle/{chunk-P55L4S6N.js → chunk-JDOSIWPN.js} +3 -3
  39. package/dist/bundle/{chunk-MF6NKU3Z.js → chunk-KLOFBUXA.js} +22 -22
  40. package/dist/bundle/{chunk-IV2QWSPG.js → chunk-L3YDXUDK.js} +12 -3
  41. package/dist/bundle/{chunk-QQF7RDLR.js → chunk-M3XIME74.js} +4 -4
  42. package/dist/bundle/{chunk-CHI6D4D6.js → chunk-MXIBRT6W.js} +4 -4
  43. package/dist/bundle/{chunk-ZHP44EML.js → chunk-MZRD776E.js} +3 -3
  44. package/dist/bundle/{chunk-KHKC236O.js → chunk-NDT22GBK.js} +2 -2
  45. package/dist/bundle/{chunk-IULYECPC.js → chunk-NFBOZT7H.js} +4 -4
  46. package/dist/bundle/{chunk-GUFM5RLW.js → chunk-ONHHBPV3.js} +2 -2
  47. package/dist/bundle/{chunk-CVLDXFRP.js → chunk-Q35J5LCO.js} +8 -8
  48. package/dist/bundle/{chunk-DZVYGBZB.js → chunk-QRH2AWBZ.js} +55 -54
  49. package/dist/bundle/{chunk-25VC6U3A.js → chunk-RARYRHQA.js} +1 -1
  50. package/dist/bundle/{chunk-AD3QPYI3.js → chunk-RSZEEWOW.js} +2 -2
  51. package/dist/bundle/{chunk-M62LF3QE.js → chunk-RXWG7OWT.js} +348 -300
  52. package/dist/bundle/{chunk-ZUOS7QUB.js → chunk-SD5J5T7M.js} +11 -11
  53. package/dist/bundle/{chunk-S7B6MTXX.js → chunk-SLAPUEMZ.js} +6 -6
  54. package/dist/bundle/{chunk-CH2ESVV5.js → chunk-TDQVVXPF.js} +42 -24
  55. package/dist/bundle/{chunk-YXCQ4DLZ.js → chunk-TJA3BWY3.js} +1 -1
  56. package/dist/bundle/{chunk-DLAFGSTN.js → chunk-UIPT6IAU.js} +1 -1
  57. package/dist/bundle/{chunk-UUQ3BH2Z.js → chunk-VM7I5VKX.js} +2 -2
  58. package/dist/bundle/{chunk-5SUFMBU5.js → chunk-VOBMR7E5.js} +45 -45
  59. package/dist/bundle/{chunk-VYR2IIWW.js → chunk-W3B6EEZU.js} +1 -1
  60. package/dist/bundle/{chunk-7T7ILNCU.js → chunk-XLNYDJKG.js} +2 -2
  61. package/dist/bundle/{chunk-ZFMS5G4H.js → chunk-YPEAEEHF.js} +2 -2
  62. package/dist/bundle/{chunk-DO33KAMM.js → chunk-YPLL3Q3M.js} +57 -57
  63. package/dist/bundle/{chunk-3PEZWXKO.js → chunk-YWSNUUW5.js} +6 -6
  64. package/dist/bundle/command-contract-TNSW7W6G.js +32 -0
  65. package/dist/bundle/{decode-RKPOGPBE.js → decode-3KBXZCFM.js} +4 -4
  66. package/dist/bundle/{echarts-H5QQRBHI.js → echarts-24TVPFGC.js} +2 -2
  67. package/dist/bundle/{embed-7TVAPNP7.js → embed-3BDPZ4Q7.js} +5 -5
  68. package/dist/bundle/{embedder-YOOHWWN6.js → embedder-EMVDEZFR.js} +8 -8
  69. package/dist/bundle/{entry-SAKW5HEZ.js → entry-NQD6Z2BM.js} +5 -5
  70. package/dist/bundle/{first-run-C744N572.js → first-run-ZBIO6C67.js} +9 -9
  71. package/dist/bundle/first-screen-4HRCG7OX.js +30 -0
  72. package/dist/bundle/{identity-NRWTZIQ4.js → identity-EDGOOTOM.js} +3 -3
  73. package/dist/bundle/{instructions-6LWRAW47.js → instructions-N2WVMNFZ.js} +1 -1
  74. package/dist/bundle/{mcp-WSGVVZWI.js → mcp-EMNFFY4N.js} +2 -2
  75. package/dist/bundle/{node-XN4PIVWW.js → node-VBZAZHUS.js} +2 -2
  76. package/dist/bundle/{node-sqlite-PCBGROGQ.js → node-sqlite-C3V64OAL.js} +4 -4
  77. package/dist/bundle/{oauth-PX6NGHUV.js → oauth-NZXELYDA.js} +6 -6
  78. package/dist/bundle/{open-BKJGJ6GX.js → open-2XRUGMV7.js} +3 -3
  79. package/dist/bundle/{openai-MJP7CZXP.js → openai-OLGTN3ZB.js} +13 -13
  80. package/dist/bundle/{process-4PRR3MLT.js → process-CASPZ2DH.js} +1 -1
  81. package/dist/bundle/{program-7YZUO42B.js → program-QPQDSGYA.js} +50 -48
  82. package/dist/bundle/{prompt-CILSZC2R.js → prompt-ESZL7SGX.js} +4 -4
  83. package/dist/bundle/{proxy-transport-FWGKTYBL.js → proxy-transport-OROEVBCG.js} +4 -4
  84. package/dist/bundle/{recognize-AVFDJAIL.js → recognize-LQ7QOG4T.js} +3 -3
  85. package/dist/bundle/{remote-2VYXGOM4.js → remote-34XP4EDN.js} +6 -6
  86. package/dist/bundle/{rerank-6FU2JPCD.js → rerank-7F6NLBCW.js} +6 -6
  87. package/dist/bundle/{serve-3YQOHBR6.js → serve-M6TTKXI4.js} +8 -8
  88. package/dist/bundle/{server-TPK3LNEX.js → server-GLZ5M7PE.js} +32 -32
  89. package/dist/bundle/server-KOW7OKE2.js +56 -0
  90. package/dist/bundle/{state-LLUNBLZE.js → state-UKKPLMHS.js} +5 -5
  91. package/dist/bundle/{store-27FQ743G.js → store-J2MBIDJK.js} +10 -10
  92. package/dist/bundle/store-maintenance-command-64B57C3U.js +45 -0
  93. package/dist/bundle/tg.js +4 -4
  94. package/dist/program.d.ts.map +1 -1
  95. package/dist/program.js +2 -1
  96. package/dist/program.js.map +1 -1
  97. package/dist/version.d.ts +1 -1
  98. package/dist/version.js +1 -1
  99. package/package.json +3 -3
  100. package/dist/bundle/command-contract-E2MWR3T3.js +0 -32
  101. package/dist/bundle/first-screen-7GKUEIWS.js +0 -30
  102. package/dist/bundle/server-S2K4YDDG.js +0 -56
  103. package/dist/bundle/store-maintenance-command-AFJMKEBK.js +0 -45
  104. /package/dist/bundle/{chunk-62EDJKGP.js → chunk-NPGVOZVK.js} +0 -0
@@ -14,7 +14,7 @@ import {
14
14
  safeParse,
15
15
  stepOf,
16
16
  writes
17
- } from "./chunk-XMMWKHNY.js";
17
+ } from "./chunk-EO563SUX.js";
18
18
  import {
19
19
  __commonJS,
20
20
  __name,
@@ -1887,7 +1887,7 @@ var require_cli_table3 = __commonJS({
1887
1887
  }
1888
1888
  });
1889
1889
 
1890
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/exit-codes.js
1890
+ // 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/exit-codes.js
1891
1891
  var EXIT_CODES = {
1892
1892
  validation_error: 2,
1893
1893
  configuration_error: 3,
@@ -1907,7 +1907,7 @@ var EXIT_CODES = {
1907
1907
  var exitCodeFor = /* @__PURE__ */ __name((code) => EXIT_CODES[code], "exitCodeFor");
1908
1908
  var GENERIC_FAILURE = 1;
1909
1909
 
1910
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/sanitize.js
1910
+ // 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/sanitize.js
1911
1911
  var CONTROL = (
1912
1912
  // biome-ignore lint/suspicious/noControlCharactersInRegex: matching them is the whole point
1913
1913
  /[\u0000-\u0008\u000B-\u001F\u007F-\u009F\u200B\u200E\u200F\u202A-\u202E\u2066-\u2069\uFEFF\u{E0000}-\u{E007F}]/gu
@@ -1931,7 +1931,7 @@ var visibleControls = /* @__PURE__ */ __name((text) => {
1931
1931
  }, "visibleControls");
1932
1932
  var singleLine = /* @__PURE__ */ __name((text) => visibleControls(text).replace(LINE_BREAKS, escaped), "singleLine");
1933
1933
 
1934
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/failure.js
1934
+ // 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/failure.js
1935
1935
  var recognise = /* @__PURE__ */ __name((failure) => {
1936
1936
  if (isCliError(failure))
1937
1937
  return failure;
@@ -2078,7 +2078,7 @@ var catchCrashes = /* @__PURE__ */ __name((options) => {
2078
2078
  };
2079
2079
  }, "catchCrashes");
2080
2080
 
2081
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/drain.js
2081
+ // 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/drain.js
2082
2082
  var waitForDrain = /* @__PURE__ */ __name((stream, signal) => {
2083
2083
  if (signal?.aborted)
2084
2084
  return Promise.reject(signal.reason);
@@ -2106,7 +2106,7 @@ var waitForDrain = /* @__PURE__ */ __name((stream, signal) => {
2106
2106
  });
2107
2107
  }, "waitForDrain");
2108
2108
 
2109
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/streams.js
2109
+ // 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/streams.js
2110
2110
  var processStreams = {
2111
2111
  drain: /* @__PURE__ */ __name(async (signal) => {
2112
2112
  await Promise.all([waitForDrain(process.stdout, signal), waitForDrain(process.stderr, signal)]);
@@ -2135,7 +2135,7 @@ var captureStreams = /* @__PURE__ */ __name(() => {
2135
2135
  };
2136
2136
  }, "captureStreams");
2137
2137
 
2138
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/retry.js
2138
+ // 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/retry.js
2139
2139
  var DEFAULT_RETRY = {
2140
2140
  retries: 1,
2141
2141
  baseDelayMs: 250,
@@ -2147,7 +2147,7 @@ var backoffMs = /* @__PURE__ */ __name((attempt, config, random) => {
2147
2147
  return Math.round(random() * ceiling);
2148
2148
  }, "backoffMs");
2149
2149
 
2150
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/result-fields.js
2150
+ // 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/result-fields.js
2151
2151
  var forbidden = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
2152
2152
  var validate = /* @__PURE__ */ __name((paths) => {
2153
2153
  if (paths.length === 0 || paths.length > 128 || paths.some((path) => path.length > 256 || !/^[A-Za-z][A-Za-z0-9_]*(?:\.[A-Za-z][A-Za-z0-9_]*)*$/.test(path) || path.split(".").some((part) => forbidden.has(part))))
@@ -2212,7 +2212,7 @@ var projectFields = /* @__PURE__ */ __name((value, fields) => {
2212
2212
  return project(value, fields);
2213
2213
  }, "projectFields");
2214
2214
 
2215
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/batch.js
2215
+ // 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/batch.js
2216
2216
  var BATCH_LIMITS = Object.freeze({
2217
2217
  requests: 32,
2218
2218
  input_bytes: 262144,
@@ -2339,7 +2339,7 @@ var runBatch = /* @__PURE__ */ __name(async (requests, options = {}) => {
2339
2339
  };
2340
2340
  }, "runBatch");
2341
2341
 
2342
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/config.js
2342
+ // 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/config.js
2343
2343
  import { randomBytes } from "node:crypto";
2344
2344
  import { mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
2345
2345
  import { dirname, join } from "node:path";
@@ -2383,11 +2383,11 @@ var saveConfigFile = /* @__PURE__ */ __name((path, config) => {
2383
2383
  `, 384);
2384
2384
  }, "saveConfigFile");
2385
2385
 
2386
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/credentials.js
2386
+ // 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/credentials.js
2387
2387
  import { readFileSync as readFileSync2 } from "node:fs";
2388
2388
  import { join as join3, resolve } from "node:path";
2389
2389
 
2390
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/keyring.js
2390
+ // 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/keyring.js
2391
2391
  import { createRequire } from "node:module";
2392
2392
  var ENTRY_OPTIONS = { linux: { store: "secret-service" } };
2393
2393
  var require2 = createRequire(new URL("keyring.js", import.meta.resolve("@wirecat/cli-base")).href);
@@ -2407,7 +2407,7 @@ var systemKeyring = {
2407
2407
  delete: /* @__PURE__ */ __name((service, account) => entry(service, account).deletePassword(), "delete")
2408
2408
  };
2409
2409
 
2410
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/paths.js
2410
+ // 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/paths.js
2411
2411
  import { homedir, userInfo } from "node:os";
2412
2412
  import { join as join2, posix, win32 } from "node:path";
2413
2413
  var PATH_KINDS = ["config", "state", "cache"];
@@ -2458,8 +2458,9 @@ var homeIsMoved = /* @__PURE__ */ __name(({ env = process.env, platform = proces
2458
2458
  }, "homeIsMoved");
2459
2459
  var configFilePath = /* @__PURE__ */ __name((configDir, fileName = "config.json") => join2(configDir, fileName), "configFilePath");
2460
2460
 
2461
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/credentials.js
2461
+ // 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/credentials.js
2462
2462
  var movedRunService = /* @__PURE__ */ __name((service, configDir) => `${service}:${resolve(configDir)}`, "movedRunService");
2463
+ var warnedRuns = /* @__PURE__ */ new WeakSet();
2463
2464
  var Credentials = class {
2464
2465
  static {
2465
2466
  __name(this, "Credentials");
@@ -2474,7 +2475,6 @@ var Credentials = class {
2474
2475
  #warn;
2475
2476
  /** Set only for a moved run with the system keyring. */
2476
2477
  #temporaryService;
2477
- #warned = false;
2478
2478
  constructor(options) {
2479
2479
  this.#configDir = options.configDir;
2480
2480
  this.#storage = options.storage ?? "auto";
@@ -2492,23 +2492,29 @@ var Credentials = class {
2492
2492
  const fromEnv = this.#envVar ? this.#env[this.#envVar]?.trim() : void 0;
2493
2493
  if (fromEnv)
2494
2494
  return { secret: fromEnv, source: "environment" };
2495
+ const fromFile = this.#storage === "keyring" ? void 0 : this.#readFile()?.[account]?.secret;
2496
+ if (fromFile)
2497
+ return { secret: fromFile, source: "file" };
2495
2498
  if (this.#storage !== "file") {
2496
2499
  const temporary = this.#temporaryService;
2497
2500
  const fromKeyring = this.#tryKeyring(() => temporary && this.#keyring.get(temporary, account) || this.#keyring.get(this.#service, account));
2498
2501
  if (fromKeyring)
2499
2502
  return { secret: fromKeyring, source: "keyring" };
2500
2503
  }
2501
- const secret = this.#readFile()?.[account]?.secret;
2502
- return secret ? { secret, source: "file" } : void 0;
2504
+ return void 0;
2503
2505
  }
2504
- write(account, secret) {
2505
- if (this.#storage !== "file") {
2506
+ write(account, secret, options = {}) {
2507
+ const inFile = this.#storage === "auto" && this.#readFile()?.[account] !== void 0;
2508
+ if (this.#storage === "keyring" || this.#storage === "auto" && (options.signIn || !inFile)) {
2506
2509
  const stored = this.#tryKeyring(() => {
2507
2510
  this.#keyring.set(this.#temporaryService ?? this.#service, account, secret);
2508
2511
  return true;
2509
2512
  });
2510
- if (stored)
2513
+ if (stored) {
2514
+ if (inFile)
2515
+ this.#removeFromFile(account);
2511
2516
  return "keyring";
2517
+ }
2512
2518
  }
2513
2519
  const store = this.#readFile();
2514
2520
  if (!store) {
@@ -2528,14 +2534,18 @@ var Credentials = class {
2528
2534
  this.#warn(removed.includes("keyring") ? `removed this run's own sign-in of ${account} from the OS keyring and kept the owner's: a run with moved folders never removes it` : `kept ${account} in the OS keyring: it is the owner's sign-in, shared with every run, and a run with moved folders never removes it`);
2529
2535
  }
2530
2536
  }
2531
- const store = this.#readFile();
2532
- if (store?.[account] !== void 0) {
2533
- delete store[account];
2534
- this.#writeFile(store);
2537
+ if (this.#storage !== "keyring" && this.#removeFromFile(account))
2535
2538
  removed.push("file");
2536
- }
2537
2539
  return removed;
2538
2540
  }
2541
+ #removeFromFile(account) {
2542
+ const store = this.#readFile();
2543
+ if (store?.[account] === void 0)
2544
+ return false;
2545
+ delete store[account];
2546
+ this.#writeFile(store);
2547
+ return true;
2548
+ }
2539
2549
  /** Only for the warning: a keyring that fails here must not fail a removal that already happened. */
2540
2550
  #ownersEntryExists(account) {
2541
2551
  try {
@@ -2574,8 +2584,8 @@ var Credentials = class {
2574
2584
  try {
2575
2585
  return operation();
2576
2586
  } catch (error) {
2577
- if (!this.#warned) {
2578
- this.#warned = true;
2587
+ if (!warnedRuns.has(this.#env)) {
2588
+ warnedRuns.add(this.#env);
2579
2589
  this.#warn(`could not reach the OS keyring \u2014 it may be locked, or no keyring service is running (${error instanceof Error ? error.message : String(error)}); using ${this.#path()} instead, readable only by you`);
2580
2590
  }
2581
2591
  return void 0;
@@ -2583,7 +2593,7 @@ var Credentials = class {
2583
2593
  }
2584
2594
  };
2585
2595
 
2586
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/time.js
2596
+ // 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/time.js
2587
2597
  var abortError = /* @__PURE__ */ __name(() => new DOMException("The operation was aborted.", "AbortError"), "abortError");
2588
2598
  var realSleep = /* @__PURE__ */ __name((ms, signal) => new Promise((resolve2, reject) => {
2589
2599
  if (signal?.aborted) {
@@ -2597,7 +2607,7 @@ var realSleep = /* @__PURE__ */ __name((ms, signal) => new Promise((resolve2, re
2597
2607
  }, { once: true });
2598
2608
  }), "realSleep");
2599
2609
 
2600
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/logging.js
2610
+ // 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/logging.js
2601
2611
  import { appendFileSync } from "node:fs";
2602
2612
  var REDACTED_FIELDS = [
2603
2613
  "authorization",
@@ -2692,7 +2702,7 @@ var silent = {
2692
2702
  }, "error")
2693
2703
  };
2694
2704
 
2695
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/pretty.js
2705
+ // 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/pretty.js
2696
2706
  var import_cli_table3 = __toESM(require_cli_table3(), 1);
2697
2707
  import { styleText } from "node:util";
2698
2708
  var renderPretty = /* @__PURE__ */ __name((value, options) => {
@@ -2767,7 +2777,7 @@ var BORDERLESS = {
2767
2777
  middle: ""
2768
2778
  };
2769
2779
 
2770
- // node_modules/.pnpm/@wirecat+cli-base@0.67.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/renderer.js
2780
+ // 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/renderer.js
2771
2781
  var createRenderer = /* @__PURE__ */ __name(({ format, color, streams = processStreams, quiet = false }) => {
2772
2782
  const mark = /* @__PURE__ */ __name((symbol, message) => format === "pretty" ? `${symbol} ${visibleControls(message)}` : visibleControls(message), "mark");
2773
2783
  const say = /* @__PURE__ */ __name((symbol) => (message) => {