@_davideast/stitch-mcp 0.5.0 → 0.5.1

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 (258) hide show
  1. package/dist/{chunk-hb3c6f6a.js → chunk-001yk06v.js} +2 -2
  2. package/dist/chunk-0cd2xak4.js +31447 -0
  3. package/dist/chunk-0cd2xak4.js.map +245 -0
  4. package/dist/{chunk-9tvppjaf.js → chunk-13mqag7n.js} +8 -10
  5. package/dist/{chunk-9tvppjaf.js.map → chunk-13mqag7n.js.map} +2 -2
  6. package/dist/chunk-1dcffh2w.js +1481 -0
  7. package/dist/chunk-1dcffh2w.js.map +23 -0
  8. package/dist/{chunk-985f11w6.js → chunk-26cgk4dt.js} +6 -8
  9. package/dist/{chunk-8yrtq2qs.js.map → chunk-26cgk4dt.js.map} +1 -1
  10. package/dist/chunk-2kg77g4q.js +167 -0
  11. package/dist/chunk-2kg77g4q.js.map +10 -0
  12. package/dist/chunk-34w2wfyp.js +68 -0
  13. package/dist/chunk-34w2wfyp.js.map +10 -0
  14. package/dist/chunk-44tn9dxb.js +19 -0
  15. package/dist/{chunk-985f11w6.js.map → chunk-44tn9dxb.js.map} +1 -1
  16. package/dist/chunk-5204d23a.js +24 -0
  17. package/dist/{chunk-ezmw2j8c.js.map → chunk-5204d23a.js.map} +1 -1
  18. package/dist/{chunk-mv9ssgmx.js → chunk-54wv5ptt.js} +5 -5
  19. package/dist/{chunk-mv9ssgmx.js.map → chunk-54wv5ptt.js.map} +2 -2
  20. package/dist/chunk-5dghg77b.js +16970 -0
  21. package/dist/chunk-5dghg77b.js.map +26 -0
  22. package/dist/{chunk-r2sg2nxa.js → chunk-5f2htt6r.js} +6 -7
  23. package/dist/chunk-5f2htt6r.js.map +9 -0
  24. package/dist/chunk-6gw9apqb.js +20 -0
  25. package/dist/chunk-6gw9apqb.js.map +10 -0
  26. package/dist/chunk-7bt2055x.js +39 -0
  27. package/dist/chunk-7bt2055x.js.map +10 -0
  28. package/dist/chunk-7egq85x5.js +273 -0
  29. package/dist/chunk-7egq85x5.js.map +10 -0
  30. package/dist/chunk-7pf2vfq9.js +69 -0
  31. package/dist/chunk-7pf2vfq9.js.map +10 -0
  32. package/dist/{chunk-q1nd6g0y.js → chunk-7rrhk07q.js} +76 -53
  33. package/dist/chunk-7rrhk07q.js.map +20 -0
  34. package/dist/{chunk-7xh1y383.js → chunk-7xsar3mr.js} +2 -2
  35. package/dist/{chunk-7xh1y383.js.map → chunk-7xsar3mr.js.map} +1 -1
  36. package/dist/chunk-7y4xzvkz.js +19132 -0
  37. package/dist/chunk-7y4xzvkz.js.map +115 -0
  38. package/dist/chunk-7zy0vdv5.js +761 -0
  39. package/dist/chunk-7zy0vdv5.js.map +18 -0
  40. package/dist/chunk-8rt3pp6g.js +256 -0
  41. package/dist/{chunk-jy2d17pr.js.map → chunk-8rt3pp6g.js.map} +3 -3
  42. package/dist/chunk-98trrxk2.js +40 -0
  43. package/dist/chunk-98trrxk2.js.map +10 -0
  44. package/dist/chunk-a1mk24q9.js +31326 -0
  45. package/dist/chunk-a1mk24q9.js.map +245 -0
  46. package/dist/chunk-a5xra9jn.js +159 -0
  47. package/dist/chunk-a5xra9jn.js.map +11 -0
  48. package/dist/chunk-abf1r0jh.js +2118 -0
  49. package/dist/chunk-abf1r0jh.js.map +44 -0
  50. package/dist/{chunk-25wakzyb.js → chunk-ahw5kfbr.js} +5 -5
  51. package/dist/chunk-akd997ec.js +11061 -0
  52. package/dist/chunk-akd997ec.js.map +238 -0
  53. package/dist/chunk-by28t333.js +19 -0
  54. package/dist/chunk-by28t333.js.map +9 -0
  55. package/dist/{chunk-2k7n0w2x.js → chunk-c6ge431q.js} +2 -2
  56. package/dist/{chunk-2k7n0w2x.js.map → chunk-c6ge431q.js.map} +1 -1
  57. package/dist/{chunk-ycfxp056.js → chunk-cnmspfhx.js} +7 -11
  58. package/dist/chunk-cnmspfhx.js.map +17 -0
  59. package/dist/chunk-cwqdka8y.js +6382 -0
  60. package/dist/chunk-cwqdka8y.js.map +109 -0
  61. package/dist/chunk-dffwrtn3.js +673 -0
  62. package/dist/chunk-dffwrtn3.js.map +17 -0
  63. package/dist/chunk-dyp9t5wf.js +44109 -0
  64. package/dist/chunk-dyp9t5wf.js.map +237 -0
  65. package/dist/chunk-e9881zy4.js +39 -0
  66. package/dist/chunk-e9881zy4.js.map +10 -0
  67. package/dist/chunk-ezs0qz0b.js +24 -0
  68. package/dist/chunk-ezs0qz0b.js.map +9 -0
  69. package/dist/chunk-f6cq8r7x.js +736 -0
  70. package/dist/chunk-f6cq8r7x.js.map +16 -0
  71. package/dist/{chunk-45wx7tn7.js → chunk-gwnmywrp.js} +2 -2
  72. package/dist/chunk-gz78f003.js +94 -0
  73. package/dist/chunk-gz78f003.js.map +10 -0
  74. package/dist/chunk-j0y94q2c.js +10 -0
  75. package/dist/{chunk-nthabjd9.js → chunk-jyem6j6k.js} +1848 -3
  76. package/dist/chunk-jyem6j6k.js.map +65 -0
  77. package/dist/chunk-kad4d9sf.js +11 -0
  78. package/dist/chunk-kad4d9sf.js.map +9 -0
  79. package/dist/{chunk-wz8d5vzb.js → chunk-krfqppg2.js} +32 -2
  80. package/dist/{chunk-wz8d5vzb.js.map → chunk-krfqppg2.js.map} +5 -4
  81. package/dist/chunk-kw62yeqn.js +124 -0
  82. package/dist/chunk-kw62yeqn.js.map +12 -0
  83. package/dist/chunk-mbt1wx7n.js +43 -0
  84. package/dist/chunk-mbt1wx7n.js.map +10 -0
  85. package/dist/chunk-nzv6abbc.js +22 -0
  86. package/dist/chunk-nzv6abbc.js.map +9 -0
  87. package/dist/{chunk-cwkb2wbe.js → chunk-pjpdhh0f.js} +27 -24
  88. package/dist/chunk-pjpdhh0f.js.map +16 -0
  89. package/dist/chunk-py8fhw0k.js +941 -0
  90. package/dist/chunk-py8fhw0k.js.map +27 -0
  91. package/dist/chunk-q6sv0243.js +93 -0
  92. package/dist/chunk-q6sv0243.js.map +13 -0
  93. package/dist/chunk-r8n5m3xq.js +19 -0
  94. package/dist/chunk-r8n5m3xq.js.map +9 -0
  95. package/dist/{chunk-nxpzt33t.js → chunk-rcwtjara.js} +8 -13
  96. package/dist/chunk-rcwtjara.js.map +10 -0
  97. package/dist/{chunk-t85nbjjb.js → chunk-rfrcdsfc.js} +5 -9
  98. package/dist/chunk-rfrcdsfc.js.map +10 -0
  99. package/dist/chunk-rj2gqxxb.js +415 -0
  100. package/dist/chunk-rj2gqxxb.js.map +20 -0
  101. package/dist/{chunk-v7117ywx.js → chunk-rvq1vb70.js} +5 -7
  102. package/dist/{chunk-v7117ywx.js.map → chunk-rvq1vb70.js.map} +2 -2
  103. package/dist/chunk-smvqara3.js +370 -0
  104. package/dist/chunk-smvqara3.js.map +16 -0
  105. package/dist/{chunk-pfyjtfex.js → chunk-sp8zjpbf.js} +7 -12
  106. package/dist/chunk-sp8zjpbf.js.map +10 -0
  107. package/dist/{chunk-48d17n29.js → chunk-ssbg48ec.js} +1 -1
  108. package/dist/chunk-ssbg48ec.js.map +9 -0
  109. package/dist/chunk-st7q66e5.js +109 -0
  110. package/dist/chunk-st7q66e5.js.map +10 -0
  111. package/dist/{chunk-sdp429xd.js → chunk-sw7h7asn.js} +32 -8
  112. package/dist/chunk-sw7h7asn.js.map +27 -0
  113. package/dist/chunk-t092ehvp.js +50 -0
  114. package/dist/chunk-t092ehvp.js.map +9 -0
  115. package/dist/{chunk-2cetsfw4.js → chunk-t0xqfse1.js} +50 -9
  116. package/dist/{chunk-2cetsfw4.js.map → chunk-t0xqfse1.js.map} +8 -3
  117. package/dist/chunk-v1t5vys5.js +124 -0
  118. package/dist/chunk-v1t5vys5.js.map +12 -0
  119. package/dist/chunk-v78rg840.js +137 -0
  120. package/dist/chunk-v78rg840.js.map +10 -0
  121. package/dist/chunk-v7xskyzm.js +19 -0
  122. package/dist/chunk-v7xskyzm.js.map +9 -0
  123. package/dist/{chunk-jy2d17pr.js → chunk-vjshqjmh.js} +12 -8
  124. package/dist/chunk-vjshqjmh.js.map +11 -0
  125. package/dist/chunk-w8075wyx.js +40 -0
  126. package/dist/chunk-w8075wyx.js.map +10 -0
  127. package/dist/chunk-wn8mek6a.js +189 -0
  128. package/dist/chunk-wn8mek6a.js.map +11 -0
  129. package/dist/{chunk-2kyqsrg2.js → chunk-y447ymks.js} +364 -3
  130. package/dist/chunk-y447ymks.js.map +18 -0
  131. package/dist/chunk-yej34vkc.js +247 -0
  132. package/dist/chunk-yej34vkc.js.map +14 -0
  133. package/dist/commands/doctor/command.js +2 -2
  134. package/dist/commands/init/command.js +2 -2
  135. package/dist/commands/logout/command.js +2 -2
  136. package/dist/commands/proxy/command.js +4 -5
  137. package/dist/commands/proxy/command.js.map +3 -3
  138. package/dist/commands/proxy/handler.d.ts +27 -5
  139. package/dist/commands/registry.d.ts +2 -0
  140. package/dist/commands/screens/ScreensView.d.ts +1 -3
  141. package/dist/commands/screens/command.js +8 -10
  142. package/dist/commands/screens/command.js.map +3 -3
  143. package/dist/commands/screens/handler.d.ts +5 -6
  144. package/dist/commands/serve/command.js +60 -10
  145. package/dist/commands/serve/command.js.map +7 -5
  146. package/dist/commands/serve/handler.d.ts +6 -21
  147. package/dist/commands/serve/json-server/handler.d.ts +8 -0
  148. package/dist/commands/serve/json-server/spec.d.ts +32 -0
  149. package/dist/commands/serve/list-screens/handler.d.ts +7 -0
  150. package/dist/commands/serve/list-screens/spec.d.ts +33 -0
  151. package/dist/commands/serve/spec.d.ts +30 -0
  152. package/dist/commands/site/command.js +12 -6
  153. package/dist/commands/site/command.js.map +4 -4
  154. package/dist/commands/site/generate/handler.d.ts +8 -0
  155. package/dist/commands/site/generate/spec.d.ts +44 -0
  156. package/dist/commands/site/hooks/useProjectHydration.d.ts +2 -2
  157. package/dist/commands/site/index.d.ts +5 -3
  158. package/dist/commands/site/list-screens/handler.d.ts +7 -0
  159. package/dist/commands/site/list-screens/spec.d.ts +33 -0
  160. package/dist/commands/site/spec.d.ts +6 -0
  161. package/dist/commands/site/ui/SiteBuilder.d.ts +2 -2
  162. package/dist/commands/site/utils/fetchWithRetry.d.ts +10 -0
  163. package/dist/commands/site/utils/suggestRoute.d.ts +1 -0
  164. package/dist/commands/snapshot/command.js +2 -2
  165. package/dist/commands/tool/command.js +2 -2
  166. package/dist/commands/tool/command.js.map +2 -2
  167. package/dist/commands/tool/context.d.ts +3 -2
  168. package/dist/commands/tool/handler.d.ts +9 -10
  169. package/dist/commands/tool/spec.d.ts +3 -2
  170. package/dist/commands/view/command.js +2 -2
  171. package/dist/index.js +11 -13
  172. package/dist/index.js.map +1 -1
  173. package/dist/platform/browser.d.ts +8 -0
  174. package/dist/services/mcp-client/client.d.ts +5 -0
  175. package/dist/services/mcp-client/spec.d.ts +6 -6
  176. package/dist/services/proxy/spec.d.ts +3 -3
  177. package/dist/services/stitch-sdk/MockStitchSDK.d.ts +18 -0
  178. package/dist/services/view/handler.d.ts +3 -3
  179. package/dist/ui/copy-behaviors/index.d.ts +8 -0
  180. package/dist/ui/navigation-behaviors/index.d.ts +34 -0
  181. package/dist/ui/serve-behaviors/index.d.ts +7 -0
  182. package/package.json +2 -1
  183. package/dist/chunk-2fcdwvrm.js +0 -54
  184. package/dist/chunk-2fcdwvrm.js.map +0 -10
  185. package/dist/chunk-2kyqsrg2.js.map +0 -10
  186. package/dist/chunk-8yrtq2qs.js +0 -18
  187. package/dist/chunk-cwkb2wbe.js.map +0 -16
  188. package/dist/chunk-djhzzcgj.js +0 -362
  189. package/dist/chunk-djhzzcgj.js.map +0 -13
  190. package/dist/chunk-ezmw2j8c.js +0 -14
  191. package/dist/chunk-fwb4fnkp.js +0 -31
  192. package/dist/chunk-fwb4fnkp.js.map +0 -10
  193. package/dist/chunk-h18jrqed.js +0 -9517
  194. package/dist/chunk-h18jrqed.js.map +0 -99
  195. package/dist/chunk-knbnsf6s.js +0 -92
  196. package/dist/chunk-knbnsf6s.js.map +0 -10
  197. package/dist/chunk-nthabjd9.js.map +0 -34
  198. package/dist/chunk-nxpzt33t.js.map +0 -10
  199. package/dist/chunk-pfyjtfex.js.map +0 -10
  200. package/dist/chunk-q1nd6g0y.js.map +0 -20
  201. package/dist/chunk-q4js8r0z.js +0 -4708
  202. package/dist/chunk-q4js8r0z.js.map +0 -29
  203. package/dist/chunk-qv44tmn6.js +0 -289
  204. package/dist/chunk-qv44tmn6.js.map +0 -13
  205. package/dist/chunk-r2sg2nxa.js.map +0 -9
  206. package/dist/chunk-rpxnm86e.js +0 -372
  207. package/dist/chunk-rpxnm86e.js.map +0 -17
  208. package/dist/chunk-sdp429xd.js.map +0 -24
  209. package/dist/chunk-t85nbjjb.js.map +0 -10
  210. package/dist/chunk-wa64nz8b.js +0 -47
  211. package/dist/chunk-wa64nz8b.js.map +0 -10
  212. package/dist/chunk-ycfxp056.js.map +0 -17
  213. package/dist/chunk-z9d2xc83.js +0 -3256
  214. package/dist/chunk-z9d2xc83.js.map +0 -84
  215. package/dist/services/config/handler.d.ts +0 -12
  216. package/dist/services/config/spec.d.ts +0 -82
  217. package/dist/src/cli.d.ts +0 -1
  218. package/dist/src/commands/doctor/handler.d.ts +0 -9
  219. package/dist/src/commands/doctor/handler.test.d.ts +0 -1
  220. package/dist/src/commands/doctor/spec.d.ts +0 -130
  221. package/dist/src/commands/doctor/spec.test.d.ts +0 -1
  222. package/dist/src/commands/init/handler.d.ts +0 -17
  223. package/dist/src/commands/init/handler.test.d.ts +0 -1
  224. package/dist/src/commands/init/spec.d.ts +0 -88
  225. package/dist/src/commands/init/spec.test.d.ts +0 -1
  226. package/dist/src/commands/proxy/handler.d.ts +0 -7
  227. package/dist/src/commands/proxy/handler.test.d.ts +0 -1
  228. package/dist/src/index.d.ts +0 -13
  229. package/dist/src/platform/detector.d.ts +0 -29
  230. package/dist/src/platform/paths.d.ts +0 -20
  231. package/dist/src/platform/shell.d.ts +0 -26
  232. package/dist/src/services/gcloud/handler.d.ts +0 -48
  233. package/dist/src/services/gcloud/handler.test.d.ts +0 -1
  234. package/dist/src/services/gcloud/spec.d.ts +0 -405
  235. package/dist/src/services/mcp-config/handler.d.ts +0 -12
  236. package/dist/src/services/mcp-config/handler.test.d.ts +0 -1
  237. package/dist/src/services/mcp-config/spec.d.ts +0 -88
  238. package/dist/src/services/mcp-config/spec.test.d.ts +0 -1
  239. package/dist/src/services/project/handler.d.ts +0 -11
  240. package/dist/src/services/project/handler.test.d.ts +0 -1
  241. package/dist/src/services/project/spec.d.ts +0 -86
  242. package/dist/src/services/project/spec.test.d.ts +0 -1
  243. package/dist/src/services/proxy/handler.d.ts +0 -15
  244. package/dist/src/services/proxy/handler.test.d.ts +0 -1
  245. package/dist/src/services/proxy/spec.d.ts +0 -83
  246. package/dist/src/services/proxy/spec.test.d.ts +0 -1
  247. package/dist/src/services/stitch/handler.d.ts +0 -15
  248. package/dist/src/services/stitch/handler.test.d.ts +0 -1
  249. package/dist/src/services/stitch/spec.d.ts +0 -262
  250. package/dist/src/services/stitch/spec.test.d.ts +0 -1
  251. package/dist/src/ui/spinner.d.ts +0 -11
  252. package/dist/src/ui/theme.d.ts +0 -18
  253. package/dist/src/ui/wizard.d.ts +0 -24
  254. package/dist/tests/mocks/shell.d.ts +0 -2
  255. /package/dist/{chunk-hb3c6f6a.js.map → chunk-001yk06v.js.map} +0 -0
  256. /package/dist/{chunk-25wakzyb.js.map → chunk-ahw5kfbr.js.map} +0 -0
  257. /package/dist/{chunk-45wx7tn7.js.map → chunk-gwnmywrp.js.map} +0 -0
  258. /package/dist/{chunk-48d17n29.js.map → chunk-j0y94q2c.js.map} +0 -0
