@wirecat/zoom-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 (170) hide show
  1. package/README.md +4 -4
  2. package/dist/bin/zm.js +35 -5
  3. package/dist/bundle/all-profiles-EKHWTGOY.js +25 -0
  4. package/dist/bundle/answer-policy-KH2IFXPN.js +96 -0
  5. package/dist/bundle/anthropic-VL54IUGF.js +70 -0
  6. package/dist/bundle/bun-ADJVI4HY.js +169 -0
  7. package/dist/bundle/bun-sqlite-2SDA3YOT.js +69 -0
  8. package/dist/bundle/chunk-2IKY7VBH.js +9 -0
  9. package/dist/bundle/chunk-2WOGZDZG.js +431 -0
  10. package/dist/bundle/chunk-4R7HYNZS.js +73 -0
  11. package/dist/bundle/chunk-4VCA7QU3.js +538 -0
  12. package/dist/bundle/chunk-4YLS4YLS.js +29 -0
  13. package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
  14. package/dist/bundle/chunk-5F7IOESV.js +281 -0
  15. package/dist/bundle/chunk-5QESMCQK.js +122 -0
  16. package/dist/bundle/chunk-6M6FJV5D.js +138 -0
  17. package/dist/bundle/chunk-6MX5T6AQ.js +17 -0
  18. package/dist/bundle/chunk-6P3YHT54.js +385 -0
  19. package/dist/bundle/chunk-7A6PZUDR.js +938 -0
  20. package/dist/bundle/chunk-7GUG6UZS.js +884 -0
  21. package/dist/bundle/chunk-7JZJMHQY.js +487 -0
  22. package/dist/bundle/chunk-A4ETXPMZ.js +98 -0
  23. package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
  24. package/dist/bundle/chunk-AE4BOXH7.js +5292 -0
  25. package/dist/bundle/chunk-AN3GVZTU.js +76 -0
  26. package/dist/bundle/chunk-BAYNCCNM.js +215 -0
  27. package/dist/bundle/chunk-BW2WPOXP.js +166 -0
  28. package/dist/bundle/chunk-BW52AJ4R.js +3387 -0
  29. package/dist/bundle/chunk-CB5UTASG.js +18 -0
  30. package/dist/bundle/chunk-CLMXBW53.js +1028 -0
  31. package/dist/bundle/chunk-DCTXOMOR.js +35 -0
  32. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  33. package/dist/bundle/chunk-EOQFWJJD.js +1095 -0
  34. package/dist/bundle/chunk-G4R4ZIGD.js +3569 -0
  35. package/dist/bundle/chunk-G4VZDINN.js +161 -0
  36. package/dist/bundle/chunk-GARCOIB6.js +409 -0
  37. package/dist/bundle/chunk-GKMGS7G5.js +1938 -0
  38. package/dist/bundle/chunk-HCNMFFG3.js +82 -0
  39. package/dist/bundle/chunk-HG5KRV55.js +1970 -0
  40. package/dist/bundle/chunk-HKYLSIZ2.js +82 -0
  41. package/dist/bundle/chunk-HTQTIKWP.js +928 -0
  42. package/dist/bundle/chunk-I4VQDXFR.js +100 -0
  43. package/dist/bundle/chunk-ICSKEDPI.js +36139 -0
  44. package/dist/bundle/chunk-IP4OK7RQ.js +24 -0
  45. package/dist/bundle/chunk-IVQ6342B.js +2 -0
  46. package/dist/bundle/chunk-K72SEMYI.js +160 -0
  47. package/dist/bundle/chunk-LHRCJYFC.js +19 -0
  48. package/dist/bundle/chunk-LPTIQLDW.js +192 -0
  49. package/dist/bundle/chunk-LQ3T2ZIX.js +124 -0
  50. package/dist/bundle/chunk-LSVI3A5X.js +836 -0
  51. package/dist/bundle/chunk-LW2G4U6W.js +570 -0
  52. package/dist/bundle/chunk-LXB6ONWC.js +3517 -0
  53. package/dist/bundle/chunk-LY26NW3I.js +6848 -0
  54. package/dist/bundle/chunk-MAEFLDHG.js +6092 -0
  55. package/dist/bundle/chunk-MZH4GDR4.js +45 -0
  56. package/dist/bundle/chunk-NN5B24KP.js +1109 -0
  57. package/dist/bundle/chunk-NO7CJEYV.js +22 -0
  58. package/dist/bundle/chunk-NTDWAAGL.js +18435 -0
  59. package/dist/bundle/chunk-NW3X3G5X.js +264 -0
  60. package/dist/bundle/chunk-O66V2WHK.js +48 -0
  61. package/dist/bundle/chunk-OCGPZHXW.js +25 -0
  62. package/dist/bundle/chunk-OIHDCGV4.js +151 -0
  63. package/dist/bundle/chunk-OVSWVPXL.js +8190 -0
  64. package/dist/bundle/chunk-PIN5RZ3D.js +63 -0
  65. package/dist/bundle/chunk-QLIB3PEC.js +1146 -0
  66. package/dist/bundle/chunk-QTR6D5HT.js +58 -0
  67. package/dist/bundle/chunk-QUJPQMHJ.js +2315 -0
  68. package/dist/bundle/chunk-R3HPOCZD.js +188 -0
  69. package/dist/bundle/chunk-RMV4C2YL.js +482 -0
  70. package/dist/bundle/chunk-RRRBMQ2E.js +844 -0
  71. package/dist/bundle/chunk-S4S7E54J.js +60 -0
  72. package/dist/bundle/chunk-SB6WOSHG.js +1109 -0
  73. package/dist/bundle/chunk-SE75DPBY.js +31 -0
  74. package/dist/bundle/chunk-SQJ7EH2D.js +97 -0
  75. package/dist/bundle/chunk-TKCHUT2H.js +422 -0
  76. package/dist/bundle/chunk-TLQUKHEM.js +193 -0
  77. package/dist/bundle/chunk-TZ2MKETI.js +100 -0
  78. package/dist/bundle/chunk-UC44ZMQV.js +78 -0
  79. package/dist/bundle/chunk-UI5UTMSZ.js +275 -0
  80. package/dist/bundle/chunk-VPPYYWOH.js +630 -0
  81. package/dist/bundle/chunk-WJHK5D7Z.js +35612 -0
  82. package/dist/bundle/chunk-WQ24UC44.js +239 -0
  83. package/dist/bundle/chunk-X5DFDGWS.js +2 -0
  84. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  85. package/dist/bundle/chunk-YB4DMKYX.js +119 -0
  86. package/dist/bundle/chunk-Z4TZ6TAF.js +288 -0
  87. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  88. package/dist/bundle/cli-72EQATJF.js +825 -0
  89. package/dist/bundle/command-contract-4MHSZUN3.js +38 -0
  90. package/dist/bundle/config-GFIJK6G2.js +79 -0
  91. package/dist/bundle/dist-IBNHCQXT.js +136 -0
  92. package/dist/bundle/dist-XUFQCJXW.js +7577 -0
  93. package/dist/bundle/echarts-RFTK737T.js +42501 -0
  94. package/dist/bundle/embed-7QYA2ZZE.js +35 -0
  95. package/dist/bundle/embedder-YNN6PCHG.js +108 -0
  96. package/dist/bundle/first-run-EVSRQKZJ.js +23 -0
  97. package/dist/bundle/first-screen-RG4GUKW7.js +36 -0
  98. package/dist/bundle/folders-JEPOMYM4.js +13 -0
  99. package/dist/bundle/instructions-FHNL7CMW.js +9 -0
  100. package/dist/bundle/main-NYGJXPH7.js +130 -0
  101. package/dist/bundle/mcp-IXFC2VVR.js +165 -0
  102. package/dist/bundle/mcp-VGSZDCKK.js +189 -0
  103. package/dist/bundle/mcp-XKP2PXLS.js +92 -0
  104. package/dist/bundle/meetings-IBPI4MM4.js +215 -0
  105. package/dist/bundle/node-P4E63KXA.js +2340 -0
  106. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  107. package/dist/bundle/node-ZMCACJVS.js +176 -0
  108. package/dist/bundle/node-sqlite-ZNGOBA5Q.js +45 -0
  109. package/dist/bundle/oauth-Q6LKF7DB.js +17 -0
  110. package/dist/bundle/open-LJ332Y5O.js +19 -0
  111. package/dist/bundle/output-file-RYQZ3RTE.js +63 -0
  112. package/dist/bundle/process-ZPTLNVQS.js +91 -0
  113. package/dist/bundle/program-IBRQBQ6W.js +5845 -0
  114. package/dist/bundle/prompt-RT7GUUXH.js +12 -0
  115. package/dist/bundle/recognize-QXGE7YJH.js +190 -0
  116. package/dist/bundle/remote-FD4MZQV3.js +26 -0
  117. package/dist/bundle/rerank-V6AVV755.js +49 -0
  118. package/dist/bundle/run-log-RE2EI3UU.js +111 -0
  119. package/dist/bundle/serve-HIJTFAW7.js +19 -0
  120. package/dist/bundle/server-3QOXOYYL.js +53 -0
  121. package/dist/bundle/server-WLJCU7KK.js +812 -0
  122. package/dist/bundle/services-KC5KQFBS.js +330 -0
  123. package/dist/bundle/speech-5JOXLYDA.js +44 -0
  124. package/dist/bundle/state-PPGRB3T6.js +33 -0
  125. package/dist/bundle/store-LODVDPK3.js +141 -0
  126. package/dist/bundle/store-WB5BICTG.js +124 -0
  127. package/dist/bundle/store-connection-EG6Z5ITP.js +76 -0
  128. package/dist/bundle/store-maintenance-command-Q5WMFUZ2.js +54 -0
  129. package/dist/bundle/streaming-UGFFNOXL.js +15 -0
  130. package/dist/bundle/tokens-AF5CPY2F.js +17 -0
  131. package/dist/bundle/zm.js +8 -0
  132. package/dist/commands.js +2 -2
  133. package/dist/commands.js.map +1 -1
  134. package/dist/config-issues.d.ts.map +1 -1
  135. package/dist/config-issues.js +3 -0
  136. package/dist/config-issues.js.map +1 -1
  137. package/dist/config.d.ts +3 -0
  138. package/dist/config.d.ts.map +1 -1
  139. package/dist/config.js +23 -0
  140. package/dist/config.js.map +1 -1
  141. package/dist/contract-overrides.d.ts.map +1 -1
  142. package/dist/contract-overrides.js +34 -45
  143. package/dist/contract-overrides.js.map +1 -1
  144. package/dist/first-screen.js +1 -1
  145. package/dist/first-screen.js.map +1 -1
  146. package/dist/mcp-command.d.ts +5 -3
  147. package/dist/mcp-command.d.ts.map +1 -1
  148. package/dist/mcp-command.js +73 -15
  149. package/dist/mcp-command.js.map +1 -1
  150. package/dist/program-bindings.d.ts.map +1 -1
  151. package/dist/program-bindings.js +1 -0
  152. package/dist/program-bindings.js.map +1 -1
  153. package/dist/recording-archive.d.ts.map +1 -1
  154. package/dist/recording-archive.js +9 -4
  155. package/dist/recording-archive.js.map +1 -1
  156. package/dist/remote-http.d.ts +2 -0
  157. package/dist/remote-http.d.ts.map +1 -1
  158. package/dist/remote-http.js +21 -11
  159. package/dist/remote-http.js.map +1 -1
  160. package/dist/request-events.d.ts +12 -0
  161. package/dist/request-events.d.ts.map +1 -1
  162. package/dist/request-events.js +56 -4
  163. package/dist/request-events.js.map +1 -1
  164. package/dist/run.d.ts.map +1 -1
  165. package/dist/run.js +4 -1
  166. package/dist/run.js.map +1 -1
  167. package/dist/version.d.ts +1 -1
  168. package/dist/version.js +1 -1
  169. package/package.json +7 -5
  170. package/skills/zoom-cli/SKILL.md +3 -1
