@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,433 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ isCliFailure
5
+ } from "./chunk-A6323R5P.js";
6
+ import {
7
+ isContentKey
8
+ } from "./chunk-YIMI6O7R.js";
9
+ import {
10
+ __name
11
+ } from "./chunk-ZVVMGPBJ.js";
12
+
13
+ // 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/runs/events.js
14
+ var providerErrorKey = /* @__PURE__ */ __name((value) => typeof value === "string" && /^[A-Za-z][A-Za-z0-9._-]{0,63}$/.test(value) ? value : void 0, "providerErrorKey");
15
+ var renderEvent = /* @__PURE__ */ __name((event) => {
16
+ if (event.event === "warning") {
17
+ const counts = Object.entries(event.counts ?? {}).map(([field, count]) => `${count} ${field}`);
18
+ return [`${MARK.warning} ${(event.operation ?? "").padEnd(16)} ${event.code}`, ...counts, event.detail].filter(Boolean).join(" ");
19
+ }
20
+ const parts = [];
21
+ if (event.event === "cache") {
22
+ parts.push(event.reason);
23
+ if (event.ageMs !== void 0)
24
+ parts.push(`cached ${age(event.ageMs)}`);
25
+ } else {
26
+ if (event.opcode !== void 0)
27
+ parts.push(`op ${event.opcode}`, `seq ${event.seq}`);
28
+ if (event.method !== void 0 || event.endpointTemplate !== void 0)
29
+ parts.push([event.method, event.endpointTemplate].filter(Boolean).join(" "));
30
+ if (event.status !== void 0)
31
+ parts.push(`${event.status}`);
32
+ if (event.attempt !== void 0 && event.attempt > 1)
33
+ parts.push(`attempt ${event.attempt}`);
34
+ if (event.waitMs !== void 0)
35
+ parts.push(`waited ${age(event.waitMs)}`);
36
+ }
37
+ if (event.ids)
38
+ for (const [name, value] of Object.entries(event.ids))
39
+ parts.push(`${name} ${value}`);
40
+ if (event.event !== "cache") {
41
+ if (event.durationMs !== void 0)
42
+ parts.push(`${event.durationMs}ms`);
43
+ if (event.bytes !== void 0)
44
+ parts.push(size(event.bytes));
45
+ }
46
+ if (event.counts)
47
+ for (const [field, count] of Object.entries(event.counts))
48
+ parts.push(`${count} ${field}`);
49
+ if (event.event !== "cache") {
50
+ if (event.errorCode)
51
+ parts.push(event.errorCode);
52
+ if (event.providerError)
53
+ parts.push(event.providerError);
54
+ }
55
+ return `${MARK[event.event]} ${event.operation.padEnd(16)} ${parts.join(" ")}`.trimEnd();
56
+ }, "renderEvent");
57
+ var MARK = { request: "\u2192", response: "\u2190", cache: "\u2022", warning: "!" };
58
+ var age = /* @__PURE__ */ __name((ms) => ms < 1e3 ? `${ms}ms` : `${Math.round(ms / 1e3)}s`, "age");
59
+ var size = /* @__PURE__ */ __name((bytes) => bytes < 1e3 ? `${bytes} B` : `${(bytes / 1e3).toFixed(1)} kB`, "size");
60
+
61
+ // 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/runs/run-context.js
62
+ import { AsyncLocalStorage } from "node:async_hooks";
63
+ import { createHash } from "node:crypto";
64
+
65
+ // 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/runs/error-detail.js
66
+ import { homedir } from "node:os";
67
+
68
+ // 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/runs/secrets.js
69
+ var SECRET_WORDS = /* @__PURE__ */ new Set([
70
+ "authorization",
71
+ "cookie",
72
+ "credential",
73
+ "credentials",
74
+ "passphrase",
75
+ "password",
76
+ "passwd",
77
+ "pwd",
78
+ "pass",
79
+ "passcode",
80
+ "pin",
81
+ "otp",
82
+ "2fa",
83
+ "secret",
84
+ "token",
85
+ "contrase\xF1a",
86
+ "contrasena",
87
+ "clave",
88
+ "\u043F\u0430\u0440\u043E\u043B\u044C",
89
+ "\u043F\u0438\u043D",
90
+ "\u043A\u043E\u0434",
91
+ ...["api", "auth", "service", "account", "db", "database", "priv", "private", "client"].map((word) => `${word}key`),
92
+ ...["db", "database", "key"].map((word) => `${word}pass`)
93
+ ]);
94
+ var secretNamed = /* @__PURE__ */ __name((name) => {
95
+ const words = name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[\s_.-]+/).map((word) => word.toLowerCase());
96
+ return words.some((word, at) => SECRET_WORDS.has(word) || SECRET_WORDS.has(word + (words[at + 1] ?? "")));
97
+ }, "secretNamed");
98
+ var START = "(?<![A-Za-z0-9_-])";
99
+ var END = "(?![A-Za-z0-9_-])";
100
+ var KNOWN_TOKENS = new RegExp(`${[
101
+ "gh[pousr]_[A-Za-z0-9]{36,}",
102
+ "github_pat_[A-Za-z0-9_]{22,}",
103
+ "sk-[A-Za-z0-9_-]{20,}",
104
+ "xox[abprs]-[A-Za-z0-9-]{10,}",
105
+ "(?:AKIA|ASIA)[A-Z0-9]{16}",
106
+ "AIza[A-Za-z0-9_-]{35}",
107
+ "(?:sk|rk)_(?:live|test)_[A-Za-z0-9]{10,}",
108
+ "npm_[A-Za-z0-9]{36}",
109
+ "eyJ[A-Za-z0-9_-]{5,}\\.eyJ[A-Za-z0-9_-]{5,}\\.[A-Za-z0-9_-]*"
110
+ ].map((pattern) => `${START}${pattern}${END}`).join("|")}|(?<!\\d)\\d{8,10}:[A-Za-z0-9_-]{35}${END}`, "g");
111
+ var PRIVATE_KEY = /-----BEGIN[A-Z ]* PRIVATE KEY-----[\s\S]*?(?:-----END[A-Z ]* PRIVATE KEY-----|$)/g;
112
+ var SCHEME = /(?<![A-Za-z])(Bearer|Basic)(\s+)(?![A-Z]?[a-z]+(?![A-Za-z0-9]))[A-Za-z0-9._~+/=-]{8,}/g;
113
+ var NAMED_PAIR = /(?<![\p{L}\p{N}])([\p{L}\p{N}_.-]*(?:token|pass|pwd|pin|otp|2fa|secret|credential|cookie|authorization|key|contrase|clave|пароль|пин|код)[\p{L}\p{N}_.-]*)(["']?\s*(?:=>|[:=])\s*["']?|\s+(?![\p{L}]+(?![\p{L}\p{N}])))((?:Bearer\s+|Basic\s+)?)([^\s"'&,;]+)/giu;
114
+ var looksRandom = /* @__PURE__ */ __name((run) => {
115
+ if (run.length < 20)
116
+ return false;
117
+ const classes = [/[a-z]/, /[A-Z]/, /\d/, /[^A-Za-z0-9]/].filter((kind) => kind.test(run)).length;
118
+ if (classes < 3)
119
+ return false;
120
+ let switches = 0;
121
+ for (let at = 1; at < run.length; at++) {
122
+ const [before, after] = [run[at - 1], run[at]];
123
+ if (/[a-z]/.test(before) && /[A-Z]/.test(after) || /[A-Z]/.test(before) && /[a-z]/.test(after))
124
+ switches += 1;
125
+ }
126
+ if (switches / run.length < 0.15)
127
+ return false;
128
+ const pieces = run.match(/[A-Z]?[a-z]+|[A-Z]+(?![a-z])|\d+/g) ?? [];
129
+ if (pieces.join("").length / Math.max(pieces.length, 1) >= 2.75)
130
+ return false;
131
+ return entropy(run) >= 3.5;
132
+ }, "looksRandom");
133
+ var entropy = /* @__PURE__ */ __name((text) => {
134
+ const counts = /* @__PURE__ */ new Map();
135
+ for (const char of text)
136
+ counts.set(char, (counts.get(char) ?? 0) + 1);
137
+ let bits = 0;
138
+ for (const count of counts.values())
139
+ bits -= count / text.length * Math.log2(count / text.length);
140
+ return bits;
141
+ }, "entropy");
142
+ var withoutSecrets = /* @__PURE__ */ __name((text, mark = "[redacted]") => text.replace(PRIVATE_KEY, mark).replace(KNOWN_TOKENS, mark).replace(SCHEME, `$1$2${mark}`).replace(NAMED_PAIR, (whole, name, separator, scheme) => secretNamed(name) ? `${name}${separator}${scheme}${mark}` : whole).replace(/[!-~]{20,}/g, (token) => (
143
+ // A URL or a path is somebody's address, not a key; a credential in one is caught by the rules above.
144
+ token.includes("://") || /^(?:\/|~\/|\.\.?\/)/.test(token) ? token : token.replace(RUN, (run) => looksRandom(run) ? mark : run.replace(HEX, (hex) => entropy(hex) >= 3 ? mark : hex))
145
+ )), "withoutSecrets");
146
+ var RUN = /(?<![A-Za-z0-9_+/-])[A-Za-z0-9_+/-]{20,}/g;
147
+ var HEX = /(?<![A-Za-z0-9])(?=[0-9]*[a-f])[0-9a-f]{20,}(?![A-Za-z0-9])/g;
148
+
149
+ // 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/runs/error-detail.js
150
+ var MESSAGE_AT_MOST = 500;
151
+ var CAUSES_AT_MOST = 5;
152
+ var FRAMES_AT_MOST = 15;
153
+ var errorDetailOf = /* @__PURE__ */ __name((error, response) => {
154
+ const details = isCliFailure(error) ? { ...error.details } : {};
155
+ const thrown = error instanceof Error ? error : void 0;
156
+ const code = isCliFailure(error) ? error.code : codeOf(error);
157
+ const reason = typeof details.reason === "string" ? details.reason : void 0;
158
+ const causeCode = typeof details.cause_code === "string" && /^[A-Za-z0-9_.-]{1,40}$/.test(details.cause_code) ? details.cause_code : void 0;
159
+ const message = thrown ? redactText(thrown.message) : void 0;
160
+ const operation = stringOf(details.operation) ?? response?.operation;
161
+ const status = numberOf(details.status) ?? response?.status;
162
+ const method = stringOf(details.method) ?? response?.method;
163
+ const endpoint = stringOf(details.endpoint) ?? response?.endpointTemplate;
164
+ const key = providerErrorKey(details.provider_error) ?? providerErrorKey(response?.providerError);
165
+ const protocol = key !== void 0 && method === void 0 && endpoint === void 0;
166
+ const http = method !== void 0 || endpoint !== void 0 || status !== void 0 && !protocol ? {
167
+ ...method === void 0 ? {} : { method: method.toUpperCase().slice(0, 16) },
168
+ ...endpoint === void 0 ? {} : { endpoint_template: endpointTemplate(endpoint) },
169
+ ...status === void 0 ? {} : { status }
170
+ } : void 0;
171
+ const causes = causesOf(thrown?.cause ?? details.cause);
172
+ const stack = framesOf(thrown);
173
+ return {
174
+ class: classOf(error),
175
+ ...code === void 0 ? {} : { code },
176
+ ...reason === void 0 ? {} : { reason },
177
+ ...causeCode === void 0 ? {} : { cause_code: causeCode },
178
+ ...message ? { message } : {},
179
+ ...operation === void 0 ? {} : { operation },
180
+ ...http ? { http } : {},
181
+ ...key === void 0 ? {} : { provider: { key, ...protocol && status !== void 0 ? { code: status } : {} } },
182
+ ...causes.length > 0 ? { causes } : {},
183
+ ...stack.length > 0 ? { stack } : {}
184
+ };
185
+ }, "errorDetailOf");
186
+ var stringOf = /* @__PURE__ */ __name((value) => typeof value === "string" && value.trim() !== "" ? value.trim() : void 0, "stringOf");
187
+ var numberOf = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isInteger(value) ? value : void 0, "numberOf");
188
+ var classOf = /* @__PURE__ */ __name((error) => {
189
+ if (!(error instanceof Error))
190
+ return error === null ? "null" : typeof error;
191
+ const constructed = error.constructor?.name;
192
+ return constructed && constructed !== "Error" && constructed !== error.name ? constructed : error.name;
193
+ }, "classOf");
194
+ var codeOf = /* @__PURE__ */ __name((error) => {
195
+ const code = error?.code;
196
+ return typeof code === "string" && /^[A-Za-z][A-Za-z0-9._-]{0,63}$/.test(code) ? code : void 0;
197
+ }, "codeOf");
198
+ var causesOf = /* @__PURE__ */ __name((first) => {
199
+ const causes = [];
200
+ const seen = /* @__PURE__ */ new Set();
201
+ for (let cause = first; cause !== void 0 && cause !== null && causes.length < CAUSES_AT_MOST; ) {
202
+ if (seen.has(cause))
203
+ break;
204
+ seen.add(cause);
205
+ const message = cause instanceof Error ? redactText(cause.message) : void 0;
206
+ causes.push({ class: classOf(cause), ...message ? { message } : {} });
207
+ cause = cause instanceof Error ? cause.cause : void 0;
208
+ }
209
+ return causes;
210
+ }, "causesOf");
211
+ var framesOf = /* @__PURE__ */ __name((error, limit = FRAMES_AT_MOST) => {
212
+ const stack = error instanceof Error && typeof error.stack === "string" ? error.stack : "";
213
+ return stack.split("\n").filter((line) => line.trimStart().startsWith("at ")).flatMap((line) => {
214
+ const match = /^\s*at (?:async )?(?:(.+?) \()?(.+?):(\d+):\d+\)?$/.exec(line);
215
+ if (!match)
216
+ return [];
217
+ const [, fn, path = "", lineNumber] = match;
218
+ if (path.startsWith("node:"))
219
+ return [];
220
+ return [`${fn ?? "<anonymous>"} ${fileOf(path)}:${lineNumber}`];
221
+ }).slice(0, limit);
222
+ }, "framesOf");
223
+ var fileOf = /* @__PURE__ */ __name((path) => {
224
+ const plain = path.replace(/^file:\/\//, "");
225
+ const packaged = /\/node_modules\/((?:@[^/]+\/)?[^/]+\/.+)$/.exec(plain)?.[1];
226
+ if (packaged)
227
+ return packaged.replace(/\/(?:dist|src)\//, "/");
228
+ return /(?:^|\/)(?:dist|src)\/(.+)$/.exec(plain)?.[1] ?? plain.split("/").at(-1) ?? "?";
229
+ }, "fileOf");
230
+ var endpointTemplate = /* @__PURE__ */ __name((raw) => {
231
+ const trimmed = raw.trim().split(/[?#]/)[0] ?? "";
232
+ const origin = /^[a-z][a-z0-9+.-]*:\/\/(?:[^@/]*@)?([^/]*)/i.exec(trimmed);
233
+ const path = origin ? trimmed.slice(origin[0].length) : trimmed;
234
+ const scheme = origin ? `${trimmed.slice(0, trimmed.indexOf("://"))}://${origin[1]}` : "";
235
+ const segments = path.split("/").map((segment) => {
236
+ if (segment === "" || /^[:{].+/.test(segment))
237
+ return segment;
238
+ if (/^bot\d+:/.test(segment) || /^\d{6,}:[\w-]{20,}$/.test(segment))
239
+ return ":token";
240
+ if (/^-?\d+$/.test(segment) || /^[0-9a-f-]{16,}$/i.test(segment))
241
+ return ":id";
242
+ if (!/^[A-Za-z0-9._~-]{1,40}$/.test(segment))
243
+ return ":value";
244
+ return segment;
245
+ });
246
+ return `${scheme}${segments.join("/")}`.slice(0, 300);
247
+ }, "endpointTemplate");
248
+ var INTERNATIONAL_PHONE = /\+\d[\d\s()-]{6,}\d/.source;
249
+ var BARE_PHONE = /(^|[^\w-])\d{11,15}\b/.source;
250
+ var redactText = /* @__PURE__ */ __name((text) => {
251
+ const home = homedir();
252
+ let out = home && home !== "/" ? text.split(home).join("~") : text;
253
+ out = withoutSecrets(out.replace(/"[^"\n]*"|“[^”\n]*”|«[^»\n]*»/g, '"[redacted]"')).replace(/\b(bearer|basic|token|key|password|secret)(\s*[:=]\s*|\s+)[^\s'"]+/gi, "$1$2[redacted]").replace(/[\w.+-]+@[\w-]+\.[\w.-]+/g, "[email]").replace(new RegExp(INTERNATIONAL_PHONE, "g"), "[number]").replace(new RegExp(BARE_PHONE, "g"), "$1[number]").replace(/\bbot\d+:[\w-]+/g, "bot[token]").replace(/\b\d{6,}:[\w-]{20,}\b/g, "[token]").replace(/(\?|&)[^\s#]*/g, "$1[redacted]").replace(/\b[A-Za-z0-9_-]{40,}\b/g, "[redacted]");
254
+ return out.length > MESSAGE_AT_MOST ? `${out.slice(0, MESSAGE_AT_MOST)}\u2026` : out;
255
+ }, "redactText");
256
+
257
+ // 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/runs/run-context.js
258
+ var REDACTED = "[redacted]";
259
+ var keepsSuccess = /* @__PURE__ */ __name(({ record, fromFlag, env, caller, persistent = false }) => {
260
+ if (!record)
261
+ return false;
262
+ if (fromFlag)
263
+ return true;
264
+ if (persistent)
265
+ return false;
266
+ return caller !== void 0 || viaOf(env) !== "desktop";
267
+ }, "keepsSuccess");
268
+ var calls = new AsyncLocalStorage();
269
+ var withCaller = /* @__PURE__ */ __name((caller, work) => calls.run(caller, work), "withCaller");
270
+ var currentCaller = /* @__PURE__ */ __name(() => calls.getStore(), "currentCaller");
271
+ var clientHash = /* @__PURE__ */ __name((id) => createHash("sha256").update(id).digest("hex").slice(0, 8), "clientHash");
272
+ var viaOf = /* @__PURE__ */ __name((env) => env.WIRECAT_CALLER?.trim() === "desktop" ? "desktop" : "cli", "viaOf");
273
+ var agentOf = /* @__PURE__ */ __name((env) => {
274
+ const named = env.AI_AGENT?.trim().split("_")[0];
275
+ const kind = (named && plainWord(named) ? named.toLowerCase() : void 0) ?? (env.CLAUDECODE ? "claude-code" : void 0) ?? (env.CODEX_THREAD_ID || env.CODEX_SESSION_ID || env.CODEX_SANDBOX ? "codex" : void 0) ?? (env.GEMINI_CLI ? "gemini-cli" : void 0) ?? (env.OPENCODE ? "opencode" : void 0) ?? (env.CURSOR_AGENT ? "cursor" : void 0) ?? // Only `exec` is the agent's own command: OpenClaw also sets `tui-local` for what the owner types in its TUI.
276
+ (env.OPENCLAW_SHELL?.trim() === "exec" ? "openclaw" : void 0);
277
+ if (!kind)
278
+ return void 0;
279
+ const session = sessionOf(kind, env);
280
+ return {
281
+ kind,
282
+ session_id: session && SESSION.test(session) ? session : null,
283
+ // OpenClaw passes the sender and chat ids of a chat-started run in this variable; only its presence is kept.
284
+ ...kind === "openclaw" && env.OPENCLAW_CHANNEL_CONTEXT?.trim() ? { from_chat: true } : {}
285
+ };
286
+ }, "agentOf");
287
+ var SESSION = /^[A-Za-z0-9._:-]{1,128}$/;
288
+ var SESSION_VARIABLE = {
289
+ "claude-code": "CLAUDE_CODE_SESSION_ID",
290
+ codex: "CODEX_THREAD_ID",
291
+ opencode: "OPENCODE_SESSION_ID",
292
+ "hermes-agent": "HERMES_SESSION_ID"
293
+ };
294
+ var sessionOf = /* @__PURE__ */ __name((kind, env) => {
295
+ const variable = SESSION_VARIABLE[kind];
296
+ return (variable === void 0 ? void 0 : env[variable]?.trim()) || void 0;
297
+ }, "sessionOf");
298
+ var plainWord = /* @__PURE__ */ __name((word) => /^[A-Za-z][A-Za-z0-9.-]{0,39}$/.test(word), "plainWord");
299
+ var secretInputs = /* @__PURE__ */ new WeakSet();
300
+ var secretInput = /* @__PURE__ */ __name((input) => {
301
+ secretInputs.add(input);
302
+ return input;
303
+ }, "secretInput");
304
+ var secretShaped = /* @__PURE__ */ __name((word) => /:\/\/[^/@\s:]+:[^/@\s]+@/.test(word) || /(^|[^A-Za-z0-9_-])[A-Za-z0-9_-]{40,}($|[^A-Za-z0-9_-])/.test(word), "secretShaped");
305
+ var withoutPhones = /* @__PURE__ */ __name((word) => word.replace(new RegExp(INTERNATIONAL_PHONE, "g"), REDACTED).replace(new RegExp(BARE_PHONE, "g"), `$1${REDACTED}`), "withoutPhones");
306
+ var maskArgv = /* @__PURE__ */ __name((program, words, { keep = false } = {}) => {
307
+ const argv = [];
308
+ let unknownCommand;
309
+ let current = program;
310
+ let positional = 0;
311
+ let profileSeen = false;
312
+ let lost = false;
313
+ const raw = /* @__PURE__ */ __name((word) => keep && !secretShaped(word) ? withoutPhones(withoutSecrets(word, REDACTED)) : REDACTED, "raw");
314
+ const keptValue = /* @__PURE__ */ __name((name, value, input) => keep ? input && secretInputs.has(input) || secretNamed(name) ? REDACTED : raw(value) : maskedValue(name, value, input?.argChoices), "keptValue");
315
+ const optionFor = /* @__PURE__ */ __name((flag) => {
316
+ for (let at = current; at; at = at.parent) {
317
+ const found = at.options.find((option) => option.long === flag || option.short === flag);
318
+ if (found)
319
+ return found;
320
+ }
321
+ return void 0;
322
+ }, "optionFor");
323
+ for (let at = 0; at < words.length; at++) {
324
+ const word = words[at];
325
+ if (word === "--") {
326
+ argv.push("--");
327
+ for (let after = at + 1; after < words.length; after++)
328
+ argv.push(raw(words[after]));
329
+ break;
330
+ }
331
+ if (word.startsWith("-") && word.length > 1 && !NUMBER.test(word)) {
332
+ const equals = word.indexOf("=");
333
+ const flag = equals > 0 ? word.slice(0, equals) : word;
334
+ if (!/^--?[A-Za-z0-9][A-Za-z0-9-]*$/.test(flag)) {
335
+ argv.push(raw(word));
336
+ continue;
337
+ }
338
+ const option = optionFor(flag);
339
+ const name = option?.attributeName() ?? flag.replace(/^-+/, "");
340
+ if (equals > 0) {
341
+ argv.push(`${flag}=${keptValue(name, word.slice(equals + 1), option)}`);
342
+ continue;
343
+ }
344
+ argv.push(flag);
345
+ if (!option && keep && secretNamed(name) && words[at + 1] !== void 0 && !words[at + 1]?.startsWith("-")) {
346
+ at += 1;
347
+ argv.push(REDACTED);
348
+ continue;
349
+ }
350
+ if (!option || !(option.required || option.optional))
351
+ continue;
352
+ const takes = /* @__PURE__ */ __name((next) => next !== void 0 && (option.required || !next.startsWith("-") || NUMBER.test(next)), "takes");
353
+ if (takes(words[at + 1])) {
354
+ at += 1;
355
+ argv.push(keptValue(name, words[at], option));
356
+ while (option.variadic && words[at + 1] !== void 0 && !words[at + 1].startsWith("-")) {
357
+ at += 1;
358
+ argv.push(keptValue(name, words[at], option));
359
+ }
360
+ }
361
+ continue;
362
+ }
363
+ if (!lost && positional === 0) {
364
+ const sub = current.commands.find((one) => one.name() === word || one.aliases().includes(word));
365
+ if (sub) {
366
+ argv.push(word);
367
+ current = sub;
368
+ continue;
369
+ }
370
+ if (current === program && !profileSeen) {
371
+ profileSeen = true;
372
+ argv.push(keep ? raw(word) : PROFILE.test(word) && withoutPhones(withoutSecrets(word)) === word ? word : REDACTED);
373
+ continue;
374
+ }
375
+ if (current.commands.length > 0 && current.registeredArguments.length === 0) {
376
+ lost = true;
377
+ unknownCommand = commandLike(word);
378
+ argv.push(keep ? raw(word) : unknownCommand);
379
+ continue;
380
+ }
381
+ }
382
+ const declared = lost ? void 0 : current.registeredArguments;
383
+ const argument = declared?.[Math.min(positional, declared.length - 1)];
384
+ positional += 1;
385
+ argv.push(secretInputs.has(current) ? REDACTED : argument ? keptValue(argument.name(), word, argument) : raw(word));
386
+ }
387
+ return { argv, ...unknownCommand === void 0 ? {} : { unknownCommand } };
388
+ }, "maskArgv");
389
+ var NUMBER = /^-?\d+(\.\d+)?$/;
390
+ var PROFILE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
391
+ var commandLike = /* @__PURE__ */ __name((word) => /^[a-z][a-z0-9-]{0,31}$/i.test(word) && withoutSecrets(word) === word ? word : REDACTED, "commandLike");
392
+ var maskedValue = /* @__PURE__ */ __name((name, value, choices) => {
393
+ if (isContentKey(name))
394
+ return REDACTED;
395
+ if (name === "profile")
396
+ return PROFILE.test(value) ? value : REDACTED;
397
+ if (name === "json" || name === "fields")
398
+ return /^[a-z0-9_.,]{1,200}$/.test(value) ? value : REDACTED;
399
+ if (choices?.includes(value))
400
+ return value;
401
+ return safeShape(value) ? value : REDACTED;
402
+ }, "maskedValue");
403
+ var safeShape = /* @__PURE__ */ __name((value) => NUMBER.test(value) && !/^\d{11,}$/.test(value) || /^\d+(ms|s|m|h|d|w)$/.test(value) || /^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/.test(value) || value === "true" || value === "false", "safeShape");
404
+ var runContextOf = /* @__PURE__ */ __name(({ bin, command, program, argv, env, recordInput = false, caller }) => {
405
+ const masked = program && argv ? maskArgv(program, argv, { keep: recordInput === true }) : void 0;
406
+ const ifFailed = program && argv && recordInput === "failed" ? maskArgv(program, argv, { keep: true }) : void 0;
407
+ const agent = caller ? caller.agent : agentOf(env);
408
+ return {
409
+ cliCommand: command ? `${bin} ${command}` : bin,
410
+ ...masked ? { argv: masked.argv } : {},
411
+ ...ifFailed ? { argvIfFailed: ifFailed.argv } : {},
412
+ ...masked?.unknownCommand === void 0 ? {} : { unknownCommand: masked.unknownCommand },
413
+ ...agent ? { agent } : {},
414
+ via: caller?.via ?? viaOf(env),
415
+ ...caller?.mcp ? { mcp: caller.mcp } : {}
416
+ };
417
+ }, "runContextOf");
418
+
419
+ export {
420
+ providerErrorKey,
421
+ renderEvent,
422
+ errorDetailOf,
423
+ framesOf,
424
+ endpointTemplate,
425
+ keepsSuccess,
426
+ withCaller,
427
+ currentCaller,
428
+ clientHash,
429
+ agentOf,
430
+ secretInput,
431
+ maskArgv,
432
+ runContextOf
433
+ };
@@ -0,0 +1,124 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ CliError,
5
+ createRenderer,
6
+ fieldsOf,
7
+ processStreams,
8
+ projectFields,
9
+ singleLine
10
+ } from "./chunk-YIMI6O7R.js";
11
+ import {
12
+ __name
13
+ } from "./chunk-ZVVMGPBJ.js";
14
+
15
+ // 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/result-fields.js
16
+ var named = /* @__PURE__ */ __name((work) => {
17
+ try {
18
+ return work();
19
+ } catch (error) {
20
+ if (error instanceof CliError && error.code === "validation_error")
21
+ throw new CliError("validation_error", "--json takes comma-separated field paths, for example --json=id,text", {
22
+ param: "--json"
23
+ });
24
+ throw error;
25
+ }
26
+ }, "named");
27
+ var fieldsOf2 = /* @__PURE__ */ __name((value) => named(() => fieldsOf(value)), "fieldsOf");
28
+ var projectCommands = /* @__PURE__ */ __name((commands, fields) => commands.map((command) => ({
29
+ ...projectFields(command, fields),
30
+ path: command.path,
31
+ name: command.name,
32
+ origin: command.origin,
33
+ effects: command.effects,
34
+ commands: projectCommands(command.commands, fields)
35
+ })), "projectCommands");
36
+ var projectFields2 = /* @__PURE__ */ __name((value, fields) => named(() => {
37
+ if (value && typeof value === "object" && "cli" in value && typeof value.cli === "string" && "contract" in value && "commands" in value && Array.isArray(value.commands))
38
+ return { ...value, commands: projectCommands(value.commands, fields) };
39
+ return projectFields(value, fields);
40
+ }), "projectFields");
41
+
42
+ // 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/output-detail.js
43
+ var RARELY_SET = ["editedAt", "replyTo", "forwardedFrom", "reactions"];
44
+ var BRIEF = ["locator", "chatTitle", "timestamp", "senderName", "excerpt", "score"];
45
+ var isHit = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && typeof value.locator === "string" && typeof value.text === "string", "isHit");
46
+ var shaped = /* @__PURE__ */ __name((hit, detail) => {
47
+ if (detail === "brief")
48
+ return Object.fromEntries(BRIEF.flatMap((key) => hit[key] === void 0 || hit[key] === null ? [] : [[key, hit[key]]]));
49
+ const { text, providerMetadata, ...rest } = hit;
50
+ for (const key of RARELY_SET)
51
+ if (rest[key] === null)
52
+ delete rest[key];
53
+ const metadata = rest.email ? void 0 : providerMetadata;
54
+ return {
55
+ ...rest,
56
+ ...typeof rest.excerpt === "string" ? {} : { text },
57
+ ...metadata === void 0 ? {} : { providerMetadata: metadata }
58
+ };
59
+ }, "shaped");
60
+ var atDetail = /* @__PURE__ */ __name((value, detail = "default") => {
61
+ if (detail === "full")
62
+ return value;
63
+ if (Array.isArray(value))
64
+ return value.map((item) => isHit(item) ? shaped(item, detail) : item);
65
+ if (isHit(value))
66
+ return shaped(value, detail);
67
+ if (typeof value === "object" && value !== null && Array.isArray(value.items))
68
+ return { ...value, items: atDetail(value.items, detail) };
69
+ return value;
70
+ }, "atDetail");
71
+
72
+ // 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/output.js
73
+ var resolveOutput = /* @__PURE__ */ __name(({ json, jsonl, quiet, streams = processStreams, tty, color, fields, hitDetail, env = process.env, capture } = {}) => {
74
+ const interactive = tty ?? process.stdout.isTTY === true;
75
+ const format = jsonl ? "jsonl" : json || !interactive ? "json" : "pretty";
76
+ const painted = format === "pretty" && (color ?? (env.NO_COLOR === void 0 && env.TERM !== "dumb" && !env.CI));
77
+ const printing = createRenderer({ format, color: painted, streams });
78
+ const rendered = capture ? { ...printing, result: capture, stream: /* @__PURE__ */ __name((items) => capture([...items]), "stream") } : printing;
79
+ const level = hitDetail ?? (fields === void 0 ? "default" : "full");
80
+ const standard = format === "pretty" ? rendered : {
81
+ ...rendered,
82
+ result: /* @__PURE__ */ __name((value) => rendered.result(atDetail(value, level)), "result"),
83
+ stream: /* @__PURE__ */ __name((items) => rendered.stream(atDetail([...items], level)), "stream")
84
+ };
85
+ const created = standard;
86
+ const paths = fields === void 0 ? void 0 : fieldsOf2(fields);
87
+ const renderer = format === "pretty" ? oneLineFields(created) : paths ? {
88
+ ...created,
89
+ result: /* @__PURE__ */ __name((value) => created.result(projectFields2(value, paths)), "result"),
90
+ stream: /* @__PURE__ */ __name((items) => created.stream([...items].map((item) => projectFields2(item, paths))), "stream")
91
+ } : created;
92
+ return { format, color: painted, streams, renderer: quiet ? silence(renderer) : renderer };
93
+ }, "resolveOutput");
94
+ var MULTI_LINE = /* @__PURE__ */ new Set(["text", "description"]);
95
+ var oneLineFields = /* @__PURE__ */ __name((renderer) => ({
96
+ ...renderer,
97
+ result: /* @__PURE__ */ __name((value) => renderer.result(oneLine(value)), "result"),
98
+ stream: /* @__PURE__ */ __name((items) => renderer.stream([...items].map((item) => oneLine(item))), "stream")
99
+ }), "oneLineFields");
100
+ var oneLine = /* @__PURE__ */ __name((value, key) => {
101
+ if (typeof value === "string")
102
+ return key !== void 0 && MULTI_LINE.has(key) ? value : singleLine(value);
103
+ if (Array.isArray(value))
104
+ return value.map((item) => oneLine(item, key));
105
+ if (value !== null && typeof value === "object" && Object.getPrototypeOf(value) === Object.prototype) {
106
+ return Object.fromEntries(Object.entries(value).map(([field, item]) => [field, oneLine(item, field)]));
107
+ }
108
+ return value;
109
+ }, "oneLine");
110
+ var silence = /* @__PURE__ */ __name((renderer) => ({
111
+ ...renderer,
112
+ note: /* @__PURE__ */ __name(() => {
113
+ }, "note"),
114
+ success: /* @__PURE__ */ __name(() => {
115
+ }, "success"),
116
+ warn: /* @__PURE__ */ __name(() => {
117
+ }, "warn")
118
+ }), "silence");
119
+
120
+ export {
121
+ fieldsOf2 as fieldsOf,
122
+ projectFields2 as projectFields,
123
+ resolveOutput
124
+ };