@wirecat/zoom-cli 0.71.0 → 0.73.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 (199) hide show
  1. package/contracts/wirecat.json +1478 -0
  2. package/dist/account-removal.d.ts.map +1 -1
  3. package/dist/account-removal.js +0 -2
  4. package/dist/account-removal.js.map +1 -1
  5. package/dist/answers.d.ts +57 -3
  6. package/dist/answers.d.ts.map +1 -1
  7. package/dist/answers.js +0 -3
  8. package/dist/answers.js.map +1 -1
  9. package/dist/bin/main.js +13 -5
  10. package/dist/bin/main.js.map +1 -1
  11. package/dist/bin/zm.js +2 -2
  12. package/dist/bundle/{all-profiles-O4YNVPZX.js → all-profiles-V47CUJFK.js} +12 -12
  13. package/dist/bundle/answer-policy-W6H72X2R.js +112 -0
  14. package/dist/bundle/{anthropic-7GGRX3RX.js → anthropic-SID7Z3QN.js} +19 -12
  15. package/dist/bundle/{app-server-CPMKM3HI.js → app-server-KCMUSY4A.js} +75 -57
  16. package/dist/bundle/{bun-POHZKEPV.js → bun-PWMM6L45.js} +2 -2
  17. package/dist/bundle/{bun-sqlite-PGYMBPEL.js → bun-sqlite-3TLKUN5A.js} +10 -6
  18. package/dist/bundle/{chunk-Q3XLZIY3.js → chunk-2BAZRRJP.js} +29 -23
  19. package/dist/bundle/{chunk-OWEBWDHV.js → chunk-2NQPB6MT.js} +103 -9
  20. package/dist/bundle/chunk-2PYZTRRC.js +84 -0
  21. package/dist/bundle/chunk-2VYEGKQ3.js +13 -0
  22. package/dist/bundle/{chunk-I4DFFR7F.js → chunk-35CYSRGJ.js} +14 -5
  23. package/dist/bundle/{chunk-GGS6D4W4.js → chunk-3ADFJ3UP.js} +3 -3
  24. package/dist/bundle/{chunk-EOSVN2ER.js → chunk-3HTJBGNP.js} +242 -242
  25. package/dist/bundle/{chunk-2KESWII5.js → chunk-44YVZIA4.js} +3 -3
  26. package/dist/bundle/{chunk-GXF5HFFP.js → chunk-4LFFDUUW.js} +4 -4
  27. package/dist/bundle/{chunk-WOIHSQAL.js → chunk-4RJL32PF.js} +49 -10
  28. package/dist/bundle/{chunk-7ROXXRGG.js → chunk-6AO2RSYH.js} +7031 -5279
  29. package/dist/bundle/{chunk-DIQLXAAZ.js → chunk-6NI4FE5G.js} +6 -8
  30. package/dist/bundle/{chunk-X277FBTF.js → chunk-6WUTUCKH.js} +3 -3
  31. package/dist/bundle/{chunk-77TCCHMP.js → chunk-AIEMFRBU.js} +1 -1
  32. package/dist/bundle/{chunk-MRI6QMZ3.js → chunk-CIUJEQH4.js} +27 -19
  33. package/dist/bundle/{chunk-CRFOGYDG.js → chunk-CMWFYZ45.js} +2 -2
  34. package/dist/bundle/{chunk-LE7MDAQG.js → chunk-CQBLPBZU.js} +2 -2
  35. package/dist/bundle/{chunk-RQG5VOGH.js → chunk-DPSTOVKC.js} +185 -34
  36. package/dist/bundle/{chunk-4QUFFB2U.js → chunk-DYLYH7VE.js} +4 -4
  37. package/dist/bundle/{chunk-FEM2JQN2.js → chunk-EA2OB75T.js} +1 -1
  38. package/dist/bundle/chunk-ERQRY6WZ.js +54 -0
  39. package/dist/bundle/{chunk-P3XC6EDU.js → chunk-ETQNHS3A.js} +10 -129
  40. package/dist/bundle/{chunk-IAV5BG3I.js → chunk-EXWZCI5G.js} +1 -1
  41. package/dist/bundle/{chunk-VW6BF6M7.js → chunk-FIVFP53N.js} +1 -1
  42. package/dist/bundle/{chunk-DSVZEXYJ.js → chunk-FJMRDRPN.js} +3573 -3347
  43. package/dist/bundle/{chunk-7QC4M4HS.js → chunk-FT7X74RT.js} +4 -4
  44. package/dist/bundle/{chunk-ADLS6FVG.js → chunk-FXBHOCJK.js} +1 -1
  45. package/dist/bundle/{chunk-ZBFL5JPT.js → chunk-FZLJ2G7A.js} +22 -120
  46. package/dist/bundle/{chunk-GL3MYFMX.js → chunk-G2TSDMTA.js} +5 -5
  47. package/dist/bundle/{chunk-2FV5JUQU.js → chunk-G3SIY4MQ.js} +47 -40
  48. package/dist/bundle/{chunk-2U27KIKU.js → chunk-GCZMYDKU.js} +6 -6
  49. package/dist/bundle/{chunk-CKPCVEXU.js → chunk-HAMDPWEZ.js} +6 -6
  50. package/dist/bundle/{chunk-OE7EIP5L.js → chunk-HCZYJMBP.js} +1 -1
  51. package/dist/bundle/{chunk-OORMSM6O.js → chunk-HNWDEDMU.js} +61 -30
  52. package/dist/bundle/{chunk-FSHCAWZS.js → chunk-HO3GBTIT.js} +13464 -10422
  53. package/dist/bundle/chunk-IE7YBRUO.js +25 -0
  54. package/dist/bundle/{chunk-RGJ7OWHU.js → chunk-IJCUAKR5.js} +61 -21
  55. package/dist/bundle/{chunk-ULDXZ6LH.js → chunk-IKNOTHG2.js} +116 -70
  56. package/dist/bundle/{chunk-633QXP57.js → chunk-ILDGZBZD.js} +14 -9
  57. package/dist/bundle/{chunk-CFQF6IGY.js → chunk-JIS34MLC.js} +69 -6
  58. package/dist/bundle/{chunk-DHWBSXG3.js → chunk-JQF4LM3V.js} +415 -66
  59. package/dist/bundle/{chunk-4LAQDZXU.js → chunk-K5JFX5TK.js} +953 -210
  60. package/dist/bundle/{chunk-5LJTU4LY.js → chunk-K7EMVFJ7.js} +115 -113
  61. package/dist/bundle/chunk-KHBZ4OEP.js +16 -0
  62. package/dist/bundle/chunk-KK2IVZUQ.js +185 -0
  63. package/dist/bundle/{chunk-SELXER2Q.js → chunk-KQD4ZVNC.js} +7 -7
  64. package/dist/bundle/{chunk-VJXHIUFP.js → chunk-KSNJK4QM.js} +13 -13
  65. package/dist/bundle/{chunk-X4GWR6GO.js → chunk-KUL7S5Y3.js} +376 -10
  66. package/dist/bundle/{chunk-M76MXMLY.js → chunk-L6YSKCC3.js} +1 -1
  67. package/dist/bundle/chunk-LQYMN36C.js +73 -0
  68. package/dist/bundle/{chunk-USQ23X5V.js → chunk-LSVQCI6V.js} +751 -735
  69. package/dist/bundle/{chunk-DRBQDCDU.js → chunk-LVDTSCIN.js} +39 -122
  70. package/dist/bundle/{chunk-P3ASN72F.js → chunk-M4OP5ASJ.js} +1 -1
  71. package/dist/bundle/chunk-MAE5UGRQ.js +301 -0
  72. package/dist/bundle/{chunk-CT4WVR4N.js → chunk-MG2CCAVG.js} +3 -3
  73. package/dist/bundle/chunk-MOKEB656.js +71 -0
  74. package/dist/bundle/{chunk-BGTEVIW4.js → chunk-N3SOTKXC.js} +6 -6
  75. package/dist/bundle/{chunk-VRH7VRTK.js → chunk-NBA2V6LB.js} +10 -15
  76. package/dist/bundle/{chunk-5J4AMBMM.js → chunk-OFA22L4G.js} +4 -4
  77. package/dist/bundle/chunk-OKOJEBHK.js +106 -0
  78. package/dist/bundle/{chunk-Q5PI72CR.js → chunk-OMLVWOEF.js} +7 -2
  79. package/dist/bundle/{chunk-DK6ICIGL.js → chunk-OU5OXA6Q.js} +2150 -1312
  80. package/dist/bundle/{chunk-QVSLSWAL.js → chunk-P4FU6R3Z.js} +27 -152
  81. package/dist/bundle/{chunk-YPO2U2YB.js → chunk-PACLT6IW.js} +363 -115
  82. package/dist/bundle/{chunk-BBTQIVFP.js → chunk-PGPHEC2X.js} +2 -2
  83. package/dist/bundle/chunk-PJ3FKBXG.js +18 -0
  84. package/dist/bundle/{chunk-X3ZDN3U7.js → chunk-PKON63JH.js} +2 -2
  85. package/dist/bundle/{chunk-Q2SUFGSH.js → chunk-Q43KX56Z.js} +2 -2
  86. package/dist/bundle/{chunk-XI3VIQKW.js → chunk-QS6DWXDB.js} +569 -537
  87. package/dist/bundle/{chunk-INVTDIF6.js → chunk-QVJMFZFW.js} +1 -1
  88. package/dist/bundle/{chunk-QTHIU7CO.js → chunk-QWGEOQHA.js} +3 -2
  89. package/dist/bundle/{chunk-N2FNMION.js → chunk-R5FTCNLJ.js} +1 -1
  90. package/dist/bundle/{chunk-MW4EGDDV.js → chunk-SO52EJ2W.js} +2 -2
  91. package/dist/bundle/{chunk-HB6XJQ3Y.js → chunk-SYIOT45G.js} +5 -5
  92. package/dist/bundle/{chunk-4QPQ7MDA.js → chunk-TI2OANJZ.js} +1 -1
  93. package/dist/bundle/{chunk-ALIT5QFT.js → chunk-UIKVP23D.js} +1 -1
  94. package/dist/bundle/{chunk-OHWMIUCT.js → chunk-USIMMGWS.js} +244 -245
  95. package/dist/bundle/{chunk-MEED7YFG.js → chunk-UYBLNGZ2.js} +8 -2
  96. package/dist/bundle/{chunk-IED3NS7G.js → chunk-V5Q2QKYM.js} +29 -36
  97. package/dist/bundle/{chunk-54YDWBYG.js → chunk-VJVYGTPM.js} +15 -2
  98. package/dist/bundle/{chunk-5K7OGPGA.js → chunk-VPPNYUQM.js} +8 -8
  99. package/dist/bundle/{chunk-ZBKWRYRS.js → chunk-X2FILY5F.js} +3 -3
  100. package/dist/bundle/{chunk-2RUAMDVV.js → chunk-XLY7V2LB.js} +14 -14
  101. package/dist/bundle/chunk-XWBPP2HX.js +2 -0
  102. package/dist/bundle/{chunk-ZVI6TFQR.js → chunk-Y3IH7EZC.js} +17 -17
  103. package/dist/bundle/{chunk-YD2RYVMK.js → chunk-Z5XCU4S7.js} +46 -40
  104. package/dist/bundle/{chunk-RN4EHCC5.js → chunk-ZAIE3G5I.js} +3 -3
  105. package/dist/bundle/{chunk-2U6SER67.js → chunk-ZMHZ6CQS.js} +2 -2
  106. package/dist/bundle/{chunk-64ZHF6PJ.js → chunk-ZVQDOKDY.js} +3 -1
  107. package/dist/bundle/{chunk-TM4JSVGQ.js → chunk-ZX4QWTMQ.js} +42 -43
  108. package/dist/bundle/{cli-KHMEUXNG.js → cli-4ZYJ6OZE.js} +158 -88
  109. package/dist/bundle/command-contract-FJDDCHYP.js +43 -0
  110. package/dist/bundle/command-server-entry-CASONRIJ.js +173 -0
  111. package/dist/bundle/config-4DZHX2WX.js +99 -0
  112. package/dist/bundle/{decode-7RP4HSVE.js → decode-KEFCVGEB.js} +6 -6
  113. package/dist/bundle/{dispatch-IZCAK47P.js → dispatch-EU67WGME.js} +11 -11
  114. package/dist/bundle/{dist-BFT2SUBV.js → dist-GCQ7KCKN.js} +55 -30
  115. package/dist/bundle/{echarts-T2BSQ2YV.js → echarts-SDZA2SWG.js} +2 -2
  116. package/dist/bundle/{embed-BAS6YPDT.js → embed-43VJEPM6.js} +7 -7
  117. package/dist/bundle/{embedder-5XD5FCAO.js → embedder-Q4ZHAGRP.js} +10 -10
  118. package/dist/bundle/{failure-R2OIHCE5.js → failure-CTJLEB2R.js} +3 -3
  119. package/dist/bundle/first-run-CPOLQVNA.js +29 -0
  120. package/dist/bundle/first-screen-XYESRGWW.js +41 -0
  121. package/dist/bundle/folders-MSBTAPAG.js +24 -0
  122. package/dist/bundle/{instructions-XZPROPKY.js → instructions-7T6JJIFS.js} +1 -1
  123. package/dist/bundle/{main-TZXKGL3L.js → main-NA3QVPXS.js} +39 -25
  124. package/dist/bundle/{mcp-M4QN2E7R.js → mcp-TDKGDB4V.js} +2 -2
  125. package/dist/bundle/{meetings-JB2ISPND.js → meetings-7CVIQJTA.js} +9 -7
  126. package/dist/bundle/{node-A3B3MJWX.js → node-BZDMUFTW.js} +2 -2
  127. package/dist/bundle/{node-P4E63KXA.js → node-KM3CUABH.js} +9 -9
  128. package/dist/bundle/{node-sqlite-QVWDLGDX.js → node-sqlite-QHGB23B4.js} +11 -7
  129. package/dist/bundle/{oauth-YA6IYV4O.js → oauth-BMEMCM2I.js} +8 -8
  130. package/dist/bundle/{open-SY7TXJBS.js → open-JGU2NRJP.js} +6 -6
  131. package/dist/bundle/openai-VTXXFNCS.js +28 -0
  132. package/dist/bundle/{output-file-YGQYZCBJ.js → output-file-VDOCYH2G.js} +6 -6
  133. package/dist/bundle/{process-6HNBTJIY.js → process-756VBE7E.js} +1 -1
  134. package/dist/bundle/{program-77BUCJ4H.js → program-XM6CDIJ2.js} +134 -129
  135. package/dist/bundle/{prompt-YDG73YDS.js → prompt-2IPFXJ4B.js} +6 -6
  136. package/dist/bundle/{recognize-ECXDGTB7.js → recognize-672E2RIB.js} +5 -5
  137. package/dist/bundle/{remote-K4JHGBVJ.js → remote-YLHRVPDS.js} +11 -8
  138. package/dist/bundle/{rerank-IU2YYD4T.js → rerank-NBXQG3OS.js} +8 -8
  139. package/dist/bundle/run-log-3WITBT2F.js +126 -0
  140. package/dist/bundle/{serve-3XWIF3HI.js → serve-FNLOUMYP.js} +10 -10
  141. package/dist/bundle/{server-56VYOHWP.js → server-7ZB5AK5H.js} +53 -47
  142. package/dist/bundle/server-GGRGD4SH.js +77 -0
  143. package/dist/bundle/{services-X7IPEGQ5.js → services-Z4UWN64R.js} +56 -37
  144. package/dist/bundle/{speech-E2OBQWYA.js → speech-XSYVCKR3.js} +17 -14
  145. package/dist/bundle/sqlite-runtime-GAPXJNWU.js +20 -0
  146. package/dist/bundle/{state-4GMJYK4H.js → state-QSA53EF5.js} +7 -7
  147. package/dist/bundle/{store-LA4TV4DM.js → store-EKI4OAJH.js} +22 -19
  148. package/dist/bundle/{store-KPI7GB5Y.js → store-NOF5EYUC.js} +38 -21
  149. package/dist/bundle/store-connection-2OZQGEIO.js +92 -0
  150. package/dist/bundle/store-maintenance-command-GNX3SOZ6.js +67 -0
  151. package/dist/bundle/{streaming-EJ3NM2C2.js → streaming-PQEXKTE5.js} +7 -7
  152. package/dist/bundle/tokens-WJQYQ3FK.js +24 -0
  153. package/dist/bundle/zm.js +34 -10
  154. package/dist/bundle/{zoom-app-QEJBTIJ4.js → zoom-app-Y7RMWLVU.js} +9 -8
  155. package/dist/folders.d.ts +12 -2
  156. package/dist/folders.d.ts.map +1 -1
  157. package/dist/folders.js +81 -3
  158. package/dist/folders.js.map +1 -1
  159. package/dist/identity.d.ts +5 -0
  160. package/dist/identity.d.ts.map +1 -1
  161. package/dist/identity.js +14 -0
  162. package/dist/identity.js.map +1 -1
  163. package/dist/recording-schedule-setup.d.ts.map +1 -1
  164. package/dist/recording-schedule-setup.js +4 -7
  165. package/dist/recording-schedule-setup.js.map +1 -1
  166. package/dist/remote-http.d.ts +1 -1
  167. package/dist/remote-http.d.ts.map +1 -1
  168. package/dist/remote-http.js +21 -23
  169. package/dist/remote-http.js.map +1 -1
  170. package/dist/setup-commands.d.ts.map +1 -1
  171. package/dist/setup-commands.js +2 -4
  172. package/dist/setup-commands.js.map +1 -1
  173. package/dist/tokens.d.ts +17 -2
  174. package/dist/tokens.d.ts.map +1 -1
  175. package/dist/tokens.js +109 -29
  176. package/dist/tokens.js.map +1 -1
  177. package/dist/version.d.ts +1 -1
  178. package/dist/version.js +1 -1
  179. package/dist/wcat.d.ts +3 -0
  180. package/dist/wcat.d.ts.map +1 -0
  181. package/dist/wcat.js +4 -0
  182. package/dist/wcat.js.map +1 -0
  183. package/package.json +15 -14
  184. package/dist/bundle/answer-policy-PPSPMCLH.js +0 -104
  185. package/dist/bundle/chunk-KMV7GZB6.js +0 -35
  186. package/dist/bundle/chunk-UG447QY2.js +0 -27
  187. package/dist/bundle/chunk-XRFHQGOD.js +0 -17
  188. package/dist/bundle/command-contract-4K6XXZYE.js +0 -41
  189. package/dist/bundle/config-EEDB632I.js +0 -90
  190. package/dist/bundle/first-run-23WWZ2PW.js +0 -28
  191. package/dist/bundle/first-screen-6HFUYVFR.js +0 -39
  192. package/dist/bundle/folders-ZXTOFY4T.js +0 -16
  193. package/dist/bundle/openai-2AU24NRN.js +0 -25
  194. package/dist/bundle/run-log-LFEXNZ74.js +0 -118
  195. package/dist/bundle/server-YSTMUZ22.js +0 -72
  196. package/dist/bundle/store-connection-AZTIF6IH.js +0 -83
  197. package/dist/bundle/store-maintenance-command-LR572PS4.js +0 -61
  198. package/dist/bundle/tokens-BE6CJMR5.js +0 -20
  199. /package/dist/bundle/{chunk-VOXIGICJ.js → chunk-7O7XM37N.js} +0 -0
