@wirecat/drive-cli 0.45.0 → 0.46.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 (149) hide show
  1. package/dist/bin/drive.js +2 -2
  2. package/dist/bundle/{all-profiles-LTHNCWQW.js → all-profiles-O7CNQ7FO.js} +8 -8
  3. package/dist/bundle/{anthropic-NOJEF3V2.js → anthropic-6T67J2CE.js} +5 -5
  4. package/dist/bundle/app-server-BVBZT3UY.js +237 -0
  5. package/dist/bundle/{bun-ADJVI4HY.js → bun-O6RL6LRQ.js} +2 -2
  6. package/dist/bundle/{bun-sqlite-GNXLBF2A.js → bun-sqlite-54W7JUY3.js} +4 -4
  7. package/dist/bundle/{chunk-IGB5CJCA.js → chunk-2DLAJGRN.js} +1 -1
  8. package/dist/bundle/{chunk-NQ6LLDDC.js → chunk-3HRDEJJW.js} +4 -4
  9. package/dist/bundle/{chunk-XPEWOPJR.js → chunk-3Z7WSD2A.js} +10 -8
  10. package/dist/bundle/{chunk-WPGCDWPU.js → chunk-44FV5JAS.js} +21 -21
  11. package/dist/bundle/{chunk-GX4WEMAG.js → chunk-4DW6QGEV.js} +11 -11
  12. package/dist/bundle/{chunk-IP4OK7RQ.js → chunk-4NGLRHWO.js} +1 -1
  13. package/dist/bundle/{chunk-LNB7BIZL.js → chunk-5MGIL5LW.js} +19 -17
  14. package/dist/bundle/{chunk-66N2DGGC.js → chunk-5MYFPQDA.js} +21 -14
  15. package/dist/bundle/{chunk-MWUITL6N.js → chunk-5TC3NCAF.js} +2 -2
  16. package/dist/bundle/{chunk-4UE7AVHZ.js → chunk-A3FU4RR6.js} +4 -4
  17. package/dist/bundle/{chunk-PIN5RZ3D.js → chunk-AIXLOMH4.js} +1 -1
  18. package/dist/bundle/{chunk-WZUJKUBK.js → chunk-AOOD3RMK.js} +7 -7
  19. package/dist/bundle/{chunk-Z4O6C7WR.js → chunk-AUS6TKP5.js} +35 -33
  20. package/dist/bundle/{chunk-OECPFZLP.js → chunk-BEXHAGXH.js} +96 -95
  21. package/dist/bundle/{chunk-3V6NPZY7.js → chunk-BHE7ZY2N.js} +45 -45
  22. package/dist/bundle/{chunk-GKHM6I64.js → chunk-BJ3JRO34.js} +7 -7
  23. package/dist/bundle/{chunk-2FTZBZOB.js → chunk-BQUPOB5H.js} +8 -8
  24. package/dist/bundle/{chunk-CDI67JSB.js → chunk-CFZWPIVC.js} +20 -20
  25. package/dist/bundle/{chunk-EVWXODYV.js → chunk-CKR3DVUK.js} +11 -11
  26. package/dist/bundle/{chunk-AN3GVZTU.js → chunk-CVIKKIGE.js} +1 -1
  27. package/dist/bundle/{chunk-7XWUOCGW.js → chunk-D67JGWSC.js} +2 -2
  28. package/dist/bundle/{chunk-UC44ZMQV.js → chunk-DDYR6DYL.js} +1 -1
  29. package/dist/bundle/{chunk-C6SMAEED.js → chunk-DL7D6Y3B.js} +199 -199
  30. package/dist/bundle/{chunk-PDH2QQQV.js → chunk-DORXXBFC.js} +7 -7
  31. package/dist/bundle/{chunk-DCTXOMOR.js → chunk-DXKVEOSS.js} +20 -2
  32. package/dist/bundle/{chunk-ZQNXKWUY.js → chunk-FEULDMWM.js} +258 -244
  33. package/dist/bundle/{chunk-TDC6JGDA.js → chunk-G3FAOS52.js} +2 -2
  34. package/dist/bundle/{chunk-HOIUIKWS.js → chunk-GHOWRW7E.js} +4 -3
  35. package/dist/bundle/{chunk-C4XP5T73.js → chunk-GNFHZZ55.js} +5 -5
  36. package/dist/bundle/{chunk-K4N2DKE5.js → chunk-GOR3Z2FR.js} +2 -2
  37. package/dist/bundle/{chunk-WQMVSQPP.js → chunk-GQW4GRYR.js} +6 -6
  38. package/dist/bundle/{chunk-Y5EJSZXV.js → chunk-GWPKIRNQ.js} +5 -5
  39. package/dist/bundle/{chunk-HA3WCVGY.js → chunk-HEPIOCHN.js} +51 -49
  40. package/dist/bundle/{chunk-DC4T3FNP.js → chunk-IAW5A7OR.js} +27 -27
  41. package/dist/bundle/{chunk-4TQSNQVV.js → chunk-IGMRWQP3.js} +25 -25
  42. package/dist/bundle/{chunk-65GGKAQ7.js → chunk-IKNU5A5Y.js} +3 -3
  43. package/dist/bundle/{chunk-ZPMLLONT.js → chunk-JVTVAZ5X.js} +19 -19
  44. package/dist/bundle/{chunk-A6ZKTNTZ.js → chunk-K74PQVQZ.js} +7 -7
  45. package/dist/bundle/{server-2UQDEWTS.js → chunk-K7FRUB33.js} +40 -63
  46. package/dist/bundle/{chunk-ZS635F4O.js → chunk-KADPV4YA.js} +2 -2
  47. package/dist/bundle/{chunk-ZIHLE7LG.js → chunk-KJMBV574.js} +3252 -3019
  48. package/dist/bundle/{chunk-ICKNJIGE.js → chunk-LHIL46I3.js} +2 -2
  49. package/dist/bundle/{chunk-LWT55XC5.js → chunk-LJARCTGL.js} +4 -4
  50. package/dist/bundle/{chunk-64WJYT2F.js → chunk-LOTQ2HMT.js} +9 -9
  51. package/dist/bundle/{chunk-MJR2OTO4.js → chunk-LZ5OTVWH.js} +6 -6
  52. package/dist/bundle/{chunk-V7GN5BI7.js → chunk-MAXN7COO.js} +1 -1
  53. package/dist/bundle/{chunk-LW2G4U6W.js → chunk-MFS52LTZ.js} +1 -1
  54. package/dist/bundle/{chunk-YJX4X564.js → chunk-NB2N6L3R.js} +6 -6
  55. package/dist/bundle/{chunk-GTYY6BIE.js → chunk-NDNTLUPS.js} +2 -2
  56. package/dist/bundle/{chunk-TOYPN2XX.js → chunk-NLEB26GA.js} +2 -2
  57. package/dist/bundle/{chunk-4TIC23D2.js → chunk-NM26XAS2.js} +1 -1
  58. package/dist/bundle/{chunk-7PVNJAQ2.js → chunk-NP3XLLN3.js} +3 -3
  59. package/dist/bundle/{chunk-LY26NW3I.js → chunk-NW7IMGRR.js} +1 -1
  60. package/dist/bundle/{chunk-NZIHPYY5.js → chunk-OWXTPXIQ.js} +11 -11
  61. package/dist/bundle/{chunk-BPBIBVFH.js → chunk-PDBBBUY7.js} +10 -10
  62. package/dist/bundle/{chunk-ZU732VCC.js → chunk-PH74B2VZ.js} +3 -3
  63. package/dist/bundle/{chunk-PJDO7AFZ.js → chunk-PJ7IQVOM.js} +2 -2
  64. package/dist/bundle/{chunk-CFT7UHF6.js → chunk-QTJUH3LS.js} +3 -3
  65. package/dist/bundle/{chunk-YE3J6DLY.js → chunk-QW36EOAM.js} +2 -2
  66. package/dist/bundle/{chunk-HLONHTSG.js → chunk-QWSRPXCJ.js} +4 -4
  67. package/dist/bundle/{chunk-LVDHWNJF.js → chunk-R2A3K7ZF.js} +5 -5
  68. package/dist/bundle/{chunk-SGOPYPVW.js → chunk-R2QRP7EJ.js} +9 -9
  69. package/dist/bundle/{chunk-35GRI4DI.js → chunk-RCS2SCX5.js} +5 -5
  70. package/dist/bundle/{chunk-CEO5HPRL.js → chunk-RJ633GFA.js} +2 -2
  71. package/dist/bundle/{chunk-N47CYWEM.js → chunk-SMHQA5J6.js} +13 -8
  72. package/dist/bundle/{chunk-YFLKH3NZ.js → chunk-SWMMR3FR.js} +2 -2
  73. package/dist/bundle/{chunk-P5KGFT7U.js → chunk-TRMIV3OA.js} +2 -2
  74. package/dist/bundle/{chunk-7NCG2SHR.js → chunk-VAGF723Z.js} +1 -1
  75. package/dist/bundle/{chunk-PWKXHDBQ.js → chunk-VCYFEWPD.js} +26 -26
  76. package/dist/bundle/{chunk-NKZ6V4JW.js → chunk-VHQNVG3J.js} +5 -5
  77. package/dist/bundle/{chunk-6KFA6HOM.js → chunk-VHT2WI4I.js} +19 -19
  78. package/dist/bundle/{chunk-QLZGLPJL.js → chunk-VYBOYBLX.js} +6 -6
  79. package/dist/bundle/{chunk-YJZBJ2TM.js → chunk-WUFCYDKB.js} +2 -2
  80. package/dist/bundle/{chunk-2YU3CXFD.js → chunk-XAZQTJXR.js} +40 -29
  81. package/dist/bundle/{chunk-I5EJHKNC.js → chunk-XEBFFKXO.js} +3 -3
  82. package/dist/bundle/{chunk-AH3SNVCV.js → chunk-XF5MFUEB.js} +15 -15
  83. package/dist/bundle/{chunk-VO4KOLQZ.js → chunk-ZBM4GEV2.js} +5 -4
  84. package/dist/bundle/{chunk-5ZVLM6YR.js → chunk-ZKXDI45R.js} +1 -1
  85. package/dist/bundle/command-contract-MXCBV3GJ.js +38 -0
  86. package/dist/bundle/drive.js +7 -7
  87. package/dist/bundle/{echarts-RFTK737T.js → echarts-LD3AI55P.js} +2 -2
  88. package/dist/bundle/{embed-5NAGJUMD.js → embed-FJKIIM43.js} +5 -5
  89. package/dist/bundle/{embedder-EWXLIGBY.js → embedder-NNQ5ZC25.js} +8 -8
  90. package/dist/bundle/{entry-YCPJ6H6U.js → entry-ZYSNPDSD.js} +6 -6
  91. package/dist/bundle/failure-M5HSCCJJ.js +37 -0
  92. package/dist/bundle/{first-run-LNAZDBB4.js → first-run-KA2UPZAU.js} +9 -9
  93. package/dist/bundle/first-screen-VQ3RXDMF.js +36 -0
  94. package/dist/bundle/{google-5FFKRHHC.js → google-ZYDFTHLN.js} +9 -9
  95. package/dist/bundle/google-api-2GT5PAW2.js +82 -0
  96. package/dist/bundle/{identity-53ZMPL2O.js → identity-R5OKB5O5.js} +2 -2
  97. package/dist/bundle/{instructions-FHNL7CMW.js → instructions-RZMSW3OC.js} +3 -1
  98. package/dist/bundle/{login-VXXZZR6G.js → login-JU6NKW5P.js} +64 -64
  99. package/dist/bundle/mcp-JOQMFGBC.js +95 -0
  100. package/dist/bundle/{mcp-IXFC2VVR.js → mcp-OQBZXELQ.js} +2 -2
  101. package/dist/bundle/{mcp-F4XZO76F.js → mcp-Z362OMZG.js} +77 -83
  102. package/dist/bundle/{node-ZMCACJVS.js → node-ZRLYQL7J.js} +2 -2
  103. package/dist/bundle/{node-sqlite-QJQ5S7KS.js → node-sqlite-TXPSRROT.js} +4 -4
  104. package/dist/bundle/{oauth-TZFDPAFE.js → oauth-NAIBKERJ.js} +6 -6
  105. package/dist/bundle/{open-IYM25QTL.js → open-3P5EPXPV.js} +3 -3
  106. package/dist/bundle/{process-ZPTLNVQS.js → process-LL77573L.js} +1 -1
  107. package/dist/bundle/{program-YX7DZMPR.js → program-PA2J6OFM.js} +129 -151
  108. package/dist/bundle/{prompt-TGWTVIEK.js → prompt-3TX2SWOY.js} +4 -4
  109. package/dist/bundle/{reasons-Q5LOQESQ.js → reasons-GF2TYGX6.js} +3 -3
  110. package/dist/bundle/{recognize-AGPMWKIY.js → recognize-IFXOJHEA.js} +5 -5
  111. package/dist/bundle/{remote-QV7QSLAK.js → remote-663M42Y5.js} +6 -6
  112. package/dist/bundle/{rerank-HZKJJCS4.js → rerank-OT2F2DBV.js} +6 -6
  113. package/dist/bundle/{serve-NRJQOVT4.js → serve-PDNNI6O6.js} +8 -8
  114. package/dist/bundle/server-BFOEPMR7.js +56 -0
  115. package/dist/bundle/server-K566PJ7H.js +69 -0
  116. package/dist/bundle/{services-NZQWVMOE.js → services-5MCTECBU.js} +28 -28
  117. package/dist/bundle/{sqlite-runtime-6MXHTYYU.js → sqlite-runtime-BF3KDM7W.js} +4 -4
  118. package/dist/bundle/{state-IF2FLTSY.js → state-SZX65E74.js} +5 -5
  119. package/dist/bundle/{store-HVIBXOXS.js → store-TCWNLA3V.js} +14 -14
  120. package/dist/bundle/{store-HBD54IRL.js → store-UKPGGAPW.js} +16 -16
  121. package/dist/bundle/store-maintenance-command-QHLUVBTJ.js +57 -0
  122. package/dist/bundle/tokens-DFCFRF7I.js +103 -0
  123. package/dist/commands/mcp.d.ts.map +1 -1
  124. package/dist/commands/mcp.js +5 -9
  125. package/dist/commands/mcp.js.map +1 -1
  126. package/dist/contract-overrides.d.ts.map +1 -1
  127. package/dist/contract-overrides.js +13 -32
  128. package/dist/contract-overrides.js.map +1 -1
  129. package/dist/mcp.d.ts +1 -8
  130. package/dist/mcp.d.ts.map +1 -1
  131. package/dist/mcp.js +1 -8
  132. package/dist/mcp.js.map +1 -1
  133. package/dist/state.d.ts +8 -0
  134. package/dist/state.d.ts.map +1 -1
  135. package/dist/state.js +7 -0
  136. package/dist/state.js.map +1 -1
  137. package/dist/version.d.ts +1 -1
  138. package/dist/version.js +1 -1
  139. package/package.json +2 -2
  140. package/dist/bundle/command-contract-HX35D7KV.js +0 -38
  141. package/dist/bundle/failure-XBWHHBEW.js +0 -37
  142. package/dist/bundle/first-screen-P5NNFJD7.js +0 -36
  143. package/dist/bundle/google-api-TJCFOOAP.js +0 -82
  144. package/dist/bundle/mcp-2CJCJXSW.js +0 -95
  145. package/dist/bundle/server-R4JUHFSW.js +0 -56
  146. package/dist/bundle/store-maintenance-command-U3F4RGJB.js +0 -57
  147. package/dist/bundle/tokens-5D5YUA2Q.js +0 -103
  148. /package/dist/bundle/{chunk-IVQ6342B.js → chunk-O5EHUB2V.js} +0 -0
  149. /package/dist/bundle/{chunk-X5DFDGWS.js → chunk-Q2Z3VCM4.js} +0 -0