@@ -1,9 +1,12 @@
1
+ import {
2
+ onExit
3
+ } from "./chunk-tz7wnw4s.js";
1
4
  import {
2
5
  theme
3
6
  } from "./chunk-kbtqrkwh.js";
4
7
  import {
5
8
  exports_external
6
- } from "./chunk-2k7n0w2x.js";
9
+ } from "./chunk-c6ge431q.js";
7
10
  import {
8
11
  __commonJS,
9
12
  __require,
@@ -2302,6 +2305,166 @@ var require_adm_zip = __commonJS((exports, module) => {
2302
2305
  };
2303
2306
  });
2304
2307
 
2308
+ // node_modules/cli-width/index.js
2309
+ var require_cli_width = __commonJS((exports, module) => {
2310
+ module.exports = cliWidth;
2311
+ function normalizeOpts(options) {
2312
+ const defaultOpts = {
2313
+ defaultWidth: 0,
2314
+ output: process.stdout,
2315
+ tty: __require("tty")
2316
+ };
2317
+ if (!options) {
2318
+ return defaultOpts;
2319
+ }
2320
+ Object.keys(defaultOpts).forEach(function(key) {
2321
+ if (!options[key]) {
2322
+ options[key] = defaultOpts[key];
2323
+ }
2324
+ });
2325
+ return options;
2326
+ }
2327
+ function cliWidth(options) {
2328
+ const opts = normalizeOpts(options);
2329
+ if (opts.output.getWindowSize) {
2330
+ return opts.output.getWindowSize()[0] || opts.defaultWidth;
2331
+ }
2332
+ if (opts.tty.getWindowSize) {
2333
+ return opts.tty.getWindowSize()[1] || opts.defaultWidth;
2334
+ }
2335
+ if (opts.output.columns) {
2336
+ return opts.output.columns;
2337
+ }
2338
+ if (process.env.CLI_WIDTH) {
2339
+ const width = parseInt(process.env.CLI_WIDTH, 10);
2340
+ if (!isNaN(width) && width !== 0) {
2341
+ return width;
2342
+ }
2343
+ }
2344
+ return opts.defaultWidth;
2345
+ }
2346
+ });
2347
+
2348
+ // node_modules/mute-stream/lib/index.js
2349
+ var require_lib = __commonJS((exports, module) => {
2350
+ var Stream = __require("stream");
2351
+
2352
+ class MuteStream extends Stream {
2353
+ #isTTY = null;
2354
+ constructor(opts = {}) {
2355
+ super(opts);
2356
+ this.writable = this.readable = true;
2357
+ this.muted = false;
2358
+ this.on("pipe", this._onpipe);
2359
+ this.replace = opts.replace;
2360
+ this._prompt = opts.prompt || null;
2361
+ this._hadControl = false;
2362
+ }
2363
+ #destSrc(key, def) {
2364
+ if (this._dest) {
2365
+ return this._dest[key];
2366
+ }
2367
+ if (this._src) {
2368
+ return this._src[key];
2369
+ }
2370
+ return def;
2371
+ }
2372
+ #proxy(method, ...args) {
2373
+ if (typeof this._dest?.[method] === "function") {
2374
+ this._dest[method](...args);
2375
+ }
2376
+ if (typeof this._src?.[method] === "function") {
2377
+ this._src[method](...args);
2378
+ }
2379
+ }
2380
+ get isTTY() {
2381
+ if (this.#isTTY !== null) {
2382
+ return this.#isTTY;
2383
+ }
2384
+ return this.#destSrc("isTTY", false);
2385
+ }
2386
+ set isTTY(val) {
2387
+ this.#isTTY = val;
2388
+ }
2389
+ get rows() {
2390
+ return this.#destSrc("rows");
2391
+ }
2392
+ get columns() {
2393
+ return this.#destSrc("columns");
2394
+ }
2395
+ mute() {
2396
+ this.muted = true;
2397
+ }
2398
+ unmute() {
2399
+ this.muted = false;
2400
+ }
2401
+ _onpipe(src) {
2402
+ this._src = src;
2403
+ }
2404
+ pipe(dest, options) {
2405
+ this._dest = dest;
2406
+ return super.pipe(dest, options);
2407
+ }
2408
+ pause() {
2409
+ if (this._src) {
2410
+ return this._src.pause();
2411
+ }
2412
+ }
2413
+ resume() {
2414
+ if (this._src) {
2415
+ return this._src.resume();
2416
+ }
2417
+ }
2418
+ write(c) {
2419
+ if (this.muted) {
2420
+ if (!this.replace) {
2421
+ return true;
2422
+ }
2423
+ if (c.match(/^\u001b/)) {
2424
+ if (c.indexOf(this._prompt) === 0) {
2425
+ c = c.slice(this._prompt.length);
2426
+ c = c.replace(/./g, this.replace);
2427
+ c = this._prompt + c;
2428
+ }
2429
+ this._hadControl = true;
2430
+ return this.emit("data", c);
2431
+ } else {
2432
+ if (this._prompt && this._hadControl && c.indexOf(this._prompt) === 0) {
2433
+ this._hadControl = false;
2434
+ this.emit("data", this._prompt);
2435
+ c = c.slice(this._prompt.length);
2436
+ }
2437
+ c = c.toString().replace(/./g, this.replace);
2438
+ }
2439
+ }
2440
+ this.emit("data", c);
2441
+ }
2442
+ end(c) {
2443
+ if (this.muted) {
2444
+ if (c && this.replace) {
2445
+ c = c.toString().replace(/./g, this.replace);
2446
+ } else {
2447
+ c = null;
2448
+ }
2449
+ }
2450
+ if (c) {
2451
+ this.emit("data", c);
2452
+ }
2453
+ this.emit("end");
2454
+ }
2455
+ destroy(...args) {
2456
+ return this.#proxy("destroy", ...args);
2457
+ }
2458
+ destroySoon(...args) {
2459
+ return this.#proxy("destroySoon", ...args);
2460
+ }
2461
+ close(...args) {
2462
+ return this.#proxy("close", ...args);
2463
+ }
2464
+ }
2465
+ module.exports = MuteStream;
2466
+ });
2467
+
2305
2468
  // src/platform/detector.ts