@@ -1,118 +1,29 @@
1
1
  import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ isCommandServer
5
+ } from "./chunk-2VYEGKQ3.js";
3
6
  import {
4
7
  envName,
5
8
  readOnlyLockOf
6
- } from "./chunk-UG447QY2.js";
9
+ } from "./chunk-MOKEB656.js";
7
10
  import {
8
- CAPABILITY_STATEMENTS,
9
- storeCapable
10
- } from "./chunk-BGTEVIW4.js";
11
+ ensureSqlite
12
+ } from "./chunk-OKOJEBHK.js";
11
13
  import {
12
14
  catchCrashes
13
- } from "./chunk-WOIHSQAL.js";
14
- import {
15
- importFrom
16
- } from "./chunk-Y5E2WNWB.js";
15
+ } from "./chunk-4RJL32PF.js";
17
16
  import {
18
17
  CliError
19
- } from "./chunk-FEM2JQN2.js";
18
+ } from "./chunk-EA2OB75T.js";
20
19
  import {
21
20
  __name
22
21
  } from "./chunk-ZVVMGPBJ.js";
23
22
 
24
- // node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_737712cd0065e7e21fd5896a79d0773d/node_modules/@wirecat/cli-core/dist/cli/entry.js
25
- import { spawn as spawn2 } from "node:child_process";
26
-
27
- // node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_737712cd0065e7e21fd5896a79d0773d/node_modules/@wirecat/cli-core/dist/sqlite-runtime.js
28
- import { spawn, spawnSync } from "node:child_process";
29
- import { readFileSync } from "node:fs";
30
- import { dirname } from "node:path";
31
- var RESTARTED = "CLI_MESSAGING_SQLITE_RESTARTED";
32
- var USER_LIBRARY_PATH = "CLI_MESSAGING_USER_LD_LIBRARY_PATH";
33
- var FORWARDED = ["SIGTERM", "SIGHUP", "SIGQUIT"];
34
- var ensureSqlite = /* @__PURE__ */ __name(async (runtime = nodeRuntime()) => {
35
- const { env } = runtime;
36
- if (env[RESTARTED]) {
37
- if (env[USER_LIBRARY_PATH] === void 0)
38
- delete env.LD_LIBRARY_PATH;
39
- else
40
- env.LD_LIBRARY_PATH = env[USER_LIBRARY_PATH];
41
- delete env[USER_LIBRARY_PATH];
42
- delete env[RESTARTED];
43
- return;
44
- }
45
- if (runtime.bun || runtime.platform !== "linux")
46
- return;
47
- const maps = runtime.maps();
48
- if (!maps.includes("libsqlite3"))
49
- return;
50
- if (await runtime.capable())
51
- return;
52
- const library = await runtime.library(maps.includes("ld-musl"));
53
- if (!library)
54
- return;
55
- const restarted = {
56
- ...env,
57
- LD_LIBRARY_PATH: [dirname(library.path), env.LD_LIBRARY_PATH].filter(Boolean).join(":"),
58
- [RESTARTED]: "1"
59
- };
60
- if (env.LD_LIBRARY_PATH !== void 0)
61
- restarted[USER_LIBRARY_PATH] = env.LD_LIBRARY_PATH;
62
- if (!runtime.works(restarted, library.version))
63
- return;
64
- await runtime.restart(restarted);
65
- }, "ensureSqlite");
66
- var trialScript = /* @__PURE__ */ __name((version) => `
67
- const { DatabaseSync } = await import("node:sqlite")
68
- const database = new DatabaseSync(":memory:")
69
- if (database.prepare("SELECT sqlite_version() AS v").get().v !== ${JSON.stringify(version)}) process.exit(1)
70
- for (const statement of ${JSON.stringify(CAPABILITY_STATEMENTS)}) database.exec(statement)
71
- `, "trialScript");
72
- var nodeRuntime = /* @__PURE__ */ __name(() => ({
73
- env: process.env,
74
- platform: process.platform,
75
- bun: "Bun" in globalThis,
76
- maps: /* @__PURE__ */ __name(() => {
77
- try {
78
- return readFileSync("/proc/self/maps", "utf8");
79
- } catch {
80
- return "";
81
- }
82
- }, "maps"),
83
- capable: /* @__PURE__ */ __name(() => storeCapable().then(() => true, () => false), "capable"),
84
- library: /* @__PURE__ */ __name(async (musl) => {
85
- try {
86
- const { libraryFor, SQLITE_VERSION } = await importFrom(new URL("sqlite-runtime.js", import.meta.resolve("@wirecat/cli-core")).href, "@wirecat/cli-core-sqlite");
87
- const path = libraryFor({ musl });
88
- return path === void 0 ? void 0 : { path, version: SQLITE_VERSION };
89
- } catch {
90
- return void 0;
91
- }
92
- }, "library"),
93
- works: /* @__PURE__ */ __name((env, version) => spawnSync(process.execPath, ["--no-warnings", "--input-type=module", "-e", trialScript(version)], {
94
- env,
95
- stdio: "ignore",
96
- timeout: 1e4
97
- }).status === 0, "works"),
98
- restart: /* @__PURE__ */ __name((env) => relay(spawn(process.execPath, [...process.execArgv, ...process.argv.slice(1)], { env, stdio: "inherit" })), "restart")
99
- }), "nodeRuntime");
100
- var relay = /* @__PURE__ */ __name((child, host = process) => new Promise(() => {
101
- for (const signal of FORWARDED)
102
- host.on(signal, () => child.kill(signal));
103
- host.on("SIGINT", () => {
104
- });
105
- child.on("error", () => host.exit(1));
106
- child.on("exit", (code, signal) => {
107
- if (signal) {
108
- host.removeAllListeners(signal);
109
- host.kill(host.pid, signal);
110
- } else
111
- host.exit(code ?? 1);
112
- });
113
- }), "relay");
23
+ // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/entry.js
24
+ import { spawn } from "node:child_process";
114
25
 