package/dist/bin/drive.js CHANGED
@@ -9,7 +9,7 @@ if (
9
9
  (words[0] === "--version" || words[0] === "-V") &&
10
10
  !Object.keys(process.env).some((key) => key.endsWith("_TEST_ARGV_LOG"))
11
11
  ) {
12
- process.stdout.write("0.45.0\n")
12
+ process.stdout.write("0.46.0\n")
13
13
  } else {
14
14
  // Before the bundle compiles: the bundle's own call comes after its chunks.
15
15
  module.enableCompileCache()
@@ -29,7 +29,7 @@ if (
29
29
  })
30
30
  }
31
31
  const running = import("../bundle/drive.js")
32
- const chunks = ["../bundle/all-profiles-LTHNCWQW.js","../bundle/anthropic-NOJEF3V2.js","../bundle/bun-ADJVI4HY.js","../bundle/bun-sqlite-GNXLBF2A.js","../bundle/command-contract-HX35D7KV.js","../bundle/dist-MWTMOYWT.js","../bundle/dist-PY3MVR3G.js","../bundle/echarts-RFTK737T.js","../bundle/embed-5NAGJUMD.js","../bundle/embedder-EWXLIGBY.js","../bundle/entry-YCPJ6H6U.js","../bundle/failure-XBWHHBEW.js","../bundle/first-run-LNAZDBB4.js","../bundle/first-screen-P5NNFJD7.js","../bundle/google-5FFKRHHC.js","../bundle/google-api-TJCFOOAP.js","../bundle/identity-53ZMPL2O.js","../bundle/instructions-FHNL7CMW.js","../bundle/login-VXXZZR6G.js","../bundle/mcp-2CJCJXSW.js","../bundle/mcp-F4XZO76F.js","../bundle/mcp-IXFC2VVR.js","../bundle/mdast-util-from-markdown-FXEPSNER.js","../bundle/mdast-util-gfm-SZM5GBDF.js","../bundle/micromark-extension-gfm-GRL24TU6.js","../bundle/node-P4E63KXA.js","../bundle/node-TLZSIHIJ.js","../bundle/node-ZMCACJVS.js","../bundle/node-sqlite-QJQ5S7KS.js","../bundle/oauth-TZFDPAFE.js","../bundle/open-IYM25QTL.js","../bundle/process-ZPTLNVQS.js","../bundle/program-YX7DZMPR.js","../bundle/prompt-TGWTVIEK.js","../bundle/reasons-Q5LOQESQ.js","../bundle/recognize-AGPMWKIY.js","../bundle/remote-QV7QSLAK.js","../bundle/rerank-HZKJJCS4.js","../bundle/serve-NRJQOVT4.js","../bundle/server-2UQDEWTS.js","../bundle/server-R4JUHFSW.js","../bundle/services-NZQWVMOE.js","../bundle/sqlite-runtime-6MXHTYYU.js","../bundle/state-IF2FLTSY.js","../bundle/store-HBD54IRL.js","../bundle/store-HVIBXOXS.js","../bundle/store-maintenance-command-U3F4RGJB.js","../bundle/terminal-TFCTWLOS.js","../bundle/tokens-5D5YUA2Q.js"]
32
+ const chunks = ["../bundle/all-profiles-O7CNQ7FO.js","../bundle/anthropic-6T67J2CE.js","../bundle/app-server-BVBZT3UY.js","../bundle/bun-O6RL6LRQ.js","../bundle/bun-sqlite-54W7JUY3.js","../bundle/command-contract-MXCBV3GJ.js","../bundle/dist-MWTMOYWT.js","../bundle/dist-PY3MVR3G.js","../bundle/echarts-LD3AI55P.js","../bundle/embed-FJKIIM43.js","../bundle/embedder-NNQ5ZC25.js","../bundle/entry-ZYSNPDSD.js","../bundle/failure-M5HSCCJJ.js","../bundle/first-run-KA2UPZAU.js","../bundle/first-screen-VQ3RXDMF.js","../bundle/google-ZYDFTHLN.js","../bundle/google-api-2GT5PAW2.js","../bundle/identity-R5OKB5O5.js","../bundle/instructions-RZMSW3OC.js","../bundle/login-JU6NKW5P.js","../bundle/mcp-JOQMFGBC.js","../bundle/mcp-OQBZXELQ.js","../bundle/mcp-Z362OMZG.js","../bundle/mdast-util-from-markdown-FXEPSNER.js","../bundle/mdast-util-gfm-SZM5GBDF.js","../bundle/micromark-extension-gfm-GRL24TU6.js","../bundle/node-P4E63KXA.js","../bundle/node-TLZSIHIJ.js","../bundle/node-ZRLYQL7J.js","../bundle/node-sqlite-TXPSRROT.js","../bundle/oauth-NAIBKERJ.js","../bundle/open-3P5EPXPV.js","../bundle/process-LL77573L.js","../bundle/program-PA2J6OFM.js","../bundle/prompt-3TX2SWOY.js","../bundle/reasons-GF2TYGX6.js","../bundle/recognize-IFXOJHEA.js","../bundle/remote-663M42Y5.js","../bundle/rerank-OT2F2DBV.js","../bundle/serve-PDNNI6O6.js","../bundle/server-BFOEPMR7.js","../bundle/server-K566PJ7H.js","../bundle/services-5MCTECBU.js","../bundle/sqlite-runtime-BF3KDM7W.js","../bundle/state-SZX65E74.js","../bundle/store-TCWNLA3V.js","../bundle/store-UKPGGAPW.js","../bundle/store-maintenance-command-QHLUVBTJ.js","../bundle/terminal-TFCTWLOS.js","../bundle/tokens-DFCFRF7I.js"]
33
33
  // After the server answers its first request, so it starts no later.
