@wirecat/zoom-cli 0.56.0 → 0.58.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 (147) hide show
  1. package/README.md +1 -1
  2. package/dist/bin/zm.js +35 -5
  3. package/dist/bundle/all-profiles-RS5IWIGR.js +25 -0
  4. package/dist/bundle/answer-policy-R7VZMCGE.js +96 -0
  5. package/dist/bundle/anthropic-5QHQR4WF.js +70 -0
  6. package/dist/bundle/app-server-7LANSZGE.js +232 -0
  7. package/dist/bundle/bun-O6RL6LRQ.js +169 -0
  8. package/dist/bundle/bun-sqlite-PEJM6CS4.js +69 -0
  9. package/dist/bundle/chunk-24DLFGES.js +97 -0
  10. package/dist/bundle/chunk-27P22POE.js +1109 -0
  11. package/dist/bundle/chunk-3SCTDFNO.js +3398 -0
  12. package/dist/bundle/chunk-3SERIWJD.js +36139 -0
  13. package/dist/bundle/chunk-4AURKUDZ.js +60 -0
  14. package/dist/bundle/chunk-4NGLRHWO.js +24 -0
  15. package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
  16. package/dist/bundle/chunk-5DVW77VC.js +789 -0
  17. package/dist/bundle/chunk-6CYLVFXM.js +9 -0
  18. package/dist/bundle/chunk-6FL25KC5.js +264 -0
  19. package/dist/bundle/chunk-7D2CD3E3.js +193 -0
  20. package/dist/bundle/chunk-7GVNQOV6.js +17 -0
  21. package/dist/bundle/chunk-7H3ZRDLW.js +630 -0
  22. package/dist/bundle/chunk-7Z4ANTAK.js +1095 -0
  23. package/dist/bundle/chunk-A6323R5P.js +22 -0
  24. package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
  25. package/dist/bundle/chunk-AIXLOMH4.js +63 -0
  26. package/dist/bundle/chunk-AQDWGJZT.js +188 -0
  27. package/dist/bundle/chunk-B32SF7J3.js +18 -0
  28. package/dist/bundle/chunk-BAQLQIMI.js +1938 -0
  29. package/dist/bundle/chunk-BGILD4CI.js +1109 -0
  30. package/dist/bundle/chunk-BXZ6WSVF.js +100 -0
  31. package/dist/bundle/chunk-CTGI4ES2.js +138 -0
  32. package/dist/bundle/chunk-CVIKKIGE.js +76 -0
  33. package/dist/bundle/chunk-DDYR6DYL.js +78 -0
  34. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  35. package/dist/bundle/chunk-DP5DX45H.js +151 -0
  36. package/dist/bundle/chunk-DXKVEOSS.js +53 -0
  37. package/dist/bundle/chunk-DXZTLB24.js +120 -0
  38. package/dist/bundle/chunk-G27MRA24.js +82 -0
  39. package/dist/bundle/chunk-HTQTIKWP.js +928 -0
  40. package/dist/bundle/chunk-IYAGQXED.js +433 -0
  41. package/dist/bundle/chunk-K76WFW4I.js +124 -0
  42. package/dist/bundle/chunk-KVHRHBLY.js +884 -0
  43. package/dist/bundle/chunk-L2UIJDWB.js +31 -0
  44. package/dist/bundle/chunk-L3VS3H34.js +482 -0
  45. package/dist/bundle/chunk-MBT7GP7K.js +1970 -0
  46. package/dist/bundle/chunk-MFS52LTZ.js +570 -0
  47. package/dist/bundle/chunk-MMT46EN4.js +29 -0
  48. package/dist/bundle/chunk-MNUTWGSA.js +6094 -0
  49. package/dist/bundle/chunk-N7GAQ27N.js +82 -0
  50. package/dist/bundle/chunk-NDXAZB5Z.js +409 -0
  51. package/dist/bundle/chunk-NOKFJJPA.js +1028 -0
  52. package/dist/bundle/chunk-NW7IMGRR.js +6848 -0
  53. package/dist/bundle/chunk-O5EHUB2V.js +2 -0
  54. package/dist/bundle/chunk-OBZWUNO4.js +160 -0
  55. package/dist/bundle/chunk-PACC5N6T.js +240 -0
  56. package/dist/bundle/chunk-PF25S7L4.js +422 -0
  57. package/dist/bundle/chunk-PKTFZAXG.js +48 -0
  58. package/dist/bundle/chunk-PNBEREOU.js +35626 -0
  59. package/dist/bundle/chunk-POOGFSRA.js +385 -0
  60. package/dist/bundle/chunk-PP3JGQQE.js +3517 -0
  61. package/dist/bundle/chunk-Q2Z3VCM4.js +2 -0
  62. package/dist/bundle/chunk-QCFHL4ES.js +45 -0
  63. package/dist/bundle/chunk-QFGBMS67.js +492 -0
  64. package/dist/bundle/chunk-RUP467ZX.js +948 -0
  65. package/dist/bundle/chunk-RXDIG23Z.js +166 -0
  66. package/dist/bundle/chunk-SIA7HJE2.js +8192 -0
  67. package/dist/bundle/chunk-SL3SXQZ5.js +100 -0
  68. package/dist/bundle/chunk-SV5L36WK.js +19 -0
  69. package/dist/bundle/chunk-T6AAM7UT.js +846 -0
  70. package/dist/bundle/chunk-U6QW67SU.js +18673 -0
  71. package/dist/bundle/chunk-UKR7KH3H.js +288 -0
  72. package/dist/bundle/chunk-UOFOMU3T.js +836 -0
  73. package/dist/bundle/chunk-URO44C5T.js +3570 -0
  74. package/dist/bundle/chunk-UXM7I35J.js +281 -0
  75. package/dist/bundle/chunk-UYJUTZTT.js +73 -0
  76. package/dist/bundle/chunk-VOAVOK4I.js +1146 -0
  77. package/dist/bundle/chunk-VSUY7PDW.js +192 -0
  78. package/dist/bundle/chunk-VYUSEJE4.js +98 -0
  79. package/dist/bundle/chunk-XFCSPOLZ.js +25 -0
  80. package/dist/bundle/chunk-XT7XVPEM.js +538 -0
  81. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  82. package/dist/bundle/chunk-YIFIY7ZE.js +58 -0
  83. package/dist/bundle/chunk-YIMI6O7R.js +5292 -0
  84. package/dist/bundle/chunk-YJRMMZI5.js +275 -0
  85. package/dist/bundle/chunk-YSHSCBPM.js +2315 -0
  86. package/dist/bundle/chunk-ZC5UXEIH.js +215 -0
  87. package/dist/bundle/chunk-ZHXIXDH5.js +161 -0
  88. package/dist/bundle/chunk-ZTOAAYFV.js +122 -0
  89. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  90. package/dist/bundle/cli-IQTASP44.js +831 -0
  91. package/dist/bundle/command-contract-WHZPF7NA.js +38 -0
  92. package/dist/bundle/config-IP5SGHKN.js +79 -0
  93. package/dist/bundle/dist-WT73DF46.js +136 -0
  94. package/dist/bundle/dist-XUFQCJXW.js +7577 -0
  95. package/dist/bundle/echarts-LD3AI55P.js +42501 -0
  96. package/dist/bundle/embed-XEMH4LNX.js +35 -0
  97. package/dist/bundle/embedder-ZCYKSKAE.js +108 -0
  98. package/dist/bundle/first-run-LGYDLIUM.js +23 -0
  99. package/dist/bundle/first-screen-LYQKPNF4.js +36 -0
  100. package/dist/bundle/folders-5ZBUQHAM.js +13 -0
  101. package/dist/bundle/instructions-RZMSW3OC.js +11 -0
  102. package/dist/bundle/main-NKY3JGXY.js +130 -0
  103. package/dist/bundle/mcp-7OXUHLTO.js +189 -0
  104. package/dist/bundle/mcp-OQBZXELQ.js +165 -0
  105. package/dist/bundle/mcp-VISEXTVC.js +92 -0
  106. package/dist/bundle/meetings-XPBHVZAU.js +215 -0
  107. package/dist/bundle/node-P4E63KXA.js +2340 -0
  108. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  109. package/dist/bundle/node-ZRLYQL7J.js +176 -0
  110. package/dist/bundle/node-sqlite-BBEDYBWO.js +45 -0
  111. package/dist/bundle/oauth-UHVRGKZU.js +17 -0
  112. package/dist/bundle/open-J4FCAUAJ.js +19 -0
  113. package/dist/bundle/output-file-SXV2ANW7.js +63 -0
  114. package/dist/bundle/process-LL77573L.js +91 -0
  115. package/dist/bundle/program-EPMIJCGA.js +5845 -0
  116. package/dist/bundle/prompt-LUUMQTMY.js +12 -0
  117. package/dist/bundle/recognize-EMHQX4XF.js +190 -0
  118. package/dist/bundle/remote-ZXS6D7VB.js +26 -0
  119. package/dist/bundle/rerank-WP7RKZNB.js +49 -0
  120. package/dist/bundle/run-log-GS2L66G6.js +111 -0
  121. package/dist/bundle/serve-L6KLLXK2.js +19 -0
  122. package/dist/bundle/server-NOFYENP5.js +53 -0
  123. package/dist/bundle/server-P5TXAPBY.js +66 -0
  124. package/dist/bundle/services-SPOEWVK3.js +330 -0
  125. package/dist/bundle/speech-6OBAKMND.js +44 -0
  126. package/dist/bundle/state-HN5EJKXQ.js +33 -0
  127. package/dist/bundle/store-LEU3M6IN.js +124 -0
  128. package/dist/bundle/store-ZP2URKET.js +141 -0
  129. package/dist/bundle/store-connection-I53XZ2TS.js +76 -0
  130. package/dist/bundle/store-maintenance-command-PSCHEHHY.js +54 -0
  131. package/dist/bundle/streaming-AK6Q2ZGQ.js +15 -0
  132. package/dist/bundle/tokens-CCM3D4ZT.js +17 -0
  133. package/dist/bundle/zm.js +8 -0
  134. package/dist/contract-overrides.d.ts.map +1 -1
  135. package/dist/contract-overrides.js +29 -17
  136. package/dist/contract-overrides.js.map +1 -1
  137. package/dist/mcp-command.d.ts +3 -2
  138. package/dist/mcp-command.d.ts.map +1 -1
  139. package/dist/mcp-command.js +62 -10
  140. package/dist/mcp-command.js.map +1 -1
  141. package/dist/program-bindings.d.ts.map +1 -1
  142. package/dist/program-bindings.js +1 -0
  143. package/dist/program-bindings.js.map +1 -1
  144. package/dist/version.d.ts +1 -1
  145. package/dist/version.js +1 -1
  146. package/package.json +7 -5
  147. package/skills/zoom-cli/SKILL.md +2 -0
