@wirecat/zoom-cli 0.59.1 → 0.60.1

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 (153) hide show
  1. package/README.md +4 -3
  2. package/dist/bin/main.js +1 -0
  3. package/dist/bin/main.js.map +1 -1
  4. package/dist/bin/zm.js +2 -2
  5. package/dist/bundle/{all-profiles-RS5IWIGR.js → all-profiles-E6KXASLY.js} +6 -6
  6. package/dist/bundle/answer-policy-YWCC55NB.js +96 -0
  7. package/dist/bundle/{anthropic-5QHQR4WF.js → anthropic-CSLAACWX.js} +4 -4
  8. package/dist/bundle/{app-server-7LANSZGE.js → app-server-RYYXX6QV.js} +48 -48
  9. package/dist/bundle/{bun-O6RL6LRQ.js → bun-JVDJVDHL.js} +2 -2
  10. package/dist/bundle/{bun-sqlite-PEJM6CS4.js → bun-sqlite-B5CZHAV4.js} +3 -3
  11. package/dist/bundle/{chunk-BXZ6WSVF.js → chunk-3LBA63D5.js} +4 -4
  12. package/dist/bundle/{chunk-UXM7I35J.js → chunk-3R437ICM.js} +4 -4
  13. package/dist/bundle/{chunk-MBT7GP7K.js → chunk-43BX56ZI.js} +9 -9
  14. package/dist/bundle/{chunk-VYUSEJE4.js → chunk-46R2JTGO.js} +2 -2
  15. package/dist/bundle/{chunk-2EYP23NY.js → chunk-4TCQT57W.js} +10 -10
  16. package/dist/bundle/{chunk-3SCTDFNO.js → chunk-6BJQBVMN.js} +16 -16
  17. package/dist/bundle/{chunk-AQDWGJZT.js → chunk-7IDNHVJS.js} +39 -2
  18. package/dist/bundle/{chunk-PF25S7L4.js → chunk-AOZGGGUK.js} +2 -2
  19. package/dist/bundle/{chunk-G27MRA24.js → chunk-AZZPMHP2.js} +2 -2
  20. package/dist/bundle/{chunk-T6AAM7UT.js → chunk-BO7J5Z3T.js} +20 -17
  21. package/dist/bundle/{chunk-PNBEREOU.js → chunk-CGCJ6P3A.js} +1906 -1529
  22. package/dist/bundle/{chunk-PKTFZAXG.js → chunk-DBSWVZES.js} +2 -2
  23. package/dist/bundle/{chunk-CVIKKIGE.js → chunk-EF2RCQ3L.js} +1 -1
  24. package/dist/bundle/{chunk-K76WFW4I.js → chunk-EN5DBDKW.js} +4 -4
  25. package/dist/bundle/{chunk-NDXAZB5Z.js → chunk-ES6UWVTM.js} +6 -6
  26. package/dist/bundle/{chunk-BAQLQIMI.js → chunk-EUHQ5D4K.js} +31 -27
  27. package/dist/bundle/{chunk-KVHRHBLY.js → chunk-FWJ3Q7NO.js} +5 -5
  28. package/dist/bundle/{chunk-ZTOAAYFV.js → chunk-FZMRHNOP.js} +3 -3
  29. package/dist/bundle/{chunk-NOKFJJPA.js → chunk-GEVHI226.js} +6 -6
  30. package/dist/bundle/{chunk-YJRMMZI5.js → chunk-HAUAEGGI.js} +10 -10
  31. package/dist/bundle/{chunk-4NGLRHWO.js → chunk-HBYE4EP2.js} +1 -1
  32. package/dist/bundle/{chunk-NW7IMGRR.js → chunk-HIAO4MPA.js} +1 -1
  33. package/dist/bundle/{chunk-VSUY7PDW.js → chunk-HYZ545ON.js} +7 -4
  34. package/dist/bundle/{chunk-OBZWUNO4.js → chunk-INARC5O7.js} +9 -9
  35. package/dist/bundle/{chunk-A6323R5P.js → chunk-IQENQXUJ.js} +2 -2
  36. package/dist/bundle/{chunk-UYJUTZTT.js → chunk-IQSBMAYB.js} +3 -3
  37. package/dist/bundle/{chunk-4AURKUDZ.js → chunk-IRX2YVAH.js} +4 -4
  38. package/dist/bundle/{chunk-CTGI4ES2.js → chunk-K6NPOZUP.js} +6 -6
  39. package/dist/bundle/{chunk-7H3ZRDLW.js → chunk-KNAS4VEA.js} +2 -2
  40. package/dist/bundle/{chunk-B32SF7J3.js → chunk-KXEC5FVT.js} +2 -2
  41. package/dist/bundle/{chunk-XFCSPOLZ.js → chunk-KYUIU5UR.js} +2 -2
  42. package/dist/bundle/{chunk-KDYPY6IL.js → chunk-LPDYI5GR.js} +1 -1
  43. package/dist/bundle/{chunk-L3VS3H34.js → chunk-LPY2ISJK.js} +6 -6
  44. package/dist/bundle/{chunk-UOFOMU3T.js → chunk-LVHZQCP4.js} +1 -1
  45. package/dist/bundle/{chunk-QFGBMS67.js → chunk-N27LOY3D.js} +14 -7
  46. package/dist/bundle/{chunk-JUS4H7Z5.js → chunk-OBUKZ2ZM.js} +25 -25
  47. package/dist/bundle/{chunk-RXDIG23Z.js → chunk-OEEMCNAO.js} +6 -6
  48. package/dist/bundle/{chunk-URO44C5T.js → chunk-PAEBFJUC.js} +157 -145
  49. package/dist/bundle/{chunk-EUQ7XFPK.js → chunk-PATM7JGR.js} +1 -1
  50. package/dist/bundle/{chunk-6FL25KC5.js → chunk-PEMLI3T7.js} +4 -4
  51. package/dist/bundle/{chunk-5DVW77VC.js → chunk-PPHUBORC.js} +32 -32
  52. package/dist/bundle/{chunk-PP3JGQQE.js → chunk-Q7U627RY.js} +110 -54
  53. package/dist/bundle/{chunk-7GVNQOV6.js → chunk-QKSCDALS.js} +1 -1
  54. package/dist/bundle/{chunk-YIMI6O7R.js → chunk-R4SRXI7M.js} +111 -111
  55. package/dist/bundle/{chunk-DP5DX45H.js → chunk-RACSKYNX.js} +1 -1
  56. package/dist/bundle/{chunk-L2UIJDWB.js → chunk-REC3AZP6.js} +2 -2
  57. package/dist/bundle/{chunk-24DLFGES.js → chunk-RUEPZTNA.js} +2 -2
  58. package/dist/bundle/{chunk-ZC5UXEIH.js → chunk-TY5PBEH2.js} +11 -11
  59. package/dist/bundle/{chunk-UKR7KH3H.js → chunk-UWVNY5CA.js} +2 -2
  60. package/dist/bundle/{chunk-SIA7HJE2.js → chunk-V53IB5AU.js} +56 -49
  61. package/dist/bundle/{chunk-N7GAQ27N.js → chunk-VJBVNDFR.js} +3 -3
  62. package/dist/bundle/{chunk-IYAGQXED.js → chunk-VKUS2V4L.js} +8 -8
  63. package/dist/bundle/{chunk-27P22POE.js → chunk-VLE3FWE3.js} +30 -26
  64. package/dist/bundle/{recognize-EMHQX4XF.js → chunk-VVKHF6VJ.js} +7 -6
  65. package/dist/bundle/{chunk-AIXLOMH4.js → chunk-W5EUHV3J.js} +1 -1
  66. package/dist/bundle/{chunk-QCFHL4ES.js → chunk-WB7MQHUI.js} +2 -2
  67. package/dist/bundle/{chunk-7Z4ANTAK.js → chunk-WEUXLXOZ.js} +28 -20
  68. package/dist/bundle/{chunk-VOAVOK4I.js → chunk-WFT2GGFH.js} +57 -18
  69. package/dist/bundle/{chunk-DXZTLB24.js → chunk-WWNZS7ZY.js} +4 -4
  70. package/dist/bundle/{chunk-MIGIKHER.js → chunk-WYRYLBST.js} +4 -4
  71. package/dist/bundle/{chunk-PACC5N6T.js → chunk-X7YPTYM4.js} +10 -3
  72. package/dist/bundle/{chunk-DXKVEOSS.js → chunk-XLJV3ZOH.js} +1 -1
  73. package/dist/bundle/{chunk-7D2CD3E3.js → chunk-XNUFDYR6.js} +5 -5
  74. package/dist/bundle/{chunk-YIFIY7ZE.js → chunk-XS72YFPV.js} +2 -2
  75. package/dist/bundle/{chunk-ZHXIXDH5.js → chunk-XX7KVQIG.js} +4 -4
  76. package/dist/bundle/{chunk-MNUTWGSA.js → chunk-Y3YURIZF.js} +32 -32
  77. package/dist/bundle/{chunk-XT7XVPEM.js → chunk-YEZQ7SD7.js} +11 -11
  78. package/dist/bundle/{chunk-SL3SXQZ5.js → chunk-YLATWUE7.js} +6 -6
  79. package/dist/bundle/{chunk-MMT46EN4.js → chunk-Z4D6M62I.js} +2 -2
  80. package/dist/bundle/{chunk-3SERIWJD.js → chunk-Z5H47R4G.js} +7856 -7818
  81. package/dist/bundle/{chunk-U6QW67SU.js → chunk-ZDRDCANC.js} +374 -317
  82. package/dist/bundle/{chunk-DDYR6DYL.js → chunk-ZK7Y5K63.js} +1 -1
  83. package/dist/bundle/{chunk-YSHSCBPM.js → chunk-ZXQCA3ZW.js} +8 -8
  84. package/dist/bundle/{cli-IQTASP44.js → cli-CYKEKT5P.js} +54 -54
  85. package/dist/bundle/command-contract-P45QCCXM.js +38 -0
  86. package/dist/bundle/config-JYKTLEA3.js +79 -0
  87. package/dist/bundle/decode-CTQJQYNU.js +158 -0
  88. package/dist/bundle/{dist-WT73DF46.js → dist-YLSQKPPY.js} +13 -13
  89. package/dist/bundle/{echarts-LD3AI55P.js → echarts-4OQHS575.js} +2 -2
  90. package/dist/bundle/{embed-XEMH4LNX.js → embed-P2BKRRJD.js} +4 -4
  91. package/dist/bundle/{embedder-ZCYKSKAE.js → embedder-HC6ZARP5.js} +7 -7
  92. package/dist/bundle/{first-run-LGYDLIUM.js → first-run-UERFFXBV.js} +7 -7
  93. package/dist/bundle/first-screen-VFIS7FX3.js +36 -0
  94. package/dist/bundle/{folders-5ZBUQHAM.js → folders-RSLPTZLJ.js} +2 -2
  95. package/dist/bundle/{instructions-RZMSW3OC.js → instructions-3QZBKKPF.js} +1 -1
  96. package/dist/bundle/{main-LDCSYBV3.js → main-2T6D77JC.js} +17 -16
  97. package/dist/bundle/mcp-4VHVUMCR.js +92 -0
  98. package/dist/bundle/{mcp-M7MW5EGT.js → mcp-6CLW2IZM.js} +62 -62
  99. package/dist/bundle/{meetings-XPBHVZAU.js → meetings-ZIDSQZBJ.js} +7 -3
  100. package/dist/bundle/{node-ZRLYQL7J.js → node-R2BLYUSB.js} +2 -2
  101. package/dist/bundle/node-sqlite-7CGHAHIS.js +61 -0
  102. package/dist/bundle/{oauth-UHVRGKZU.js → oauth-UBCYXTWV.js} +5 -5
  103. package/dist/bundle/{open-J4FCAUAJ.js → open-AWUB4Q7Z.js} +2 -2
  104. package/dist/bundle/{output-file-SXV2ANW7.js → output-file-SN22HAVL.js} +3 -3
  105. package/dist/bundle/{process-LL77573L.js → process-IX5YWGDP.js} +1 -1
  106. package/dist/bundle/{program-4S5BJVSW.js → program-STYPTNT3.js} +74 -70
  107. package/dist/bundle/{prompt-LUUMQTMY.js → prompt-MAYUHEGN.js} +3 -3
  108. package/dist/bundle/recognize-FVTNXRTF.js +21 -0
  109. package/dist/bundle/{remote-ZXS6D7VB.js → remote-WCPRU73L.js} +5 -5
  110. package/dist/bundle/{rerank-WP7RKZNB.js → rerank-6CBLZBCV.js} +5 -5
  111. package/dist/bundle/{run-log-GS2L66G6.js → run-log-G4WZTOBW.js} +51 -51
  112. package/dist/bundle/{serve-L6KLLXK2.js → serve-3IDUVTZL.js} +7 -7
  113. package/dist/bundle/server-7GU36TER.js +66 -0
  114. package/dist/bundle/server-VHRS5UAL.js +53 -0
  115. package/dist/bundle/{services-SPOEWVK3.js → services-326Z3TNE.js} +24 -24
  116. package/dist/bundle/{speech-6OBAKMND.js → speech-KSZ7RKM3.js} +4 -4
  117. package/dist/bundle/{state-HN5EJKXQ.js → state-EPB3L2JM.js} +4 -4
  118. package/dist/bundle/{store-ZP2URKET.js → store-7WX7SW2R.js} +14 -14
  119. package/dist/bundle/{store-LEU3M6IN.js → store-KO242JBK.js} +12 -12
  120. package/dist/bundle/store-connection-K3MNDCQQ.js +76 -0
  121. package/dist/bundle/store-maintenance-command-GJDJYI2U.js +54 -0
  122. package/dist/bundle/{streaming-AK6Q2ZGQ.js → streaming-M6VDKBBH.js} +4 -4
  123. package/dist/bundle/{tokens-CCM3D4ZT.js → tokens-BTNXHR7T.js} +4 -4
  124. package/dist/bundle/zm.js +1 -1
  125. package/dist/login.d.ts +1 -0
  126. package/dist/login.d.ts.map +1 -1
  127. package/dist/login.js +1 -1
  128. package/dist/login.js.map +1 -1
  129. package/dist/recording-schedule-setup.d.ts.map +1 -1
  130. package/dist/recording-schedule-setup.js +1 -0
  131. package/dist/recording-schedule-setup.js.map +1 -1
  132. package/dist/setup-commands.d.ts.map +1 -1
  133. package/dist/setup-commands.js +6 -1
  134. package/dist/setup-commands.js.map +1 -1
  135. package/dist/tokens.d.ts +15 -0
  136. package/dist/tokens.d.ts.map +1 -1
  137. package/dist/tokens.js +40 -1
  138. package/dist/tokens.js.map +1 -1
  139. package/dist/version.d.ts +1 -1
  140. package/dist/version.js +1 -1
  141. package/package.json +2 -2
  142. package/skills/zoom-cli/SKILL.md +1 -0
  143. package/dist/bundle/answer-policy-7BYG6XWZ.js +0 -96
  144. package/dist/bundle/command-contract-WHZPF7NA.js +0 -38
  145. package/dist/bundle/config-AXMQ2PXT.js +0 -79
  146. package/dist/bundle/first-screen-LYQKPNF4.js +0 -36
  147. package/dist/bundle/mcp-VISEXTVC.js +0 -92
  148. package/dist/bundle/node-sqlite-BBEDYBWO.js +0 -45
  149. package/dist/bundle/server-NOFYENP5.js +0 -53
  150. package/dist/bundle/server-P5TXAPBY.js +0 -66
  151. package/dist/bundle/store-connection-3UZBORXK.js +0 -76
  152. package/dist/bundle/store-maintenance-command-PSCHEHHY.js +0 -54
  153. /package/dist/bundle/{chunk-Q2Z3VCM4.js → chunk-YLBNPI7H.js} +0 -0