34
34
  if (serves) setTimeout(() => void Promise.allSettled(chunks.map((chunk) => import(chunk))), 2000).unref()
35
35
  await running
@@ -6,15 +6,15 @@ import {
6
6
  serveAllProfilesOverHttp,
7
7
  serveAllProfilesOverStdio,
8
8
  withProfile
9
- } from "./chunk-HLONHTSG.js";
10
- import "./chunk-AN3GVZTU.js";
11
- import "./chunk-TDC6JGDA.js";
9
+ } from "./chunk-QWSRPXCJ.js";
10
+ import "./chunk-CVIKKIGE.js";
11
+ import "./chunk-G3FAOS52.js";
12
12
  import "./chunk-5FONRUG6.js";
13
- import "./chunk-XPEWOPJR.js";
14
- import "./chunk-K4N2DKE5.js";
15
- import "./chunk-IVQ6342B.js";
16
- import "./chunk-6KFA6HOM.js";
17
- import "./chunk-GKHM6I64.js";
13
+ import "./chunk-3Z7WSD2A.js";
14
+ import "./chunk-GOR3Z2FR.js";
15
+ import "./chunk-O5EHUB2V.js";
16
+ import "./chunk-VHT2WI4I.js";
17
+ import "./chunk-BJ3JRO34.js";
18
18
  import "./chunk-Y5E2WNWB.js";
