@_davideast/stitch-mcp 0.5.3 → 0.5.5
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.
- package/dist/chunk-18nfnnkg.js +947 -0
- package/dist/chunk-18nfnnkg.js.map +28 -0
- package/dist/chunk-1sgyj1qf.js +256 -0
- package/dist/chunk-1sgyj1qf.js.map +11 -0
- package/dist/chunk-1tzaa3zn.js +370 -0
- package/dist/chunk-1tzaa3zn.js.map +16 -0
- package/dist/chunk-2efzz3tw.js +10 -0
- package/dist/chunk-2efzz3tw.js.map +9 -0
- package/dist/chunk-2eq8thmz.js +31529 -0
- package/dist/chunk-2eq8thmz.js.map +245 -0
- package/dist/chunk-4xa2a5hb.js +19 -0
- package/dist/chunk-4xa2a5hb.js.map +9 -0
- package/dist/chunk-7vdj1qwb.js +2121 -0
- package/dist/chunk-7vdj1qwb.js.map +44 -0
- package/dist/chunk-7zyv8g2t.js +5216 -0
- package/dist/chunk-7zyv8g2t.js.map +67 -0
- package/dist/chunk-94xqpnv4.js +7 -0
- package/dist/chunk-94xqpnv4.js.map +9 -0
- package/dist/chunk-b43pzs3z.js +839 -0
- package/dist/chunk-b43pzs3z.js.map +11 -0
- package/dist/chunk-byzfppa1.js +759 -0
- package/dist/chunk-byzfppa1.js.map +19 -0
- package/dist/chunk-cjkw69md.js +94 -0
- package/dist/chunk-cjkw69md.js.map +10 -0
- package/dist/chunk-d92ngrr6.js +680 -0
- package/dist/chunk-d92ngrr6.js.map +17 -0
- package/dist/chunk-de74byjc.js +19 -0
- package/dist/chunk-de74byjc.js.map +9 -0
- package/dist/chunk-ewab4gg0.js +17 -0
- package/dist/chunk-ewab4gg0.js.map +9 -0
- package/dist/chunk-f0phn3y1.js +1495 -0
- package/dist/chunk-f0phn3y1.js.map +23 -0
- package/dist/chunk-f398cwqb.js +24 -0
- package/dist/chunk-f398cwqb.js.map +9 -0
- package/dist/chunk-fkzq5m59.js +111 -0
- package/dist/chunk-fkzq5m59.js.map +10 -0
- package/dist/chunk-gzk8pt16.js +44184 -0
- package/dist/chunk-gzk8pt16.js.map +237 -0
- package/dist/chunk-kme6y874.js +125 -0
- package/dist/chunk-kme6y874.js.map +12 -0
- package/dist/chunk-mw5wn97e.js +109 -0
- package/dist/chunk-mw5wn97e.js.map +10 -0
- package/dist/chunk-mxcybqhd.js +412 -0
- package/dist/chunk-mxcybqhd.js.map +20 -0
- package/dist/chunk-nep9nerg.js +137 -0
- package/dist/chunk-nep9nerg.js.map +10 -0
- package/dist/chunk-nrcb494d.js +50 -0
- package/dist/chunk-nrcb494d.js.map +9 -0
- package/dist/chunk-p9vvygz4.js +736 -0
- package/dist/chunk-p9vvygz4.js.map +16 -0
- package/dist/chunk-rd2ye9s7.js +17 -0
- package/dist/chunk-rd2ye9s7.js.map +9 -0
- package/dist/chunk-svk5y62j.js +164 -0
- package/dist/chunk-svk5y62j.js.map +10 -0
- package/dist/chunk-w3wh3zkf.js +269 -0
- package/dist/chunk-w3wh3zkf.js.map +10 -0
- package/dist/chunk-x1tt02n9.js +264 -0
- package/dist/chunk-x1tt02n9.js.map +12 -0
- package/dist/chunk-x7g5p1gv.js +66 -0
- package/dist/chunk-x7g5p1gv.js.map +10 -0
- package/dist/chunk-z7b1n864.js +246 -0
- package/dist/chunk-z7b1n864.js.map +14 -0
- package/dist/chunk-zcc6seqb.js +19132 -0
- package/dist/chunk-zcc6seqb.js.map +115 -0
- package/dist/commands/doctor/command.js +1 -1
- package/dist/commands/init/command.js +1 -1
- package/dist/commands/logout/command.js +1 -1
- package/dist/commands/proxy/command.js +1 -1
- package/dist/commands/screens/command.js +4 -4
- package/dist/commands/serve/command.js +5 -5
- package/dist/commands/site/command.js +1 -1
- package/dist/commands/snapshot/command.js +1 -1
- package/dist/commands/tool/command.js +1 -1
- package/dist/commands/view/command.js +1 -1
- package/dist/index.js +5 -7
- package/dist/index.js.map +1 -1
- package/dist/ui/copy-behaviors/clipboard.d.ts +0 -7
- package/package.json +1 -3
|
@@ -0,0 +1,947 @@
|
|
|
1
|
+
import {
|
|
2
|
+
GcloudExecutor,
|
|
3
|
+
onExit
|
|
4
|
+
} from "./chunk-7zyv8g2t.js";
|
|
5
|
+
import {
|
|
6
|
+
require_cli_spinners
|
|
7
|
+
} from "./chunk-nq68kghz.js";
|
|
8
|
+
import {
|
|
9
|
+
eastAsianWidth
|
|
10
|
+
} from "./chunk-q6sv0243.js";
|
|
11
|
+
import {
|
|
12
|
+
source_default
|
|
13
|
+
} from "./chunk-3sfn889r.js";
|
|
14
|
+
import {
|
|
15
|
+
__commonJS,
|
|
16
|
+
__toESM
|
|
17
|
+
} from "./chunk-9wyra8hs.js";
|
|
18
|
+
|
|
19
|
+
// node_modules/ora/node_modules/emoji-regex/index.js
|
|
20
|
+
var require_emoji_regex = __commonJS((exports, module) => {
|
|
21
|
+
module.exports = () => {
|
|
22
|
+
return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// src/services/stitch/iam.ts
|
|
27
|
+
class StitchIamService {
|
|
28
|
+
executor;
|
|
29
|
+
constructor(executor) {
|
|
30
|
+
this.executor = executor;
|
|
31
|
+
}
|
|
32
|
+
async configureIAM(input) {
|
|
33
|
+
try {
|
|
34
|
+
const role = "roles/serviceusage.serviceUsageConsumer";
|
|
35
|
+
const member = `user:${input.userEmail}`;
|
|
36
|
+
const result = await this.executor.exec([
|
|
37
|
+
"projects",
|
|
38
|
+
"add-iam-policy-binding",
|
|
39
|
+
input.projectId,
|
|
40
|
+
`--member=${member}`,
|
|
41
|
+
`--role=${role}`,
|
|
42
|
+
"--condition=None",
|
|
43
|
+
"--quiet"
|
|
44
|
+
]);
|
|
45
|
+
if (!result.success) {
|
|
46
|
+
const errorMsg = result.stderr || result.error || result.stdout || "Unknown error";
|
|
47
|
+
return {
|
|
48
|
+
success: false,
|
|
49
|
+
error: {
|
|
50
|
+
code: "IAM_CONFIG_FAILED",
|
|
51
|
+
message: `Failed to configure IAM permissions: ${errorMsg}`,
|
|
52
|
+
suggestion: "Ensure you have Owner or Editor role on the project",
|
|
53
|
+
recoverable: true,
|
|
54
|
+
details: `Exit code: ${result.exitCode}
|
|
55
|
+
Stderr: ${result.stderr}
|
|
56
|
+
Stdout: ${result.stdout}`
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
success: true,
|
|
62
|
+
data: {
|
|
63
|
+
role,
|
|
64
|
+
member
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
} catch (error) {
|
|
68
|
+
return {
|
|
69
|
+
success: false,
|
|
70
|
+
error: {
|
|
71
|
+
code: "IAM_CONFIG_FAILED",
|
|
72
|
+
message: error instanceof Error ? error.message : String(error),
|
|
73
|
+
recoverable: false
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
async checkIAMRole(input) {
|
|
79
|
+
try {
|
|
80
|
+
const role = "roles/serviceusage.serviceUsageConsumer";
|
|
81
|
+
const member = `user:${input.userEmail}`;
|
|
82
|
+
const result = await this.executor.exec([
|
|
83
|
+
"projects",
|
|
84
|
+
"get-iam-policy",
|
|
85
|
+
input.projectId,
|
|
86
|
+
`--flatten=bindings[].members`,
|
|
87
|
+
`--filter=bindings.role=${role} AND bindings.members=${member}`,
|
|
88
|
+
"--format=value(bindings.members)"
|
|
89
|
+
]);
|
|
90
|
+
return result.success && result.stdout.trim().includes(member);
|
|
91
|
+
} catch {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// src/services/stitch/api.ts
|
|
98
|
+
class StitchApiService {
|
|
99
|
+
executor;
|
|
100
|
+
constructor(executor) {
|
|
101
|
+
this.executor = executor;
|
|
102
|
+
}
|
|
103
|
+
async enableAPI(input) {
|
|
104
|
+
try {
|
|
105
|
+
const api = "stitch.googleapis.com";
|
|
106
|
+
const result = await this.executor.exec(["beta", "services", "mcp", "enable", api, `--project=${input.projectId}`, "--quiet"]);
|
|
107
|
+
if (!result.success) {
|
|
108
|
+
const errorMsg = result.stderr || result.error || result.stdout || "Unknown error";
|
|
109
|
+
return {
|
|
110
|
+
success: false,
|
|
111
|
+
error: {
|
|
112
|
+
code: "API_ENABLE_FAILED",
|
|
113
|
+
message: `Failed to enable Stitch API: ${errorMsg}`,
|
|
114
|
+
suggestion: "Ensure the project has billing enabled",
|
|
115
|
+
recoverable: true,
|
|
116
|
+
details: `Exit code: ${result.exitCode}
|
|
117
|
+
Stderr: ${result.stderr}
|
|
118
|
+
Stdout: ${result.stdout}`
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
success: true,
|
|
124
|
+
data: {
|
|
125
|
+
api,
|
|
126
|
+
enabled: true
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
} catch (error) {
|
|
130
|
+
return {
|
|
131
|
+
success: false,
|
|
132
|
+
error: {
|
|
133
|
+
code: "API_ENABLE_FAILED",
|
|
134
|
+
message: error instanceof Error ? error.message : String(error),
|
|
135
|
+
recoverable: false
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
async checkAPIEnabled(input) {
|
|
141
|
+
try {
|
|
142
|
+
const result = await this.executor.exec([
|
|
143
|
+
"services",
|
|
144
|
+
"list",
|
|
145
|
+
`--project=${input.projectId}`,
|
|
146
|
+
"--enabled",
|
|
147
|
+
"--filter=name:stitch.googleapis.com",
|
|
148
|
+
"--format=value(name)"
|
|
149
|
+
]);
|
|
150
|
+
return result.success && result.stdout.trim().includes("stitch.googleapis.com");
|
|
151
|
+
} catch {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// src/services/stitch/connection.ts
|
|
158
|
+
class StitchConnectionService {
|
|
159
|
+
async testConnectionWithApiKey(input) {
|
|
160
|
+
try {
|
|
161
|
+
const url = process.env.STITCH_HOST || "https://stitch.googleapis.com/mcp";
|
|
162
|
+
const payload = {
|
|
163
|
+
method: "tools/call",
|
|
164
|
+
jsonrpc: "2.0",
|
|
165
|
+
params: {
|
|
166
|
+
name: "list_projects",
|
|
167
|
+
arguments: {}
|
|
168
|
+
},
|
|
169
|
+
id: 1
|
|
170
|
+
};
|
|
171
|
+
const response = await fetch(url, {
|
|
172
|
+
method: "POST",
|
|
173
|
+
headers: {
|
|
174
|
+
"Content-Type": "application/json",
|
|
175
|
+
Accept: "application/json, text/event-stream",
|
|
176
|
+
"X-Goog-Api-Key": input.apiKey
|
|
177
|
+
},
|
|
178
|
+
body: JSON.stringify(payload)
|
|
179
|
+
});
|
|
180
|
+
if (!response.ok) {
|
|
181
|
+
let errorDetails = "";
|
|
182
|
+
let errorMessage = `API request failed with status ${response.status}`;
|
|
183
|
+
try {
|
|
184
|
+
const errorBody = await response.json();
|
|
185
|
+
errorDetails = JSON.stringify(errorBody, null, 2);
|
|
186
|
+
if (errorBody?.error?.message) {
|
|
187
|
+
errorMessage = errorBody.error.message;
|
|
188
|
+
}
|
|
189
|
+
} catch {
|
|
190
|
+
try {
|
|
191
|
+
errorDetails = await response.text();
|
|
192
|
+
} catch {
|
|
193
|
+
errorDetails = `Status ${response.status}: ${response.statusText}`;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return {
|
|
197
|
+
success: false,
|
|
198
|
+
error: {
|
|
199
|
+
code: response.status === 403 ? "PERMISSION_DENIED" : "CONNECTION_TEST_FAILED",
|
|
200
|
+
message: errorMessage,
|
|
201
|
+
suggestion: response.status === 403 ? "Check that your API key is valid and has access to the Stitch API" : "Verify API key configuration and try again",
|
|
202
|
+
recoverable: true,
|
|
203
|
+
details: errorDetails
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
const data = await response.json();
|
|
208
|
+
return {
|
|
209
|
+
success: true,
|
|
210
|
+
data: {
|
|
211
|
+
connected: true,
|
|
212
|
+
statusCode: response.status,
|
|
213
|
+
url,
|
|
214
|
+
response: data
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
} catch (error) {
|
|
218
|
+
return {
|
|
219
|
+
success: false,
|
|
220
|
+
error: {
|
|
221
|
+
code: "CONNECTION_TEST_FAILED",
|
|
222
|
+
message: error instanceof Error ? error.message : String(error),
|
|
223
|
+
recoverable: false
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
async testConnection(input) {
|
|
229
|
+
try {
|
|
230
|
+
const url = process.env.STITCH_HOST || "https://stitch.googleapis.com/mcp";
|
|
231
|
+
const payload = {
|
|
232
|
+
method: "tools/call",
|
|
233
|
+
jsonrpc: "2.0",
|
|
234
|
+
params: {
|
|
235
|
+
name: "list_projects",
|
|
236
|
+
arguments: {}
|
|
237
|
+
},
|
|
238
|
+
id: 1
|
|
239
|
+
};
|
|
240
|
+
const response = await fetch(url, {
|
|
241
|
+
method: "POST",
|
|
242
|
+
headers: {
|
|
243
|
+
"Content-Type": "application/json",
|
|
244
|
+
Accept: "application/json, text/event-stream",
|
|
245
|
+
Authorization: `Bearer ${input.accessToken}`,
|
|
246
|
+
"X-Goog-User-Project": input.projectId
|
|
247
|
+
},
|
|
248
|
+
body: JSON.stringify(payload)
|
|
249
|
+
});
|
|
250
|
+
if (!response.ok) {
|
|
251
|
+
let errorDetails = "";
|
|
252
|
+
let errorMessage = `API request failed with status ${response.status}`;
|
|
253
|
+
try {
|
|
254
|
+
const errorBody = await response.json();
|
|
255
|
+
errorDetails = JSON.stringify(errorBody, null, 2);
|
|
256
|
+
if (errorBody?.error?.message) {
|
|
257
|
+
errorMessage = errorBody.error.message;
|
|
258
|
+
}
|
|
259
|
+
} catch {
|
|
260
|
+
try {
|
|
261
|
+
errorDetails = await response.text();
|
|
262
|
+
} catch {
|
|
263
|
+
errorDetails = `Status ${response.status}: ${response.statusText}`;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return {
|
|
267
|
+
success: false,
|
|
268
|
+
error: {
|
|
269
|
+
code: response.status === 403 ? "PERMISSION_DENIED" : "CONNECTION_TEST_FAILED",
|
|
270
|
+
message: errorMessage,
|
|
271
|
+
suggestion: response.status === 403 ? "Check IAM permissions and ensure API is enabled" : "Verify project configuration and try again",
|
|
272
|
+
recoverable: true,
|
|
273
|
+
details: errorDetails
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
const data = await response.json();
|
|
278
|
+
return {
|
|
279
|
+
success: true,
|
|
280
|
+
data: {
|
|
281
|
+
connected: true,
|
|
282
|
+
statusCode: response.status,
|
|
283
|
+
url,
|
|
284
|
+
response: data
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
} catch (error) {
|
|
288
|
+
return {
|
|
289
|
+
success: false,
|
|
290
|
+
error: {
|
|
291
|
+
code: "CONNECTION_TEST_FAILED",
|
|
292
|
+
message: error instanceof Error ? error.message : String(error),
|
|
293
|
+
recoverable: false
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
// src/services/stitch/handler.ts
|
|
301
|
+
class StitchHandler {
|
|
302
|
+
executor;
|
|
303
|
+
iamService;
|
|
304
|
+
apiService;
|
|
305
|
+
connectionService;
|
|
306
|
+
constructor() {
|
|
307
|
+
this.executor = new GcloudExecutor;
|
|
308
|
+
this.iamService = new StitchIamService(this.executor);
|
|
309
|
+
this.apiService = new StitchApiService(this.executor);
|
|
310
|
+
this.connectionService = new StitchConnectionService;
|
|
311
|
+
}
|
|
312
|
+
async configureIAM(input) {
|
|
313
|
+
return this.iamService.configureIAM(input);
|
|
314
|
+
}
|
|
315
|
+
async enableAPI(input) {
|
|
316
|
+
return this.apiService.enableAPI(input);
|
|
317
|
+
}
|
|
318
|
+
async checkIAMRole(input) {
|
|
319
|
+
return this.iamService.checkIAMRole(input);
|
|
320
|
+
}
|
|
321
|
+
async checkAPIEnabled(input) {
|
|
322
|
+
return this.apiService.checkAPIEnabled(input);
|
|
323
|
+
}
|
|
324
|
+
async testConnectionWithApiKey(input) {
|
|
325
|
+
return this.connectionService.testConnectionWithApiKey(input);
|
|
326
|
+
}
|
|
327
|
+
async testConnection(input) {
|
|
328
|
+
return this.connectionService.testConnection(input);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// node_modules/ora/index.js
|
|
333
|
+
import process7 from "node:process";
|
|
334
|
+
|
|
335
|
+
// node_modules/ora/node_modules/cli-cursor/index.js
|
|
336
|
+
import process3 from "node:process";
|
|
337
|
+
|
|
338
|
+
// node_modules/ora/node_modules/restore-cursor/index.js
|
|
339
|
+
import process2 from "node:process";
|
|
340
|
+
|
|
341
|
+
// node_modules/mimic-function/index.js
|
|
342
|
+
var copyProperty = (to, from, property, ignoreNonConfigurable) => {
|
|
343
|
+
if (property === "length" || property === "prototype") {
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
if (property === "arguments" || property === "caller") {
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
|
|
350
|
+
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
|
|
351
|
+
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
Object.defineProperty(to, property, fromDescriptor);
|
|
355
|
+
};
|
|
356
|
+
var canCopyProperty = function(toDescriptor, fromDescriptor) {
|
|
357
|
+
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
|
|
358
|
+
};
|
|
359
|
+
var changePrototype = (to, from) => {
|
|
360
|
+
const fromPrototype = Object.getPrototypeOf(from);
|
|
361
|
+
if (fromPrototype === Object.getPrototypeOf(to)) {
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
Object.setPrototypeOf(to, fromPrototype);
|
|
365
|
+
};
|
|
366
|
+
var wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/
|
|
367
|
+
${fromBody}`;
|
|
368
|
+
var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString");
|
|
369
|
+
var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name");
|
|
370
|
+
var changeToString = (to, from, name) => {
|
|
371
|
+
const withName = name === "" ? "" : `with ${name.trim()}() `;
|
|
372
|
+
const newToString = wrappedToString.bind(null, withName, from.toString());
|
|
373
|
+
Object.defineProperty(newToString, "name", toStringName);
|
|
374
|
+
const { writable, enumerable, configurable } = toStringDescriptor;
|
|
375
|
+
Object.defineProperty(to, "toString", { value: newToString, writable, enumerable, configurable });
|
|
376
|
+
};
|
|
377
|
+
function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
|
|
378
|
+
const { name } = to;
|
|
379
|
+
for (const property of Reflect.ownKeys(from)) {
|
|
380
|
+
copyProperty(to, from, property, ignoreNonConfigurable);
|
|
381
|
+
}
|
|
382
|
+
changePrototype(to, from);
|
|
383
|
+
changeToString(to, from, name);
|
|
384
|
+
return to;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// node_modules/onetime/index.js
|
|
388
|
+
var calledFunctions = new WeakMap;
|
|
389
|
+
var onetime = (function_, options = {}) => {
|
|
390
|
+
if (typeof function_ !== "function") {
|
|
391
|
+
throw new TypeError("Expected a function");
|
|
392
|
+
}
|
|
393
|
+
let returnValue;
|
|
394
|
+
let callCount = 0;
|
|
395
|
+
const functionName = function_.displayName || function_.name || "<anonymous>";
|
|
396
|
+
const onetime2 = function(...arguments_) {
|
|
397
|
+
calledFunctions.set(onetime2, ++callCount);
|
|
398
|
+
if (callCount === 1) {
|
|
399
|
+
returnValue = function_.apply(this, arguments_);
|
|
400
|
+
function_ = undefined;
|
|
401
|
+
} else if (options.throw === true) {
|
|
402
|
+
throw new Error(`Function \`${functionName}\` can only be called once`);
|
|
403
|
+
}
|
|
404
|
+
return returnValue;
|
|
405
|
+
};
|
|
406
|
+
mimicFunction(onetime2, function_);
|
|
407
|
+
calledFunctions.set(onetime2, callCount);
|
|
408
|
+
return onetime2;
|
|
409
|
+
};
|
|
410
|
+
onetime.callCount = (function_) => {
|
|
411
|
+
if (!calledFunctions.has(function_)) {
|
|
412
|
+
throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
|
|
413
|
+
}
|
|
414
|
+
return calledFunctions.get(function_);
|
|
415
|
+
};
|
|
416
|
+
var onetime_default = onetime;
|
|
417
|
+
|
|
418
|
+
// node_modules/ora/node_modules/restore-cursor/index.js
|
|
419
|
+
var terminal = process2.stderr.isTTY ? process2.stderr : process2.stdout.isTTY ? process2.stdout : undefined;
|
|
420
|
+
var restoreCursor = terminal ? onetime_default(() => {
|
|
421
|
+
onExit(() => {
|
|
422
|
+
terminal.write("\x1B[?25h");
|
|
423
|
+
}, { alwaysLast: true });
|
|
424
|
+
}) : () => {};
|
|
425
|
+
var restore_cursor_default = restoreCursor;
|
|
426
|
+
|
|
427
|
+
// node_modules/ora/node_modules/cli-cursor/index.js
|
|
428
|
+
var isHidden = false;
|
|
429
|
+
var cliCursor = {};
|
|
430
|
+
cliCursor.show = (writableStream = process3.stderr) => {
|
|
431
|
+
if (!writableStream.isTTY) {
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
isHidden = false;
|
|
435
|
+
writableStream.write("\x1B[?25h");
|
|
436
|
+
};
|
|
437
|
+
cliCursor.hide = (writableStream = process3.stderr) => {
|
|
438
|
+
if (!writableStream.isTTY) {
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
restore_cursor_default();
|
|
442
|
+
isHidden = true;
|
|
443
|
+
writableStream.write("\x1B[?25l");
|
|
444
|
+
};
|
|
445
|
+
cliCursor.toggle = (force, writableStream) => {
|
|
446
|
+
if (force !== undefined) {
|
|
447
|
+
isHidden = force;
|
|
448
|
+
}
|
|
449
|
+
if (isHidden) {
|
|
450
|
+
cliCursor.show(writableStream);
|
|
451
|
+
} else {
|
|
452
|
+
cliCursor.hide(writableStream);
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
var cli_cursor_default = cliCursor;
|
|
456
|
+
|
|
457
|
+
// node_modules/ora/index.js
|
|
458
|
+
var import_cli_spinners = __toESM(require_cli_spinners(), 1);
|
|
459
|
+
|
|
460
|
+
// node_modules/ora/node_modules/log-symbols/node_modules/is-unicode-supported/index.js
|
|
461
|
+
import process4 from "node:process";
|
|
462
|
+
function isUnicodeSupported() {
|
|
463
|
+
if (process4.platform !== "win32") {
|
|
464
|
+
return process4.env.TERM !== "linux";
|
|
465
|
+
}
|
|
466
|
+
return Boolean(process4.env.CI) || Boolean(process4.env.WT_SESSION) || Boolean(process4.env.TERMINUS_SUBLIME) || process4.env.ConEmuTask === "{cmd::Cmder}" || process4.env.TERM_PROGRAM === "Terminus-Sublime" || process4.env.TERM_PROGRAM === "vscode" || process4.env.TERM === "xterm-256color" || process4.env.TERM === "alacritty" || process4.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// node_modules/ora/node_modules/log-symbols/index.js
|
|
470
|
+
var main = {
|
|
471
|
+
info: source_default.blue("ℹ"),
|
|
472
|
+
success: source_default.green("✔"),
|
|
473
|
+
warning: source_default.yellow("⚠"),
|
|
474
|
+
error: source_default.red("✖")
|
|
475
|
+
};
|
|
476
|
+
var fallback = {
|
|
477
|
+
info: source_default.blue("i"),
|
|
478
|
+
success: source_default.green("√"),
|
|
479
|
+
warning: source_default.yellow("‼"),
|
|
480
|
+
error: source_default.red("×")
|
|
481
|
+
};
|
|
482
|
+
var logSymbols = isUnicodeSupported() ? main : fallback;
|
|
483
|
+
var log_symbols_default = logSymbols;
|
|
484
|
+
|
|
485
|
+
// node_modules/ora/node_modules/ansi-regex/index.js
|
|
486
|
+
function ansiRegex({ onlyFirst = false } = {}) {
|
|
487
|
+
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
488
|
+
const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
|
|
489
|
+
const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
|
|
490
|
+
const pattern = `${osc}|${csi}`;
|
|
491
|
+
return new RegExp(pattern, onlyFirst ? undefined : "g");
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// node_modules/ora/node_modules/strip-ansi/index.js
|
|
495
|
+
var regex = ansiRegex();
|
|
496
|
+
function stripAnsi(string) {
|
|
497
|
+
if (typeof string !== "string") {
|
|
498
|
+
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
499
|
+
}
|
|
500
|
+
if (!string.includes("\x1B") && !string.includes("")) {
|
|
501
|
+
return string;
|
|
502
|
+
}
|
|
503
|
+
return string.replace(regex, "");
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
// node_modules/ora/node_modules/string-width/index.js
|
|
507
|
+
var import_emoji_regex = __toESM(require_emoji_regex(), 1);
|
|
508
|
+
var segmenter = new Intl.Segmenter;
|
|
509
|
+
var defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
|
|
510
|
+
function stringWidth(string, options = {}) {
|
|
511
|
+
if (typeof string !== "string" || string.length === 0) {
|
|
512
|
+
return 0;
|
|
513
|
+
}
|
|
514
|
+
const {
|
|
515
|
+
ambiguousIsNarrow = true,
|
|
516
|
+
countAnsiEscapeCodes = false
|
|
517
|
+
} = options;
|
|
518
|
+
if (!countAnsiEscapeCodes) {
|
|
519
|
+
string = stripAnsi(string);
|
|
520
|
+
}
|
|
521
|
+
if (string.length === 0) {
|
|
522
|
+
return 0;
|
|
523
|
+
}
|
|
524
|
+
let width = 0;
|
|
525
|
+
const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
|
|
526
|
+
for (const { segment: character } of segmenter.segment(string)) {
|
|
527
|
+
const codePoint = character.codePointAt(0);
|
|
528
|
+
if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) {
|
|
529
|
+
continue;
|
|
530
|
+
}
|
|
531
|
+
if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) {
|
|
532
|
+
continue;
|
|
533
|
+
}
|
|
534
|
+
if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) {
|
|
535
|
+
continue;
|
|
536
|
+
}
|
|
537
|
+
if (codePoint >= 55296 && codePoint <= 57343) {
|
|
538
|
+
continue;
|
|
539
|
+
}
|
|
540
|
+
if (codePoint >= 65024 && codePoint <= 65039) {
|
|
541
|
+
continue;
|
|
542
|
+
}
|
|
543
|
+
if (defaultIgnorableCodePointRegex.test(character)) {
|
|
544
|
+
continue;
|
|
545
|
+
}
|
|
546
|
+
if (import_emoji_regex.default().test(character)) {
|
|
547
|
+
width += 2;
|
|
548
|
+
continue;
|
|
549
|
+
}
|
|
550
|
+
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
551
|
+
}
|
|
552
|
+
return width;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
// node_modules/is-interactive/index.js
|
|
556
|
+
function isInteractive({ stream = process.stdout } = {}) {
|
|
557
|
+
return Boolean(stream && stream.isTTY && process.env.TERM !== "dumb" && !("CI" in process.env));
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// node_modules/is-unicode-supported/index.js
|
|
561
|
+
import process5 from "node:process";
|
|
562
|
+
function isUnicodeSupported2() {
|
|
563
|
+
const { env } = process5;
|
|
564
|
+
const { TERM, TERM_PROGRAM } = env;
|
|
565
|
+
if (process5.platform !== "win32") {
|
|
566
|
+
return TERM !== "linux";
|
|
567
|
+
}
|
|
568
|
+
return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
// node_modules/stdin-discarder/index.js
|
|
572
|
+
import process6 from "node:process";
|
|
573
|
+
var ASCII_ETX_CODE = 3;
|
|
574
|
+
|
|
575
|
+
class StdinDiscarder {
|
|
576
|
+
#activeCount = 0;
|
|
577
|
+
start() {
|
|
578
|
+
this.#activeCount++;
|
|
579
|
+
if (this.#activeCount === 1) {
|
|
580
|
+
this.#realStart();
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
stop() {
|
|
584
|
+
if (this.#activeCount <= 0) {
|
|
585
|
+
throw new Error("`stop` called more times than `start`");
|
|
586
|
+
}
|
|
587
|
+
this.#activeCount--;
|
|
588
|
+
if (this.#activeCount === 0) {
|
|
589
|
+
this.#realStop();
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
#realStart() {
|
|
593
|
+
if (process6.platform === "win32" || !process6.stdin.isTTY) {
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
process6.stdin.setRawMode(true);
|
|
597
|
+
process6.stdin.on("data", this.#handleInput);
|
|
598
|
+
process6.stdin.resume();
|
|
599
|
+
}
|
|
600
|
+
#realStop() {
|
|
601
|
+
if (!process6.stdin.isTTY) {
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
process6.stdin.off("data", this.#handleInput);
|
|
605
|
+
process6.stdin.pause();
|
|
606
|
+
process6.stdin.setRawMode(false);
|
|
607
|
+
}
|
|
608
|
+
#handleInput(chunk) {
|
|
609
|
+
if (chunk[0] === ASCII_ETX_CODE) {
|
|
610
|
+
process6.emit("SIGINT");
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
var stdinDiscarder = new StdinDiscarder;
|
|
615
|
+
var stdin_discarder_default = stdinDiscarder;
|
|
616
|
+
|
|
617
|
+
// node_modules/ora/index.js
|
|
618
|
+
var import_cli_spinners2 = __toESM(require_cli_spinners(), 1);
|
|
619
|
+
|
|
620
|
+
class Ora {
|
|
621
|
+
#linesToClear = 0;
|
|
622
|
+
#isDiscardingStdin = false;
|
|
623
|
+
#lineCount = 0;
|
|
624
|
+
#frameIndex = -1;
|
|
625
|
+
#lastSpinnerFrameTime = 0;
|
|
626
|
+
#options;
|
|
627
|
+
#spinner;
|
|
628
|
+
#stream;
|
|
629
|
+
#id;
|
|
630
|
+
#initialInterval;
|
|
631
|
+
#isEnabled;
|
|
632
|
+
#isSilent;
|
|
633
|
+
#indent;
|
|
634
|
+
#text;
|
|
635
|
+
#prefixText;
|
|
636
|
+
#suffixText;
|
|
637
|
+
color;
|
|
638
|
+
constructor(options) {
|
|
639
|
+
if (typeof options === "string") {
|
|
640
|
+
options = {
|
|
641
|
+
text: options
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
this.#options = {
|
|
645
|
+
color: "cyan",
|
|
646
|
+
stream: process7.stderr,
|
|
647
|
+
discardStdin: true,
|
|
648
|
+
hideCursor: true,
|
|
649
|
+
...options
|
|
650
|
+
};
|
|
651
|
+
this.color = this.#options.color;
|
|
652
|
+
this.spinner = this.#options.spinner;
|
|
653
|
+
this.#initialInterval = this.#options.interval;
|
|
654
|
+
this.#stream = this.#options.stream;
|
|
655
|
+
this.#isEnabled = typeof this.#options.isEnabled === "boolean" ? this.#options.isEnabled : isInteractive({ stream: this.#stream });
|
|
656
|
+
this.#isSilent = typeof this.#options.isSilent === "boolean" ? this.#options.isSilent : false;
|
|
657
|
+
this.text = this.#options.text;
|
|
658
|
+
this.prefixText = this.#options.prefixText;
|
|
659
|
+
this.suffixText = this.#options.suffixText;
|
|
660
|
+
this.indent = this.#options.indent;
|
|
661
|
+
if (process7.env.NODE_ENV === "test") {
|
|
662
|
+
this._stream = this.#stream;
|
|
663
|
+
this._isEnabled = this.#isEnabled;
|
|
664
|
+
Object.defineProperty(this, "_linesToClear", {
|
|
665
|
+
get() {
|
|
666
|
+
return this.#linesToClear;
|
|
667
|
+
},
|
|
668
|
+
set(newValue) {
|
|
669
|
+
this.#linesToClear = newValue;
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
Object.defineProperty(this, "_frameIndex", {
|
|
673
|
+
get() {
|
|
674
|
+
return this.#frameIndex;
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
Object.defineProperty(this, "_lineCount", {
|
|
678
|
+
get() {
|
|
679
|
+
return this.#lineCount;
|
|
680
|
+
}
|
|
681
|
+
});
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
get indent() {
|
|
685
|
+
return this.#indent;
|
|
686
|
+
}
|
|
687
|
+
set indent(indent = 0) {
|
|
688
|
+
if (!(indent >= 0 && Number.isInteger(indent))) {
|
|
689
|
+
throw new Error("The `indent` option must be an integer from 0 and up");
|
|
690
|
+
}
|
|
691
|
+
this.#indent = indent;
|
|
692
|
+
this.#updateLineCount();
|
|
693
|
+
}
|
|
694
|
+
get interval() {
|
|
695
|
+
return this.#initialInterval ?? this.#spinner.interval ?? 100;
|
|
696
|
+
}
|
|
697
|
+
get spinner() {
|
|
698
|
+
return this.#spinner;
|
|
699
|
+
}
|
|
700
|
+
set spinner(spinner) {
|
|
701
|
+
this.#frameIndex = -1;
|
|
702
|
+
this.#initialInterval = undefined;
|
|
703
|
+
if (typeof spinner === "object") {
|
|
704
|
+
if (spinner.frames === undefined) {
|
|
705
|
+
throw new Error("The given spinner must have a `frames` property");
|
|
706
|
+
}
|
|
707
|
+
this.#spinner = spinner;
|
|
708
|
+
} else if (!isUnicodeSupported2()) {
|
|
709
|
+
this.#spinner = import_cli_spinners.default.line;
|
|
710
|
+
} else if (spinner === undefined) {
|
|
711
|
+
this.#spinner = import_cli_spinners.default.dots;
|
|
712
|
+
} else if (spinner !== "default" && import_cli_spinners.default[spinner]) {
|
|
713
|
+
this.#spinner = import_cli_spinners.default[spinner];
|
|
714
|
+
} else {
|
|
715
|
+
throw new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
get text() {
|
|
719
|
+
return this.#text;
|
|
720
|
+
}
|
|
721
|
+
set text(value = "") {
|
|
722
|
+
this.#text = value;
|
|
723
|
+
this.#updateLineCount();
|
|
724
|
+
}
|
|
725
|
+
get prefixText() {
|
|
726
|
+
return this.#prefixText;
|
|
727
|
+
}
|
|
728
|
+
set prefixText(value = "") {
|
|
729
|
+
this.#prefixText = value;
|
|
730
|
+
this.#updateLineCount();
|
|
731
|
+
}
|
|
732
|
+
get suffixText() {
|
|
733
|
+
return this.#suffixText;
|
|
734
|
+
}
|
|
735
|
+
set suffixText(value = "") {
|
|
736
|
+
this.#suffixText = value;
|
|
737
|
+
this.#updateLineCount();
|
|
738
|
+
}
|
|
739
|
+
get isSpinning() {
|
|
740
|
+
return this.#id !== undefined;
|
|
741
|
+
}
|
|
742
|
+
#getFullPrefixText(prefixText = this.#prefixText, postfix = " ") {
|
|
743
|
+
if (typeof prefixText === "string" && prefixText !== "") {
|
|
744
|
+
return prefixText + postfix;
|
|
745
|
+
}
|
|
746
|
+
if (typeof prefixText === "function") {
|
|
747
|
+
return prefixText() + postfix;
|
|
748
|
+
}
|
|
749
|
+
return "";
|
|
750
|
+
}
|
|
751
|
+
#getFullSuffixText(suffixText = this.#suffixText, prefix = " ") {
|
|
752
|
+
if (typeof suffixText === "string" && suffixText !== "") {
|
|
753
|
+
return prefix + suffixText;
|
|
754
|
+
}
|
|
755
|
+
if (typeof suffixText === "function") {
|
|
756
|
+
return prefix + suffixText();
|
|
757
|
+
}
|
|
758
|
+
return "";
|
|
759
|
+
}
|
|
760
|
+
#updateLineCount() {
|
|
761
|
+
const columns = this.#stream.columns ?? 80;
|
|
762
|
+
const fullPrefixText = this.#getFullPrefixText(this.#prefixText, "-");
|
|
763
|
+
const fullSuffixText = this.#getFullSuffixText(this.#suffixText, "-");
|
|
764
|
+
const fullText = " ".repeat(this.#indent) + fullPrefixText + "--" + this.#text + "--" + fullSuffixText;
|
|
765
|
+
this.#lineCount = 0;
|
|
766
|
+
for (const line of stripAnsi(fullText).split(`
|
|
767
|
+
`)) {
|
|
768
|
+
this.#lineCount += Math.max(1, Math.ceil(stringWidth(line, { countAnsiEscapeCodes: true }) / columns));
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
get isEnabled() {
|
|
772
|
+
return this.#isEnabled && !this.#isSilent;
|
|
773
|
+
}
|
|
774
|
+
set isEnabled(value) {
|
|
775
|
+
if (typeof value !== "boolean") {
|
|
776
|
+
throw new TypeError("The `isEnabled` option must be a boolean");
|
|
777
|
+
}
|
|
778
|
+
this.#isEnabled = value;
|
|
779
|
+
}
|
|
780
|
+
get isSilent() {
|
|
781
|
+
return this.#isSilent;
|
|
782
|
+
}
|
|
783
|
+
set isSilent(value) {
|
|
784
|
+
if (typeof value !== "boolean") {
|
|
785
|
+
throw new TypeError("The `isSilent` option must be a boolean");
|
|
786
|
+
}
|
|
787
|
+
this.#isSilent = value;
|
|
788
|
+
}
|
|
789
|
+
frame() {
|
|
790
|
+
const now = Date.now();
|
|
791
|
+
if (this.#frameIndex === -1 || now - this.#lastSpinnerFrameTime >= this.interval) {
|
|
792
|
+
this.#frameIndex = ++this.#frameIndex % this.#spinner.frames.length;
|
|
793
|
+
this.#lastSpinnerFrameTime = now;
|
|
794
|
+
}
|
|
795
|
+
const { frames } = this.#spinner;
|
|
796
|
+
let frame = frames[this.#frameIndex];
|
|
797
|
+
if (this.color) {
|
|
798
|
+
frame = source_default[this.color](frame);
|
|
799
|
+
}
|
|
800
|
+
const fullPrefixText = typeof this.#prefixText === "string" && this.#prefixText !== "" ? this.#prefixText + " " : "";
|
|
801
|
+
const fullText = typeof this.text === "string" ? " " + this.text : "";
|
|
802
|
+
const fullSuffixText = typeof this.#suffixText === "string" && this.#suffixText !== "" ? " " + this.#suffixText : "";
|
|
803
|
+
return fullPrefixText + frame + fullText + fullSuffixText;
|
|
804
|
+
}
|
|
805
|
+
clear() {
|
|
806
|
+
if (!this.#isEnabled || !this.#stream.isTTY) {
|
|
807
|
+
return this;
|
|
808
|
+
}
|
|
809
|
+
this.#stream.cursorTo(0);
|
|
810
|
+
for (let index = 0;index < this.#linesToClear; index++) {
|
|
811
|
+
if (index > 0) {
|
|
812
|
+
this.#stream.moveCursor(0, -1);
|
|
813
|
+
}
|
|
814
|
+
this.#stream.clearLine(1);
|
|
815
|
+
}
|
|
816
|
+
if (this.#indent || this.lastIndent !== this.#indent) {
|
|
817
|
+
this.#stream.cursorTo(this.#indent);
|
|
818
|
+
}
|
|
819
|
+
this.lastIndent = this.#indent;
|
|
820
|
+
this.#linesToClear = 0;
|
|
821
|
+
return this;
|
|
822
|
+
}
|
|
823
|
+
render() {
|
|
824
|
+
if (this.#isSilent) {
|
|
825
|
+
return this;
|
|
826
|
+
}
|
|
827
|
+
this.clear();
|
|
828
|
+
this.#stream.write(this.frame());
|
|
829
|
+
this.#linesToClear = this.#lineCount;
|
|
830
|
+
return this;
|
|
831
|
+
}
|
|
832
|
+
start(text) {
|
|
833
|
+
if (text) {
|
|
834
|
+
this.text = text;
|
|
835
|
+
}
|
|
836
|
+
if (this.#isSilent) {
|
|
837
|
+
return this;
|
|
838
|
+
}
|
|
839
|
+
if (!this.#isEnabled) {
|
|
840
|
+
if (this.text) {
|
|
841
|
+
this.#stream.write(`- ${this.text}
|
|
842
|
+
`);
|
|
843
|
+
}
|
|
844
|
+
return this;
|
|
845
|
+
}
|
|
846
|
+
if (this.isSpinning) {
|
|
847
|
+
return this;
|
|
848
|
+
}
|
|
849
|
+
if (this.#options.hideCursor) {
|
|
850
|
+
cli_cursor_default.hide(this.#stream);
|
|
851
|
+
}
|
|
852
|
+
if (this.#options.discardStdin && process7.stdin.isTTY) {
|
|
853
|
+
this.#isDiscardingStdin = true;
|
|
854
|
+
stdin_discarder_default.start();
|
|
855
|
+
}
|
|
856
|
+
this.render();
|
|
857
|
+
this.#id = setInterval(this.render.bind(this), this.interval);
|
|
858
|
+
return this;
|
|
859
|
+
}
|
|
860
|
+
stop() {
|
|
861
|
+
if (!this.#isEnabled) {
|
|
862
|
+
return this;
|
|
863
|
+
}
|
|
864
|
+
clearInterval(this.#id);
|
|
865
|
+
this.#id = undefined;
|
|
866
|
+
this.#frameIndex = 0;
|
|
867
|
+
this.clear();
|
|
868
|
+
if (this.#options.hideCursor) {
|
|
869
|
+
cli_cursor_default.show(this.#stream);
|
|
870
|
+
}
|
|
871
|
+
if (this.#options.discardStdin && process7.stdin.isTTY && this.#isDiscardingStdin) {
|
|
872
|
+
stdin_discarder_default.stop();
|
|
873
|
+
this.#isDiscardingStdin = false;
|
|
874
|
+
}
|
|
875
|
+
return this;
|
|
876
|
+
}
|
|
877
|
+
succeed(text) {
|
|
878
|
+
return this.stopAndPersist({ symbol: log_symbols_default.success, text });
|
|
879
|
+
}
|
|
880
|
+
fail(text) {
|
|
881
|
+
return this.stopAndPersist({ symbol: log_symbols_default.error, text });
|
|
882
|
+
}
|
|
883
|
+
warn(text) {
|
|
884
|
+
return this.stopAndPersist({ symbol: log_symbols_default.warning, text });
|
|
885
|
+
}
|
|
886
|
+
info(text) {
|
|
887
|
+
return this.stopAndPersist({ symbol: log_symbols_default.info, text });
|
|
888
|
+
}
|
|
889
|
+
stopAndPersist(options = {}) {
|
|
890
|
+
if (this.#isSilent) {
|
|
891
|
+
return this;
|
|
892
|
+
}
|
|
893
|
+
const prefixText = options.prefixText ?? this.#prefixText;
|
|
894
|
+
const fullPrefixText = this.#getFullPrefixText(prefixText, " ");
|
|
895
|
+
const symbolText = options.symbol ?? " ";
|
|
896
|
+
const text = options.text ?? this.text;
|
|
897
|
+
const separatorText = symbolText ? " " : "";
|
|
898
|
+
const fullText = typeof text === "string" ? separatorText + text : "";
|
|
899
|
+
const suffixText = options.suffixText ?? this.#suffixText;
|
|
900
|
+
const fullSuffixText = this.#getFullSuffixText(suffixText, " ");
|
|
901
|
+
const textToWrite = fullPrefixText + symbolText + fullText + fullSuffixText + `
|
|
902
|
+
`;
|
|
903
|
+
this.stop();
|
|
904
|
+
this.#stream.write(textToWrite);
|
|
905
|
+
return this;
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
function ora(options) {
|
|
909
|
+
return new Ora(options);
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
// src/ui/spinner.ts
|
|
913
|
+
class Spinner {
|
|
914
|
+
spinner = null;
|
|
915
|
+
start(message) {
|
|
916
|
+
this.spinner = ora({
|
|
917
|
+
text: message,
|
|
918
|
+
color: "blue",
|
|
919
|
+
spinner: "dots"
|
|
920
|
+
}).start();
|
|
921
|
+
}
|
|
922
|
+
succeed(message) {
|
|
923
|
+
if (this.spinner) {
|
|
924
|
+
this.spinner.succeed(message);
|
|
925
|
+
this.spinner = null;
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
fail(message) {
|
|
929
|
+
if (this.spinner) {
|
|
930
|
+
this.spinner.fail(message);
|
|
931
|
+
this.spinner = null;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
stop() {
|
|
935
|
+
if (this.spinner) {
|
|
936
|
+
this.spinner.stop();
|
|
937
|
+
this.spinner = null;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
function createSpinner() {
|
|
942
|
+
return new Spinner;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
export { StitchHandler, createSpinner };
|
|
946
|
+
|
|
947
|
+
//# debugId=909DF21B544BDC2A64756E2164756E21
|