@@ -6,22 +6,22 @@ import {
6
6
  agentArguments,
7
7
  agentJson,
8
8
  commandAvailability
9
- } from "./chunk-XT7XVPEM.js";
9
+ } from "./chunk-YEZQ7SD7.js";
10
10
  import {
11
11
  callerOf
12
- } from "./chunk-7H3ZRDLW.js";
12
+ } from "./chunk-KNAS4VEA.js";
13
13
  import {
14
14
  lentConnection,
15
15
  refuseLacking
16
- } from "./chunk-VOAVOK4I.js";
16
+ } from "./chunk-WFT2GGFH.js";
17
17
  import {
18
18
  onlineDeps,
19
19
  servicesFor,
20
20
  storeModeDeps
21
- } from "./chunk-3SERIWJD.js";
21
+ } from "./chunk-Z5H47R4G.js";
22
22
  import {
23
23
  ENTITIES
24
- } from "./chunk-URO44C5T.js";
24
+ } from "./chunk-PAEBFJUC.js";
25
25
  import {
26
26
  DEFAULT_OUTPUT_BYTES,
27
27
  LOCAL_WRITE,
@@ -35,32 +35,32 @@ import {
35
35
  refuseStoreChange,
36
36
  sealed,
37
37
  startRecording
38
- } from "./chunk-MNUTWGSA.js";
38
+ } from "./chunk-Y3YURIZF.js";
39
39
  import {
40
40
  currentCaller,
41
41
  keepsSuccess,
42
42
  runContextOf,
43
43
  withCaller
44
- } from "./chunk-IYAGQXED.js";
44
+ } from "./chunk-VKUS2V4L.js";
45
45
  import {
46
46
  enclosingTraceId,
47
47
  inRun,
48
48
  newRunId,
49
49
  traceOf
50
- } from "./chunk-7Z4ANTAK.js";
50
+ } from "./chunk-WEUXLXOZ.js";
51
51
  import {
52
52
  failureContext
53
- } from "./chunk-PACC5N6T.js";
53
+ } from "./chunk-X7YPTYM4.js";
54
54
  import {
55
55
  authorityAllowed,
56
56
  botApiAllowed,
57
57
  keyForCommand,
58
58
  levelFor,
59
59
  readKeysForCommand
60
- } from "./chunk-PF25S7L4.js";
60
+ } from "./chunk-AOZGGGUK.js";
61
61
  import {
62
62
  MAX_BUFFERED_INPUT
63
- } from "./chunk-G27MRA24.js";
63
+ } from "./chunk-AZZPMHP2.js";
64
64
  import {
65
65
  CliError,
66
66
  SNAKE_CASE,
@@ -102,12 +102,12 @@ import {
102
102
  unknown,
103
103
  word,
104
104
  writes
105
- } from "./chunk-YIMI6O7R.js";
105
+ } from "./chunk-R4SRXI7M.js";
106
106
  import {
107
107
  __name
108
108
  } from "./chunk-ZVVMGPBJ.js";