19
19
  import "./chunk-ZVVMGPBJ.js";
20
20
  export {
@@ -2,27 +2,27 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  checkedOptions
5
- } from "./chunk-ICKNJIGE.js";
5
+ } from "./chunk-LHIL46I3.js";
6
6
  import {
7
7
  messagesFor,
8
8
  systemFor
9
- } from "./chunk-ZS635F4O.js";
9
+ } from "./chunk-KADPV4YA.js";
10
10
  import {
11
11
  Anthropic
12
12
  } from "./chunk-ADLS6FVG.js";
13
- import "./chunk-6KFA6HOM.js";
13
+ import "./chunk-VHT2WI4I.js";
14
14
  import {
15
15
  array,
16
16
  optional,
17
17
  strictObject,
18
18
  string
19
- } from "./chunk-GKHM6I64.js";
19
+ } from "./chunk-BJ3JRO34.js";
20
20
  import "./chunk-Y5E2WNWB.js";
21
21
  import {
22
22
  __name
23
23
  } from "./chunk-ZVVMGPBJ.js";
24
24
 
25
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/models/anthropic.js
25
+ // 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/models/anthropic.js
26
26
  var options = strictObject({
27
27
  stop_sequences: optional(array(string()))
28
28
  });
@@ -0,0 +1,237 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ PER_RUN,
5
+ envelope
6
+ } from "./chunk-K7FRUB33.js";
7
+ import "./chunk-IGMRWQP3.js";
8
+ import {
9
+ mcpUrlOf
10
+ } from "./chunk-SWMMR3FR.js";
11
+ import {
12
+ answeredWire
13
+ } from "./chunk-CVIKKIGE.js";
14
+ import {
15
+ answered,
16
+ failed,
17
+ registerCommands,
18
+ runCommandForAgent,
19
+ toolsFromCommands
20
+ } from "./chunk-XAZQTJXR.js";
21
+ import {
22
+ agentJson,
23
+ skillResource
24
+ } from "./chunk-XF5MFUEB.js";
25
+ import {
26
+ StdioServerTransport,
27
+ serveStdio
28
+ } from "./chunk-G3FAOS52.js";
29
+ import "./chunk-GHOWRW7E.js";
30
+ import {
31
+ appInstructions
32
+ } from "./chunk-DXKVEOSS.js";
33
+ import {
34
+ McpServer
35
+ } from "./chunk-5FONRUG6.js";
36
+ import {
37
+ mcpHttpMarker
38
+ } from "./chunk-3HRDEJJW.js";
39
+ import "./chunk-IAW5A7OR.js";
40
+ import "./chunk-JVTVAZ5X.js";
41
+ import "./chunk-NP3XLLN3.js";
42
+ import "./chunk-DL7D6Y3B.js";
43
+ import "./chunk-VCYFEWPD.js";
44
+ import "./chunk-DORXXBFC.js";
45
+ import "./chunk-5MGIL5LW.js";
46
+ import "./chunk-K74PQVQZ.js";
47
+ import "./chunk-BEXHAGXH.js";
48
+ import {
49
+ DEFAULT_OUTPUT_BYTES,
50
+ changesAuthorityAt,
51
+ environmentOf,
52
+ fetchesOnlyAt,
53
+ judgedTargets,
54
+ rootOf2 as rootOf
55
+ } from "./chunk-AUS6TKP5.js";
56
+ import "./chunk-3Z7WSD2A.js";
57
+ import {
58
+ describeProgram
59
+ } from "./chunk-LOTQ2HMT.js";
60
+ import "./chunk-AIXLOMH4.js";
61
+ import "./chunk-CFZWPIVC.js";
62
+ import "./chunk-GOR3Z2FR.js";
63
+ import "./chunk-PJ7IQVOM.js";
64
+ import "./chunk-ZBM4GEV2.js";
65
+ import "./chunk-A3FU4RR6.js";
66
+ import "./chunk-MFS52LTZ.js";
67
+ import "./chunk-LJARCTGL.js";
68
+ import {
69
+ readOnlyLockOf
70
+ } from "./chunk-RJ633GFA.js";
71
+ import "./chunk-WUFCYDKB.js";
72
+ import "./chunk-KADPV4YA.js";
73
+ import "./chunk-PH74B2VZ.js";
74
+ import "./chunk-RCS2SCX5.js";
75
+ import "./chunk-5DPV7X27.js";
76
+ import "./chunk-GNFHZZ55.js";
77
+ import "./chunk-FEULDMWM.js";
78
+ import "./chunk-5TC3NCAF.js";
79
+ import "./chunk-AOOD3RMK.js";
80
+ import "./chunk-NB2N6L3R.js";
81
+ import "./chunk-BHE7ZY2N.js";
82
+ import "./chunk-R2QRP7EJ.js";
83
+ import "./chunk-O5EHUB2V.js";
84
+ import "./chunk-BQUPOB5H.js";
85
+ import "./chunk-GQW4GRYR.js";
86
+ import "./chunk-TRMIV3OA.js";
87
+ import "./chunk-VYBOYBLX.js";
88
+ import {
89
+ mcpErrorResult
90
+ } from "./chunk-VHT2WI4I.js";
91
+ import {
92
+ CliError
93
+ } from "./chunk-BJ3JRO34.js";
94
+ import "./chunk-Y5E2WNWB.js";
95
+ import "./chunk-NW7IMGRR.js";
96
+ import {
97
+ __name
98
+ } from "./chunk-ZVVMGPBJ.js";
99
+
100
+ // 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/mcp/app-server.js
101
+ var EXCLUDED = [["mcp"]];
102
+ var createAppServer = /* @__PURE__ */ __name((command, context, options) => {
103
+ const { app } = options;
104
+ const root = rootOf(command);
105
+ const environment = environmentOf(command);
106
+ if (!environment.runCommand)
107
+ throw new Error("the MCP server runs inside run(), which hands it the program");
108
+ const program = { run: environment.runCommand, commands: describeProgram(root) };
109
+ const flags = command.optsWithGlobals();
110
+ const overrides = flags.permission ?? [];
111
+ const { settings } = context;
112
+ const levels = /* @__PURE__ */ __name(() => options.resolveSettings(flags, { env: context.env }).permissions, "levels");
113
+ const readOnly = /* @__PURE__ */ __name(() => readOnlyLockOf(app, context.env) !== void 0, "readOnly");
114
+ const authority = changesAuthorityAt(root);
115
+ const targets = judgedTargets(root);
116
+ const passed = Object.fromEntries(Object.entries(environment).filter(([key]) => !PER_RUN.has(key)));
117
+ const tools = toolsFromCommands(program.commands, {
118
+ includeUnavailable: true,
119
+ exclude: EXCLUDED,
120
+ levels: settings.permissions,
121
+ currentLevels: levels,
122
+ readOnly: readOnly(),
123
+ authority,
124
+ fetchOnly: fetchesOnlyAt(root),
125
+ permissions: options.permissions
126
+ });
127
+ const availability = /* @__PURE__ */ __name((one) => () => {
128
+ const permitted = one.availability?.() ?? { available: true };
129
+ if (!permitted.available)
130
+ return permitted;
131
+ return options.availability?.(one.path, settings.profile) ?? permitted;
132
+ }, "availability");
133
+ const commands = Object.fromEntries(tools.map((one) => [
134
+ one.command,
135
+ {
136
+ title: one.title,
137
+ description: one.description,
138
+ writes: one.writes,
139
+ availability: availability(one),
140
+ input: one.input,
141
+ run: /* @__PURE__ */ __name(async (input, ctx) => {
142
+ const own = options.availability?.(one.path, settings.profile);
143
+ if (own && !own.available)
144
+ return failed(new CliError("permission_error", `${one.command}: ${own.reason ?? "unavailable for this profile"}`, {
145
+ ...own.permission ? { permission: own.permission } : {}
146
+ }), app.errors);
147
+ const traceparent = ctx?.mcpReq?._meta?.traceparent;
148
+ const env = typeof traceparent === "string" ? { ...context.env, TRACEPARENT: traceparent } : context.env;
149
+ const answer = await runCommandForAgent(program, one.path, input, {
150
+ profile: settings.profile,
151
+ readOnly: readOnly(),
152
+ env,
153
+ levels,
154
+ overrides,
155
+ authority,
156
+ permissions: options.permissions,
157
+ environment: passed
158
+ });
159
+ if ("error" in answer)
160
+ return mcpErrorResult(JSON.parse(agentJson(answer.error)));
161
+ try {
162
+ return answered(envelope(one.command, answer.result), DEFAULT_OUTPUT_BYTES, targets);
163
+ } catch (error) {
164
+ return failed(error, app.errors);
165
+ }
166
+ }, "run")
167
+ }
168
+ ]));
169
+ const skill = options.skill ? skillResource(app, options.skill) : void 0;
170
+ const build = /* @__PURE__ */ __name(() => {
171
+ const server = new McpServer({ name: app.command, version: app.version }, {
172
+ instructions: appInstructions({
173
+ command: app.command,
174
+ name: options.name,
175
+ profile: settings.profile,
176
+ untrusted: options.untrusted,
177
+ ...skill ? { skill: skill.instruction } : {}
178
+ })
179
+ });
180
+ registerCommands(server, app.command, commands, app.errors, void 0, app.messenger);
181
+ if (skill) {
182
+ const { uri, name, title, description, mimeType, read } = skill;
183
+ server.registerResource(name, uri, { title, description, mimeType }, read);
184
+ }
185
+ return server;
186
+ }, "build");
187
+ return { build, offered: Object.keys(commands) };
188
+ }, "createAppServer");
189
+ var serveAppOverStdio = /* @__PURE__ */ __name(async (command, context, options) => {
190
+ const { build } = createAppServer(command, context, options);
191
+ const { stdin, stdout, signal } = environmentOf(command);
192
+ const own = stdin && stdout && stdin !== process.stdin;
193
+ const wire = answeredWire(own ? stdin : process.stdin, own ? stdout : process.stdout);
194
+ const handle = serveStdio(build, {
195
+ transport: new StdioServerTransport(wire.input, wire.output),
196
+ onerror: /* @__PURE__ */ __name((error) => context.renderer.note(`mcp: ${error.message}`), "onerror")
197
+ });
198
+ const ended = await new Promise((resolve) => {
199
+ wire.ended.then(() => resolve("input"));
200
+ if (own)
201
+ signal?.addEventListener("abort", () => resolve("stopped"), { once: true });
202
+ else {
203
+ process.once("SIGINT", () => resolve("stopped"));
204
+ process.once("SIGTERM", () => resolve("stopped"));
205
+ }
206
+ });
207
+ if (ended === "input")
208
+ await wire.answered();
209
+ wire.release();
210
+ await handle.close();
211
+ }, "serveAppOverStdio");
212
+ var serveAppOverHttp = /* @__PURE__ */ __name(async (command, context, options, http) => {
213
+ const { app } = options;
214
+ const { build } = createAppServer(command, context, options);
215
+ const { serveOverHttp } = await import("./serve-PDNNI6O6.js");
216
+ const listening = await serveOverHttp(build, {
217
+ ...http,
218
+ appName: app.command,
219
+ onCode: /* @__PURE__ */ __name((code, expires) => context.renderer.note(context.env[mcpHttpMarker(app.envPrefix)] === void 0 ? `login code for a new browser app: ${code} (until ${expires.toTimeString().slice(0, 5)}; a new one after each login)` : `a new login code for a browser app: \`${app.command} ${context.settings.profile} mcp server status\``), "onCode"),
220
+ onError: /* @__PURE__ */ __name((error) => context.renderer.note(`mcp: ${error.message}`), "onError")
221
+ }).catch((error) => {
222
+ if (error.code === "EADDRINUSE")
223
+ throw new CliError("configuration_error", `port ${http.port} is in use \u2014 pass another with --port`);
224
+ throw error;
225
+ });
226
+ context.renderer.note(`serving on ${listening.url.href} \u2014 point your tunnel at it; connectors use ${mcpUrlOf(http.publicUrl).href}`);
227
+ await new Promise((resolve) => {
228
+ process.once("SIGINT", resolve);
229
+ process.once("SIGTERM", resolve);
230
+ });
231
+ await listening.close();
232
+ }, "serveAppOverHttp");
233
+ export {
234
+ createAppServer,
235
+ serveAppOverHttp,
236
+ serveAppOverStdio
237
+ };
@@ -18,12 +18,12 @@ import {
18
18
  jitCompatCheck,
19
19
  refineSqliteCodecs,
20
20
  sql
21
- } from "./chunk-LY26NW3I.js";
21
+ } from "./chunk-NW7IMGRR.js";
22
22
  import {
23
23
  __name
24
24
  } from "./chunk-ZVVMGPBJ.js";
