@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
@@ -2,52 +2,31 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError
5
- } from "./chunk-FEM2JQN2.js";
5
+ } from "./chunk-EA2OB75T.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // 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/files/atomic-write.js
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/files/lock.js
11
+ import { mkdir as mkdir2 } from "node:fs/promises";
12
+ import { basename, dirname } from "node:path";
13
+
14
+ // 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/files/native-writer-lease.js
11
15
  import { randomUUID } from "node:crypto";
12
- import { constants } from "node:fs";
13
- import { link, open, realpath, rename, unlink } from "node:fs/promises";
14
- import { basename, dirname, join } from "node:path";
15
- var openFolder = /* @__PURE__ */ __name((folder) => process.platform === "win32" ? Promise.resolve(void 0) : open(folder, constants.O_RDONLY | (constants.O_DIRECTORY ?? 0) | (constants.O_NOFOLLOW ?? 0)), "openFolder");
16
- var writeFileAtomic = /* @__PURE__ */ __name(async (path, content, { mode = 384, overwrite = true, signal, beforePublish } = {}) => {
17
- signal?.throwIfAborted();
18
- const folder = await realpath(dirname(path));
19
- const target = join(folder, basename(path));
20
- const directory = await openFolder(folder);
21
- try {
22
- const temporary = join(folder, `.${basename(path)}.${randomUUID()}.tmp`);
23
- let handle = await open(temporary, "wx", mode);
24
- let published = false;
25
- try {
26
- await handle.writeFile(content);
27
- await handle.sync();
28
- await handle.close();
29
- handle = void 0;
30
- signal?.throwIfAborted();
31
- await beforePublish?.();
32
- if (overwrite)
33
- await rename(temporary, target);
34
- else
35
- await link(temporary, target);
36
- published = overwrite;
37
- await directory?.sync();
38
- } finally {
39
- await handle?.close().catch(() => void 0);
40
- if (!published)
41
- await unlink(temporary).catch(() => void 0);
42
- }
43
- } finally {
44
- await directory?.close().catch(() => void 0);
45
- }
46
- }, "writeFileAtomic");
16
+ import { lstat as lstat3, mkdir, open as open2, realpath as realpath2, rmdir as rmdir2, unlink as unlink3 } from "node:fs/promises";
17
+ import { hostname as hostname2 } from "node:os";
18
+ import { join as join2 } from "node:path";
47
19
 
48
- // 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/files/ordinary-file.js
49
- import { constants as constants2 } from "node:fs";
50
- import { lstat, open as open2 } from "node:fs/promises";
20
+ // 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/files/native-lease-inspection.js
21
+ import { lstat as lstat2, readdir, realpath, unlink } from "node:fs/promises";
22
+ import { join } from "node:path";
23
+
24
+ // 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/files/native-lease-owner.js
25
+ import { hostname } from "node:os";
26
+
27
+ // 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/files/ordinary-file.js
28
+ import { constants } from "node:fs";
29
+ import { lstat, open } from "node:fs/promises";
51
30
  var deviceOf = /* @__PURE__ */ __name((dev) => process.platform === "win32" ? BigInt.asUintN(32, dev) : dev, "deviceOf");
52
31
  var sameIdentity = /* @__PURE__ */ __name((left, right) => left.ino === right.ino && deviceOf(left.dev) === deviceOf(right.dev), "sameIdentity");