109
109
 
110
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/mcp/agent.js
110
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/node_modules/@wirecat/cli-core/dist/mcp/agent.js
111
111
  import { Readable } from "node:stream";
112
112
 
113
113
  // node_modules/.pnpm/@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/standards/lint.js
@@ -2755,7 +2755,7 @@ var VOCABULARY = defineVocabulary({
2755
2755
  flags: [...HOW_FLAGS, ...WHAT_FLAGS, ...CALENDAR_FLAGS]
2756
2756
  });
2757
2757
 
2758
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/mcp/agent.js
2758
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/node_modules/@wirecat/cli-core/dist/mcp/agent.js
2759
2759
  var TYPES = new Map(VOCABULARY.flags.map((flag) => [flag.name, flag.type]));
2760
2760
  var snake = /* @__PURE__ */ __name((name) => name.replaceAll("|", "_or_").replace(/[^a-z0-9]+/gi, "_"), "snake");
2761
2761
  var longOf = /* @__PURE__ */ __name((option) => option.flags.match(/--[a-z0-9][a-z0-9-]*/)?.[0], "longOf");
@@ -2976,7 +2976,7 @@ var runCommandForAgent = /* @__PURE__ */ __name(async (program, path, input, ctx
2976
2976
  }
2977
2977
  }, "runCommandForAgent");