25
25
 
26
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/bun.js
26
+ // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/bun.js
27
27
  import { Database } from "bun:sqlite";
28
28
  var bunSQLiteCodecs = refineSqliteCodecs({
29
29
  "integer:boolean": { normalize: booleanFromInteger },
@@ -3,9 +3,9 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  loadVectorExtension,
5
5
  vectorExtension
6
- } from "./chunk-GTYY6BIE.js";
7
- import "./chunk-6KFA6HOM.js";
8
- import "./chunk-GKHM6I64.js";
6
+ } from "./chunk-NDNTLUPS.js";
7
+ import "./chunk-VHT2WI4I.js";
8
+ import "./chunk-BJ3JRO34.js";
9
9
  import {
10
10
  importFrom
11
11
  } from "./chunk-Y5E2WNWB.js";
@@ -13,7 +13,7 @@ import {
13
13
  __name
14
14
  } from "./chunk-ZVVMGPBJ.js";
15
15
 
16
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/store/drivers/bun-sqlite.js
16
+ // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/store/drivers/bun-sqlite.js
17
17
  var customised = false;
18
18
  var ownLibrary = /* @__PURE__ */ __name(async () => {
19
19
  try {
@@ -3,7 +3,7 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError,
5
5
  isCliError
6
- } from "./chunk-GKHM6I64.js";
6
+ } from "./chunk-BJ3JRO34.js";
7
7
  import {
8
8
  __name
9
9
  } from "./chunk-ZVVMGPBJ.js";
@@ -5,15 +5,15 @@ import {
5
5
  readLock,
6
6
  releaseLock,
7
7
  takeLock
8
- } from "./chunk-7PVNJAQ2.js";
8
+ } from "./chunk-NP3XLLN3.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/mcp/http/state.js
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/mcp/http/state.js
14
14
  import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