2306
2469
  import os from "node:os";
2307
2470
  function detectPlatform() {
@@ -3133,6 +3296,1688 @@ class GcloudHandler {
3133
3296
  }
3134
3297
  }
3135
3298
 
3136
- export { getStitchDir, getGcloudConfigPath, execCommand, GcloudExecutor, GcloudHandler };
3299
+ // node_modules/@inquirer/core/dist/lib/key.js
3300
+ var isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
3301
+ var isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
3302
+ var isBackspaceKey = (key) => key.name === "backspace";
3303
+ var isTabKey = (key) => key.name === "tab";
3304
+ var isNumberKey = (key) => "1234567890".includes(key.name);
3305
+ var isEnterKey = (key) => key.name === "enter" || key.name === "return";
3306
+ // node_modules/@inquirer/core/dist/lib/errors.js
3307
+ class AbortPromptError extends Error {
3308
+ name = "AbortPromptError";
3309
+ message = "Prompt was aborted";
3310
+ constructor(options) {
3311
+ super();
3312
+ this.cause = options?.cause;
3313
+ }
3314
+ }
3315
+
3316
+ class CancelPromptError extends Error {
3317
+ name = "CancelPromptError";
3318
+ message = "Prompt was canceled";
3319
+ }
3320
+
3321
+ class ExitPromptError extends Error {
3322
+ name = "ExitPromptError";
3323
+ }
3324
+
3325
+ class HookError extends Error {
3326
+ name = "HookError";
3327
+ }
3328
+
3329
+ class ValidationError extends Error {
3330
+ name = "ValidationError";
3331
+ }
3332
+ // node_modules/@inquirer/core/dist/lib/use-state.js
3333
+ import { AsyncResource as AsyncResource2 } from "node:async_hooks";
3334
+
3335
+ // node_modules/@inquirer/core/dist/lib/hook-engine.js
3336
+ import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
3337
+ var hookStorage = new AsyncLocalStorage;
3338
+ function createStore(rl) {
3339
+ const store = {
3340
+ rl,
3341
+ hooks: [],
3342
+ hooksCleanup: [],
3343
+ hooksEffect: [],
3344
+ index: 0,
3345
+ handleChange() {}
3346
+ };
3347
+ return store;
3348
+ }
3349
+ function withHooks(rl, cb) {
3350
+ const store = createStore(rl);
3351
+ return hookStorage.run(store, () => {
3352
+ function cycle(render) {
3353
+ store.handleChange = () => {
3354
+ store.index = 0;
3355
+ render();
3356
+ };
3357
+ store.handleChange();
3358
+ }
3359
+ return cb(cycle);
3360
+ });
3361
+ }
3362
+ function getStore() {
3363
+ const store = hookStorage.getStore();
3364
+ if (!store) {
3365
+ throw new HookError("[Inquirer] Hook functions can only be called from within a prompt");
3366
+ }
3367
+ return store;
3368
+ }
3369
+ function readline() {
3370
+ return getStore().rl;
3371
+ }
3372
+ function withUpdates(fn) {
3373
+ const wrapped = (...args) => {
3374
+ const store = getStore();
3375
+ let shouldUpdate = false;
3376
+ const oldHandleChange = store.handleChange;
3377
+ store.handleChange = () => {
3378
+ shouldUpdate = true;
3379
+ };
3380
+ const returnValue = fn(...args);
3381
+ if (shouldUpdate) {
3382
+ oldHandleChange();
3383
+ }
3384
+ store.handleChange = oldHandleChange;
3385
+ return returnValue;
3386
+ };
3387
+ return AsyncResource.bind(wrapped);
3388
+ }
3389
+ function withPointer(cb) {
3390
+ const store = getStore();
3391
+ const { index } = store;
3392
+ const pointer = {
3393
+ get() {
3394
+ return store.hooks[index];
3395
+ },
3396
+ set(value) {
3397
+ store.hooks[index] = value;
3398
+ },
3399
+ initialized: index in store.hooks
3400
+ };
3401
+ const returnValue = cb(pointer);
3402
+ store.index++;
3403
+ return returnValue;
3404
+ }
3405
+ function handleChange() {
3406
+ getStore().handleChange();
3407
+ }
3408
+ var effectScheduler = {
3409
+ queue(cb) {
3410
+ const store = getStore();
3411
+ const { index } = store;
3412
+ store.hooksEffect.push(() => {
3413
+ store.hooksCleanup[index]?.();
3414
+ const cleanFn = cb(readline());
3415
+ if (cleanFn != null && typeof cleanFn !== "function") {
3416
+ throw new ValidationError("useEffect return value must be a cleanup function or nothing.");
3417
+ }
3418
+ store.hooksCleanup[index] = cleanFn;
3419
+ });
3420
+ },
3421
+ run() {
3422
+ const store = getStore();
3423
+ withUpdates(() => {
3424
+ store.hooksEffect.forEach((effect) => {
3425
+ effect();
3426
+ });
3427
+ store.hooksEffect.length = 0;
3428
+ })();
3429
+ },
3430
+ clearAll() {
3431
+ const store = getStore();
3432
+ store.hooksCleanup.forEach((cleanFn) => {
3433
+ cleanFn?.();
3434
+ });
3435
+ store.hooksEffect.length = 0;
3436
+ store.hooksCleanup.length = 0;
3437
+ }
3438
+ };
3439
+
3440
+ // node_modules/@inquirer/core/dist/lib/use-state.js
3441
+ function useState(defaultValue) {
3442
+ return withPointer((pointer) => {
3443
+ const setState = AsyncResource2.bind(function setState2(newValue) {
3444
+ if (pointer.get() !== newValue) {
3445
+ pointer.set(newValue);
3446
+ handleChange();
3447
+ }
3448
+ });
3449
+ if (pointer.initialized) {
3450
+ return [pointer.get(), setState];
3451
+ }
3452
+ const value = typeof defaultValue === "function" ? defaultValue() : defaultValue;
3453
+ pointer.set(value);
3454
+ return [value, setState];
3455
+ });
3456
+ }
3457
+
3458
+ // node_modules/@inquirer/core/dist/lib/use-effect.js
3459
+ function useEffect(cb, depArray) {
3460
+ withPointer((pointer) => {
3461
+ const oldDeps = pointer.get();
3462
+ const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i]));
3463
+ if (hasChanged) {
3464
+ effectScheduler.queue(cb);
3465
+ }
3466
+ pointer.set(depArray);
3467
+ });
3468
+ }
3469
+
3470
+ // node_modules/@inquirer/core/dist/lib/theme.js
3471
+ import { styleText } from "node:util";
3472
+
3473
+ // node_modules/@inquirer/figures/dist/index.js
3474
+ import process2 from "node:process";
3475
+ function isUnicodeSupported() {
3476
+ if (process2.platform !== "win32") {
3477
+ return process2.env["TERM"] !== "linux";
3478
+ }
3479
+ return Boolean(process2.env["WT_SESSION"]) || Boolean(process2.env["TERMINUS_SUBLIME"]) || process2.env["ConEmuTask"] === "{cmd::Cmder}" || process2.env["TERM_PROGRAM"] === "Terminus-Sublime" || process2.env["TERM_PROGRAM"] === "vscode" || process2.env["TERM"] === "xterm-256color" || process2.env["TERM"] === "alacritty" || process2.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
3480
+ }
3481
+ var common = {
3482
+ circleQuestionMark: "(?)",
3483
+ questionMarkPrefix: "(?)",
3484
+ square: "█",
3485
+ squareDarkShade: "▓",
3486
+ squareMediumShade: "▒",
3487
+ squareLightShade: "░",
3488
+ squareTop: "▀",
3489
+ squareBottom: "▄",
3490
+ squareLeft: "▌",
3491
+ squareRight: "▐",
3492
+ squareCenter: "■",
3493
+ bullet: "●",
3494
+ dot: "․",
3495
+ ellipsis: "…",
3496
+ pointerSmall: "›",
3497
+ triangleUp: "▲",
3498
+ triangleUpSmall: "▴",
3499
+ triangleDown: "▼",
3500
+ triangleDownSmall: "▾",
3501
+ triangleLeftSmall: "◂",
3502
+ triangleRightSmall: "▸",
3503
+ home: "⌂",
3504
+ heart: "♥",
3505
+ musicNote: "♪",
3506
+ musicNoteBeamed: "♫",
3507
+ arrowUp: "↑",
3508
+ arrowDown: "↓",
3509
+ arrowLeft: "←",
3510
+ arrowRight: "→",
3511
+ arrowLeftRight: "↔",
3512
+ arrowUpDown: "↕",
3513
+ almostEqual: "≈",
3514
+ notEqual: "≠",
3515
+ lessOrEqual: "≤",
3516
+ greaterOrEqual: "≥",
3517
+ identical: "≡",
3518
+ infinity: "∞",
3519
+ subscriptZero: "₀",
3520
+ subscriptOne: "₁",
3521
+ subscriptTwo: "₂",
3522
+ subscriptThree: "₃",
3523
+ subscriptFour: "₄",
3524
+ subscriptFive: "₅",
3525
+ subscriptSix: "₆",
3526
+ subscriptSeven: "₇",
3527
+ subscriptEight: "₈",
3528
+ subscriptNine: "₉",
3529
+ oneHalf: "½",
3530
+ oneThird: "⅓",
3531
+ oneQuarter: "¼",
3532
+ oneFifth: "⅕",
3533
+ oneSixth: "⅙",
3534
+ oneEighth: "⅛",
3535
+ twoThirds: "⅔",
3536
+ twoFifths: "⅖",
3537
+ threeQuarters: "¾",
3538
+ threeFifths: "⅗",
3539
+ threeEighths: "⅜",
3540
+ fourFifths: "⅘",
3541
+ fiveSixths: "⅚",
3542
+ fiveEighths: "⅝",
3543
+ sevenEighths: "⅞",
3544
+ line: "─",
3545
+ lineBold: "━",
3546
+ lineDouble: "═",
3547
+ lineDashed0: "┄",
3548
+ lineDashed1: "┅",
3549
+ lineDashed2: "┈",
3550
+ lineDashed3: "┉",
3551
+ lineDashed4: "╌",
3552
+ lineDashed5: "╍",
3553
+ lineDashed6: "╴",
3554
+ lineDashed7: "╶",
3555
+ lineDashed8: "╸",
3556
+ lineDashed9: "╺",
3557
+ lineDashed10: "╼",
3558
+ lineDashed11: "╾",
3559
+ lineDashed12: "−",
3560
+ lineDashed13: "–",
3561
+ lineDashed14: "‐",
3562
+ lineDashed15: "⁃",
3563
+ lineVertical: "│",
3564
+ lineVerticalBold: "┃",
3565
+ lineVerticalDouble: "║",
3566
+ lineVerticalDashed0: "┆",
3567
+ lineVerticalDashed1: "┇",
3568
+ lineVerticalDashed2: "┊",
3569
+ lineVerticalDashed3: "┋",
3570
+ lineVerticalDashed4: "╎",
3571
+ lineVerticalDashed5: "╏",
3572
+ lineVerticalDashed6: "╵",
3573
+ lineVerticalDashed7: "╷",
3574
+ lineVerticalDashed8: "╹",
3575
+ lineVerticalDashed9: "╻",
3576
+ lineVerticalDashed10: "╽",
3577
+ lineVerticalDashed11: "╿",
3578
+ lineDownLeft: "┐",
3579
+ lineDownLeftArc: "╮",
3580
+ lineDownBoldLeftBold: "┓",
3581
+ lineDownBoldLeft: "┒",
3582
+ lineDownLeftBold: "┑",
3583
+ lineDownDoubleLeftDouble: "╗",
3584
+ lineDownDoubleLeft: "╖",
3585
+ lineDownLeftDouble: "╕",
3586
+ lineDownRight: "┌",
3587
+ lineDownRightArc: "╭",
3588
+ lineDownBoldRightBold: "┏",
3589
+ lineDownBoldRight: "┎",
3590
+ lineDownRightBold: "┍",
3591
+ lineDownDoubleRightDouble: "╔",
3592
+ lineDownDoubleRight: "╓",
3593
+ lineDownRightDouble: "╒",
3594
+ lineUpLeft: "┘",
3595
+ lineUpLeftArc: "╯",
3596
+ lineUpBoldLeftBold: "┛",
3597
+ lineUpBoldLeft: "┚",
3598
+ lineUpLeftBold: "┙",
3599
+ lineUpDoubleLeftDouble: "╝",
3600
+ lineUpDoubleLeft: "╜",
3601
+ lineUpLeftDouble: "╛",
3602
+ lineUpRight: "└",
3603
+ lineUpRightArc: "╰",
3604
+ lineUpBoldRightBold: "┗",
3605
+ lineUpBoldRight: "┖",
3606
+ lineUpRightBold: "┕",
3607
+ lineUpDoubleRightDouble: "╚",
3608
+ lineUpDoubleRight: "╙",
3609
+ lineUpRightDouble: "╘",
3610
+ lineUpDownLeft: "┤",
3611
+ lineUpBoldDownBoldLeftBold: "┫",
3612
+ lineUpBoldDownBoldLeft: "┨",
3613
+ lineUpDownLeftBold: "┥",
3614
+ lineUpBoldDownLeftBold: "┩",
3615
+ lineUpDownBoldLeftBold: "┪",
3616
+ lineUpDownBoldLeft: "┧",
3617
+ lineUpBoldDownLeft: "┦",
3618
+ lineUpDoubleDownDoubleLeftDouble: "╣",
3619
+ lineUpDoubleDownDoubleLeft: "╢",
3620
+ lineUpDownLeftDouble: "╡",
3621
+ lineUpDownRight: "├",
3622
+ lineUpBoldDownBoldRightBold: "┣",
3623
+ lineUpBoldDownBoldRight: "┠",
3624
+ lineUpDownRightBold: "┝",
3625
+ lineUpBoldDownRightBold: "┡",
3626
+ lineUpDownBoldRightBold: "┢",
3627
+ lineUpDownBoldRight: "┟",
3628
+ lineUpBoldDownRight: "┞",
3629
+ lineUpDoubleDownDoubleRightDouble: "╠",
3630
+ lineUpDoubleDownDoubleRight: "╟",
3631
+ lineUpDownRightDouble: "╞",
3632
+ lineDownLeftRight: "┬",
3633
+ lineDownBoldLeftBoldRightBold: "┳",
3634
+ lineDownLeftBoldRightBold: "┯",
3635
+ lineDownBoldLeftRight: "┰",
3636
+ lineDownBoldLeftBoldRight: "┱",
3637
+ lineDownBoldLeftRightBold: "┲",
3638
+ lineDownLeftRightBold: "┮",
3639
+ lineDownLeftBoldRight: "┭",
3640
+ lineDownDoubleLeftDoubleRightDouble: "╦",
3641
+ lineDownDoubleLeftRight: "╥",
3642
+ lineDownLeftDoubleRightDouble: "╤",
3643
+ lineUpLeftRight: "┴",
3644
+ lineUpBoldLeftBoldRightBold: "┻",
3645
+ lineUpLeftBoldRightBold: "┷",
3646
+ lineUpBoldLeftRight: "┸",
3647
+ lineUpBoldLeftBoldRight: "┹",
3648
+ lineUpBoldLeftRightBold: "┺",
3649
+ lineUpLeftRightBold: "┶",
3650
+ lineUpLeftBoldRight: "┵",
3651
+ lineUpDoubleLeftDoubleRightDouble: "╩",
3652
+ lineUpDoubleLeftRight: "╨",
3653
+ lineUpLeftDoubleRightDouble: "╧",
3654
+ lineUpDownLeftRight: "┼",
3655
+ lineUpBoldDownBoldLeftBoldRightBold: "╋",
3656
+ lineUpDownBoldLeftBoldRightBold: "╈",
3657
+ lineUpBoldDownLeftBoldRightBold: "╇",
3658
+ lineUpBoldDownBoldLeftRightBold: "╊",
3659
+ lineUpBoldDownBoldLeftBoldRight: "╉",
3660
+ lineUpBoldDownLeftRight: "╀",
3661
+ lineUpDownBoldLeftRight: "╁",
3662
+ lineUpDownLeftBoldRight: "┽",
3663
+ lineUpDownLeftRightBold: "┾",
3664
+ lineUpBoldDownBoldLeftRight: "╂",
3665
+ lineUpDownLeftBoldRightBold: "┿",
3666
+ lineUpBoldDownLeftBoldRight: "╃",
3667
+ lineUpBoldDownLeftRightBold: "╄",
3668
+ lineUpDownBoldLeftBoldRight: "╅",
3669
+ lineUpDownBoldLeftRightBold: "╆",
3670
+ lineUpDoubleDownDoubleLeftDoubleRightDouble: "╬",
3671
+ lineUpDoubleDownDoubleLeftRight: "╫",
3672
+ lineUpDownLeftDoubleRightDouble: "╪",
3673
+ lineCross: "╳",
3674
+ lineBackslash: "╲",
3675
+ lineSlash: "╱"
3676
+ };
3677
+ var specialMainSymbols = {
3678
+ tick: "✔",
3679
+ info: "ℹ",
3680
+ warning: "⚠",
3681
+ cross: "✘",
3682
+ squareSmall: "◻",
3683
+ squareSmallFilled: "◼",
3684
+ circle: "◯",
3685
+ circleFilled: "◉",
3686
+ circleDotted: "◌",
3687
+ circleDouble: "◎",
3688
+ circleCircle: "ⓞ",
3689
+ circleCross: "ⓧ",
3690
+ circlePipe: "Ⓘ",
3691
+ radioOn: "◉",
3692
+ radioOff: "◯",
3693
+ checkboxOn: "☒",
3694
+ checkboxOff: "☐",
3695
+ checkboxCircleOn: "ⓧ",
3696
+ checkboxCircleOff: "Ⓘ",
3697
+ pointer: "❯",
3698
+ triangleUpOutline: "△",
3699
+ triangleLeft: "◀",
3700
+ triangleRight: "▶",
3701
+ lozenge: "◆",
3702
+ lozengeOutline: "◇",
3703
+ hamburger: "☰",
3704
+ smiley: "㋡",
3705
+ mustache: "෴",
3706
+ star: "★",
3707
+ play: "▶",
3708
+ nodejs: "⬢",
3709
+ oneSeventh: "⅐",
3710
+ oneNinth: "⅑",
3711
+ oneTenth: "⅒"
3712
+ };
3713
+ var specialFallbackSymbols = {
3714
+ tick: "√",
3715
+ info: "i",
3716
+ warning: "‼",
3717
+ cross: "×",
3718
+ squareSmall: "□",
3719
+ squareSmallFilled: "■",
3720
+ circle: "( )",
3721
+ circleFilled: "(*)",
3722
+ circleDotted: "( )",
3723
+ circleDouble: "( )",
3724
+ circleCircle: "(○)",
3725
+ circleCross: "(×)",
3726
+ circlePipe: "(│)",
3727
+ radioOn: "(*)",
3728
+ radioOff: "( )",
3729
+ checkboxOn: "[×]",
3730
+ checkboxOff: "[ ]",
3731
+ checkboxCircleOn: "(×)",
3732
+ checkboxCircleOff: "( )",
3733
+ pointer: ">",
3734
+ triangleUpOutline: "∆",
3735
+ triangleLeft: "◄",
3736
+ triangleRight: "►",
3737
+ lozenge: "♦",
3738
+ lozengeOutline: "◊",
3739
+ hamburger: "≡",
3740
+ smiley: "☺",
3741
+ mustache: "┌─┐",
3742
+ star: "✶",
3743
+ play: "►",
3744
+ nodejs: "♦",
3745
+ oneSeventh: "1/7",
3746
+ oneNinth: "1/9",
3747
+ oneTenth: "1/10"
3748
+ };
3749
+ var mainSymbols = {
3750
+ ...common,
3751
+ ...specialMainSymbols
3752
+ };
3753
+ var fallbackSymbols = {
3754
+ ...common,
3755
+ ...specialFallbackSymbols
3756
+ };
3757
+ var shouldUseMain = isUnicodeSupported();
3758
+ var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
3759
+ var dist_default = figures;
3760
+ var replacements = Object.entries(specialMainSymbols);
3761
+
3762
+ // node_modules/@inquirer/core/dist/lib/theme.js
3763
+ var defaultTheme = {
3764
+ prefix: {
3765
+ idle: styleText("blue", "?"),
3766
+ done: styleText("green", dist_default.tick)
3767
+ },
3768
+ spinner: {
3769
+ interval: 80,
3770
+ frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => styleText("yellow", frame))
3771
+ },
3772
+ style: {
3773
+ answer: (text) => styleText("cyan", text),
3774
+ message: (text) => styleText("bold", text),
3775
+ error: (text) => styleText("red", `> ${text}`),
3776
+ defaultAnswer: (text) => styleText("dim", `(${text})`),
3777
+ help: (text) => styleText("dim", text),
3778
+ highlight: (text) => styleText("cyan", text),
3779
+ key: (text) => styleText("cyan", styleText("bold", `<${text}>`))
3780
+ }
3781
+ };
3782
+
3783
+ // node_modules/@inquirer/core/dist/lib/make-theme.js
3784
+ function isPlainObject(value) {
3785
+ if (typeof value !== "object" || value === null)
3786
+ return false;
3787
+ let proto = value;
3788
+ while (Object.getPrototypeOf(proto) !== null) {
3789
+ proto = Object.getPrototypeOf(proto);
3790
+ }
3791
+ return Object.getPrototypeOf(value) === proto;
3792
+ }
3793
+ function deepMerge(...objects) {
3794
+ const output = {};
3795
+ for (const obj of objects) {
3796
+ for (const [key, value] of Object.entries(obj)) {
3797
+ const prevValue = output[key];
3798
+ output[key] = isPlainObject(prevValue) && isPlainObject(value) ? deepMerge(prevValue, value) : value;
3799
+ }
3800
+ }
3801
+ return output;
3802
+ }
3803
+ function makeTheme(...themes) {
3804
+ const themesToMerge = [
3805
+ defaultTheme,
3806
+ ...themes.filter((theme2) => theme2 != null)
3807
+ ];
3808
+ return deepMerge(...themesToMerge);
3809
+ }
3810
+
3811
+ // node_modules/@inquirer/core/dist/lib/use-prefix.js
3812
+ function usePrefix({ status = "idle", theme: theme2 }) {
3813
+ const [showLoader, setShowLoader] = useState(false);
3814
+ const [tick, setTick] = useState(0);
3815
+ const { prefix, spinner } = makeTheme(theme2);
3816
+ useEffect(() => {
3817
+ if (status === "loading") {
3818
+ let tickInterval;
3819
+ let inc = -1;
3820
+ const delayTimeout = setTimeout(() => {
3821
+ setShowLoader(true);
3822
+ tickInterval = setInterval(() => {
3823
+ inc = inc + 1;
3824
+ setTick(inc % spinner.frames.length);
3825
+ }, spinner.interval);
3826
+ }, 300);
3827
+ return () => {
3828
+ clearTimeout(delayTimeout);
3829
+ clearInterval(tickInterval);
3830
+ };
3831
+ } else {
3832
+ setShowLoader(false);
3833
+ }
3834
+ }, [status]);
3835
+ if (showLoader) {
3836
+ return spinner.frames[tick];
3837
+ }
3838
+ const iconName = status === "loading" ? "idle" : status;
3839
+ return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
3840
+ }
3841
+ // node_modules/@inquirer/core/dist/lib/use-memo.js
3842
+ function useMemo(fn, dependencies) {
3843
+ return withPointer((pointer) => {
3844
+ const prev = pointer.get();
3845
+ if (!prev || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
3846
+ const value = fn();
3847
+ pointer.set({ value, dependencies });
3848
+ return value;
3849
+ }
3850
+ return prev.value;
3851
+ });
3852
+ }
3853
+ // node_modules/@inquirer/core/dist/lib/use-ref.js
3854
+ function useRef(val) {
3855
+ return useState({ current: val })[0];
3856
+ }
3857
+ // node_modules/@inquirer/core/dist/lib/use-keypress.js
3858
+ function useKeypress(userHandler) {
3859
+ const signal = useRef(userHandler);
3860
+ signal.current = userHandler;
3861
+ useEffect((rl) => {
3862
+ let ignore = false;
3863
+ const handler = withUpdates((_input, event) => {
3864
+ if (ignore)
3865
+ return;
3866
+ signal.current(event, rl);
3867
+ });
3868
+ rl.input.on("keypress", handler);
3869
+ return () => {
3870
+ ignore = true;
3871
+ rl.input.removeListener("keypress", handler);
3872
+ };
3873
+ }, []);
3874
+ }
3875
+ // node_modules/@inquirer/core/dist/lib/utils.js
3876
+ var import_cli_width = __toESM(require_cli_width(), 1);
3877
+
3878
+ // node_modules/fast-string-truncated-width/dist/utils.js
3879
+ var getCodePointsLength = (() => {
3880
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
3881
+ return (input) => {
3882
+ let surrogatePairsNr = 0;
3883
+ SURROGATE_PAIR_RE.lastIndex = 0;
3884
+ while (SURROGATE_PAIR_RE.test(input)) {
3885
+ surrogatePairsNr += 1;
3886
+ }
3887
+ return input.length - surrogatePairsNr;
3888
+ };
3889
+ })();
3890
+ var isFullWidth = (x) => {
3891
+ return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
3892
+ };
3893
+ var isWideNotCJKTNotEmoji = (x) => {
3894
+ return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
3895
+ };
3896
+
3897
+ // node_modules/fast-string-truncated-width/dist/index.js
3898
+ var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
3899
+ var CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
3900
+ var CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/yu;
3901
+ var TAB_RE = /\t{1,1000}/y;
3902
+ var EMOJI_RE = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/yu;
3903
+ var LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
3904
+ var MODIFIER_RE = /\p{M}+/gu;
3905
+ var NO_TRUNCATION = { limit: Infinity, ellipsis: "" };
3906
+ var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
3907
+ const LIMIT = truncationOptions.limit ?? Infinity;
3908
+ const ELLIPSIS = truncationOptions.ellipsis ?? "";
3909
+ const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
3910
+ const ANSI_WIDTH = 0;
3911
+ const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
3912
+ const TAB_WIDTH = widthOptions.tabWidth ?? 8;
3913
+ const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
3914
+ const FULL_WIDTH_WIDTH = 2;
3915
+ const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
3916
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
3917
+ const PARSE_BLOCKS = [
3918
+ [LATIN_RE, REGULAR_WIDTH],
3919
+ [ANSI_RE, ANSI_WIDTH],
3920
+ [CONTROL_RE, CONTROL_WIDTH],
3921
+ [TAB_RE, TAB_WIDTH],
3922
+ [EMOJI_RE, EMOJI_WIDTH],
3923
+ [CJKT_WIDE_RE, WIDE_WIDTH]
3924
+ ];
3925
+ let indexPrev = 0;
3926
+ let index = 0;
3927
+ let length = input.length;
3928
+ let lengthExtra = 0;
3929
+ let truncationEnabled = false;
3930
+ let truncationIndex = length;
3931
+ let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
3932
+ let unmatchedStart = 0;
3933
+ let unmatchedEnd = 0;
3934
+ let width = 0;
3935
+ let widthExtra = 0;
3936
+ outer:
3937
+ while (true) {
3938
+ if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
3939
+ const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
3940
+ lengthExtra = 0;
3941
+ for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
3942
+ const codePoint = char.codePointAt(0) || 0;
3943
+ if (isFullWidth(codePoint)) {
3944
+ widthExtra = FULL_WIDTH_WIDTH;
3945
+ } else if (isWideNotCJKTNotEmoji(codePoint)) {
3946
+ widthExtra = WIDE_WIDTH;
3947
+ } else {
3948
+ widthExtra = REGULAR_WIDTH;
3949
+ }
3950
+ if (width + widthExtra > truncationLimit) {
3951
+ truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
3952
+ }
3953
+ if (width + widthExtra > LIMIT) {
3954
+ truncationEnabled = true;
3955
+ break outer;
3956
+ }
3957
+ lengthExtra += char.length;
3958
+ width += widthExtra;
3959
+ }
3960
+ unmatchedStart = unmatchedEnd = 0;
3961
+ }
3962
+ if (index >= length) {
3963
+ break outer;
3964
+ }
3965
+ for (let i = 0, l = PARSE_BLOCKS.length;i < l; i++) {
3966
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
3967
+ BLOCK_RE.lastIndex = index;
3968
+ if (BLOCK_RE.test(input)) {
3969
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
3970
+ widthExtra = lengthExtra * BLOCK_WIDTH;
3971
+ if (width + widthExtra > truncationLimit) {
3972
+ truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
3973
+ }
3974
+ if (width + widthExtra > LIMIT) {
3975
+ truncationEnabled = true;
3976
+ break outer;
3977
+ }
3978
+ width += widthExtra;
3979
+ unmatchedStart = indexPrev;
3980
+ unmatchedEnd = index;
3981
+ index = indexPrev = BLOCK_RE.lastIndex;
3982
+ continue outer;
3983
+ }
3984
+ }
3985
+ index += 1;
3986
+ }
3987
+ return {
3988
+ width: truncationEnabled ? truncationLimit : width,
3989
+ index: truncationEnabled ? truncationIndex : length,
3990
+ truncated: truncationEnabled,
3991
+ ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
3992
+ };
3993
+ };
3994
+ var dist_default2 = getStringTruncatedWidth;
3995
+
3996
+ // node_modules/fast-string-width/dist/index.js
3997
+ var NO_TRUNCATION2 = {
3998
+ limit: Infinity,
3999
+ ellipsis: "",
4000
+ ellipsisWidth: 0
4001
+ };
4002
+ var fastStringWidth = (input, options = {}) => {
4003
+ return dist_default2(input, NO_TRUNCATION2, options).width;
4004
+ };
4005
+ var dist_default3 = fastStringWidth;
4006
+
4007
+ // node_modules/fast-wrap-ansi/lib/main.js
4008
+ var ESC = "\x1B";
4009
+ var CSI = "›";
4010
+ var END_CODE = 39;
4011
+ var ANSI_ESCAPE_BELL = "\x07";
4012
+ var ANSI_CSI = "[";
4013
+ var ANSI_OSC = "]";
4014
+ var ANSI_SGR_TERMINATOR = "m";
4015
+ var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
4016
+ var GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
4017
+ var getClosingCode = (openingCode) => {
4018
+ if (openingCode >= 30 && openingCode <= 37)
4019
+ return 39;
4020
+ if (openingCode >= 90 && openingCode <= 97)
4021
+ return 39;
4022
+ if (openingCode >= 40 && openingCode <= 47)
4023
+ return 49;
4024
+ if (openingCode >= 100 && openingCode <= 107)
4025
+ return 49;
4026
+ if (openingCode === 1 || openingCode === 2)
4027
+ return 22;
4028
+ if (openingCode === 3)
4029
+ return 23;
4030
+ if (openingCode === 4)
4031
+ return 24;
4032
+ if (openingCode === 7)
4033
+ return 27;
4034
+ if (openingCode === 8)
4035
+ return 28;
4036
+ if (openingCode === 9)
4037
+ return 29;
4038
+ if (openingCode === 0)
4039
+ return 0;
4040
+ return;
4041
+ };
4042
+ var wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
4043
+ var wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
4044
+ var wrapWord = (rows, word, columns) => {
4045
+ const characters = word[Symbol.iterator]();
4046
+ let isInsideEscape = false;
4047
+ let isInsideLinkEscape = false;
4048
+ let lastRow = rows.at(-1);
4049
+ let visible = lastRow === undefined ? 0 : dist_default3(lastRow);
4050
+ let currentCharacter = characters.next();
4051
+ let nextCharacter = characters.next();
4052
+ let rawCharacterIndex = 0;
4053
+ while (!currentCharacter.done) {
4054
+ const character = currentCharacter.value;
4055
+ const characterLength = dist_default3(character);
4056
+ if (visible + characterLength <= columns) {
4057
+ rows[rows.length - 1] += character;
4058
+ } else {
4059
+ rows.push(character);
4060
+ visible = 0;
4061
+ }
4062
+ if (character === ESC || character === CSI) {
4063
+ isInsideEscape = true;
4064
+ isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
4065
+ }
4066
+ if (isInsideEscape) {
4067
+ if (isInsideLinkEscape) {
4068
+ if (character === ANSI_ESCAPE_BELL) {
4069
+ isInsideEscape = false;
4070
+ isInsideLinkEscape = false;
4071
+ }
4072
+ } else if (character === ANSI_SGR_TERMINATOR) {
4073
+ isInsideEscape = false;
4074
+ }
4075
+ } else {
4076
+ visible += characterLength;
4077
+ if (visible === columns && !nextCharacter.done) {
4078
+ rows.push("");
4079
+ visible = 0;
4080
+ }
4081
+ }
4082
+ currentCharacter = nextCharacter;
4083
+ nextCharacter = characters.next();
4084
+ rawCharacterIndex += character.length;
4085
+ }
4086
+ lastRow = rows.at(-1);
4087
+ if (!visible && lastRow !== undefined && lastRow.length && rows.length > 1) {
4088
+ rows[rows.length - 2] += rows.pop();
4089
+ }
4090
+ };
4091
+ var stringVisibleTrimSpacesRight = (string) => {
4092
+ const words = string.split(" ");
4093
+ let last = words.length;
4094
+ while (last) {
4095
+ if (dist_default3(words[last - 1])) {
4096
+ break;
4097
+ }
4098
+ last--;
4099
+ }
4100
+ if (last === words.length) {
4101
+ return string;
4102
+ }
4103
+ return words.slice(0, last).join(" ") + words.slice(last).join("");
4104
+ };
4105
+ var exec = (string, columns, options = {}) => {
4106
+ if (options.trim !== false && string.trim() === "") {
4107
+ return "";
4108
+ }
4109
+ let returnValue = "";
4110
+ let escapeCode;
4111
+ let escapeUrl;
4112
+ const words = string.split(" ");
4113
+ let rows = [""];
4114
+ let rowLength = 0;
4115
+ for (let index = 0;index < words.length; index++) {
4116
+ const word = words[index];
4117
+ if (options.trim !== false) {
4118
+ const row = rows.at(-1) ?? "";
4119
+ const trimmed = row.trimStart();
4120
+ if (row.length !== trimmed.length) {
4121
+ rows[rows.length - 1] = trimmed;
4122
+ rowLength = dist_default3(trimmed);
4123
+ }
4124
+ }
4125
+ if (index !== 0) {
4126
+ if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
4127
+ rows.push("");
4128
+ rowLength = 0;
4129
+ }
4130
+ if (rowLength || options.trim === false) {
4131
+ rows[rows.length - 1] += " ";
4132
+ rowLength++;
4133
+ }
4134
+ }
4135
+ const wordLength = dist_default3(word);
4136
+ if (options.hard && wordLength > columns) {
4137
+ const remainingColumns = columns - rowLength;
4138
+ const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
4139
+ const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);
4140
+ if (breaksStartingNextLine < breaksStartingThisLine) {
4141
+ rows.push("");
4142
+ }
4143
+ wrapWord(rows, word, columns);
4144
+ rowLength = dist_default3(rows.at(-1) ?? "");
4145
+ continue;
4146
+ }
4147
+ if (rowLength + wordLength > columns && rowLength && wordLength) {
4148
+ if (options.wordWrap === false && rowLength < columns) {
4149
+ wrapWord(rows, word, columns);
4150
+ rowLength = dist_default3(rows.at(-1) ?? "");
4151
+ continue;
4152
+ }
4153
+ rows.push("");
4154
+ rowLength = 0;
4155
+ }
4156
+ if (rowLength + wordLength > columns && options.wordWrap === false) {
4157
+ wrapWord(rows, word, columns);
4158
+ rowLength = dist_default3(rows.at(-1) ?? "");
4159
+ continue;
4160
+ }
4161
+ rows[rows.length - 1] += word;
4162
+ rowLength += wordLength;
4163
+ }
4164
+ if (options.trim !== false) {
4165
+ rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
4166
+ }
4167
+ const preString = rows.join(`
4168
+ `);
4169
+ let inSurrogate = false;
4170
+ for (let i = 0;i < preString.length; i++) {
4171
+ const character = preString[i];
4172
+ returnValue += character;
4173
+ if (!inSurrogate) {
4174
+ inSurrogate = character >= "\uD800" && character <= "\uDBFF";
4175
+ if (inSurrogate) {
4176
+ continue;
4177
+ }
4178
+ } else {
4179
+ inSurrogate = false;
4180
+ }
4181
+ if (character === ESC || character === CSI) {
4182
+ GROUP_REGEX.lastIndex = i + 1;
4183
+ const groupsResult = GROUP_REGEX.exec(preString);
4184
+ const groups = groupsResult?.groups;
4185
+ if (groups?.code !== undefined) {
4186
+ const code = Number.parseFloat(groups.code);
4187
+ escapeCode = code === END_CODE ? undefined : code;
4188
+ } else if (groups?.uri !== undefined) {
4189
+ escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;
4190
+ }
4191
+ }
4192
+ if (preString[i + 1] === `
4193
+ `) {
4194
+ if (escapeUrl) {
4195
+ returnValue += wrapAnsiHyperlink("");
4196
+ }
4197
+ const closingCode = escapeCode ? getClosingCode(escapeCode) : undefined;
4198
+ if (escapeCode && closingCode) {
4199
+ returnValue += wrapAnsiCode(closingCode);
4200
+ }
4201
+ } else if (character === `
4202
+ `) {
4203
+ if (escapeCode && getClosingCode(escapeCode)) {
4204
+ returnValue += wrapAnsiCode(escapeCode);
4205
+ }
4206
+ if (escapeUrl) {
4207
+ returnValue += wrapAnsiHyperlink(escapeUrl);
4208
+ }
4209
+ }
4210
+ }
4211
+ return returnValue;
4212
+ };
4213
+ var CRLF_OR_LF = /\r?\n/;
4214
+ function wrapAnsi(string, columns, options) {
4215
+ return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join(`
4216
+ `);
4217
+ }
4218
+
4219
+ // node_modules/@inquirer/core/dist/lib/utils.js
4220
+ function breakLines(content, width) {
4221
+ return content.split(`
4222
+ `).flatMap((line) => wrapAnsi(line, width, { trim: false, hard: true }).split(`
4223
+ `).map((str) => str.trimEnd())).join(`
4224
+ `);
4225
+ }
4226
+ function readlineWidth() {
4227
+ return import_cli_width.default({ defaultWidth: 80, output: readline().output });
4228
+ }
4229
+
4230
+ // node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
4231
+ function usePointerPosition({ active, renderedItems, pageSize, loop }) {
4232
+ const state = useRef({
4233
+ lastPointer: active,
4234
+ lastActive: undefined
4235
+ });
4236
+ const { lastPointer, lastActive } = state.current;
4237
+ const middle = Math.floor(pageSize / 2);
4238
+ const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
4239
+ const defaultPointerPosition = renderedItems.slice(0, active).reduce((acc, item) => acc + item.length, 0);
4240
+ let pointer = defaultPointerPosition;
4241
+ if (renderedLength > pageSize) {
4242
+ if (loop) {
4243
+ pointer = lastPointer;
4244
+ if (lastActive != null && lastActive < active && active - lastActive < pageSize) {
4245
+ pointer = Math.min(middle, Math.abs(active - lastActive) === 1 ? Math.min(lastPointer + (renderedItems[lastActive]?.length ?? 0), Math.max(defaultPointerPosition, lastPointer)) : lastPointer + active - lastActive);
4246
+ }
4247
+ } else {
4248
+ const spaceUnderActive = renderedItems.slice(active).reduce((acc, item) => acc + item.length, 0);
4249
+ pointer = spaceUnderActive < pageSize - middle ? pageSize - spaceUnderActive : Math.min(defaultPointerPosition, middle);
4250
+ }
4251
+ }
4252
+ state.current.lastPointer = pointer;
4253
+ state.current.lastActive = active;
4254
+ return pointer;
4255
+ }
4256
+ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
4257
+ const width = readlineWidth();
4258
+ const bound = (num) => (num % items.length + items.length) % items.length;
4259
+ const renderedItems = items.map((item, index) => {
4260
+ if (item == null)
4261
+ return [];
4262
+ return breakLines(renderItem({ item, index, isActive: index === active }), width).split(`
4263
+ `);
4264
+ });
4265
+ const renderedLength = renderedItems.reduce((acc, item) => acc + item.length, 0);
4266
+ const renderItemAtIndex = (index) => renderedItems[index] ?? [];
4267
+ const pointer = usePointerPosition({ active, renderedItems, pageSize, loop });
4268
+ const activeItem = renderItemAtIndex(active).slice(0, pageSize);
4269
+ const activeItemPosition = pointer + activeItem.length <= pageSize ? pointer : pageSize - activeItem.length;
4270
+ const pageBuffer = Array.from({ length: pageSize });
4271
+ pageBuffer.splice(activeItemPosition, activeItem.length, ...activeItem);
4272
+ const itemVisited = new Set([active]);
4273
+ let bufferPointer = activeItemPosition + activeItem.length;
4274
+ let itemPointer = bound(active + 1);
4275
+ while (bufferPointer < pageSize && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer > active)) {
4276
+ const lines = renderItemAtIndex(itemPointer);
4277
+ const linesToAdd = lines.slice(0, pageSize - bufferPointer);
4278
+ pageBuffer.splice(bufferPointer, linesToAdd.length, ...linesToAdd);
4279
+ itemVisited.add(itemPointer);
4280
+ bufferPointer += linesToAdd.length;
4281
+ itemPointer = bound(itemPointer + 1);
4282
+ }
4283
+ bufferPointer = activeItemPosition - 1;
4284
+ itemPointer = bound(active - 1);
4285
+ while (bufferPointer >= 0 && !itemVisited.has(itemPointer) && (loop && renderedLength > pageSize ? itemPointer !== active : itemPointer < active)) {
4286
+ const lines = renderItemAtIndex(itemPointer);
4287
+ const linesToAdd = lines.slice(Math.max(0, lines.length - bufferPointer - 1));
4288
+ pageBuffer.splice(bufferPointer - linesToAdd.length + 1, linesToAdd.length, ...linesToAdd);
4289
+ itemVisited.add(itemPointer);
4290
+ bufferPointer -= linesToAdd.length;
4291
+ itemPointer = bound(itemPointer - 1);
4292
+ }
4293
+ return pageBuffer.filter((line) => typeof line === "string").join(`
4294
+ `);
4295
+ }
4296
+ // node_modules/@inquirer/core/dist/lib/create-prompt.js
4297
+ var import_mute_stream = __toESM(require_lib(), 1);
4298
+ import * as readline2 from "node:readline";
4299
+ import { AsyncResource as AsyncResource3 } from "node:async_hooks";
4300
+
4301
+ // node_modules/@inquirer/core/dist/lib/screen-manager.js
4302
+ import { stripVTControlCharacters } from "node:util";
4303
+
4304
+ // node_modules/@inquirer/ansi/dist/index.js
4305
+ var ESC2 = "\x1B[";
4306
+ var cursorLeft = ESC2 + "G";
4307
+ var cursorHide = ESC2 + "?25l";
4308
+ var cursorShow = ESC2 + "?25h";
4309
+ var cursorUp = (rows = 1) => rows > 0 ? `${ESC2}${rows}A` : "";
4310
+ var cursorDown = (rows = 1) => rows > 0 ? `${ESC2}${rows}B` : "";
4311
+ var cursorTo = (x, y) => {
4312
+ if (typeof y === "number" && !Number.isNaN(y)) {
4313
+ return `${ESC2}${y + 1};${x + 1}H`;
4314
+ }
4315
+ return `${ESC2}${x + 1}G`;
4316
+ };
4317
+ var eraseLine = ESC2 + "2K";
4318
+ var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
4319
+
4320
+ // node_modules/@inquirer/core/dist/lib/screen-manager.js
4321
+ var height = (content) => content.split(`
4322
+ `).length;
4323
+ var lastLine = (content) => content.split(`
4324
+ `).pop() ?? "";
4325
+
4326
+ class ScreenManager {
4327
+ height = 0;
4328
+ extraLinesUnderPrompt = 0;
4329
+ cursorPos;
4330
+ rl;
4331
+ constructor(rl) {
4332
+ this.rl = rl;
4333
+ this.cursorPos = rl.getCursorPos();
4334
+ }
4335
+ write(content) {
4336
+ this.rl.output.unmute();
4337
+ this.rl.output.write(content);
4338
+ this.rl.output.mute();
4339
+ }
4340
+ render(content, bottomContent = "") {
4341
+ const promptLine = lastLine(content);
4342
+ const rawPromptLine = stripVTControlCharacters(promptLine);
4343
+ let prompt = rawPromptLine;
4344
+ if (this.rl.line.length > 0) {
4345
+ prompt = prompt.slice(0, -this.rl.line.length);
4346
+ }
4347
+ this.rl.setPrompt(prompt);
4348
+ this.cursorPos = this.rl.getCursorPos();
4349
+ const width = readlineWidth();
4350
+ content = breakLines(content, width);
4351
+ bottomContent = breakLines(bottomContent, width);
4352
+ if (rawPromptLine.length % width === 0) {
4353
+ content += `
4354
+ `;
4355
+ }
4356
+ let output = content + (bottomContent ? `
4357
+ ` + bottomContent : "");
4358
+ const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
4359
+ const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);
4360
+ if (bottomContentHeight > 0)
4361
+ output += cursorUp(bottomContentHeight);
4362
+ output += cursorTo(this.cursorPos.cols);
4363
+ this.write(cursorDown(this.extraLinesUnderPrompt) + eraseLines(this.height) + output);
4364
+ this.extraLinesUnderPrompt = bottomContentHeight;
4365
+ this.height = height(output);
4366
+ }
4367
+ checkCursorPos() {
4368
+ const cursorPos = this.rl.getCursorPos();
4369
+ if (cursorPos.cols !== this.cursorPos.cols) {
4370
+ this.write(cursorTo(cursorPos.cols));
4371
+ this.cursorPos = cursorPos;
4372
+ }
4373
+ }
4374
+ done({ clearContent }) {
4375
+ this.rl.setPrompt("");
4376
+ let output = cursorDown(this.extraLinesUnderPrompt);
4377
+ output += clearContent ? eraseLines(this.height) : `
4378
+ `;
4379
+ output += cursorShow;
4380
+ this.write(output);
4381
+ this.rl.close();
4382
+ }
4383
+ }
4384
+
4385
+ // node_modules/@inquirer/core/dist/lib/promise-polyfill.js
4386
+ class PromisePolyfill extends Promise {
4387
+ static withResolver() {
4388
+ let resolve;
4389
+ let reject;
4390
+ const promise = new Promise((res, rej) => {
4391
+ resolve = res;
4392
+ reject = rej;
4393
+ });
4394
+ return { promise, resolve, reject };
4395
+ }
4396
+ }
4397
+
4398
+ // node_modules/@inquirer/core/dist/lib/create-prompt.js
4399
+ var nativeSetImmediate = globalThis.setImmediate;
4400
+ function getCallSites() {
4401
+ const _prepareStackTrace = Error.prepareStackTrace;
4402
+ let result = [];
4403
+ try {
4404
+ Error.prepareStackTrace = (_, callSites) => {
4405
+ const callSitesWithoutCurrent = callSites.slice(1);
4406
+ result = callSitesWithoutCurrent;
4407
+ return callSitesWithoutCurrent;
4408
+ };
4409
+ new Error().stack;
4410
+ } catch {
4411
+ return result;
4412
+ }
4413
+ Error.prepareStackTrace = _prepareStackTrace;
4414
+ return result;
4415
+ }
4416
+ function createPrompt(view) {
4417
+ const callSites = getCallSites();
4418
+ const prompt = (config, context = {}) => {
4419
+ const { input = process.stdin, signal } = context;
4420
+ const cleanups = new Set;
4421
+ const output = new import_mute_stream.default;
4422
+ output.pipe(context.output ?? process.stdout);
4423
+ output.mute();
4424
+ const rl = readline2.createInterface({
4425
+ terminal: true,
4426
+ input,
4427
+ output
4428
+ });
4429
+ const screen = new ScreenManager(rl);
4430
+ const { promise, resolve, reject } = PromisePolyfill.withResolver();
4431
+ const cancel = () => reject(new CancelPromptError);
4432
+ if (signal) {
4433
+ const abort = () => reject(new AbortPromptError({ cause: signal.reason }));
4434
+ if (signal.aborted) {
4435
+ abort();
4436
+ return Object.assign(promise, { cancel });
4437
+ }
4438
+ signal.addEventListener("abort", abort);
4439
+ cleanups.add(() => signal.removeEventListener("abort", abort));
4440
+ }
4441
+ cleanups.add(onExit((code, signal2) => {
4442
+ reject(new ExitPromptError(`User force closed the prompt with ${code} ${signal2}`));
4443
+ }));
4444
+ const sigint = () => reject(new ExitPromptError(`User force closed the prompt with SIGINT`));
4445
+ rl.on("SIGINT", sigint);
4446
+ cleanups.add(() => rl.removeListener("SIGINT", sigint));
4447
+ return withHooks(rl, (cycle) => {
4448
+ const hooksCleanup = AsyncResource3.bind(() => effectScheduler.clearAll());
4449
+ rl.on("close", hooksCleanup);
4450
+ cleanups.add(() => rl.removeListener("close", hooksCleanup));
4451
+ const startCycle = () => {
4452
+ const checkCursorPos = () => screen.checkCursorPos();
4453
+ rl.input.on("keypress", checkCursorPos);
4454
+ cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
4455
+ cycle(() => {
4456
+ try {
4457
+ const nextView = view(config, (value) => {
4458
+ setImmediate(() => resolve(value));
4459
+ });
4460
+ if (nextView === undefined) {
4461
+ const callerFilename = callSites[1]?.getFileName();
4462
+ throw new Error(`Prompt functions must return a string.
4463
+ at ${callerFilename}`);
4464
+ }
4465
+ const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
4466
+ screen.render(content, bottomContent);
4467
+ effectScheduler.run();
4468
+ } catch (error) {
4469
+ reject(error);
4470
+ }
4471
+ });
4472
+ };
4473
+ if ("readableFlowing" in input) {
4474
+ nativeSetImmediate(startCycle);
4475
+ } else {
4476
+ startCycle();
4477
+ }
4478
+ return Object.assign(promise.then((answer) => {
4479
+ effectScheduler.clearAll();
4480
+ return answer;
4481
+ }, (error) => {
4482
+ effectScheduler.clearAll();
4483
+ throw error;
4484
+ }).finally(() => {
4485
+ cleanups.forEach((cleanup) => cleanup());
4486
+ screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
4487
+ output.end();
4488
+ }).then(() => promise), { cancel });
4489
+ });
4490
+ };
4491
+ return prompt;
4492
+ }
4493
+ // node_modules/@inquirer/core/dist/lib/Separator.js
4494
+ import { styleText as styleText2 } from "node:util";
4495
+ class Separator {
4496
+ separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
4497
+ type = "separator";
4498
+ constructor(separator) {
4499
+ if (separator) {
4500
+ this.separator = separator;
4501
+ }
4502
+ }
4503
+ static isSeparator(choice) {
4504
+ return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
4505
+ }
4506
+ }
4507
+ // node_modules/@inquirer/confirm/dist/index.js
4508
+ function getBooleanValue(value, defaultValue) {
4509
+ let answer = defaultValue !== false;
4510
+ if (/^(y|yes)/i.test(value))
4511
+ answer = true;
4512
+ else if (/^(n|no)/i.test(value))
4513
+ answer = false;
4514
+ return answer;
4515
+ }
4516
+ function boolToString(value) {
4517
+ return value ? "Yes" : "No";
4518
+ }
4519
+ var dist_default4 = createPrompt((config, done) => {
4520
+ const { transformer = boolToString } = config;
4521
+ const [status, setStatus] = useState("idle");
4522
+ const [value, setValue] = useState("");
4523
+ const theme2 = makeTheme(config.theme);
4524
+ const prefix = usePrefix({ status, theme: theme2 });
4525
+ useKeypress((key, rl) => {
4526
+ if (status !== "idle")
4527
+ return;
4528
+ if (isEnterKey(key)) {
4529
+ const answer = getBooleanValue(value, config.default);
4530
+ setValue(transformer(answer));
4531
+ setStatus("done");
4532
+ done(answer);
4533
+ } else if (isTabKey(key)) {
4534
+ const answer = boolToString(!getBooleanValue(value, config.default));
4535
+ rl.clearLine(0);
4536
+ rl.write(answer);
4537
+ setValue(answer);
4538
+ } else {
4539
+ setValue(rl.line);
4540
+ }
4541
+ });
4542
+ let formattedValue = value;
4543
+ let defaultValue = "";
4544
+ if (status === "done") {
4545
+ formattedValue = theme2.style.answer(value);
4546
+ } else {
4547
+ defaultValue = ` ${theme2.style.defaultAnswer(config.default === false ? "y/N" : "Y/n")}`;
4548
+ }
4549
+ const message = theme2.style.message(config.message, status);
4550
+ return `${prefix} ${message}${defaultValue} ${formattedValue}`;
4551
+ });
4552
+ // node_modules/@inquirer/input/dist/index.js
4553
+ var inputTheme = {
4554
+ validationFailureMode: "keep"
4555
+ };
4556
+ var dist_default5 = createPrompt((config, done) => {
4557
+ const { prefill = "tab" } = config;
4558
+ const theme2 = makeTheme(inputTheme, config.theme);
4559
+ const [status, setStatus] = useState("idle");
4560
+ const [defaultValue, setDefaultValue] = useState(String(config.default ?? ""));
4561
+ const [errorMsg, setError] = useState();
4562
+ const [value, setValue] = useState("");
4563
+ const prefix = usePrefix({ status, theme: theme2 });
4564
+ async function validate(value2) {
4565
+ const { required, pattern, patternError = "Invalid input" } = config;
4566
+ if (required && !value2) {
4567
+ return "You must provide a value";
4568
+ }
4569
+ if (pattern && !pattern.test(value2)) {
4570
+ return patternError;
4571
+ }
4572
+ if (typeof config.validate === "function") {
4573
+ return await config.validate(value2) || "You must provide a valid value";
4574
+ }
4575
+ return true;
4576
+ }
4577
+ useKeypress(async (key, rl) => {
4578
+ if (status !== "idle") {
4579
+ return;
4580
+ }
4581
+ if (isEnterKey(key)) {
4582
+ const answer = value || defaultValue;
4583
+ setStatus("loading");
4584
+ const isValid = await validate(answer);
4585
+ if (isValid === true) {
4586
+ setValue(answer);
4587
+ setStatus("done");
4588
+ done(answer);
4589
+ } else {
4590
+ if (theme2.validationFailureMode === "clear") {
4591
+ setValue("");
4592
+ } else {
4593
+ rl.write(value);
4594
+ }
4595
+ setError(isValid);
4596
+ setStatus("idle");
4597
+ }
4598
+ } else if (isBackspaceKey(key) && !value) {
4599
+ setDefaultValue("");
4600
+ } else if (isTabKey(key) && !value) {
4601
+ setDefaultValue("");
4602
+ rl.clearLine(0);
4603
+ rl.write(defaultValue);
4604
+ setValue(defaultValue);
4605
+ } else {
4606
+ setValue(rl.line);
4607
+ setError(undefined);
4608
+ }
4609
+ });
4610
+ useEffect((rl) => {
4611
+ if (prefill === "editable" && defaultValue) {
4612
+ rl.write(defaultValue);
4613
+ setValue(defaultValue);
4614
+ }
4615
+ }, []);
4616
+ const message = theme2.style.message(config.message, status);
4617
+ let formattedValue = value;
4618
+ if (typeof config.transformer === "function") {
4619
+ formattedValue = config.transformer(value, { isFinal: status === "done" });
4620
+ } else if (status === "done") {
4621
+ formattedValue = theme2.style.answer(value);
4622
+ }
4623
+ let defaultStr;
4624
+ if (defaultValue && status !== "done" && !value) {
4625
+ defaultStr = theme2.style.defaultAnswer(defaultValue);
4626
+ }
4627
+ let error = "";
4628
+ if (errorMsg) {
4629
+ error = theme2.style.error(errorMsg);
4630
+ }
4631
+ return [
4632
+ [prefix, message, defaultStr, formattedValue].filter((v) => v !== undefined).join(" "),
4633
+ error
4634
+ ];
4635
+ });
4636
+ // node_modules/@inquirer/password/dist/index.js
4637
+ var passwordTheme = {
4638
+ style: {
4639
+ maskedText: "[input is masked]"
4640
+ }
4641
+ };
4642
+ var dist_default6 = createPrompt((config, done) => {
4643
+ const { validate = () => true } = config;
4644
+ const theme2 = makeTheme(passwordTheme, config.theme);
4645
+ const [status, setStatus] = useState("idle");
4646
+ const [errorMsg, setError] = useState();
4647
+ const [value, setValue] = useState("");
4648
+ const prefix = usePrefix({ status, theme: theme2 });
4649
+ useKeypress(async (key, rl) => {
4650
+ if (status !== "idle") {
4651
+ return;
4652
+ }
4653
+ if (isEnterKey(key)) {
4654
+ const answer = value;
4655
+ setStatus("loading");
4656
+ const isValid = await validate(answer);
4657
+ if (isValid === true) {
4658
+ setValue(answer);
4659
+ setStatus("done");
4660
+ done(answer);
4661
+ } else {
4662
+ rl.write(value);
4663
+ setError(isValid || "You must provide a valid value");
4664
+ setStatus("idle");
4665
+ }
4666
+ } else {
4667
+ setValue(rl.line);
4668
+ setError(undefined);
4669
+ }
4670
+ });
4671
+ const message = theme2.style.message(config.message, status);
4672
+ let formattedValue = "";
4673
+ let helpTip;
4674
+ if (config.mask) {
4675
+ const maskChar = typeof config.mask === "string" ? config.mask : "*";
4676
+ formattedValue = maskChar.repeat(value.length);
4677
+ } else if (status !== "done") {
4678
+ helpTip = `${theme2.style.help(theme2.style.maskedText)}${cursorHide}`;
4679
+ }
4680
+ if (status === "done") {
4681
+ formattedValue = theme2.style.answer(formattedValue);
4682
+ }
4683
+ let error = "";
4684
+ if (errorMsg) {
4685
+ error = theme2.style.error(errorMsg);
4686
+ }
4687
+ return [[prefix, message, config.mask ? formattedValue : helpTip].join(" "), error];
4688
+ });
4689
+ // node_modules/@inquirer/select/dist/index.js
4690
+ import { styleText as styleText3 } from "node:util";
4691
+ var selectTheme = {
4692
+ icon: { cursor: dist_default.pointer },
4693
+ style: {
4694
+ disabled: (text) => styleText3("dim", text),
4695
+ description: (text) => styleText3("cyan", text),
4696
+ keysHelpTip: (keys) => keys.map(([key, action]) => `${styleText3("bold", key)} ${styleText3("dim", action)}`).join(styleText3("dim", " • "))
4697
+ },
4698
+ i18n: { disabledError: "This option is disabled and cannot be selected." },
4699
+ indexMode: "hidden",
4700
+ keybindings: []
4701
+ };
4702
+ function isSelectable(item) {
4703
+ return !Separator.isSeparator(item) && !item.disabled;
4704
+ }
4705
+ function isNavigable(item) {
4706
+ return !Separator.isSeparator(item);
4707
+ }
4708
+ function normalizeChoices(choices) {
4709
+ return choices.map((choice) => {
4710
+ if (Separator.isSeparator(choice))
4711
+ return choice;
4712
+ if (typeof choice !== "object" || choice === null || !("value" in choice)) {
4713
+ const name2 = String(choice);
4714
+ return {
4715
+ value: choice,
4716
+ name: name2,
4717
+ short: name2,
4718
+ disabled: false
4719
+ };
4720
+ }
4721
+ const name = choice.name ?? String(choice.value);
4722
+ const normalizedChoice = {
4723
+ value: choice.value,
4724
+ name,
4725
+ short: choice.short ?? name,
4726
+ disabled: choice.disabled ?? false
4727
+ };
4728
+ if (choice.description) {
4729
+ normalizedChoice.description = choice.description;
4730
+ }
4731
+ return normalizedChoice;
4732
+ });
4733
+ }
4734
+ var dist_default7 = createPrompt((config, done) => {
4735
+ const { loop = true, pageSize = 7 } = config;
4736
+ const theme2 = makeTheme(selectTheme, config.theme);
4737
+ const { keybindings } = theme2;
4738
+ const [status, setStatus] = useState("idle");
4739
+ const prefix = usePrefix({ status, theme: theme2 });
4740
+ const searchTimeoutRef = useRef();
4741
+ const searchEnabled = !keybindings.includes("vim");
4742
+ const items = useMemo(() => normalizeChoices(config.choices), [config.choices]);
4743
+ const bounds = useMemo(() => {
4744
+ const first = items.findIndex(isNavigable);
4745
+ const last = items.findLastIndex(isNavigable);
4746
+ if (first === -1) {
4747
+ throw new ValidationError("[select prompt] No selectable choices. All choices are disabled.");
4748
+ }
4749
+ return { first, last };
4750
+ }, [items]);
4751
+ const defaultItemIndex = useMemo(() => {
4752
+ if (!("default" in config))
4753
+ return -1;
4754
+ return items.findIndex((item) => isSelectable(item) && item.value === config.default);
4755
+ }, [config.default, items]);
4756
+ const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
4757
+ const selectedChoice = items[active];
4758
+ const [errorMsg, setError] = useState();
4759
+ useKeypress((key, rl) => {
4760
+ clearTimeout(searchTimeoutRef.current);
4761
+ if (errorMsg) {
4762
+ setError(undefined);
4763
+ }
4764
+ if (isEnterKey(key)) {
4765
+ if (selectedChoice.disabled) {
4766
+ setError(theme2.i18n.disabledError);
4767
+ } else {
4768
+ setStatus("done");
4769
+ done(selectedChoice.value);
4770
+ }
4771
+ } else if (isUpKey(key, keybindings) || isDownKey(key, keybindings)) {
4772
+ rl.clearLine(0);
4773
+ if (loop || isUpKey(key, keybindings) && active !== bounds.first || isDownKey(key, keybindings) && active !== bounds.last) {
4774
+ const offset = isUpKey(key, keybindings) ? -1 : 1;
4775
+ let next = active;
4776
+ do {
4777
+ next = (next + offset + items.length) % items.length;
4778
+ } while (!isNavigable(items[next]));
4779
+ setActive(next);
4780
+ }
4781
+ } else if (isNumberKey(key) && !Number.isNaN(Number(rl.line))) {
4782
+ const selectedIndex = Number(rl.line) - 1;
4783
+ let selectableIndex = -1;
4784
+ const position = items.findIndex((item2) => {
4785
+ if (Separator.isSeparator(item2))
4786
+ return false;
4787
+ selectableIndex++;
4788
+ return selectableIndex === selectedIndex;
4789
+ });
4790
+ const item = items[position];
4791
+ if (item != null && isSelectable(item)) {
4792
+ setActive(position);
4793
+ }
4794
+ searchTimeoutRef.current = setTimeout(() => {
4795
+ rl.clearLine(0);
4796
+ }, 700);
4797
+ } else if (isBackspaceKey(key)) {
4798
+ rl.clearLine(0);
4799
+ } else if (searchEnabled) {
4800
+ const searchTerm = rl.line.toLowerCase();
4801
+ const matchIndex = items.findIndex((item) => {
4802
+ if (Separator.isSeparator(item) || !isSelectable(item))
4803
+ return false;
4804
+ return item.name.toLowerCase().startsWith(searchTerm);
4805
+ });
4806
+ if (matchIndex !== -1) {
4807
+ setActive(matchIndex);
4808
+ }
4809
+ searchTimeoutRef.current = setTimeout(() => {
4810
+ rl.clearLine(0);
4811
+ }, 700);
4812
+ }
4813
+ });
4814
+ useEffect(() => () => {
4815
+ clearTimeout(searchTimeoutRef.current);
4816
+ }, []);
4817
+ const message = theme2.style.message(config.message, status);
4818
+ const helpLine = theme2.style.keysHelpTip([
4819
+ ["↑↓", "navigate"],
4820
+ ["⏎", "select"]
4821
+ ]);
4822
+ let separatorCount = 0;
4823
+ const page = usePagination({
4824
+ items,
4825
+ active,
4826
+ renderItem({ item, isActive, index }) {
4827
+ if (Separator.isSeparator(item)) {
4828
+ separatorCount++;
4829
+ return ` ${item.separator}`;
4830
+ }
4831
+ const cursor = isActive ? theme2.icon.cursor : " ";
4832
+ const indexLabel = theme2.indexMode === "number" ? `${index + 1 - separatorCount}. ` : "";
4833
+ if (item.disabled) {
4834
+ const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
4835
+ const disabledCursor = isActive ? theme2.icon.cursor : "-";
4836
+ return theme2.style.disabled(`${disabledCursor} ${indexLabel}${item.name} ${disabledLabel}`);
4837
+ }
4838
+ const color = isActive ? theme2.style.highlight : (x) => x;
4839
+ return color(`${cursor} ${indexLabel}${item.name}`);
4840
+ },
4841
+ pageSize,
4842
+ loop
4843
+ });
4844
+ if (status === "done") {
4845
+ return [prefix, message, theme2.style.answer(selectedChoice.short)].filter(Boolean).join(" ");
4846
+ }
4847
+ const { description } = selectedChoice;
4848
+ const lines = [
4849
+ [prefix, message].filter(Boolean).join(" "),
4850
+ page,
4851
+ " ",
4852
+ description ? theme2.style.description(description) : "",
4853
+ errorMsg ? theme2.style.error(errorMsg) : "",
4854
+ helpLine
4855
+ ].filter(Boolean).join(`
4856
+ `).trimEnd();
4857
+ return `${lines}${cursorHide}`;
4858
+ });
4859
+ // src/ui/wizard.ts
4860
+ async function promptMcpClient() {
4861
+ return await dist_default7({
4862
+ message: "Which MCP client are you using?",
4863
+ choices: [
4864
+ { name: "Antigravity", value: "antigravity" },
4865
+ { name: "VSCode", value: "vscode" },
4866
+ { name: "Cursor", value: "cursor" },
4867
+ { name: "Claude Code", value: "claude-code" },
4868
+ { name: "Gemini CLI", value: "gemini-cli" },
4869
+ { name: "Codex CLI", value: "codex" },
4870
+ { name: "OpenCode", value: "opencode" }
4871
+ ]
4872
+ });
4873
+ }
4874
+ async function promptAuthMode() {
4875
+ return await dist_default7({
4876
+ message: "Select Authentication Mode:",
4877
+ choices: [
4878
+ {
4879
+ name: "API Key",
4880
+ value: "apiKey",
4881
+ description: "Persistent keys generated in the Stitch Settings page."
4882
+ },
4883
+ {
4884
+ name: "OAuth",
4885
+ value: "oauth",
4886
+ description: "A browser-based authentication flow required by specific AI clients that do not support manual key entry, or for environments where storing persistent secrets on disk is restricted."
4887
+ }
4888
+ ]
4889
+ });
4890
+ }
4891
+ async function promptApiKeyStorage() {
4892
+ return await dist_default7({
4893
+ message: "Where would you like to store your API Key?",
4894
+ choices: [
4895
+ {
4896
+ name: ".env file",
4897
+ value: ".env",
4898
+ description: "Use the current working directory. Append if existing, create if not."
4899
+ },
4900
+ {
4901
+ name: "MCP config",
4902
+ value: "config",
4903
+ description: "Add it to the final MCP config to copy and paste."
4904
+ },
4905
+ {
4906
+ name: "Skip",
4907
+ value: "skip",
4908
+ description: "Use a placeholder in the final config."
4909
+ }
4910
+ ]
4911
+ });
4912
+ }
4913
+ async function promptApiKey() {
4914
+ return await dist_default6({
4915
+ message: "Enter your Stitch API Key:",
4916
+ mask: "*"
4917
+ });
4918
+ }
4919
+ async function promptSelect(message, choices) {
4920
+ return await dist_default7({ message, choices });
4921
+ }
4922
+ async function promptInput(message, defaultValue) {
4923
+ return await dist_default5({ message, default: defaultValue });
4924
+ }
4925
+ async function promptConfirm(message, defaultValue = true) {
4926
+ return await dist_default4({ message, default: defaultValue });
4927
+ }
4928
+ async function promptTransportType(authMode = "oauth") {
4929
+ const isApiKey = authMode === "apiKey";
4930
+ return await dist_default7({
4931
+ message: "How would you like to connect to Stitch?",
4932
+ choices: [
4933
+ {
4934
+ name: "Direct (Standard)",
4935
+ value: "http",
4936
+ description: isApiKey ? "You or the IDE/CLI handles the loading of the API key." : "Standard HTTP. Production-ready. Requires manual OAuth token management."
4937
+ },
4938
+ {
4939
+ name: "Proxy (Recommended for Dev)",
4940
+ value: "stdio",
4941
+ description: isApiKey ? "stitch-mcp will manage the loading of the API key." : "Zero-config. Uses a local bridge to auto-refresh gcloud credentials."
4942
+ }
4943
+ ]
4944
+ });
4945
+ }
4946
+
4947
+ // src/framework/ConsoleUI.ts
4948
+ class ConsoleUI {
4949
+ async promptMcpClient() {
4950
+ return promptMcpClient();
4951
+ }
4952
+ async promptAuthMode() {
4953
+ return promptAuthMode();
4954
+ }
4955
+ async promptTransportType(authMode) {
4956
+ return promptTransportType(authMode);
4957
+ }
4958
+ async promptApiKeyStorage() {
4959
+ return promptApiKeyStorage();
4960
+ }
4961
+ async promptApiKey() {
4962
+ return promptApiKey();
4963
+ }
4964
+ async promptConfirm(message, defaultYes) {
4965
+ return promptConfirm(message, defaultYes);
4966
+ }
4967
+ log(message) {
4968
+ console.log(message);
4969
+ }
4970
+ warn(message) {
4971
+ console.log(theme.yellow(message));
4972
+ }
4973
+ error(message) {
4974
+ console.error(theme.red(message));
4975
+ }
4976
+ success(message) {
4977
+ console.log(theme.green(message));
4978
+ }
4979
+ }
4980
+
4981
+ export { getGcloudConfigPath, execCommand, GcloudExecutor, GcloudHandler, promptSelect, promptInput, promptConfirm, ConsoleUI };
3137
4982
 
3138
- //# debugId=CD3A09070AD99D0C64756E2164756E21
4983
+ //# debugId=E774EF874339132C64756E2164756E21