@@ -0,0 +1,63 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ __name
5
+ } from "./chunk-ZVVMGPBJ.js";
6
+
7
+ // 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/background/processes.js
8
+ import { execFileSync } from "node:child_process";
9
+ import { readdirSync, readFileSync, readlinkSync } from "node:fs";
10
+ var alive = /* @__PURE__ */ __name((pid) => {
11
+ try {
12
+ process.kill(pid, 0);
13
+ return true;
14
+ } catch (error) {
15
+ return error.code === "EPERM";
16
+ }
17
+ }, "alive");
18
+ var carries = /* @__PURE__ */ __name((pid, marker) => {
19
+ if (pid <= 0 || !alive(pid))
20
+ return false;
21
+ try {
22
+ if (process.platform === "linux") {
23
+ return readFileSync(`/proc/${pid}/environ`, "latin1").split("\0").some((entry) => entry.endsWith(marker));
24
+ }
25
+ if (process.platform === "darwin") {
26
+ return execFileSync("ps", ["eww", "-o", "command=", "-p", String(pid)], { encoding: "utf8" }).includes(marker);
27
+ }
28
+ } catch {
29
+ return false;
30
+ }
31
+ return false;
32
+ }, "carries");
33
+ var holdersOf = /* @__PURE__ */ __name((paths) => {
34
+ if (process.platform === "linux") {
35
+ const wanted = new Set(paths);
36
+ return readdirSync("/proc").filter((entry) => /^\d+$/.test(entry) && Number(entry) !== process.pid).filter((pid) => {
37
+ try {
38
+ return readdirSync(`/proc/${pid}/fd`).some((fd) => {
39
+ try {
40
+ return wanted.has(readlinkSync(`/proc/${pid}/fd/${fd}`));
41
+ } catch {
42
+ return false;
43
+ }
44
+ });
45
+ } catch {
46
+ return false;
47
+ }
48
+ }).map(Number);
49
+ }
50
+ const pids = /* @__PURE__ */ __name((listed) => listed.split("\n").filter(Boolean).map(Number).filter((pid) => pid !== process.pid), "pids");
51
+ try {
52
+ return pids(execFileSync("lsof", ["-t", "--", ...paths], { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"] }));
53
+ } catch (error) {
54
+ const { status, stdout } = error;
55
+ return status === 1 ? pids(stdout ?? "") : void 0;
56
+ }
57
+ }, "holdersOf");
58
+
59
+ export {
60
+ alive,
61
+ carries,
62
+ holdersOf
63
+ };
@@ -0,0 +1,188 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ checkCancelled,
5
+ object
6
+ } from "./chunk-VYUSEJE4.js";
7
+ import {
8
+ CliError,
9
+ isCliError
10
+ } from "./chunk-YIMI6O7R.js";
11
+ import {
12
+ __name
13
+ } from "./chunk-ZVVMGPBJ.js";
14
+
15
+ // dist/tokens.js
16
+ var TOKEN_LOG_ALLOW = ["rotated", "saved", "pid"];
17
+ var TOKEN_LOG_EVENT = "zoom.token.exchange";
18
+ var abortReason = /* @__PURE__ */ __name((parent) => !parent?.aborted ? "timeout" : isCliError(parent.reason) ? parent.reason.code : "cancelled", "abortReason");
19
+ var TokenManager = class _TokenManager {
20
+ static {
21
+ __name(this, "TokenManager");
22
+ }
23
+ options;
24
+ refreshState = /* @__PURE__ */ new Map();
25
+ constructor(options) {
26
+ this.options = options;
27
+ }
28
+ /** The login of one profile: `<client id>:<profile>` in the keyring. */
29
+ forProfile(profile) {
30
+ const parent = this.options;
31
+ const scoped = new _TokenManager({
32
+ get clientId() {
33
+ return parent.clientId;
34
+ },
35
+ get account() {
36
+ return `${parent.clientId}:${profile}`;
37
+ },
38
+ keyring: parent.keyring,
39
+ service: parent.service,
40
+ fetch: parent.fetch,
41
+ now: parent.now,
42
+ log: parent.log,
43
+ signal: parent.signal
44
+ });
45
+ scoped.refreshState = this.refreshState;
46
+ return scoped;
47
+ }
48
+ withSignal(signal, fetcher = this.options.fetch) {
49
+ const parent = this.options;
50
+ let login;
51
+ const pinned = /* @__PURE__ */ __name(() => login ??= { clientId: parent.clientId, account: parent.account }, "pinned");
52
+ const scoped = new _TokenManager({
53
+ get clientId() {
54
+ return pinned().clientId;
55
+ },
56
+ get account() {
57
+ return pinned().account;
58
+ },
59
+ keyring: parent.keyring,
60
+ service: parent.service,
61
+ fetch: fetcher,
62
+ now: parent.now,
63
+ log: parent.log,
64
+ signal: signal && parent.signal ? AbortSignal.any([signal, parent.signal]) : signal ?? parent.signal
65
+ });
66
+ scoped.refreshState = this.refreshState;
67
+ return scoped;
68
+ }
69
+ accountOf() {
70
+ return this.options.account ?? this.options.clientId;
71
+ }
72
+ read(account) {
73
+ try {
74
+ return this.options.keyring.get(this.options.service, account);
75
+ } catch {
76
+ throw new CliError("configuration_error", "system keyring is unavailable");
77
+ }
78
+ }
79
+ load(account = this.accountOf()) {
80
+ const saved = this.read(account);
81
+ if (!saved)
82
+ return null;
83
+ try {
84
+ const value = object(JSON.parse(saved));
85
+ if (typeof value.accessToken !== "string" || !value.accessToken || typeof value.refreshToken !== "string" || !value.refreshToken || typeof value.expiresAt !== "number" || !Number.isFinite(value.expiresAt) || !Array.isArray(value.scopes) || !value.scopes.every((s) => typeof s === "string"))
86
+ throw new Error("invalid token entry");
87
+ return {
88
+ accessToken: value.accessToken,
89
+ refreshToken: value.refreshToken,
90
+ expiresAt: value.expiresAt,
91
+ scopes: value.scopes
92
+ };
93
+ } catch (error) {
94
+ if (isCliError(error) && error.code === "configuration_error")
95
+ throw error;
96
+ throw new CliError("authentication_error", "saved login is invalid; run zm <profile> session start again, or sign in from WireCat Desktop (Tools \u2192 Zoom \u2192 Manage)");
97
+ }
98
+ }
99
+ save(tokens, account = this.accountOf()) {
100
+ try {
101
+ this.options.keyring.set(this.options.service, account, JSON.stringify(tokens));
102
+ } catch {
103
+ throw new CliError("configuration_error", "could not save login to the system keyring");
104
+ }
105
+ }
106
+ async exchange(params, previous, clientId = this.options.clientId, account = this.options.account ?? clientId) {
107
+ checkCancelled(this.options.signal);
108
+ const signal = this.options.signal ? AbortSignal.any([this.options.signal, AbortSignal.timeout(3e4)]) : AbortSignal.timeout(3e4);
109
+ const parent = this.options.signal;
110
+ const record = /* @__PURE__ */ __name((level, fields) => this.options.log?.[level]({
111
+ event: TOKEN_LOG_EVENT,
112
+ operation: params.grant_type ?? "unknown",
113
+ pid: process.pid,
114
+ ...signal.aborted ? { reason: abortReason(parent) } : {},
115
+ ...fields
116
+ }), "record");
117
+ let response;
118
+ try {
119
+ response = await this.options.fetch("https://zoom.us/oauth/token", {
120
+ method: "POST",
121
+ headers: { "content-type": "application/x-www-form-urlencoded" },
122
+ body: new URLSearchParams({ ...params, client_id: clientId }),
123
+ signal,
124
+ redirect: "error"
125
+ });
126
+ } catch {
127
+ record("warn", { outcome: "no_response" });
128
+ throw new CliError("outcome_unknown", "Zoom token exchange did not finish; run zm <profile> session start again before retrying");
129
+ }
130
+ if (!response.ok) {
131
+ record("warn", { outcome: "rejected", status: response.status });
132
+ throw new CliError("authentication_error", `Zoom token request failed (HTTP ${response.status}); run zm <profile> session start again`);
133
+ }
134
+ let body;
135
+ try {
136
+ body = object(await response.json());
137
+ } catch {
138
+ record("error", { outcome: "unreadable_response", status: response.status });
139
+ throw new CliError("outcome_unknown", "Zoom returned an invalid token response; run zm <profile> session start again before retrying");
140
+ }
141
+ const refreshToken = typeof body.refresh_token === "string" ? body.refresh_token : previous?.refreshToken;
142
+ if (typeof body.access_token !== "string" || !body.access_token || !refreshToken || typeof body.expires_in !== "number" || !Number.isFinite(body.expires_in) || body.expires_in <= 0 || !Number.isFinite((this.options.now?.() ?? Date.now()) + body.expires_in * 1e3) || body.scope !== void 0 && typeof body.scope !== "string" || body.refresh_token !== void 0 && typeof body.refresh_token !== "string") {
143
+ record("error", { outcome: "invalid_response", status: response.status });
144
+ throw new CliError("outcome_unknown", "Zoom returned an invalid token response; run zm <profile> session start again before retrying");
145
+ }
146
+ const rotated = previous ? { rotated: refreshToken !== previous.refreshToken } : {};
147
+ const tokens = {
148
+ accessToken: body.access_token,
149
+ refreshToken,
150
+ expiresAt: (this.options.now?.() ?? Date.now()) + body.expires_in * 1e3,
151
+ scopes: typeof body.scope === "string" ? body.scope.split(/\s+/).filter(Boolean) : previous?.scopes ?? []
152
+ };
153
+ try {
154
+ this.save(tokens, account);
155
+ } catch (error) {
156
+ record("error", { outcome: "save_failed", status: response.status, ...rotated, saved: false });
157
+ throw error;
158
+ }
159
+ record("info", { outcome: "saved", status: response.status, ...rotated, saved: true });
160
+ return tokens;
161
+ }
162
+ async tokens() {
163
+ checkCancelled(this.options.signal);
164
+ const clientId = this.options.clientId;
165
+ const account = this.options.account ?? clientId;
166
+ const saved = this.load(account);
167
+ if (!saved)
168
+ throw new CliError("authentication_error", "run zm <profile> session start first, or sign in from WireCat Desktop (Tools \u2192 Zoom \u2192 Manage)");
169
+ if (saved.expiresAt > (this.options.now?.() ?? Date.now()) + 3e4)
170
+ return saved;
171
+ let refreshing = this.refreshState.get(account);
172
+ if (!refreshing) {
173
+ refreshing = this.exchange({ grant_type: "refresh_token", refresh_token: saved.refreshToken }, saved, clientId, account).finally(() => {
174
+ this.refreshState.delete(account);
175
+ });
176
+ this.refreshState.set(account, refreshing);
177
+ }
178
+ const refreshed = await refreshing;
179
+ checkCancelled(this.options.signal);
180
+ return refreshed;
181
+ }
182
+ };
183
+
184
+ export {
185
+ TOKEN_LOG_ALLOW,
186
+ TOKEN_LOG_EVENT,
187
+ TokenManager
188
+ };
@@ -0,0 +1,18 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ resolvePaths
5
+ } from "./chunk-YIMI6O7R.js";
6
+ import {
7
+ __name
8
+ } from "./chunk-ZVVMGPBJ.js";
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/store/path.js
11
+ import { join } from "node:path";
12
+ var wirecatDirectory = /* @__PURE__ */ __name((env = process.env, platform) => resolvePaths({ appName: "WireCat", prefix: "WIRECAT", env, ...platform ? { platform } : {} }).state, "wirecatDirectory");
13
+ var storePath = /* @__PURE__ */ __name((env = process.env) => env.MESSAGING_STORE ?? join(wirecatDirectory(env), "wirecat.db"), "storePath");
14
+
15
+ export {
16
+ wirecatDirectory,
17
+ storePath
18
+ };