15
15
 
16
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/mcp/http/activity.js
16
+ // 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/mcp/http/activity.js
17
17
  import { randomBytes } from "node:crypto";
18
18
  import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
19
19
  import { dirname } from "node:path";
@@ -86,7 +86,7 @@ var activityRecorder = /* @__PURE__ */ __name((path, now = Date.now) => {
86
86
  };
87
87
  }, "activityRecorder");
88
88
 
89
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/mcp/http/state.js
89
+ // 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/mcp/http/state.js
90
90
  var ACCESS_SECONDS = 60 * 60;
91
91
  var REFRESH_SECONDS = 30 * 24 * 60 * 60;
92
92
  var readStored = /* @__PURE__ */ __name((path) => existsSync2(path) ? JSON.parse(readFileSync2(path, "utf8")) : { clients: [], tokens: [] }, "readStored");
@@ -2,22 +2,22 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  isCliFailure
5
- } from "./chunk-K4N2DKE5.js";
5
+ } from "./chunk-GOR3Z2FR.js";
6
6
  import {
7
7
  isContentKey
8
- } from "./chunk-GKHM6I64.js";
8
+ } from "./chunk-BJ3JRO34.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/runs/run-context.js
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/run-context.js
14
14
  import { AsyncLocalStorage } from "node:async_hooks";