2978
2978
 
2979
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/mcp/tool.js
2979
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/node_modules/@wirecat/cli-core/dist/mcp/tool.js
2980
2980
  var limit = optional(pipe(number(), integer(), minValue(1), maxValue(100), description("how many")));
2981
2981
  var page = optional(pipe(number(), integer(), minValue(1), description("which page, from 1")));
2982
2982
  var message = pipe(
@@ -3235,7 +3235,7 @@ var failed = /* @__PURE__ */ __name((error, errors, effects) => {
3235
3235
  return mcpErrorResult(JSON.parse(agentJson(errorObjectOf(error, context))));
3236
3236
  }, "failed");
3237
3237
 
3238
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/mcp/surface.js
3238
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/node_modules/@wirecat/cli-core/dist/mcp/surface.js
3239
3239
  import { randomUUID } from "node:crypto";
3240
3240
  var MATCHES = 8;
3241
3241
  var ANSWER = answerSchema();
@@ -3,11 +3,12 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  checkCancelled,
5
5
  object
6
- } from "./chunk-VYUSEJE4.js";
6
+ } from "./chunk-46R2JTGO.js";
7
7
  import {
8
8
  CliError,
9
+ Credentials,
9
10
  isCliError
10
- } from "./chunk-YIMI6O7R.js";
11
+ } from "./chunk-R4SRXI7M.js";
11
12
  import {
12
13
  __name
13
14
  } from "./chunk-ZVVMGPBJ.js";