115
- // node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_737712cd0065e7e21fd5896a79d0773d/node_modules/@wirecat/cli-core/dist/cli/argv-log.js
26
+ // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/argv-log.js
116
27
  import { appendFileSync } from "node:fs";
117
28
  var logParsedArgv = /* @__PURE__ */ __name((file, action) => {
118
29
  const words = [];
@@ -136,7 +47,7 @@ var logVersion = /* @__PURE__ */ __name((file) => {
136
47
  `);
137
48
  }, "logVersion");
138
49
 
139
- // node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_737712cd0065e7e21fd5896a79d0773d/node_modules/@wirecat/cli-core/dist/cli/entry.js
50
+ // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/entry.js
140
51
  var processIo = /* @__PURE__ */ __name(() => ({
141
52
  argv: process.argv,
142
53
  env: process.env,
@@ -148,13 +59,17 @@ var processIo = /* @__PURE__ */ __name(() => ({
148
59
  setExitCode: /* @__PURE__ */ __name((code) => {
149
60
  process.exitCode = code;
150
61
  }, "setExitCode"),
151
- spawn: spawn2
62
+ spawn
152
63
  }), "processIo");
153
64
  var startCli = /* @__PURE__ */ __name(async (entry) => {
154
65
  const io = { ...processIo(), ...entry.io };
155
66
  const args = io.argv.slice(2);
156
67
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-V"))
157
68
  return printVersion(entry.app, io);
69
+ if (isCommandServer(args)) {
70
+ const { serveEntry } = await import("./command-server-entry-CASONRIJ.js");
71
+ return serveEntry(entry, io, { firstRunAt, commanderExit });
72
+ }
158
73
  const tty = io.stdout.isTTY === true;
159
74
  const release = catchCrashes({
160
75
  cli: entry.app.command,
@@ -186,27 +101,11 @@ var startCli = /* @__PURE__ */ __name(async (entry) => {
186
101
  env: io.env,
187
102
  tty,
188
103
  signal: controller.signal,
189
- atStart: /* @__PURE__ */ __name(async (command) => {
190
- if (command.optsWithGlobals().dryRun === true)
191
- return;
192
- const [{ setupAtStart }, { commandPathOf }] = await Promise.all([
193
- import("./first-run-23WWZ2PW.js"),
194
- import("./command-contract-4K6XXZYE.js")
195
- ]);
196
- await setupAtStart({
197
- command: entry.app.command,
198
- env: io.env,
199
- contentLanguages: entry.app.contentLanguages,
200
- path: commandPathOf(command),
201
- headless: headless(command),
202
- readOnlyLock: readOnlyLockOf(entry.app, io.env),
203
- input: io.stdin
204
- });
205
- }, "atStart"),
104
+ atStart: firstRunAt(entry, io, headless),
206
105
  ask: /* @__PURE__ */ __name(async (question, command) => {
207
106
  if (headless(command) || io.stdin.isTTY !== true)
208
107
  return false;
209
- const { readSecret } = await import("./prompt-YDG73YDS.js");
108
+ const { readSecret } = await import("./prompt-2IPFXJ4B.js");
210
109
  const answer = await readSecret(`${question} [y/N] `, {
211
110
  input: io.stdin,
212
111
  output: io.stderr,
@@ -219,7 +118,8 @@ var startCli = /* @__PURE__ */ __name(async (entry) => {
219
118
  if (!headless(command))
220
119
  await openBrowser(url, browser, io);
221
120
  }, "openBrowser"),
222
- outputClosed: /* @__PURE__ */ __name(() => closed, "outputClosed")
121
+ outputClosed: /* @__PURE__ */ __name(() => closed, "outputClosed"),
122
+ setExitCode: io.setExitCode
223
123
  };
224
124
  let code;
225
125
  try {
@@ -244,6 +144,23 @@ var startCli = /* @__PURE__ */ __name(async (entry) => {
244
144
  else if (code !== void 0)
245
145
  io.setExitCode(code);
246
146
  }, "startCli");
147
+ var firstRunAt = /* @__PURE__ */ __name((entry, io, headless) => async (command) => {
148
+ if (command.optsWithGlobals().dryRun === true)
149
+ return;
150
+ const [{ setupAtStart }, { commandPathOf }] = await Promise.all([
151
+ import("./first-run-CPOLQVNA.js"),
152
+ import("./command-contract-FJDDCHYP.js")
153
+ ]);
154
+ await setupAtStart({
155
+ command: entry.app.command,
156
+ env: io.env,
157
+ contentLanguages: entry.app.contentLanguages,
158
+ path: commandPathOf(command),
159
+ headless: headless(command),
160
+ readOnlyLock: readOnlyLockOf(entry.app, io.env),
161
+ input: io.stdin
162
+ });
163
+ }, "firstRunAt");
247
164
  var printVersion = /* @__PURE__ */ __name((app, io) => {
248
165
  const argvLog = io.env[envName(app, "TEST_ARGV_LOG")];
249
166
  if (argvLog)
@@ -261,7 +178,7 @@ var commanderExit = /* @__PURE__ */ __name((error) => {
261
178
  return 0;
262
179
  return code === "commander.help" ? 2 : void 0;
263
180
  }, "commanderExit");
264
- var openBrowser = /* @__PURE__ */ __name((url, browser, io = { platform: process.platform, spawn: spawn2 }) => {
181
+ var openBrowser = /* @__PURE__ */ __name((url, browser, io = { platform: process.platform, spawn }) => {
265
182
  const [command, prefix] = browser !== void 0 ? [browser, []] : io.platform === "darwin" ? ["open", []] : io.platform === "win32" ? ["rundll32.exe", ["url.dll,FileProtocolHandler"]] : ["xdg-open", []];
266
183
  return new Promise((resolve, reject) => {
267
184
  const child = io.spawn(command, [...prefix, url], { detached: true, stdio: "ignore", windowsHide: true });
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/installer.js
7
+ // node_modules/.pnpm/@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/installer.js
8
8
  var installerOf = /* @__PURE__ */ __name((scriptPath) => {
9
9
  const path = scriptPath.replaceAll("\\", "/");
10
10
  if (path.includes("/_npx/"))
@@ -0,0 +1,301 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ DEFAULT_RETRY,
5
+ backoffMs,
6
+ realSleep,
7
+ wallClock
8
+ } from "./chunk-HNWDEDMU.js";
9
+ import {
10
+ CliError,
11
+ isCliError
12
+ } from "./chunk-EA2OB75T.js";
13
+ import {
14
+ __name
15
+ } from "./chunk-ZVVMGPBJ.js";
16
+
17
+ // node_modules/.pnpm/@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/hosts.js
18
+ var LABEL = "[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?";
19
+ var HOST_PATTERN = new RegExp(`^(?:${LABEL}(?:\\.${LABEL})*|\\*\\.${LABEL}(?:\\.${LABEL})+)$`);
20
+ var hostProblems = /* @__PURE__ */ __name((hosts) => [
21
+ ...hosts.filter((host) => !HOST_PATTERN.test(host) || host.length > 253).map((host) => `${JSON.stringify(host)} is not a host: a lower-case hostname with no scheme, port or path, or one leading *. before two labels or more`),
22
+ ...hosts.filter((host, at) => hosts.indexOf(host) !== at).map((host) => `${JSON.stringify(host)} is listed twice`)
23
+ ], "hostProblems");
24
+ var hostCovered = /* @__PURE__ */ __name((hostname, hosts) => {
25
+ const name = hostname.toLowerCase().replace(/\.$/, "");
26
+ return hosts.some((host) => host.startsWith("*.") ? name.endsWith(host.slice(1)) : name === host);
27
+ }, "hostCovered");
28
+
29
+ // node_modules/.pnpm/@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/fetch.js
30
+ var HOST_FETCH_TIMEOUT_MS = 3e4;
31
+ var REDIRECTS = 5;
32
+ var REDIRECT_STATUSES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
33
+ var CREDENTIAL_HEADERS = ["authorization", "cookie", "proxy-authorization"];
34
+ var NO_BODY = /* @__PURE__ */ new Set([204, 205, 304]);
35
+ var deadline = /* @__PURE__ */ __name((ms) => {
36
+ const controller = new AbortController();
37
+ const timer = setTimeout(() => controller.abort(new DOMException(`no answer within ${ms} ms`, "TimeoutError")), ms);
38
+ timer.unref?.();
39
+ return { signal: controller.signal, clear: /* @__PURE__ */ __name(() => clearTimeout(timer), "clear") };
40
+ }, "deadline");
41
+ var released = /* @__PURE__ */ __name((response, clear) => {
42
+ if (!response.body || NO_BODY.has(response.status) || response.status < 200 || response.status > 599) {
43
+ clear();
44
+ return response;
45
+ }
46
+ const { status, statusText, headers, url, redirected } = response;
47
+ const wrapped = new Response(response.body.pipeThrough(new TransformStream({ flush: clear })), {
48
+ status,
49
+ statusText,
50
+ headers
51
+ });
52
+ return Object.defineProperties(wrapped, { url: { value: url }, redirected: { value: redirected } });
53
+ }, "released");
54
+ var undeclared = /* @__PURE__ */ __name((url) => new CliError("configuration_error", `${url.hostname} is not a host this CLI declares: add "${url.hostname}" to \`hosts\` in its WCAT identity and run cli-dev manifest`, { reason: "network.host-undeclared", sent: false }), "undeclared");
55
+ var checked = /* @__PURE__ */ __name((url, hosts) => {
56
+ if (url.protocol !== "https:" && url.protocol !== "http:")
57
+ throw new CliError("validation_error", `only http and https are fetched, not ${url.protocol.replace(/:$/, "")}`, {
58
+ sent: false
59
+ });
60
+ if (!hostCovered(url.hostname, hosts))
61
+ throw undeclared(url);
62
+ return url;
63
+ }, "checked");
64
+ var hostFetch = /* @__PURE__ */ __name((options) => {
65
+ const problems = hostProblems(options.hosts);
66
+ if (problems.length > 0)
67
+ throw new CliError("configuration_error", problems.join("; "));
68
+ const { hosts, fetch: send = globalThis.fetch, timeoutMs = HOST_FETCH_TIMEOUT_MS, redirects = REDIRECTS } = options;
69
+ return async (input, init = {}) => {
70
+ const request = input instanceof Request ? input : void 0;
71
+ let url = checked(new URL(request?.url ?? String(input)), hosts);
72
+ const caller = init.signal ?? request?.signal;
73
+ const timeout = deadline(timeoutMs);
74
+ const signal = caller ? AbortSignal.any([caller, timeout.signal]) : timeout.signal;
75
+ const follow = (init.redirect ?? request?.redirect ?? "follow") === "follow";
76
+ let method = (init.method ?? request?.method ?? "GET").toUpperCase();
77
+ let body = init.body ?? request?.body ?? void 0;
78
+ const headers = new Headers(init.headers ?? request?.headers);
79
+ try {
80
+ let response = await send(input, { ...init, signal, ...follow ? { redirect: "manual" } : {} });
81
+ for (let hop = 0; follow && REDIRECT_STATUSES.has(response.status); hop += 1) {
82
+ const location = response.headers.get("location");
83
+ if (!location)
84
+ return released(response, timeout.clear);
85
+ if (hop >= redirects)
86
+ throw new CliError("invalid_response", `more than ${redirects} redirects from ${url.hostname}`);
87
+ void response.body?.cancel().catch(() => {
88
+ });
89
+ const next = checked(new URL(location, url), hosts);
90
+ if (response.status === 303 || (response.status === 301 || response.status === 302) && method === "POST") {
91
+ method = method === "HEAD" ? "HEAD" : "GET";
92
+ body = void 0;
93
+ headers.delete("content-type");
94
+ headers.delete("content-length");
95
+ } else if (body instanceof ReadableStream)
96
+ throw new CliError("invalid_response", `${url.hostname} redirected a streamed body, which cannot be sent again`);
97
+ if (next.origin !== url.origin)
98
+ for (const name of CREDENTIAL_HEADERS)
99
+ headers.delete(name);
100
+ url = next;
101
+ response = await send(url, { ...init, method, headers, body, signal, redirect: "manual" });
102
+ }
103
+ return released(response, timeout.clear);
104
+ } catch (error) {
105
+ timeout.clear();
106
+ if (isCliError(error))
107
+ throw error;
108
+ if (caller?.aborted)
109
+ throw isCliError(caller.reason) ? caller.reason : new CliError("cancelled", "request cancelled");
110
+ if (timeout.signal.aborted)
111
+ throw new CliError("timeout", `${url.hostname} did not answer within ${timeoutMs} ms`, { retryable: true });
112
+ throw new CliError("network_error", `${url.hostname} could not be reached`, { retryable: true });
113
+ }
114
+ };
115
+ }, "hostFetch");
116
+
117
+ // node_modules/.pnpm/@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/body.js
118
+ var interrupted = /* @__PURE__ */ __name((signal) => isCliError(signal.reason) ? signal.reason : new CliError(signal.reason instanceof Error && signal.reason.name === "TimeoutError" ? "timeout" : "cancelled", "HTTP response read was interrupted"), "interrupted");
119
+ var checked2 = /* @__PURE__ */ __name((signal) => {
120
+ if (signal?.aborted)
121
+ throw interrupted(signal);
122
+ }, "checked");
123
+ var abortable = /* @__PURE__ */ __name(async (pending, signal) => {
124
+ if (!signal)
125
+ return pending;
126
+ let abort = /* @__PURE__ */ __name(() => {
127
+ }, "abort");
128
+ const stopped = new Promise((_, reject) => {
129
+ abort = /* @__PURE__ */ __name(() => reject(interrupted(signal)), "abort");
130
+ signal.addEventListener("abort", abort, { once: true });
131
+ if (signal.aborted)
132
+ abort();
133
+ });
134
+ try {
135
+ return await Promise.race([pending, stopped]);
136
+ } finally {
137
+ signal.removeEventListener("abort", abort);
138
+ }
139
+ }, "abortable");
140
+ var readJsonResponse = /* @__PURE__ */ __name(async (response, options) => {
141
+ const { maxBytes, signal } = options ?? {};
142
+ if (!Number.isSafeInteger(maxBytes) || maxBytes < 1)
143
+ throw new CliError("validation_error", "maxBytes must be a positive safe integer");
144
+ if (signal !== void 0 && !(signal instanceof AbortSignal))
145
+ throw new CliError("validation_error", "signal must be an AbortSignal");
146
+ if (signal?.aborted) {
147
+ void response.body?.cancel().catch(() => {
148
+ });
149
+ throw interrupted(signal);
150
+ }
151
+ const length = response.headers.get("content-length");
152
+ if (length !== null && (!/^\d+$/.test(length) || Number(length) > maxBytes)) {
153
+ void response.body?.cancel().catch(() => {
154
+ });
155
+ throw new CliError("invalid_response", "HTTP response exceeds the byte budget");
156
+ }
157
+ if (!response.body)
158
+ throw new CliError("invalid_response", "HTTP response has no body");
159
+ if (response.body.locked)
160
+ throw new CliError("invalid_response", "HTTP response body is already in use");
161
+ const reader = response.body.getReader();
162
+ const chunks = [];
163
+ let bytes = 0;
164
+ try {
165
+ for (; ; ) {
166
+ checked2(signal);
167
+ const part = await abortable(reader.read(), signal);
168
+ checked2(signal);
169
+ if (part.done)
170
+ break;
171
+ if (!(part.value instanceof Uint8Array))
172
+ throw new CliError("invalid_response", "HTTP response is not bytes");
173
+ bytes += part.value.byteLength;
174
+ if (bytes > maxBytes)
175
+ throw new CliError("invalid_response", "HTTP response exceeds the byte budget");
176
+ if (part.value.byteLength)
177
+ chunks.push(new Uint8Array(part.value));
178
+ }
179
+ const body = new Uint8Array(bytes);
180
+ let offset = 0;
181
+ for (const chunk of chunks) {
182
+ body.set(chunk, offset);
183
+ offset += chunk.byteLength;
184
+ }
185
+ try {
186
+ return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(body));
187
+ } catch {
188
+ throw new CliError("invalid_response", "HTTP response is not valid UTF-8 JSON");
189
+ }
190
+ } catch (error) {
191
+ checked2(signal);
192
+ if (isCliError(error))
193
+ throw error;
194
+ throw new CliError("network_error", "HTTP response could not be read");
195
+ } finally {
196
+ void reader.cancel().catch(() => {
197
+ });
198
+ reader.releaseLock();
199
+ }
200
+ }, "readJsonResponse");
201
+
202
+ // node_modules/.pnpm/@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/index.js
203
+ var parseRetryAfter = /* @__PURE__ */ __name((header, now) => {
204
+ if (!header)
205
+ return void 0;
206
+ const trimmed = header.trim();
207
+ if (/^\d+$/.test(trimmed))
208
+ return Number(trimmed) * 1e3;
209
+ const at = Date.parse(trimmed);
210
+ if (Number.isNaN(at))
211
+ return void 0;
212
+ const delta = at - now().getTime();
213
+ return delta > 0 ? delta : void 0;
214
+ }, "parseRetryAfter");
215
+ var parseRateLimitReset = /* @__PURE__ */ __name((header, now) => {
216
+ if (!header)
217
+ return void 0;
218
+ const seconds = Number(header.trim());
219
+ if (!Number.isFinite(seconds))
220
+ return void 0;
221
+ const delta = seconds * 1e3 - now().getTime();
222
+ return delta > 0 ? delta : void 0;
223
+ }, "parseRateLimitReset");
224
+ var providerWaitMs = /* @__PURE__ */ __name((headers, now) => parseRetryAfter(headers.get("retry-after"), now) ?? parseRateLimitReset(headers.get("x-ratelimit-reset"), now), "providerWaitMs");
225
+ var retryableStatus = /* @__PURE__ */ __name((status) => status === 408 || status === 429 || status >= 500, "retryableStatus");
226
+ var statusToCode = /* @__PURE__ */ __name((status) => {
227
+ if (status === 400 || status === 422)
228
+ return "validation_error";
229
+ if (status === 401)
230
+ return "authentication_error";
231
+ if (status === 403)
232
+ return "permission_error";
233
+ if (status === 404)
234
+ return "not_found";
235
+ if (status === 408)
236
+ return "timeout";
237
+ if (status === 429)
238
+ return "rate_limited";
239
+ if (status === 502 || status === 503 || status === 504)
240
+ return "provider_unavailable";
241
+ return "provider_error";
242
+ }, "statusToCode");
243
+ var SAFE = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
244
+ var retrying = /* @__PURE__ */ __name((send, options = {}) => {
245
+ const { retry = DEFAULT_RETRY, reads = /* @__PURE__ */ __name((method) => SAFE.has(method), "reads"), pacer, budget = Number.POSITIVE_INFINITY, sleep = realSleep, now = wallClock, random = Math.random } = options;
246
+ return async (input, init = {}) => {
247
+ const request = input instanceof Request ? input : void 0;
248
+ const method = (init.method ?? request?.method ?? "GET").toUpperCase();
249
+ const read = reads(method, new URL(request?.url ?? String(input)));
250
+ const signal = init.signal ?? request?.signal ?? void 0;
251
+ const once = init.body instanceof ReadableStream;
252
+ let waited = 0;
253
+ const pause = /* @__PURE__ */ __name(async (ms) => {
254
+ waited += ms;
255
+ await sleep(ms, signal, "retry");
256
+ }, "pause");
257
+ for (let attempt = 1; ; attempt++) {
258
+ if (pacer) {
259
+ const wait = await pacer.reserve() - now().getTime();
260
+ if (wait > 0) {
261
+ if (waited + wait > budget)
262
+ throw new CliError("rate_limited", `the provider's pace needs a ${wait} ms wait, more than this run allows`, {
263
+ retry_after_ms: wait,
264
+ sent: false
265
+ });
266
+ await pause(wait);
267
+ }
268
+ }
269
+ const last = once || attempt > retry.retries;
270
+ try {
271
+ const response = await send(request && !last ? request.clone() : input, init);
272
+ if (last || !retryableStatus(response.status) || !(read || response.status === 429))
273
+ return response;
274
+ const wait = providerWaitMs(response.headers, now) ?? backoffMs(attempt, retry, random);
275
+ if (wait > retry.maxRetryAfterMs || waited + wait > budget)
276
+ return response;
277
+ await response.body?.cancel().catch(() => {
278
+ });
279
+ if (response.status === 429)
280
+ await pacer?.holdFor(wait);
281
+ await pause(wait);
282
+ } catch (error) {
283
+ if (last || !read || signal?.aborted || !isCliError(error) || error.details.retryable !== true)
284
+ throw error;
285
+ const wait = backoffMs(attempt, retry, random);
286
+ if (waited + wait > budget)
287
+ throw error;
288
+ await pause(wait);
289
+ }
290
+ }
291
+ };
292
+ }, "retrying");
293
+
294
+ export {
295
+ readJsonResponse,
296
+ hostFetch,
297
+ providerWaitMs,
298
+ retryableStatus,
299
+ statusToCode,
300
+ retrying
301
+ };
@@ -2,15 +2,15 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  openOrdinaryFile
5
- } from "./chunk-5LJTU4LY.js";
5
+ } from "./chunk-K7EMVFJ7.js";
6
6
  import {
7
7
  CliError
8
- } from "./chunk-FEM2JQN2.js";
8
+ } from "./chunk-EA2OB75T.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.620.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_737712cd0065e7e21fd5896a79d0773d/node_modules/@wirecat/cli-core/dist/speech/wav.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/speech/wav.js
14
14
  import { createHash } from "node:crypto";