15
15
  import { createHash } from "node:crypto";
16
16
 
17
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/runs/error-detail.js
17
+ // 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
18
18
  import { homedir } from "node:os";
19
19
 
20
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/runs/events.js
20
+ // 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
21
21
  var providerErrorKey = /* @__PURE__ */ __name((value) => typeof value === "string" && /^[A-Za-z][A-Za-z0-9._-]{0,63}$/.test(value) ? value : void 0, "providerErrorKey");
22
22
  var renderEvent = /* @__PURE__ */ __name((event) => {
23
23
  if (event.event === "warning") {
@@ -65,7 +65,7 @@ var MARK = { request: "\u2192", response: "\u2190", cache: "\u2022", warning: "!
65
65
  var age = /* @__PURE__ */ __name((ms) => ms < 1e3 ? `${ms}ms` : `${Math.round(ms / 1e3)}s`, "age");
66
66
  var size = /* @__PURE__ */ __name((bytes) => bytes < 1e3 ? `${bytes} B` : `${(bytes / 1e3).toFixed(1)} kB`, "size");
67
67
 
68
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/runs/secrets.js
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
69
  var SECRET_WORDS = /* @__PURE__ */ new Set([
70
70
  "authorization",
71
71
  "cookie",
@@ -146,7 +146,7 @@ var withoutSecrets = /* @__PURE__ */ __name((text, mark = "[redacted]") => text.
146
146
  var RUN = /(?<![A-Za-z0-9_+/-])[A-Za-z0-9_+/-]{20,}/g;
147
147
  var HEX = /(?<![A-Za-z0-9])(?=[0-9]*[a-f])[0-9a-f]{20,}(?![A-Za-z0-9])/g;
148
148
 
149
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/runs/error-detail.js
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
150
  var MESSAGE_AT_MOST = 500;
151
151
  var CAUSES_AT_MOST = 5;
152
152
  var FRAMES_AT_MOST = 15;
@@ -155,6 +155,7 @@ var errorDetailOf = /* @__PURE__ */ __name((error, response) => {
155
155
  const thrown = error instanceof Error ? error : void 0;
156
156
  const code = isCliFailure(error) ? error.code : codeOf(error);
157
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;
158
159
  const message = thrown ? redactText(thrown.message) : void 0;
159
160
  const operation = stringOf(details.operation) ?? response?.operation;
160
161
  const status = numberOf(details.status) ?? response?.status;
@@ -173,6 +174,7 @@ var errorDetailOf = /* @__PURE__ */ __name((error, response) => {
173
174
  class: classOf(error),
174
175
  ...code === void 0 ? {} : { code },
175
176
  ...reason === void 0 ? {} : { reason },
177
+ ...causeCode === void 0 ? {} : { cause_code: causeCode },
176
178
  ...message ? { message } : {},
177
179
  ...operation === void 0 ? {} : { operation },
178
180
  ...http ? { http } : {},
@@ -252,7 +254,7 @@ var redactText = /* @__PURE__ */ __name((text) => {
252
254
  return out.length > MESSAGE_AT_MOST ? `${out.slice(0, MESSAGE_AT_MOST)}\u2026` : out;
253
255
  }, "redactText");
254
256
 
255
- // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/runs/run-context.js
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
256
258
  var REDACTED = "[redacted]";
257
259
  var keepsSuccess = /* @__PURE__ */ __name(({ record, fromFlag, env, caller, persistent = false }) => {
258
260
  if (!record)