@@ -16,14 +17,32 @@ import {
16
17
  var TOKEN_LOG_ALLOW = ["rotated", "saved", "pid"];
17
18
  var TOKEN_LOG_EVENT = "zoom.token.exchange";
18
19
  var abortReason = /* @__PURE__ */ __name((parent) => !parent?.aborted ? "timeout" : isCliError(parent.reason) ? parent.reason.code : "cancelled", "abortReason");
20
+ var storesOf = /* @__PURE__ */ __name(({ configDir, service, keyring }) => configDir === void 0 ? void 0 : {
21
+ auto: new Credentials({ configDir, service, keyring }),
22
+ file: new Credentials({ configDir, service, keyring, storage: "file" })
23
+ }, "storesOf");
19
24
  var TokenManager = class _TokenManager {
20
25
  static {
21
26
  __name(this, "TokenManager");
22
27
  }
23
28
  options;
24
29
  refreshState = /* @__PURE__ */ new Map();
30
+ // Shared by every scoped manager, so a failing keyring is reported once per run.
31
+ stores;
25
32
  constructor(options) {
26
33
  this.options = options;
34
+ this.stores = storesOf(options);
35
+ }
36
+ /** Where this login is kept: the file once it holds it, the keyring otherwise. */
37
+ storageOf(account = this.accountOf()) {
38
+ return this.stores?.file.read(account) ? "file" : "keyring";
39
+ }
40
+ /** The same login, saved where `session start --credential-storage` says. */
41
+ storedIn(storage) {
42
+ const scoped = new _TokenManager({ ...this.options, storage });
43
+ scoped.refreshState = this.refreshState;
44
+ scoped.stores = this.stores;
45
+ return scoped;
27
46
  }
28
47
  /** The login of one profile: `<client id>:<profile>` in the keyring. */
29
48
  forProfile(profile) {
@@ -37,12 +56,15 @@ var TokenManager = class _TokenManager {
37
56
  },
38
57
  keyring: parent.keyring,
39
58
  service: parent.service,
59
+ ...parent.configDir === void 0 ? {} : { configDir: parent.configDir },
60
+ ...parent.storage === void 0 ? {} : { storage: parent.storage },
40
61
  fetch: parent.fetch,
41
62
  now: parent.now,
42
63
  log: parent.log,
43
64
  signal: parent.signal
44
65
  });
45
66
  scoped.refreshState = this.refreshState;
67
+ scoped.stores = this.stores;
46
68
  return scoped;
47
69
  }