15
15
  import { basename, resolve } from "node:path";
16
16
  var prepared = /* @__PURE__ */ new WeakMap();
@@ -0,0 +1,71 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ CliError
5
+ } from "./chunk-EA2OB75T.js";
6
+ import {
7
+ __name
8
+ } from "./chunk-ZVVMGPBJ.js";
9
+
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/ports/app.js
11
+ import { readFileSync } from "node:fs";
12
+ var envName = /* @__PURE__ */ __name((app, name) => `${app.envPrefix}_${name}`, "envName");
13
+ var locking = /* @__PURE__ */ __name((value) => value !== void 0 && value.trim() !== "" && value !== "0", "locking");
14
+ var ancestries = /* @__PURE__ */ new Map();
15
+ var readable = /* @__PURE__ */ __name((read, path) => {
16
+ try {
17
+ return read(path);
18
+ } catch (error) {
19
+ if (error.code === "EACCES")
20
+ return void 0;
21
+ throw error;
22
+ }
23
+ }, "readable");
24
+ var ancestorEnvironments = /* @__PURE__ */ __name(({ read = /* @__PURE__ */ __name((path) => readFileSync(path, "utf8"), "read"), from = process.ppid, uid = process.getuid?.() ?? -1, cache = ancestries } = {}) => {
25
+ if (process.platform !== "linux")
26
+ return [];
27
+ const key = `${from}:${uid}`;
28
+ const known = cache.get(key);
29
+ if (known !== void 0)
30
+ return known;
31
+ let found = [];
32
+ try {
33
+ for (let pid = from, depth = 0; pid >= 1 && depth < 64; depth++) {
34
+ const status = read(`/proc/${pid}/status`);
35
+ const field = /* @__PURE__ */ __name((name) => new RegExp(`^${name}:\\s*(\\d+)`, "m").exec(status)?.[1], "field");
36
+ if (Number(field("Uid")) !== uid)
37
+ break;
38
+ const environ = readable(read, `/proc/${pid}/environ`);
39
+ if (environ === void 0)
40
+ break;
41
+ found.push(environ.split("\0"));
42
+ pid = Number(field("PPid"));
43
+ }
44
+ } catch {
45
+ found = null;
46
+ }
47
+ cache.set(key, found);
48
+ return found;
49
+ }, "ancestorEnvironments");
50
+ var valuesOf = /* @__PURE__ */ __name((environments, name) => environments.flatMap((environ) => environ.filter((entry) => entry.startsWith(`${name}=`)).map((entry) => entry.slice(name.length + 1))), "valuesOf");
51
+ var lockedByAncestor = /* @__PURE__ */ __name((name, ancestry = {}) => {
52
+ const environments = ancestorEnvironments(ancestry);
53
+ return environments === null || valuesOf(environments, name).some(locking);
54
+ }, "lockedByAncestor");
55
+ var ancestorValue = /* @__PURE__ */ __name((name, env, ancestry = {}) => valuesOf(ancestorEnvironments(ancestry) ?? [], name).at(-1) ?? env[name], "ancestorValue");
56
+ var readOnlyLockOf = /* @__PURE__ */ __name((app, env) => {
57
+ const name = envName(app, "READ_ONLY");
58
+ return locking(env[name]) || lockedByAncestor(name) ? name : void 0;
59
+ }, "readOnlyLockOf");
60
+ var mailHolderVariable = /* @__PURE__ */ __name((app) => envName(app, "MAIL_HOLDER"), "mailHolderVariable");
61
+ var MESSENGER_CHANGE_REFUSAL = "send, react, change chats or change the account";
62
+ var readOnlyRefusal = /* @__PURE__ */ __name((lock, what) => new CliError("permission_error", `this process is read-only (${lock}) \u2014 it cannot ${what}`), "readOnlyRefusal");
63
+
64
+ export {
65
+ envName,
66
+ ancestorValue,
67
+ readOnlyLockOf,
68
+ mailHolderVariable,
69
+ MESSENGER_CHANGE_REFUSAL,
70
+ readOnlyRefusal
71
+ };