@@ -0,0 +1,281 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ answeredWire
5
+ } from "./chunk-AN3GVZTU.js";
6
+ import {
7
+ CALLER_META_KEY,
8
+ PROXY_CLIENT_NAME,
9
+ StdioServerTransport,
10
+ callerOf,
11
+ serveStdio
12
+ } from "./chunk-VPPYYWOH.js";
13
+ import {
14
+ McpServer
15
+ } from "./chunk-5D4AEUVA.js";
16
+ import {
17
+ __name
18
+ } from "./chunk-ZVVMGPBJ.js";
19
+
20
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/mcp/all-profiles.js
21
+ import { spawn } from "node:child_process";
22
+ import { randomUUID } from "node:crypto";
23
+ var PROTOCOL = "2025-06-18";
24
+ var START_MS = 3e4;
25
+ var CHILD_IDLE_MS = 10 * 60 * 1e3;
26
+ var startChild = /* @__PURE__ */ __name((spec, note, onExit) => {
27
+ const child = spawn(spec.command, spec.args, { env: spec.env, stdio: "pipe" });
28
+ const pending = /* @__PURE__ */ new Map();
29
+ let next = 1;
30
+ let buffer = "";
31
+ let gone;
32
+ const fail = /* @__PURE__ */ __name((error) => {
33
+ gone ??= error;
34
+ for (const waiter of pending.values())
35
+ waiter.reject(error);
36
+ pending.clear();
37
+ }, "fail");
38
+ child.on("error", () => fail(new Error("the profile's MCP server could not be started")));
39
+ child.on("exit", () => {
40
+ fail(new Error("the profile's MCP server stopped"));
41
+ onExit();
42
+ });
43
+ child.stdin.on("error", () => fail(new Error("the profile's MCP server closed its input")));
44
+ child.stderr.setEncoding("utf8");
45
+ let errors = "";
46
+ child.stderr.on("data", (chunk) => {
47
+ const lines = (errors + chunk).split("\n");
48
+ errors = lines.pop() ?? "";
49
+ for (const line of lines)
50
+ if (line.trim())
51
+ note(line);
52
+ });
53
+ child.stdout.setEncoding("utf8");
54
+ child.stdout.on("data", (chunk) => {
55
+ buffer += chunk;
56
+ for (let at = buffer.indexOf("\n"); at !== -1; at = buffer.indexOf("\n")) {
57
+ const line = buffer.slice(0, at);
58
+ buffer = buffer.slice(at + 1);
59
+ let message;
60
+ try {
61
+ message = JSON.parse(line);
62
+ } catch {
63
+ continue;
64
+ }
65
+ if (message.method !== void 0 && message.id !== void 0) {
66
+ send({ id: message.id, error: { code: -32601, message: "not offered through the all-profiles server" } });
67
+ continue;
68
+ }
69
+ if (typeof message.id !== "number")
70
+ continue;
71
+ const waiter = pending.get(message.id);
72
+ if (!waiter)
73
+ continue;
74
+ pending.delete(message.id);
75
+ if (message.error)
76
+ waiter.reject(new Error(message.error.message ?? "the profile's MCP server refused"));
77
+ else
78
+ waiter.resolve(message.result ?? {});
79
+ }
80
+ });
81
+ const send = /* @__PURE__ */ __name((message) => child.stdin.write(`${JSON.stringify({ jsonrpc: "2.0", ...message })}
82
+ `), "send");
83
+ const request = /* @__PURE__ */ __name((method, params) => new Promise((resolve, reject) => {
84
+ if (gone)
85
+ return reject(gone);
86
+ const id = next++;
87
+ pending.set(id, { resolve, reject });
88
+ send({ id, method, params });
89
+ }), "request");
90
+ const close = /* @__PURE__ */ __name(() => new Promise((resolve) => {
91
+ if (child.exitCode !== null || child.signalCode !== null)
92
+ return resolve();
93
+ child.once("exit", () => resolve());
94
+ child.stdin.end();
95
+ }), "close");
96
+ const timer = setTimeout(() => fail(new Error("the profile's MCP server did not answer in time")), START_MS);
97
+ return request("initialize", {
98
+ protocolVersion: PROTOCOL,
99
+ capabilities: {},
100
+ clientInfo: { name: PROXY_CLIENT_NAME, version: "1" }
101
+ }).then(() => {
102
+ send({ method: "notifications/initialized" });
103
+ return { request, close };
104
+ }).catch(async (error) => {
105
+ await close();
106
+ throw error;
107
+ }).finally(() => clearTimeout(timer));
108
+ }, "startChild");
109
+ var pool = /* @__PURE__ */ __name((options) => {
110
+ const idleMs = options.idleMs ?? CHILD_IDLE_MS;
111
+ const note = options.note ?? (() => {
112
+ });
113
+ const running = /* @__PURE__ */ new Map();
114
+ const forget = /* @__PURE__ */ __name((profile, child) => {
115
+ const one = running.get(profile);
116
+ if (one?.child !== child)
117
+ return;
118
+ clearTimeout(one.timer);
119
+ running.delete(profile);
120
+ }, "forget");
121
+ const use = /* @__PURE__ */ __name(async (profile, work) => {
122
+ let one = running.get(profile);
123
+ if (!one) {
124
+ const child = startChild(options.child(profile), (line) => note(`${profile}: ${line}`), () => forget(profile, child));
125
+ child.catch(() => forget(profile, child));
126
+ one = { child };
127
+ running.set(profile, one);
128
+ }
129
+ clearTimeout(one.timer);
130
+ const entry = one;
131
+ try {
132
+ return await work(await entry.child);
133
+ } finally {
134
+ if (running.get(profile) === entry) {
135
+ entry.timer = setTimeout(() => {
136
+ forget(profile, entry.child);
137
+ void entry.child.then((child) => child.close()).catch(() => void 0);
138
+ }, idleMs);
139
+ entry.timer.unref();
140
+ }
141
+ }
142
+ }, "use");
143
+ const close = /* @__PURE__ */ __name(async () => {
144
+ const all = [...running.values()];
145
+ running.clear();
146
+ for (const one of all)
147
+ clearTimeout(one.timer);
148
+ await Promise.all(all.map((one) => one.child.then((child) => child.close()).catch(() => void 0)));
149
+ }, "close");
150
+ return { use, close };
151
+ }, "pool");
152
+ var withProfile = /* @__PURE__ */ __name((tool, profiles, name, signedIn = () => true) => {
153
+ const schema = tool.inputSchema;
154
+ const out = profiles.filter((profile) => !signedIn(profile));
155
+ const states = out.length === 0 ? "" : ` Signed in: ${profiles.filter(signedIn).join(", ") || "none"} \xB7 Not signed in: ${out.join(", ")}.`;
156
+ return {
157
+ ...tool,
158
+ inputSchema: {
159
+ ...tool.inputSchema,
160
+ properties: {
161
+ profile: {
162
+ type: "string",
163
+ enum: [...profiles],
164
+ oneOf: profiles.map((profile) => ({
165
+ const: profile,
166
+ title: signedIn(profile) ? profile : `${profile} \u2014 not signed in`
167
+ })),
168
+ description: `Which ${name} account, by its profile. If the owner did not name one, ask which \u2014 never guess.${states}`
169
+ },
170
+ ...schema.properties
171
+ },
172
+ required: ["profile", ...(schema.required ?? []).filter((field) => field !== "profile")]
173
+ }
174
+ };
175
+ }, "withProfile");
176
+ var refusal = /* @__PURE__ */ __name((text) => ({
177
+ isError: true,
178
+ content: [{ type: "text", text }]
179
+ }), "refusal");
180
+ var allProfilesServer = /* @__PURE__ */ __name((options) => {
181
+ const children = pool(options);
182
+ let listed;
183
+ const tools = /* @__PURE__ */ __name((profiles) => {
184
+ listed ??= children.use(profiles.find(signedIn) ?? profiles[0], (child) => child.request("tools/list", {})).then((answer) => answer.tools ?? []);
185
+ listed.catch(() => {
186
+ listed = void 0;
187
+ });
188
+ return listed;
189
+ }, "tools");
190
+ const signedIn = /* @__PURE__ */ __name((profile) => options.signedIn?.(profile) ?? true, "signedIn");
191
+ const build = /* @__PURE__ */ __name(() => {
192
+ const profiles = [...options.profiles()].sort();
193
+ const server = new McpServer({ name: options.command, version: options.version }, { capabilities: { tools: {} }, instructions: options.instructions });
194
+ server.server.setRequestHandler("tools/list", async () => ({
195
+ tools: profiles.length === 0 ? [] : (await tools(profiles)).map((one) => withProfile(one, profiles, options.name, signedIn))
196
+ }));
197
+ const callers = {
198
+ env: options.env ?? process.env,
199
+ client: /* @__PURE__ */ __name(() => server.server.getClientVersion(), "client"),
200
+ connectionId: randomUUID()
201
+ };
202
+ server.server.setRequestHandler("tools/call", async (request, ctx) => {
203
+ const { name, arguments: given = {}, _meta } = request.params;
204
+ const { profile, ...rest } = given;
205
+ if (typeof profile !== "string" || !profiles.includes(profile))
206
+ return refusal(`${name} needs "profile", one of: ${profiles.join(", ")}. If the owner did not say which account, ask.`);
207
+ if (!signedIn(profile))
208
+ return refusal(options.signIn?.(profile) ?? `profile ${profile} is not signed in.`);
209
+ try {
210
+ return await children.use(profile, (child) => (
211
+ // Children are shared by every session, so each call names its own caller.
212
+ child.request("tools/call", {
213
+ name,
214
+ arguments: rest,
215
+ _meta: { ..._meta, [CALLER_META_KEY]: callerOf(ctx, name, callers) }
216
+ })
217
+ ));
218
+ } catch (error) {
219
+ return refusal(`profile ${profile}: ${error instanceof Error ? error.message : String(error)}`);
220
+ }
221
+ });
222
+ return server;
223
+ }, "build");
224
+ return { build, close: /* @__PURE__ */ __name(() => children.close(), "close") };
225
+ }, "allProfilesServer");
226
+ var serveAllProfilesOverStdio = /* @__PURE__ */ __name(async (options, io = {}) => {
227
+ const { build, close } = allProfilesServer(options);
228
+ const own = io.stdin !== void 0 && io.stdin !== process.stdin;
229
+ const wire = answeredWire(io.stdin ?? process.stdin, io.stdout ?? process.stdout);
230
+ const handle = serveStdio(build, {
231
+ transport: new StdioServerTransport(wire.input, wire.output),
232
+ onerror: /* @__PURE__ */ __name((error) => options.note?.(`mcp: ${error.message}`), "onerror")
233
+ });
234
+ const ended = await new Promise((resolve) => {
235
+ wire.ended.then(() => resolve("input"));
236
+ if (own)
237
+ io.signal?.addEventListener("abort", () => resolve("stopped"), { once: true });
238
+ else {
239
+ process.once("SIGINT", () => resolve("stopped"));
240
+ process.once("SIGTERM", () => resolve("stopped"));
241
+ }
242
+ });
243
+ try {
244
+ if (ended === "input")
245
+ await wire.answered();
246
+ wire.release();
247
+ await handle.close();
248
+ } finally {
249
+ await close();
250
+ }
251
+ }, "serveAllProfilesOverStdio");
252
+ var serveAllProfilesOverHttp = /* @__PURE__ */ __name(async (options, http) => {
253
+ const { build, close } = allProfilesServer(options);
254
+ const { serveOverHttp } = await import("./serve-HIJTFAW7.js");
255
+ const listening = await serveOverHttp(build, {
256
+ ...http,
257
+ appName: options.command,
258
+ onError: /* @__PURE__ */ __name((error) => options.note?.(`mcp: ${error.message}`), "onError")
259
+ }).catch(async (error) => {
260
+ await close();
261
+ throw error;
262
+ });
263
+ return {
264
+ url: listening.url,
265
+ close: /* @__PURE__ */ __name(async () => {
266
+ try {
267
+ await listening.close();
268
+ } finally {
269
+ await close();
270
+ }
271
+ }, "close")
272
+ };
273
+ }, "serveAllProfilesOverHttp");
274
+
275
+ export {
276
+ CHILD_IDLE_MS,
277
+ withProfile,
278
+ allProfilesServer,
279
+ serveAllProfilesOverStdio,
280
+ serveAllProfilesOverHttp
281
+ };
@@ -0,0 +1,122 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ unit
5
+ } from "./chunk-CLMXBW53.js";
6
+ import {
7
+ CliError
8
+ } from "./chunk-AE4BOXH7.js";
9
+ import {
10
+ __name
11
+ } from "./chunk-ZVVMGPBJ.js";
12
+
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/embeddings/remote.js
14
+ import { setTimeout } from "node:timers/promises";
15
+ var OPENAI_URL = "https://api.openai.com/v1";
16
+ var OPENAI_MODELS = {
17
+ "text-embedding-3-small": { dims: 1536, perMillion: 0.02 },
18
+ "text-embedding-3-large": { dims: 3072, perMillion: 0.13 }
19
+ };
20
+ var DEFAULT_OPENAI_MODEL = "text-embedding-3-small";
21
+ var PER_REQUEST = 256;
22
+ var LOCAL = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]", "::1"]);
23
+ var isLocal = /* @__PURE__ */ __name((baseUrl) => LOCAL.has(new URL(baseUrl).hostname), "isLocal");
24
+ var remoteModel = /* @__PURE__ */ __name(({ model = DEFAULT_OPENAI_MODEL, baseUrl, dims }) => {
25
+ const known = baseUrl === void 0 ? OPENAI_MODELS[model] : void 0;
26
+ if (baseUrl === void 0 && !known) {
27
+ throw new CliError("validation_error", `OpenAI has no embedding model ${model} here \u2014 one of: ${Object.keys(OPENAI_MODELS).join(", ")}; another server takes --base-url`);
28
+ }
29
+ const size = dims ?? known?.dims;
30
+ if (size === void 0)
31
+ throw new CliError("validation_error", "with --base-url, say the vector size with --dims");
32
+ return {
33
+ provider: baseUrl === void 0 ? "openai" : `url:${new URL(baseUrl).host}`,
34
+ model,
35
+ dims: size,
36
+ baseUrl: baseUrl ?? OPENAI_URL,
37
+ shorten: known !== void 0 && size !== known.dims,
38
+ ...known ? { price: { perMillion: known.perMillion, read: "2026-10-02" } } : {}
39
+ };
40
+ }, "remoteModel");
41
+ var remoteKey = /* @__PURE__ */ __name(({ provider, model, dims }) => `${provider}:${model}:${dims}`, "remoteKey");
42
+ var openRemote = /* @__PURE__ */ __name((remote, apiKey, { concurrency = 4, fetch: post = fetch, tries = 5 } = {}) => {
43
+ const request = /* @__PURE__ */ __name(async (input) => {
44
+ for (let attempt = 1; ; attempt++) {
45
+ let response;
46
+ try {
47
+ response = await post(`${remote.baseUrl.replace(/\/$/, "")}/embeddings`, {
48
+ method: "POST",
49
+ headers: {
50
+ "content-type": "application/json",
51
+ ...apiKey ? { authorization: `Bearer ${apiKey}` } : {}
52
+ },
53
+ body: JSON.stringify({
54
+ model: remote.model,
55
+ input,
56
+ encoding_format: "float",
57
+ ...remote.shorten ? { dimensions: remote.dims } : {}
58
+ })
59
+ });
60
+ } catch {
61
+ if (attempt >= tries)
62
+ throw new CliError("network_error", `${remote.provider} could not be reached`);
63
+ await setTimeout(1e3 * attempt);
64
+ continue;
65
+ }
66
+ if (response.ok) {
67
+ const body = await response.json();
68
+ const data = [...body.data ?? []].sort((a, b) => a.index - b.index);
69
+ if (data.length !== input.length || data.some(({ embedding }) => embedding.length !== remote.dims)) {
70
+ throw new CliError("invalid_response", `${remote.provider} answered with vectors of another number or size than ${input.length} \xD7 ${remote.dims}`);
71
+ }
72
+ return data.map(({ embedding }) => unit(Float32Array.from(embedding)));
73
+ }
74
+ const code = await errorCode(response);
75
+ if (response.status === 401 || response.status === 403) {
76
+ throw new CliError("authentication_error", `${remote.provider} refused the key (HTTP ${response.status}${code}) \u2014 set it again with \`models keys set\``);
77
+ }
78
+ const again = response.status === 429 || response.status >= 500;
79
+ if (!again || attempt >= tries) {
80
+ throw new CliError(response.status === 429 ? "rate_limited" : "provider_error", `${remote.provider} answered HTTP ${response.status}${code}`);
81
+ }
82
+ const wait = Number(response.headers.get("retry-after"));
83
+ await setTimeout(Number.isFinite(wait) && wait > 0 ? wait * 1e3 : 1e3 * 2 ** attempt);
84
+ }
85
+ }, "request");
86
+ return {
87
+ model: { id: remote.model, dims: remote.dims },
88
+ embed: /* @__PURE__ */ __name(async (texts) => {
89
+ const parts = [];
90
+ for (let start = 0; start < texts.length; start += PER_REQUEST)
91
+ parts.push(texts.slice(start, start + PER_REQUEST));
92
+ const results = new Array(parts.length);
93
+ let next = 0;
94
+ await Promise.all(Array.from({ length: Math.min(concurrency, parts.length) }, async () => {
95
+ for (let index = next++; index < parts.length; index = next++)
96
+ results[index] = await request(parts[index]);
97
+ }));
98
+ return results.flat();
99
+ }, "embed"),
100
+ close: /* @__PURE__ */ __name(async () => {
101
+ }, "close")
102
+ };
103
+ }, "openRemote");
104
+ var errorCode = /* @__PURE__ */ __name(async (response) => {
105
+ try {
106
+ const body = await response.json();
107
+ const code = body.error?.code ?? body.error?.type;
108
+ return typeof code === "string" && /^[\w.-]{1,64}$/.test(code) ? `, ${code}` : "";
109
+ } catch {
110
+ return "";
111
+ }
112
+ }, "errorCode");
113
+
114
+ export {
115
+ OPENAI_URL,
116
+ OPENAI_MODELS,
117
+ DEFAULT_OPENAI_MODEL,
118
+ isLocal,
119
+ remoteModel,
120
+ remoteKey,
121
+ openRemote
122
+ };
@@ -0,0 +1,138 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ CliError
5
+ } from "./chunk-AE4BOXH7.js";
6
+ import {
7
+ __name
8
+ } from "./chunk-ZVVMGPBJ.js";
9
+
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/tasks/model.js
11
+ var TASK_KINDS = ["question", "request", "mention", "promise"];
12
+ var TASK_STATES = ["open", "done", "dismissed"];
13
+ var TASK_ORIGINS = ["rule", "agent", "owner"];
14
+ var TASK_VERDICTS = ["useful", "not_useful"];
15
+ function closeTask(task, state, by, at, reason) {
16
+ if (task.state !== "open")
17
+ throw new CliError("validation_error", `task ${task.id} is already ${task.state}`, { reason: "task.closed" });
18
+ const { claimedBy: _by, claimedUntil: _until, ...unclaimed } = task;
19
+ return { ...unclaimed, state, closedAt: at, closedBy: by, ...reason === void 0 ? {} : { reason } };
20
+ }
21
+ __name(closeTask, "closeTask");
22
+
23
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/tasks/service.js
24
+ function createTaskService({ store, now = /* @__PURE__ */ __name(() => /* @__PURE__ */ new Date(), "now"), newId = /* @__PURE__ */ __name(() => crypto.randomUUID(), "newId") }) {
25
+ async function find(id) {
26
+ const task = await store.get(id);
27
+ if (!task)
28
+ throw new CliError("not_found", `no task ${id}`);
29
+ return task;
30
+ }
31
+ __name(find, "find");
32
+ return {
33
+ /**
34
+ * A rule never makes a second task from a source it has seen, whatever that task's state, so a
35
+ * dismissed one stays dismissed — nor from a message attached or merged into a task. A person or an agent may
36
+ * add a task of another kind to it. A task a rule opens goes through the host's duplicate check.
37
+ */
38
+ async add(input) {
39
+ const rule = input.origin === "rule";
40
+ const existing = await store.findBySource(input.account, input.source, rule ? { linked: true } : void 0);
41
+ const same = rule ? existing[0] : existing.find((task2) => task2.kind === input.kind);
42
+ if (same)
43
+ return { task: same, created: false };
44
+ const task = { ...input, id: newId(), state: "open", createdAt: now() };
45
+ await store.insert(task);
46
+ if (!rule || !store.reviewDuplicates)
47
+ return { task, created: true };
48
+ return { task, created: true, review: await store.reviewDuplicates(task.id) };
49
+ },
50
+ async close(id, { as, by, reason }) {
51
+ const task = closeTask(await find(id), as, by, now(), reason);
52
+ await store.update(task);
53
+ return task;
54
+ },
55
+ list: /* @__PURE__ */ __name((filter = {}) => store.list(filter), "list"),
56
+ async stats(filter = {}) {
57
+ const byGroup = /* @__PURE__ */ new Map();
58
+ for (const task of await store.list(filter))
59
+ byGroup.set(task.group, [...byGroup.get(task.group) ?? [], task]);
60
+ return [...byGroup].map(([group, tasks]) => {
61
+ const open = tasks.filter((task) => task.state === "open");
62
+ const closeMs = tasks.flatMap((task) => task.closedAt ? [task.closedAt.getTime() - task.createdAt.getTime()] : []);
63
+ const oldestOpenAt = open.map((task) => task.createdAt).sort((a, b) => a.getTime() - b.getTime())[0];
64
+ return {
65
+ group,
66
+ open: open.length,
67
+ ...oldestOpenAt ? { oldestOpenAt } : {},
68
+ ...closeMs.length > 0 ? { medianCloseMs: median(closeMs) } : {}
69
+ };
70
+ });
71
+ }
72
+ };
73
+ }
74
+ __name(createTaskService, "createTaskService");
75
+ function median(values) {
76
+ const sorted = [...values].sort((a, b) => a - b);
77
+ const middle = Math.floor(sorted.length / 2);
78
+ const upper = sorted[middle] ?? 0;
79
+ return sorted.length % 2 === 1 ? upper : ((sorted[middle - 1] ?? 0) + upper) / 2;
80
+ }
81
+ __name(median, "median");
82
+
83
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/tasks/store.js
84
+ function matches(task, filter) {
85
+ return (filter.account === void 0 || task.account === filter.account) && (filter.state === void 0 || task.state === filter.state) && (filter.group === void 0 || task.group === filter.group) && (filter.kind === void 0 || task.kind === filter.kind) && (filter.createdBefore === void 0 || task.createdAt < filter.createdBefore);
86
+ }
87
+ __name(matches, "matches");
88
+
89
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/domain/knowledge.js
90
+ var FACT_TYPES = ["fact", "statement", "question", "decision", "promise"];
91
+ var FACT_STATUSES = ["proposed", "accepted", "superseded", "reversed"];
92
+ var MEMORY_KINDS = ["summary", "digest", "preference"];
93
+ var MEMORY_STATUSES = ["proposed", "confirmed", "stale", "superseded"];
94
+ var MEMORY_SCOPES = ["personal", "work"];
95
+ var WORK_TASK_TYPES = ["bug", "feature", "chore"];
96
+ var TASK_TYPES = [...WORK_TASK_TYPES, ...TASK_KINDS];
97
+
98
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/store/sqlite/link-kinds.js
99
+ var LINK_KINDS = [
100
+ "links-to",
101
+ "blocked-by",
102
+ "follow-up-of",
103
+ "about",
104
+ "member-of",
105
+ "labelled",
106
+ "answered-by",
107
+ "evidence",
108
+ "created-from",
109
+ "duplicate-of",
110
+ "related-to",
111
+ "assigned-to",
112
+ "attached"
113
+ ];
114
+ var LINK_ORIGINS = ["file", "owner", "suggested", "message"];
115
+ var LINK_SOURCES = [...LINK_ORIGINS, "calendar"];
116
+ var RELATION_KINDS = ["member-of", "related-to"];
117
+ var linkKind = /* @__PURE__ */ __name((kind) => `'${kind}'`, "linkKind");
118
+
119
+ export {
120
+ LINK_KINDS,
121
+ LINK_ORIGINS,
122
+ LINK_SOURCES,
123
+ RELATION_KINDS,
124
+ linkKind,
125
+ TASK_KINDS,
126
+ TASK_STATES,
127
+ TASK_ORIGINS,
128
+ TASK_VERDICTS,
129
+ createTaskService,
130
+ matches,
131
+ FACT_TYPES,
132
+ FACT_STATUSES,
133
+ MEMORY_KINDS,
134
+ MEMORY_STATUSES,
135
+ MEMORY_SCOPES,
136
+ WORK_TASK_TYPES,
137
+ TASK_TYPES
138
+ };
@@ -0,0 +1,17 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ resolvePaths
5
+ } from "./chunk-AE4BOXH7.js";
6
+ import {
7
+ __name
8
+ } from "./chunk-ZVVMGPBJ.js";
9
+
10
+ // dist/folders.js
11
+ var loginService = /* @__PURE__ */ __name((configDir) => `zoom-cli:${configDir}`, "loginService");
12
+ var zmPaths = /* @__PURE__ */ __name((options = {}) => resolvePaths({ appName: "zm", ...options }), "zmPaths");
13
+
14
+ export {
15
+ loginService,
16
+ zmPaths
17
+ };