48
70
  withSignal(signal, fetcher = this.options.fetch) {
@@ -58,18 +80,23 @@ var TokenManager = class _TokenManager {
58
80
  },
59
81
  keyring: parent.keyring,
60
82
  service: parent.service,
83
+ ...parent.configDir === void 0 ? {} : { configDir: parent.configDir },
84
+ ...parent.storage === void 0 ? {} : { storage: parent.storage },
61
85
  fetch: fetcher,
62
86
  now: parent.now,
63
87
  log: parent.log,
64
88
  signal: signal && parent.signal ? AbortSignal.any([signal, parent.signal]) : signal ?? parent.signal
65
89
  });
66
90
  scoped.refreshState = this.refreshState;
91
+ scoped.stores = this.stores;
67
92
  return scoped;
68
93
  }
69
94
  accountOf() {
70
95
  return this.options.account ?? this.options.clientId;
71
96
  }
72
97
  read(account) {
98
+ if (this.stores)
99
+ return this.stores.file.read(account)?.secret ?? this.stores.auto.read(account)?.secret ?? null;
73
100
  try {
74
101
  return this.options.keyring.get(this.options.service, account);
75
102
  } catch {
@@ -97,6 +124,16 @@ var TokenManager = class _TokenManager {
97
124
  }
98
125
  }
99
126
  save(tokens, account = this.accountOf()) {
127
+ if (this.stores) {
128
+ const { auto, file } = this.stores;
129
+ const storage = this.options.storage ?? this.storageOf(account);
130
+ const value = JSON.stringify(tokens);
131
+ if (storage === "file")
132
+ file.write(account, value);
133
+ else if (auto.write(account, value) === "keyring" && this.options.storage === "keyring")
134
+ file.remove(account);
135
+ return;
136
+ }
100
137
  try {
101
138
  this.options.keyring.set(this.options.service, account, JSON.stringify(tokens));
102
139
  } catch {
@@ -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-YIMI6O7R.js";
5
+ } from "./chunk-R4SRXI7M.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/sends/permissions.js
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/node_modules/@wirecat/cli-core/dist/sends/permissions.js
11
11
  var LEVELS = ["deny", "readonly", "ask", "allow"];
12
12
  var DANGEROUS = /* @__PURE__ */ new Set(["messages.delete", "bot.messages.delete", "topics.delete", "chats.delete", "chats.clear"]);
13
13
  var skipFlagFor = /* @__PURE__ */ __name((key) => DANGEROUS.has(key) ? "--allow-dangerous" : "--yes", "skipFlagFor");
@@ -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-YIMI6O7R.js";
5
+ } from "./chunk-R4SRXI7M.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/cli/input-policy.js
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/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();
@@ -4,7 +4,7 @@ import {
4
4
  organization,
5
5
  project,
6
6
  reminder
7
- } from "./chunk-DXZTLB24.js";
7
+ } from "./chunk-WWNZS7ZY.js";
8
8
  import {
9
9
  MIGRATIONS,
10
10
  SnapshotBudget,
@@ -28,28 +28,31 @@ import {
28
28
  tagMemberIds,
29
29
  thingOf,
30
30
  write
31
- } from "./chunk-PNBEREOU.js";
31
+ } from "./chunk-CGCJ6P3A.js";
32
+ import {
33
+ fold
34
+ } from "./chunk-ZXQCA3ZW.js";
32
35
  import {
33
36
  filesAccountSql,
34
37
  folderProviderOf,
35
38
  folderProviderSql,
36
39
  isDocumentAccountProvider
37
- } from "./chunk-NDXAZB5Z.js";
40
+ } from "./chunk-ES6UWVTM.js";
38
41
  import {
39
42
  queryFieldsOf
40
- } from "./chunk-UOFOMU3T.js";
43
+ } from "./chunk-LVHZQCP4.js";
41
44
  import {
42
45
  CliError
43
- } from "./chunk-YIMI6O7R.js";
46
+ } from "./chunk-R4SRXI7M.js";
44
47
  import {
45
48
  __name
46
49
  } from "./chunk-ZVVMGPBJ.js";