53
32
  var openOrdinaryFile = /* @__PURE__ */ __name(async (path, options = {}) => {
@@ -56,16 +35,16 @@ var openOrdinaryFile = /* @__PURE__ */ __name(async (path, options = {}) => {
56
35
  throw new CliError("validation_error", "archive path must be an ordinary file without a symlink");
57
36
  if (!before.isFile())
58
37
  throw new CliError("validation_error", "archive path must be an ordinary file");
59
- const access = options.writable ? constants2.O_RDWR : constants2.O_RDONLY;
60
- const flags = process.platform === "win32" ? access : access | (constants2.O_NOFOLLOW ?? 0) | (constants2.O_NONBLOCK ?? 0);
61
- const file = await open2(path, flags);
38
+ const access = options.writable ? constants.O_RDWR : constants.O_RDONLY;
39
+ const flags = process.platform === "win32" ? access : access | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0);
40
+ const file = await open(path, flags);
62
41
  try {
63
42
  const opened = await file.stat({ bigint: true });
64
43
  const after = await lstat(path, { bigint: true });
65
44
  if (!opened.isFile() || !after.isFile() || before.ino !== opened.ino || before.ino !== after.ino)
66
45
  throw new CliError("validation_error", "archive file changed while opening");
67
46
  if (process.platform === "win32" && before.dev === 0n && after.dev === 0n) {
68
- const witness = await open2(path, flags);
47
+ const witness = await open(path, flags);
69
48
  try {
70
49
  const identified = await witness.stat({ bigint: true });
71
50
  const final = await lstat(path, { bigint: true });
@@ -101,7 +80,7 @@ var sameOrdinaryFile = /* @__PURE__ */ __name(async (path, created) => {
101
80
  var syncDirectory = /* @__PURE__ */ __name(async (path) => {
102
81
  if (process.platform === "win32")
103
82
  return;
104
- const directory = await open2(path, constants2.O_RDONLY | (constants2.O_DIRECTORY ?? 0) | (constants2.O_NOFOLLOW ?? 0));
83
+ const directory = await open(path, constants.O_RDONLY | (constants.O_DIRECTORY ?? 0) | (constants.O_NOFOLLOW ?? 0));
105
84
  try {
106
85
  if (!(await directory.stat()).isDirectory())
107
86
  throw new CliError("validation_error", "archive publication directory must be ordinary");
@@ -111,51 +90,7 @@ var syncDirectory = /* @__PURE__ */ __name(async (path) => {
111
90
  }
112
91
  }, "syncDirectory");
113
92
 
114
- // 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/files/bounded-utf8.js
115
- var readBoundedUtf8File = /* @__PURE__ */ __name(async (path, { maxBytes }) => {
116
- if (!Number.isSafeInteger(maxBytes) || maxBytes < 1 || maxBytes > 16 * 1024 * 1024)
117
- throw new CliError("validation_error", "file maxBytes takes 1\u201316777216 bytes");
118
- const file = await openOrdinaryFile(path);
119
- try {
120
- if ((await file.stat()).size > maxBytes)
121
- throw new CliError("validation_error", "input file exceeds its byte budget");
122
- const chunks = [], buffer = Buffer.alloc(Math.min(65536, maxBytes + 1));
123
- let bytes = 0;
124
- for (; ; ) {
125
- const { bytesRead } = await file.read(buffer, 0, Math.min(buffer.length, maxBytes - bytes + 1), null);
126
- if (bytesRead === 0)
127
- break;
128
- bytes += bytesRead;
129
- if (bytes > maxBytes)
130
- throw new CliError("validation_error", "input file exceeds its byte budget");
131
- chunks.push(Buffer.from(buffer.subarray(0, bytesRead)));
132
- }
133
- try {
134
- return new TextDecoder("utf-8", { fatal: true }).decode(Buffer.concat(chunks, bytes));
135
- } catch {
136
- throw new CliError("validation_error", "input file must contain valid UTF-8");
137
- }
138
- } finally {
139
- await file.close();
140
- }
141
- }, "readBoundedUtf8File");
142
-
143
- // 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/files/lock.js
144
- import { mkdir as mkdir2 } from "node:fs/promises";
145
- import { basename as basename2, dirname as dirname2 } from "node:path";
146
-
147
- // 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/files/native-writer-lease.js
148
- import { randomUUID as randomUUID2 } from "node:crypto";
149
- import { lstat as lstat3, mkdir, open as open3, realpath as realpath3, rmdir as rmdir2, unlink as unlink4 } from "node:fs/promises";
150
- import { hostname as hostname2 } from "node:os";
151
- import { join as join3 } from "node:path";
152
-
153
- // 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/files/native-lease-inspection.js
154
- import { lstat as lstat2, readdir, realpath as realpath2, unlink as unlink2 } from "node:fs/promises";
155
- import { join as join2 } from "node:path";
156
-
157
- // 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/files/native-lease-owner.js
158
- import { hostname } from "node:os";
93
+ // 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/files/native-lease-owner.js
159
94
  var missingLeaseFile = /* @__PURE__ */ __name((error) => typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT", "missingLeaseFile");
160
95
  var readLeaseOwner = /* @__PURE__ */ __name(async (path, name, signal) => {
161
96
  signal?.throwIfAborted();
@@ -199,13 +134,13 @@ var leaseOwnerStatus = /* @__PURE__ */ __name((owner) => {
199
134
  }
200
135
  }, "leaseOwnerStatus");
201
136
 
202
- // 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/files/native-lease-inspection.js
137
+ // 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/files/native-lease-inspection.js
203
138
  var leaseInspection = /* @__PURE__ */ __name((markerDirectory) => {
204
139
  const inspect = /* @__PURE__ */ __name(async (destination, options = {}) => {
205
140
  options.signal?.throwIfAborted();
206
- const root = await realpath2(destination);
141
+ const root = await realpath(destination);
207
142
  options.signal?.throwIfAborted();
208
- const folder = join2(root, markerDirectory);
143
+ const folder = join(root, markerDirectory);
209
144
  let names;
210
145
  try {
211
146
  if ((await lstat2(folder)).isSymbolicLink())
@@ -221,7 +156,7 @@ var leaseInspection = /* @__PURE__ */ __name((markerDirectory) => {
221
156
  const result = [];
222
157
  for (const name of names.sort()) {
223
158
  options.signal?.throwIfAborted();
224
- const owner = await readLeaseOwner(join2(folder, name), name, options.signal);
159
+ const owner = await readLeaseOwner(join(folder, name), name, options.signal);
225
160
  result.push({
226
161
  name,
227
162
  status: owner ? leaseOwnerStatus(owner) : "unrecognized",
@@ -233,7 +168,7 @@ var leaseInspection = /* @__PURE__ */ __name((markerDirectory) => {
233
168
  }, "inspect");
234
169
  const recover = /* @__PURE__ */ __name(async (destination, options = {}) => {
235
170
  options.signal?.throwIfAborted();
236
- const root = await realpath2(destination);
171
+ const root = await realpath(destination);
237
172
  const locks = await inspect(root, options);
238
173
  const removed = [];
239
174
  if (options.apply)
@@ -241,12 +176,12 @@ var leaseInspection = /* @__PURE__ */ __name((markerDirectory) => {
241
176
  options.signal?.throwIfAborted();
242
177
  if (lock.status !== "stale")
243
178
  continue;
244
- const path = join2(root, markerDirectory, lock.name);
179
+ const path = join(root, markerDirectory, lock.name);
245
180
  const owner = await readLeaseOwner(path, lock.name, options.signal);
246
181
  if (!owner || leaseOwnerStatus(owner) !== "stale")
247
182
  continue;
248
183
  try {
249
- await unlink2(path);
184
+ await unlink(path);
250
185
  removed.push(lock.name);
251
186
  } catch (error) {
252
187
  if (!missingLeaseFile(error))
@@ -258,8 +193,8 @@ var leaseInspection = /* @__PURE__ */ __name((markerDirectory) => {
258
193
  return { inspect, recover };
259
194
  }, "leaseInspection");
260
195
 
261
- // 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/files/native-lease-release.js
262
- import { rmdir, unlink as unlink3 } from "node:fs/promises";
196
+ // 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/files/native-lease-release.js
197
+ import { rmdir, unlink as unlink2 } from "node:fs/promises";
263
198
  var ownedNativeLease = /* @__PURE__ */ __name((path, name, owner, folder, identity) => {
264
199
  let releasing;
265
200
  const held = /* @__PURE__ */ __name(async () => {
@@ -271,7 +206,7 @@ var ownedNativeLease = /* @__PURE__ */ __name((path, name, owner, folder, identi
271
206
  const release = /* @__PURE__ */ __name(async () => {
272
207
  if (!await held())
273
208
  throw new CliError("configuration_error", "owned archive lock changed before release");
274
- await unlink3(path);
209
+ await unlink2(path);
275
210
  await rmdir(folder).catch(() => void 0);
276
211
  }, "release");
277
212
  return {
@@ -283,7 +218,7 @@ var ownedNativeLease = /* @__PURE__ */ __name((path, name, owner, folder, identi
283
218
  };
284
219
  }, "ownedNativeLease");
285
220
 
286
- // 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/files/native-writer-lease.js
221
+ // 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/files/native-writer-lease.js
287
222
  var validName = /* @__PURE__ */ __name((value) => typeof value === "string" && value.length > 0 && value !== "." && value !== ".." && !/[\\/\0:]/.test(value), "validName");
288
223
  var nativeWriterLeaseStore = /* @__PURE__ */ __name((layout) => {
289
224
  const { markerDirectory, legacyMarker } = layout;
@@ -294,12 +229,12 @@ var nativeWriterLeaseStore = /* @__PURE__ */ __name((layout) => {
294
229
  ...inspection,
295
230
  acquire: /* @__PURE__ */ __name(async (destination, { signal } = {}) => {
296
231
  signal?.throwIfAborted();
297
- const root = await realpath3(destination);
232
+ const root = await realpath2(destination);
298
233
  signal?.throwIfAborted();
299
- const folder = join3(root, markerDirectory);
300
- const owner = { version: 1, pid: process.pid, host: hostname2(), nonce: randomUUID2() };
234
+ const folder = join2(root, markerDirectory);
235
+ const owner = { version: 1, pid: process.pid, host: hostname2(), nonce: randomUUID() };
301
236
  const name = `${owner.pid}-${owner.nonce}.json`;
302
- const path = join3(folder, name);
237
+ const path = join2(folder, name);
303
238
  const marker = /* @__PURE__ */ __name(async (attempt = 1) => {
304
239
  await mkdir(folder, { recursive: true });
305
240
  try {
@@ -307,7 +242,7 @@ var nativeWriterLeaseStore = /* @__PURE__ */ __name((layout) => {
307
242
  throw new CliError("validation_error", "archive lock directory must not be a symlink");
308
243
  await inspection.recover(root, { apply: true, signal });
309
244
  signal?.throwIfAborted();
310
- return await open3(path, "wx", 384);
245
+ return await open2(path, "wx", 384);
311
246
  } catch (error) {
312
247
  if (attempt < 5 && missingLeaseFile(error))
313
248
  return marker(attempt + 1);
@@ -332,7 +267,7 @@ var nativeWriterLeaseStore = /* @__PURE__ */ __name((layout) => {
332
267
  return { status: "busy", locks };
333
268
  if (legacyMarker) {
334
269
  try {
335
- await lstat3(join3(root, legacyMarker));
270
+ await lstat3(join2(root, legacyMarker));
336
271
  return { status: "legacy" };
337
272
  } catch (error) {
338
273
  if (!missingLeaseFile(error))
@@ -346,7 +281,7 @@ var nativeWriterLeaseStore = /* @__PURE__ */ __name((layout) => {
346
281
  await file.close().catch(() => void 0);
347
282
  if (!retained) {
348
283
  if (identity && await sameOrdinaryFile(path, identity))
349
- await unlink4(path).catch(() => void 0);
284
+ await unlink3(path).catch(() => void 0);
350
285
  await rmdir2(folder).catch(() => void 0);
351
286
  }
352
287
  }
@@ -354,22 +289,89 @@ var nativeWriterLeaseStore = /* @__PURE__ */ __name((layout) => {
354
289
  };
355
290
  }, "nativeWriterLeaseStore");
356
291
 
357
- // 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/files/lock.js
292
+ // 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/files/lock.js
358
293
  var acquireLock = /* @__PURE__ */ __name(async (path, { signal } = {}) => {
359
- const folder = dirname2(path);
294
+ const folder = dirname(path);
360
295
  await mkdir2(folder, { recursive: true, mode: 448 });
361
- const acquired = await nativeWriterLeaseStore({ markerDirectory: basename2(path) }).acquire(folder, {
296
+ const acquired = await nativeWriterLeaseStore({ markerDirectory: basename(path) }).acquire(folder, {
362
297
  ...signal ? { signal } : {}
363
298
  });
364
299
  if (acquired.status === "acquired")
365
300
  return acquired.lease;
366
- throw new CliError("validation_error", `${basename2(path)} is locked by another process`, {
301
+ throw new CliError("validation_error", `${basename(path)} is locked by another process`, {
367
302
  reason: "file.locked",
368
303
  ...acquired.status === "busy" ? { holders: acquired.locks } : {}
369
304
  });
370
305
  }, "acquireLock");
371
306
 
372
- // 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/files/safe-name.js
307
+ // 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/files/atomic-write.js
308
+ import { randomUUID as randomUUID2 } from "node:crypto";
309
+ import { constants as constants2 } from "node:fs";
310
+ import { link, open as open3, realpath as realpath3, rename, unlink as unlink4 } from "node:fs/promises";
311
+ import { basename as basename2, dirname as dirname2, join as join3 } from "node:path";
312
+ var openFolder = /* @__PURE__ */ __name((folder) => process.platform === "win32" ? Promise.resolve(void 0) : open3(folder, constants2.O_RDONLY | (constants2.O_DIRECTORY ?? 0) | (constants2.O_NOFOLLOW ?? 0)), "openFolder");
313
+ var writeFileAtomic = /* @__PURE__ */ __name(async (path, content, { mode = 384, overwrite = true, signal, beforePublish } = {}) => {
314
+ signal?.throwIfAborted();
315
+ const folder = await realpath3(dirname2(path));
316
+ const target = join3(folder, basename2(path));
317
+ const directory = await openFolder(folder);
318
+ try {
319
+ const temporary = join3(folder, `.${basename2(path)}.${randomUUID2()}.tmp`);
320
+ let handle = await open3(temporary, "wx", mode);
321
+ let published = false;
322
+ try {
323
+ await handle.writeFile(content);
324
+ await handle.sync();
325
+ await handle.close();
326
+ handle = void 0;
327
+ signal?.throwIfAborted();
328
+ await beforePublish?.();
329
+ if (overwrite)
330
+ await rename(temporary, target);
331
+ else
332
+ await link(temporary, target);
333
+ published = overwrite;
334
+ await directory?.sync();
335
+ } finally {
336
+ await handle?.close().catch(() => void 0);
337
+ if (!published)
338
+ await unlink4(temporary).catch(() => void 0);
339
+ }
340
+ } finally {
341
+ await directory?.close().catch(() => void 0);
342
+ }
343
+ }, "writeFileAtomic");
344
+
345
+ // 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/files/bounded-utf8.js
346
+ var readBoundedUtf8File = /* @__PURE__ */ __name(async (path, { maxBytes }) => {
347
+ if (!Number.isSafeInteger(maxBytes) || maxBytes < 1 || maxBytes > 16 * 1024 * 1024)
348
+ throw new CliError("validation_error", "file maxBytes takes 1\u201316777216 bytes");
349
+ const file = await openOrdinaryFile(path);
350
+ try {
351
+ if ((await file.stat()).size > maxBytes)
352
+ throw new CliError("validation_error", "input file exceeds its byte budget");
353
+ const chunks = [], buffer = Buffer.alloc(Math.min(65536, maxBytes + 1));
354
+ let bytes = 0;
355
+ for (; ; ) {
356
+ const { bytesRead } = await file.read(buffer, 0, Math.min(buffer.length, maxBytes - bytes + 1), null);
357
+ if (bytesRead === 0)
358
+ break;
359
+ bytes += bytesRead;
360
+ if (bytes > maxBytes)
361
+ throw new CliError("validation_error", "input file exceeds its byte budget");
362
+ chunks.push(Buffer.from(buffer.subarray(0, bytesRead)));
363
+ }
364
+ try {
365
+ return new TextDecoder("utf-8", { fatal: true }).decode(Buffer.concat(chunks, bytes));
366
+ } catch {
367
+ throw new CliError("validation_error", "input file must contain valid UTF-8");
368
+ }
369
+ } finally {
370
+ await file.close();
371
+ }
372
+ }, "readBoundedUtf8File");
373
+
374
+ // 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/files/safe-name.js
373
375
  import { basename as basename3 } from "node:path";
374
376
  var safeName = /* @__PURE__ */ __name((name, platform = process.platform) => {
375
377
  let plain = name === void 0 ? "" : basename3(name.replaceAll("\\", "/")).replace(/[\p{Cc}​-‏‪-‮⁦-⁩]/gu, "").replace(/^\.+/, "");
@@ -0,0 +1,16 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ __name
5
+ } from "./chunk-ZVVMGPBJ.js";
6
+
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/normalize.js
8
+ var NORMALIZER_VERSION = 1;
9
+ var fold = /* @__PURE__ */ __name((text) => text.normalize("NFKD").replace(new RegExp("\\p{M}+", "gu"), "").normalize("NFC").toLowerCase(), "fold");
10
+ var normalize = /* @__PURE__ */ __name((text) => fold(text).replace(new RegExp("\\p{Cc}", "gu"), " ").replace(/\s+/gu, " ").trim(), "normalize");
11
+
12
+ export {
13
+ NORMALIZER_VERSION,
14
+ fold,
15
+ normalize
16
+ };
@@ -0,0 +1,185 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ isCommandServer
5
+ } from "./chunk-2VYEGKQ3.js";
6
+ import {
7
+ stdinFieldOf
8
+ } from "./chunk-PJ3FKBXG.js";
9
+ import {
10
+ commandPathOf
11
+ } from "./chunk-G2TSDMTA.js";
12
+ import {
13
+ commandServerRequest,
14
+ metaOf
15
+ } from "./chunk-FJMRDRPN.js";
16
+ import {
17
+ errorObjectOf,
18
+ renderError
19
+ } from "./chunk-4RJL32PF.js";
20
+ import {
21
+ CliError
22
+ } from "./chunk-EA2OB75T.js";
23
+ import {
24
+ __name
25
+ } from "./chunk-ZVVMGPBJ.js";
26
+
27
+ // 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/command-server.js
28
+ import { createInterface } from "node:readline";
29
+ var COMMAND_SERVER_PROTOCOL = 1;
30
+ var COMMAND_SERVER_IDLE_MS = 10 * 6e4;
31
+ var COMMAND_SERVER_CONCURRENT = 8;
32
+ var runsAlone = /* @__PURE__ */ __name((command) => commandPathOf(command)[0] === "store", "runsAlone");
33
+ var enterCommandServer = /* @__PURE__ */ __name(async (command, cli) => {
34
+ const request = commandServerRequest();
35
+ if (!request)
36
+ return;
37
+ refuseInCommandServer(command, cli);
38
+ if (runsAlone(command))
39
+ await request.alone();
40
+ }, "enterCommandServer");
41
+ var refuseInCommandServer = /* @__PURE__ */ __name((command, cli) => {
42
+ if (!commandServerRequest())
43
+ return;
44
+ const typed = [cli, ...commandPathOf(command)].join(" ");
45
+ const { lifetime } = metaOf(command);
46
+ if (lifetime)
47
+ throw new CliError("validation_error", `\`${typed}\` ${lifetime === "persistent" ? "runs until it is stopped" : "waits on a person"}; the command server runs only commands that return \u2014 start it as a process of its own`);
48
+ if (stdinFieldOf(command))
49
+ throw new CliError("validation_error", `\`${typed}\` reads its input on stdin, which the command server does not pass on \u2014 start it as a process of its own`);
50
+ }, "refuseInCommandServer");
51
+ var refusal = /* @__PURE__ */ __name((cli, message) => `${renderError(errorObjectOf(new CliError("validation_error", message)), { cli, interactive: false })}
52
+ `, "refusal");
53
+ var requestOf = /* @__PURE__ */ __name((line, cli) => {
54
+ let parsed;
55
+ try {
56
+ parsed = JSON.parse(line);
57
+ } catch {
58
+ return { id: null, error: "a request is one JSON object per line" };
59
+ }
60
+ const { id, argv } = parsed ?? {};
61
+ const known = typeof id === "number" && Number.isFinite(id) ? id : null;
62
+ if (known === null)
63
+ return { id: null, error: 'a request needs a numeric "id"' };
64
+ if (!Array.isArray(argv) || !argv.every((word) => typeof word === "string"))
65
+ return { id: known, error: '"argv" is a list of strings' };
66
+ if (isCommandServer(argv))
67
+ return { id: known, error: `\`${cli} commands --serve\` cannot run inside itself` };
68
+ return { id: known, argv };
69
+ }, "requestOf");
70
+ var serveCommands = /* @__PURE__ */ __name(async ({ input, write, run, cli, version, idleMs = COMMAND_SERVER_IDLE_MS, concurrent = COMMAND_SERVER_CONCURRENT, signal }) => {
71
+ const send = /* @__PURE__ */ __name((value) => write(`${JSON.stringify(value)}
72
+ `), "send");
73
+ await send({ ready: true, protocol: COMMAND_SERVER_PROTOCOL, version, concurrent });
74
+ const lines = createInterface({ input, crlfDelay: Number.POSITIVE_INFINITY });
75
+ return new Promise((resolve) => {
76
+ const waiting = [];
77
+ let active = 0;
78
+ let running = 0;
79
+ let gated = false;
80
+ let drained;
81
+ let turns = Promise.resolve();
82
+ let timer;
83
+ let ending = false;
84
+ let done = false;
85
+ const finish = /* @__PURE__ */ __name(() => {
86
+ if (done)
87
+ return;
88
+ done = true;
89
+ clearTimeout(timer);
90
+ lines.close();
91
+ resolve(0);
92
+ }, "finish");
93
+ const settle = /* @__PURE__ */ __name(() => {
94
+ if (running === 0 && drained) {
95
+ const go = drained;
96
+ drained = void 0;
97
+ go();
98
+ }
99
+ pump();
100
+ if (active > 0 || waiting.length > 0 || done)
101
+ return;
102
+ if (ending)
103
+ finish();
104
+ else {
105
+ clearTimeout(timer);
106
+ timer = setTimeout(finish, idleMs);
107
+ }
108
+ }, "settle");
109
+ const start = /* @__PURE__ */ __name((line) => {
110
+ active += 1;
111
+ running += 1;
112
+ let holdsPlace = true;
113
+ let ended = false;
114
+ let turn;
115
+ let release;
116
+ const alone = /* @__PURE__ */ __name(() => {
117
+ if (turn)
118
+ return turn;
119
+ holdsPlace = false;
120
+ running -= 1;
121
+ turn = turns.then(() => new Promise((go) => {
122
+ if (ended)
123
+ return go();
124
+ gated = true;
125
+ drained = /* @__PURE__ */ __name(() => {
126
+ if (ended)
127
+ gated = false;
128
+ else {
129
+ holdsPlace = true;
130
+ running += 1;
131
+ }
132
+ go();
133
+ }, "drained");
134
+ settle();
135
+ }));
136
+ turns = turn.then(() => ended && !holdsPlace ? void 0 : new Promise((free) => release = free));
137
+ return turn;
138
+ }, "alone");
139
+ const answer = /* @__PURE__ */ __name(async () => {
140
+ const request = requestOf(line, cli);
141
+ if ("error" in request)
142
+ return send({ id: request.id, code: 2, stdout: "", stderr: refusal(cli, request.error) });
143
+ const answered = await run(request.argv, alone);
144
+ return send({ id: request.id, ...answered });
145
+ }, "answer");
146
+ answer().catch(finish).finally(() => {
147
+ ended = true;
148
+ active -= 1;
149
+ if (holdsPlace)
150
+ running -= 1;
151
+ if (release) {
152
+ gated = false;
153
+ release();
154
+ }
155
+ settle();
156
+ });
157
+ }, "start");
158
+ const pump = /* @__PURE__ */ __name(() => {
159
+ while (!done && !gated && running < concurrent && waiting.length > 0)
160
+ start(waiting.shift());
161
+ }, "pump");
162
+ lines.on("line", (line) => {
163
+ if (done || ending || line.trim() === "")
164
+ return;
165
+ clearTimeout(timer);
166
+ waiting.push(line);
167
+ pump();
168
+ });
169
+ const end = /* @__PURE__ */ __name(() => {
170
+ ending = true;
171
+ settle();
172
+ }, "end");
173
+ lines.on("close", end);
174
+ if (signal?.aborted)
175
+ end();
176
+ signal?.addEventListener("abort", end, { once: true });
177
+ settle();
178
+ });
179
+ }, "serveCommands");
180
+
181
+ export {
182
+ COMMAND_SERVER_CONCURRENT,
183
+ enterCommandServer,
184
+ serveCommands
185
+ };
@@ -5,21 +5,21 @@ import {
5
5
  fieldsOf,
6
6
  processStreams,
7
7
  projectFields
8
- } from "./chunk-OORMSM6O.js";
8
+ } from "./chunk-HNWDEDMU.js";
9
9
  import {
10
10
  COMPACT_FLAG
11
- } from "./chunk-WOIHSQAL.js";
11
+ } from "./chunk-4RJL32PF.js";
12
12
  import {
13
13
  CliError
14
- } from "./chunk-FEM2JQN2.js";
14
+ } from "./chunk-EA2OB75T.js";
15
15
  import {
16
16
  singleLine
17
- } from "./chunk-OE7EIP5L.js";
17
+ } from "./chunk-HCZYJMBP.js";
18
18
  import {
19
19
  __name
20
20
  } from "./chunk-ZVVMGPBJ.js";
21
21
 
22
- // 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/result-fields.js
22
+ // 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/result-fields.js
23
23
  var named = /* @__PURE__ */ __name((work) => {
24
24
  try {
25
25
  return work();
@@ -46,7 +46,7 @@ var projectFields2 = /* @__PURE__ */ __name((value, fields) => named(() => {
46
46
  return projectFields(value, fields);
47
47
  }), "projectFields");
48
48
 
49
- // 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/output-detail.js
49
+ // 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/output-detail.js
50
50
  var RARELY_SET = ["editedAt", "replyTo", "forwardedFrom", "reactions"];
51
51
  var BRIEF = ["locator", "chatTitle", "timestamp", "senderName", "excerpt", "score"];
52
52
  var SNAKE_BRIEF = ["ref", "chat_title", "timestamp", "sender_name", "excerpt", "score"];
@@ -82,7 +82,7 @@ var atDetail = /* @__PURE__ */ __name((value, detail = "default") => {
82
82
  return value;
83
83
  }, "atDetail");
84
84
 
85
- // 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/output.js
85
+ // 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/output.js
86
86
  var refuseCompact = /* @__PURE__ */ __name(({ json, jsonl, fields, hitDetail }) => {
87
87
  const other = jsonl ? "--jsonl" : fields !== void 0 ? "--json=\u2026" : json ? "--json" : hitDetail === "brief" ? "--brief" : "";
88
88
  if (other)