47
50
 
48
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/store/document-transfer/index.js
51
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/node_modules/@wirecat/cli-core/dist/store/document-transfer/index.js
49
52
  import { realpathSync, statSync } from "node:fs";
50
53
  import { resolve } from "node:path";
51
54
 
52
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/people.js
55
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/people.js
53
56
  var planPeople = /* @__PURE__ */ __name((database, snapshot, mappings, bindings, conflicts) => {
54
57
  const creatable = /* @__PURE__ */ new Set();
55
58
  let people = 0, identities = 0;
@@ -104,7 +107,7 @@ var copyPeople = /* @__PURE__ */ __name((database, snapshot, mappings, now) => {
104
107
  if (row && Number(row.person_id) !== person.id)
105
108
  throw new CliError("configuration_error", "an identity belongs to another destination person; the transfer was rolled back");
106
109
  if (!row)
107
- row = database.prepare("INSERT INTO identities (provider,external_id,name,username,bot,created_at,updated_at) VALUES (?,?,?,?,?,?,?) RETURNING id").get(String(identity.provider), String(identity.external_id), identity.name ?? null, identity.username ?? null, identity.bot ?? null, identity.created_at ?? now(), identity.updated_at ?? now());
110
+ row = database.prepare("INSERT INTO identities (provider,external_id,name,name_folded,username,bot,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?) RETURNING id").get(String(identity.provider), String(identity.external_id), identity.name ?? null, identity.name == null ? null : fold(String(identity.name)), identity.username ?? null, identity.bot ?? null, identity.created_at ?? now(), identity.updated_at ?? now());
108
111
  if (!database.prepare("SELECT identity_id FROM identity_links WHERE identity_id=?").get(Number(row?.id)))
109
112
  database.prepare("INSERT INTO identity_links (identity_id,person_id,method,confidence,author,source,created_at,updated_at) VALUES (?,?,?,?,?,?,?,?)").run(Number(row?.id), person.id, identity.link_method ?? "transfer", identity.link_confidence ?? 1, identity.link_author ?? "owner", identity.link_source ?? null, identity.link_created_at ?? now(), identity.link_updated_at ?? now());
110
113
  mappings.set(`identity:${String(identity.id)}`, { type: "identity", id: Number(row?.id) });
@@ -112,11 +115,11 @@ var copyPeople = /* @__PURE__ */ __name((database, snapshot, mappings, now) => {
112
115
  }
113
116
  }, "copyPeople");
114
117
 
115
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/store/document-transfer/digest.js
118
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/node_modules/@wirecat/cli-core/dist/store/document-transfer/digest.js
116
119
  import { createHash } from "node:crypto";
117
120
  var digest = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "digest");
118
121
 
119
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/collection.js
122
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/collection.js
120
123
  var documentsKeyOf = /* @__PURE__ */ __name((collection) => {
121
124
  const colon = collection.indexOf(":");
122
125
  const provider = collection.slice(0, colon);
@@ -160,7 +163,7 @@ var currentCollection = /* @__PURE__ */ __name((row) => {
160
163
  };
161
164
  }, "currentCollection");
162
165
 
163
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/plan.js
166
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/plan.js
164
167
  var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindings) => {
165
168
  const mappings = /* @__PURE__ */ new Map();
166
169
  const missing = /* @__PURE__ */ new Set(), conflicts = /* @__PURE__ */ new Set();
@@ -327,7 +330,7 @@ var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindin
327
330
  };
328
331
  }, "planTransfer");
329
332
 
330
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/snapshot.js
333
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/snapshot.js
331
334
  var TRANSFER_TABLES = { document: "documents", note: "notes", memory: "memories", fact: "facts" };
332
335
  var MAX_ENTITIES = 1e3;
333
336
  var MAX_AUXILIARY = 1e4;
@@ -489,7 +492,7 @@ var transferSnapshot = /* @__PURE__ */ __name((database, collection) => read(dat
489
492
  };
490
493
  }), "transferSnapshot");
491
494
 
492
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/apply.js
495
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/apply.js
493
496
  var providerHere = /* @__PURE__ */ __name(({ provider, name, settings }) => {
494
497
  if (provider !== "folder" || String(name ?? "").startsWith("google-drive:"))
495
498
  return provider ?? null;
@@ -661,7 +664,7 @@ var remapEntity = /* @__PURE__ */ __name((database, entity, id, mappings) => {
661
664
  database.prepare(`UPDATE ${TRANSFER_TABLES[entity.kind]} SET ${columns.join(",")} WHERE id=?`).run(...values, id);
662
665
  }, "remapEntity");
663
666
 
664
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/store/document-transfer/index.js
667
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/node_modules/@wirecat/cli-core/dist/store/document-transfer/index.js
665
668
  var locations = /* @__PURE__ */ __name((options) => {
666
669
  for (const value of [options.source, options.destination, options.collection])
667
670
  if (typeof value !== "string" || !value.trim())
@@ -757,7 +760,7 @@ var applyDocumentTransfer = /* @__PURE__ */ __name(async (options) => {
757
760
  }
758
761
  }, "applyDocumentTransfer");
759
762
 
760
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
763
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/node_modules/@wirecat/cli-core/dist/store/knowledge-query.js
761
764
  var ORGANIZATIONS_QUERY = {
762
765
  entity: "organization",
763
766
  backend: "sql",
@@ -792,7 +795,7 @@ var REMINDERS_QUERY = {
792
795
  })
793
796
  };
794
797
 
795
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/store/project-transfer/preview.js
798
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/node_modules/@wirecat/cli-core/dist/store/project-transfer/preview.js
796
799
  var previewProjectAnnotationSnapshot = /* @__PURE__ */ __name(async (options) => {
797
800
  if (!options || typeof options !== "object" || Array.isArray(options))
798
801
  throw new CliError("validation_error", "project preview options are required");
@@ -814,7 +817,7 @@ var previewProjectAnnotationSnapshot = /* @__PURE__ */ __name(async (options) =>
814
817
  }
815
818
  }, "previewProjectAnnotationSnapshot");
816
819
 
817
- // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot.js
820
+ // node_modules/.pnpm/@wirecat+cli-core@0.491.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_1193098e908042dfe6f4070222ac0245/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot.js
818
821
  var snapshotProjectAnnotations = /* @__PURE__ */ __name(async (options) => {
819
822
  if (!options || typeof options !== "object" || Array.isArray(options))
820
823
  throw new CliError("validation_error", "snapshot options are required");