@mdless/cli 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -1
- package/dist/index.js +722 -481
- package/package.json +8 -4
- package/src/agents/prompts/orchestrator.md +22 -7
- package/LICENSE +0 -21
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
19
19
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
20
20
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
21
21
|
|
|
22
|
-
// node_modules/commander/lib/error.js
|
|
22
|
+
// ../../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/error.js
|
|
23
23
|
var require_error = __commonJS((exports) => {
|
|
24
24
|
class CommanderError extends Error {
|
|
25
25
|
constructor(exitCode, code, message) {
|
|
@@ -43,7 +43,7 @@ var require_error = __commonJS((exports) => {
|
|
|
43
43
|
exports.InvalidArgumentError = InvalidArgumentError;
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
// node_modules/commander/lib/argument.js
|
|
46
|
+
// ../../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/argument.js
|
|
47
47
|
var require_argument = __commonJS((exports) => {
|
|
48
48
|
var { InvalidArgumentError } = require_error();
|
|
49
49
|
|
|
@@ -123,7 +123,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
123
123
|
exports.humanReadableArgName = humanReadableArgName;
|
|
124
124
|
});
|
|
125
125
|
|
|
126
|
-
// node_modules/commander/lib/help.js
|
|
126
|
+
// ../../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/help.js
|
|
127
127
|
var require_help = __commonJS((exports) => {
|
|
128
128
|
var { humanReadableArgName } = require_argument();
|
|
129
129
|
|
|
@@ -480,7 +480,7 @@ ${itemIndentStr}`);
|
|
|
480
480
|
exports.stripColor = stripColor;
|
|
481
481
|
});
|
|
482
482
|
|
|
483
|
-
// node_modules/commander/lib/option.js
|
|
483
|
+
// ../../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/option.js
|
|
484
484
|
var require_option = __commonJS((exports) => {
|
|
485
485
|
var { InvalidArgumentError } = require_error();
|
|
486
486
|
|
|
@@ -664,7 +664,7 @@ var require_option = __commonJS((exports) => {
|
|
|
664
664
|
exports.DualOptions = DualOptions;
|
|
665
665
|
});
|
|
666
666
|
|
|
667
|
-
// node_modules/commander/lib/suggestSimilar.js
|
|
667
|
+
// ../../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/suggestSimilar.js
|
|
668
668
|
var require_suggestSimilar = __commonJS((exports) => {
|
|
669
669
|
var maxDistance = 3;
|
|
670
670
|
function editDistance(a, b) {
|
|
@@ -737,7 +737,7 @@ var require_suggestSimilar = __commonJS((exports) => {
|
|
|
737
737
|
exports.suggestSimilar = suggestSimilar;
|
|
738
738
|
});
|
|
739
739
|
|
|
740
|
-
// node_modules/commander/lib/command.js
|
|
740
|
+
// ../../node_modules/.bun/commander@14.0.3/node_modules/commander/lib/command.js
|
|
741
741
|
var require_command = __commonJS((exports) => {
|
|
742
742
|
var EventEmitter = __require("node:events").EventEmitter;
|
|
743
743
|
var childProcess = __require("node:child_process");
|
|
@@ -2092,7 +2092,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2092
2092
|
exports.useColor = useColor;
|
|
2093
2093
|
});
|
|
2094
2094
|
|
|
2095
|
-
// node_modules/commander/index.js
|
|
2095
|
+
// ../../node_modules/.bun/commander@14.0.3/node_modules/commander/index.js
|
|
2096
2096
|
var require_commander = __commonJS((exports) => {
|
|
2097
2097
|
var { Argument } = require_argument();
|
|
2098
2098
|
var { Command } = require_command();
|
|
@@ -2112,7 +2112,7 @@ var require_commander = __commonJS((exports) => {
|
|
|
2112
2112
|
exports.InvalidOptionArgumentError = InvalidArgumentError;
|
|
2113
2113
|
});
|
|
2114
2114
|
|
|
2115
|
-
// node_modules/cli-width/index.js
|
|
2115
|
+
// ../../node_modules/.bun/cli-width@4.1.0/node_modules/cli-width/index.js
|
|
2116
2116
|
var require_cli_width = __commonJS((exports, module) => {
|
|
2117
2117
|
module.exports = cliWidth;
|
|
2118
2118
|
function normalizeOpts(options) {
|
|
@@ -2152,14 +2152,7 @@ var require_cli_width = __commonJS((exports, module) => {
|
|
|
2152
2152
|
}
|
|
2153
2153
|
});
|
|
2154
2154
|
|
|
2155
|
-
// node_modules/
|
|
2156
|
-
var require_emoji_regex = __commonJS((exports, module) => {
|
|
2157
|
-
module.exports = () => {
|
|
2158
|
-
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;
|
|
2159
|
-
};
|
|
2160
|
-
});
|
|
2161
|
-
|
|
2162
|
-
// node_modules/mute-stream/lib/index.js
|
|
2155
|
+
// ../../node_modules/.bun/mute-stream@3.0.0/node_modules/mute-stream/lib/index.js
|
|
2163
2156
|
var require_lib = __commonJS((exports, module) => {
|
|
2164
2157
|
var Stream = __require("stream");
|
|
2165
2158
|
|
|
@@ -2279,7 +2272,7 @@ var require_lib = __commonJS((exports, module) => {
|
|
|
2279
2272
|
module.exports = MuteStream;
|
|
2280
2273
|
});
|
|
2281
2274
|
|
|
2282
|
-
// node_modules/commander/esm.mjs
|
|
2275
|
+
// ../../node_modules/.bun/commander@14.0.3/node_modules/commander/esm.mjs
|
|
2283
2276
|
var import__ = __toESM(require_commander(), 1);
|
|
2284
2277
|
var {
|
|
2285
2278
|
program,
|
|
@@ -2295,13 +2288,24 @@ var {
|
|
|
2295
2288
|
Help
|
|
2296
2289
|
} = import__.default;
|
|
2297
2290
|
|
|
2298
|
-
// node_modules/@inquirer/core/dist/lib/key.js
|
|
2299
|
-
var
|
|
2300
|
-
var
|
|
2291
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/key.js
|
|
2292
|
+
var keybindings = ["emacs", "vim"];
|
|
2293
|
+
var keybindingLookup = new Set(keybindings);
|
|
2294
|
+
function isKeybinding(value) {
|
|
2295
|
+
return keybindingLookup.has(value);
|
|
2296
|
+
}
|
|
2297
|
+
function getDefaultKeybindings() {
|
|
2298
|
+
const env = process.env["INQUIRER_KEYBINDINGS"];
|
|
2299
|
+
if (!env)
|
|
2300
|
+
return [];
|
|
2301
|
+
return Array.from(new Set(env.toLowerCase().split(/[\s,]+/).filter(isKeybinding)));
|
|
2302
|
+
}
|
|
2303
|
+
var isUpKey = (key, keybindings2 = []) => key.name === "up" || keybindings2.includes("vim") && key.name === "k" || keybindings2.includes("emacs") && key.ctrl && key.name === "p";
|
|
2304
|
+
var isDownKey = (key, keybindings2 = []) => key.name === "down" || keybindings2.includes("vim") && key.name === "j" || keybindings2.includes("emacs") && key.ctrl && key.name === "n";
|
|
2301
2305
|
var isBackspaceKey = (key) => key.name === "backspace";
|
|
2302
2306
|
var isNumberKey = (key) => "1234567890".includes(key.name);
|
|
2303
2307
|
var isEnterKey = (key) => key.name === "enter" || key.name === "return";
|
|
2304
|
-
// node_modules/@inquirer/core/dist/lib/errors.js
|
|
2308
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/errors.js
|
|
2305
2309
|
class AbortPromptError extends Error {
|
|
2306
2310
|
name = "AbortPromptError";
|
|
2307
2311
|
message = "Prompt was aborted";
|
|
@@ -2327,11 +2331,12 @@ class HookError extends Error {
|
|
|
2327
2331
|
class ValidationError extends Error {
|
|
2328
2332
|
name = "ValidationError";
|
|
2329
2333
|
}
|
|
2330
|
-
// node_modules/@inquirer/core/dist/lib/use-state.js
|
|
2334
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
2331
2335
|
import { AsyncResource as AsyncResource2 } from "node:async_hooks";
|
|
2332
2336
|
|
|
2333
|
-
// node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
2337
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
2334
2338
|
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
|
2339
|
+
var nativeQueueMicrotask = globalThis.queueMicrotask;
|
|
2335
2340
|
var hookStorage = new AsyncLocalStorage;
|
|
2336
2341
|
function createStore(rl) {
|
|
2337
2342
|
const store = {
|
|
@@ -2340,22 +2345,21 @@ function createStore(rl) {
|
|
|
2340
2345
|
hooksCleanup: [],
|
|
2341
2346
|
hooksEffect: [],
|
|
2342
2347
|
index: 0,
|
|
2343
|
-
handleChange() {}
|
|
2348
|
+
handleChange() {},
|
|
2349
|
+
deferredPaint: null
|
|
2344
2350
|
};
|
|
2345
2351
|
return store;
|
|
2346
2352
|
}
|
|
2347
2353
|
function withHooks(rl, cb) {
|
|
2348
2354
|
const store = createStore(rl);
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
store.
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
return cb(cycle);
|
|
2358
|
-
});
|
|
2355
|
+
function cycle(render) {
|
|
2356
|
+
store.handleChange = () => {
|
|
2357
|
+
store.index = 0;
|
|
2358
|
+
render();
|
|
2359
|
+
};
|
|
2360
|
+
store.handleChange();
|
|
2361
|
+
}
|
|
2362
|
+
return hookStorage.run(store, () => cb(cycle));
|
|
2359
2363
|
}
|
|
2360
2364
|
function getStore() {
|
|
2361
2365
|
const store = hookStorage.getStore();
|
|
@@ -2372,18 +2376,40 @@ function withUpdates(fn) {
|
|
|
2372
2376
|
const store = getStore();
|
|
2373
2377
|
let shouldUpdate = false;
|
|
2374
2378
|
const oldHandleChange = store.handleChange;
|
|
2375
|
-
|
|
2379
|
+
const recordChange = () => {
|
|
2376
2380
|
shouldUpdate = true;
|
|
2377
2381
|
};
|
|
2382
|
+
store.handleChange = recordChange;
|
|
2378
2383
|
const returnValue = fn(...args);
|
|
2379
2384
|
if (shouldUpdate) {
|
|
2385
|
+
let flushedUpdate = false;
|
|
2386
|
+
store.handleChange = () => {
|
|
2387
|
+
flushedUpdate = true;
|
|
2388
|
+
};
|
|
2380
2389
|
oldHandleChange();
|
|
2390
|
+
store.handleChange = oldHandleChange;
|
|
2391
|
+
if (flushedUpdate) {
|
|
2392
|
+
scheduleDeferredPaint(store, oldHandleChange);
|
|
2393
|
+
}
|
|
2394
|
+
} else {
|
|
2395
|
+
store.handleChange = oldHandleChange;
|
|
2381
2396
|
}
|
|
2382
|
-
store.handleChange = oldHandleChange;
|
|
2383
2397
|
return returnValue;
|
|
2384
2398
|
};
|
|
2385
2399
|
return AsyncResource.bind(wrapped);
|
|
2386
2400
|
}
|
|
2401
|
+
function scheduleDeferredPaint(store, paint) {
|
|
2402
|
+
if (store.deferredPaint !== null)
|
|
2403
|
+
return;
|
|
2404
|
+
store.deferredPaint = AsyncResource.bind(paint);
|
|
2405
|
+
nativeQueueMicrotask(() => {
|
|
2406
|
+
const pending = store.deferredPaint;
|
|
2407
|
+
if (pending === null)
|
|
2408
|
+
return;
|
|
2409
|
+
store.deferredPaint = null;
|
|
2410
|
+
pending();
|
|
2411
|
+
});
|
|
2412
|
+
}
|
|
2387
2413
|
function withPointer(cb) {
|
|
2388
2414
|
const store = getStore();
|
|
2389
2415
|
const { index } = store;
|
|
@@ -2432,28 +2458,37 @@ var effectScheduler = {
|
|
|
2432
2458
|
});
|
|
2433
2459
|
store.hooksEffect.length = 0;
|
|
2434
2460
|
store.hooksCleanup.length = 0;
|
|
2461
|
+
store.deferredPaint = null;
|
|
2435
2462
|
}
|
|
2436
2463
|
};
|
|
2437
2464
|
|
|
2438
|
-
// node_modules/@inquirer/core/dist/lib/use-state.js
|
|
2465
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/use-state.js
|
|
2466
|
+
function isFactory(value) {
|
|
2467
|
+
return typeof value === "function";
|
|
2468
|
+
}
|
|
2469
|
+
function isReducer(value) {
|
|
2470
|
+
return typeof value === "function";
|
|
2471
|
+
}
|
|
2439
2472
|
function useState(defaultValue) {
|
|
2440
2473
|
return withPointer((pointer) => {
|
|
2441
2474
|
const setState = AsyncResource2.bind(function setState2(newValue) {
|
|
2442
|
-
|
|
2443
|
-
|
|
2475
|
+
const currentValue = pointer.get();
|
|
2476
|
+
const nextValue = isReducer(newValue) ? newValue(currentValue) : newValue;
|
|
2477
|
+
if (!Object.is(currentValue, nextValue)) {
|
|
2478
|
+
pointer.set(nextValue);
|
|
2444
2479
|
handleChange();
|
|
2445
2480
|
}
|
|
2446
2481
|
});
|
|
2447
2482
|
if (pointer.initialized) {
|
|
2448
2483
|
return [pointer.get(), setState];
|
|
2449
2484
|
}
|
|
2450
|
-
const value =
|
|
2485
|
+
const value = isFactory(defaultValue) ? defaultValue() : defaultValue;
|
|
2451
2486
|
pointer.set(value);
|
|
2452
2487
|
return [value, setState];
|
|
2453
2488
|
});
|
|
2454
2489
|
}
|
|
2455
2490
|
|
|
2456
|
-
// node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
2491
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/use-effect.js
|
|
2457
2492
|
function useEffect(cb, depArray) {
|
|
2458
2493
|
withPointer((pointer) => {
|
|
2459
2494
|
const oldDeps = pointer.get();
|
|
@@ -2465,16 +2500,16 @@ function useEffect(cb, depArray) {
|
|
|
2465
2500
|
});
|
|
2466
2501
|
}
|
|
2467
2502
|
|
|
2468
|
-
// node_modules/@inquirer/core/dist/lib/theme.js
|
|
2503
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/theme.js
|
|
2469
2504
|
import { styleText } from "node:util";
|
|
2470
2505
|
|
|
2471
|
-
// node_modules/@inquirer/figures/dist/index.js
|
|
2506
|
+
// ../../node_modules/.bun/@inquirer+figures@2.1.1/node_modules/@inquirer/figures/dist/index.js
|
|
2472
2507
|
import process2 from "node:process";
|
|
2473
2508
|
function isUnicodeSupported() {
|
|
2474
|
-
if (process2.platform
|
|
2509
|
+
if (!process2.platform.startsWith("win")) {
|
|
2475
2510
|
return process2.env["TERM"] !== "linux";
|
|
2476
2511
|
}
|
|
2477
|
-
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";
|
|
2512
|
+
return Boolean(process2.env["CI"]) || 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";
|
|
2478
2513
|
}
|
|
2479
2514
|
var common = {
|
|
2480
2515
|
circleQuestionMark: "(?)",
|
|
@@ -2757,7 +2792,7 @@ var figures = shouldUseMain ? mainSymbols : fallbackSymbols;
|
|
|
2757
2792
|
var dist_default = figures;
|
|
2758
2793
|
var replacements = Object.entries(specialMainSymbols);
|
|
2759
2794
|
|
|
2760
|
-
// node_modules/@inquirer/core/dist/lib/theme.js
|
|
2795
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/theme.js
|
|
2761
2796
|
var defaultTheme = {
|
|
2762
2797
|
prefix: {
|
|
2763
2798
|
idle: styleText("blue", "?"),
|
|
@@ -2767,6 +2802,7 @@ var defaultTheme = {
|
|
|
2767
2802
|
interval: 80,
|
|
2768
2803
|
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"].map((frame) => styleText("yellow", frame))
|
|
2769
2804
|
},
|
|
2805
|
+
keybindings: [],
|
|
2770
2806
|
style: {
|
|
2771
2807
|
answer: (text) => styleText("cyan", text),
|
|
2772
2808
|
message: (text) => styleText("bold", text),
|
|
@@ -2777,8 +2813,14 @@ var defaultTheme = {
|
|
|
2777
2813
|
key: (text) => styleText("cyan", styleText("bold", `<${text}>`))
|
|
2778
2814
|
}
|
|
2779
2815
|
};
|
|
2816
|
+
function getDefaultTheme() {
|
|
2817
|
+
return {
|
|
2818
|
+
...defaultTheme,
|
|
2819
|
+
keybindings: getDefaultKeybindings()
|
|
2820
|
+
};
|
|
2821
|
+
}
|
|
2780
2822
|
|
|
2781
|
-
// node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
2823
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/make-theme.js
|
|
2782
2824
|
function isPlainObject(value) {
|
|
2783
2825
|
if (typeof value !== "object" || value === null)
|
|
2784
2826
|
return false;
|
|
@@ -2792,6 +2834,8 @@ function deepMerge(...objects) {
|
|
|
2792
2834
|
const output = {};
|
|
2793
2835
|
for (const obj of objects) {
|
|
2794
2836
|
for (const [key, value] of Object.entries(obj)) {
|
|
2837
|
+
if (value === undefined)
|
|
2838
|
+
continue;
|
|
2795
2839
|
const prevValue = output[key];
|
|
2796
2840
|
output[key] = isPlainObject(prevValue) && isPlainObject(value) ? deepMerge(prevValue, value) : value;
|
|
2797
2841
|
}
|
|
@@ -2800,13 +2844,13 @@ function deepMerge(...objects) {
|
|
|
2800
2844
|
}
|
|
2801
2845
|
function makeTheme(...themes) {
|
|
2802
2846
|
const themesToMerge = [
|
|
2803
|
-
|
|
2847
|
+
getDefaultTheme(),
|
|
2804
2848
|
...themes.filter((theme) => theme != null)
|
|
2805
2849
|
];
|
|
2806
2850
|
return deepMerge(...themesToMerge);
|
|
2807
2851
|
}
|
|
2808
2852
|
|
|
2809
|
-
// node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
2853
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/use-prefix.js
|
|
2810
2854
|
function usePrefix({ status = "idle", theme }) {
|
|
2811
2855
|
const [showLoader, setShowLoader] = useState(false);
|
|
2812
2856
|
const [tick, setTick] = useState(0);
|
|
@@ -2836,11 +2880,11 @@ function usePrefix({ status = "idle", theme }) {
|
|
|
2836
2880
|
const iconName = status === "loading" ? "idle" : status;
|
|
2837
2881
|
return typeof prefix === "string" ? prefix : prefix[iconName] ?? prefix["idle"];
|
|
2838
2882
|
}
|
|
2839
|
-
// node_modules/@inquirer/core/dist/lib/use-memo.js
|
|
2883
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/use-memo.js
|
|
2840
2884
|
function useMemo(fn, dependencies) {
|
|
2841
2885
|
return withPointer((pointer) => {
|
|
2842
2886
|
const prev = pointer.get();
|
|
2843
|
-
if (!
|
|
2887
|
+
if (!pointer.initialized || prev.dependencies.length !== dependencies.length || prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
|
|
2844
2888
|
const value = fn();
|
|
2845
2889
|
pointer.set({ value, dependencies });
|
|
2846
2890
|
return value;
|
|
@@ -2848,11 +2892,11 @@ function useMemo(fn, dependencies) {
|
|
|
2848
2892
|
return prev.value;
|
|
2849
2893
|
});
|
|
2850
2894
|
}
|
|
2851
|
-
// node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
2895
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/use-ref.js
|
|
2852
2896
|
function useRef(val) {
|
|
2853
2897
|
return useState({ current: val })[0];
|
|
2854
2898
|
}
|
|
2855
|
-
// node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
2899
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/use-keypress.js
|
|
2856
2900
|
function useKeypress(userHandler) {
|
|
2857
2901
|
const signal = useRef(userHandler);
|
|
2858
2902
|
signal.current = userHandler;
|
|
@@ -2870,309 +2914,196 @@ function useKeypress(userHandler) {
|
|
|
2870
2914
|
};
|
|
2871
2915
|
}, []);
|
|
2872
2916
|
}
|
|
2873
|
-
// node_modules/@inquirer/core/dist/lib/utils.js
|
|
2917
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/utils.js
|
|
2874
2918
|
var import_cli_width = __toESM(require_cli_width(), 1);
|
|
2875
2919
|
|
|
2876
|
-
// node_modules/
|
|
2877
|
-
|
|
2878
|
-
const
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
|
|
2890
|
-
}
|
|
2891
|
-
return string.replace(regex, "");
|
|
2892
|
-
}
|
|
2893
|
-
|
|
2894
|
-
// node_modules/wrap-ansi/node_modules/string-width/node_modules/get-east-asian-width/lookup.js
|
|
2895
|
-
function isAmbiguous(x) {
|
|
2896
|
-
return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
|
|
2897
|
-
}
|
|
2898
|
-
function isFullWidth(x) {
|
|
2920
|
+
// ../../node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
|
|
2921
|
+
var getCodePointsLength = (() => {
|
|
2922
|
+
const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
|
|
2923
|
+
return (input) => {
|
|
2924
|
+
let surrogatePairsNr = 0;
|
|
2925
|
+
SURROGATE_PAIR_RE.lastIndex = 0;
|
|
2926
|
+
while (SURROGATE_PAIR_RE.test(input)) {
|
|
2927
|
+
surrogatePairsNr += 1;
|
|
2928
|
+
}
|
|
2929
|
+
return input.length - surrogatePairsNr;
|
|
2930
|
+
};
|
|
2931
|
+
})();
|
|
2932
|
+
var isFullWidth = (x) => {
|
|
2899
2933
|
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
2900
|
-
}
|
|
2901
|
-
|
|
2902
|
-
return x
|
|
2903
|
-
}
|
|
2904
|
-
|
|
2905
|
-
// node_modules/wrap-ansi/node_modules/string-width/node_modules/get-east-asian-width/index.js
|
|
2906
|
-
function validate(codePoint) {
|
|
2907
|
-
if (!Number.isSafeInteger(codePoint)) {
|
|
2908
|
-
throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
|
|
2909
|
-
}
|
|
2910
|
-
}
|
|
2911
|
-
function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
|
|
2912
|
-
validate(codePoint);
|
|
2913
|
-
if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) {
|
|
2914
|
-
return 2;
|
|
2915
|
-
}
|
|
2916
|
-
return 1;
|
|
2917
|
-
}
|
|
2934
|
+
};
|
|
2935
|
+
var isWideNotCJKTNotEmoji = (x) => {
|
|
2936
|
+
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;
|
|
2937
|
+
};
|
|
2918
2938
|
|
|
2919
|
-
// node_modules/
|
|
2920
|
-
var
|
|
2921
|
-
var
|
|
2922
|
-
var
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2939
|
+
// ../../node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
|
|
2940
|
+
var ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
|
|
2941
|
+
var CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
2942
|
+
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;
|
|
2943
|
+
var TAB_RE = /\t{1,1000}/y;
|
|
2944
|
+
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;
|
|
2945
|
+
var LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
|
|
2946
|
+
var MODIFIER_RE = /\p{M}+/gu;
|
|
2947
|
+
var NO_TRUNCATION = { limit: Infinity, ellipsis: "" };
|
|
2948
|
+
var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
|
|
2949
|
+
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
2950
|
+
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
2951
|
+
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION, widthOptions).width : 0);
|
|
2952
|
+
const ANSI_WIDTH = 0;
|
|
2953
|
+
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
2954
|
+
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
2955
|
+
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
2956
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
2957
|
+
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
2958
|
+
const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
|
|
2959
|
+
const PARSE_BLOCKS = [
|
|
2960
|
+
[LATIN_RE, REGULAR_WIDTH],
|
|
2961
|
+
[ANSI_RE, ANSI_WIDTH],
|
|
2962
|
+
[CONTROL_RE, CONTROL_WIDTH],
|
|
2963
|
+
[TAB_RE, TAB_WIDTH],
|
|
2964
|
+
[EMOJI_RE, EMOJI_WIDTH],
|
|
2965
|
+
[CJKT_WIDE_RE, WIDE_WIDTH]
|
|
2966
|
+
];
|
|
2967
|
+
let indexPrev = 0;
|
|
2968
|
+
let index = 0;
|
|
2969
|
+
let length = input.length;
|
|
2970
|
+
let lengthExtra = 0;
|
|
2971
|
+
let truncationEnabled = false;
|
|
2972
|
+
let truncationIndex = length;
|
|
2973
|
+
let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
|
|
2974
|
+
let unmatchedStart = 0;
|
|
2975
|
+
let unmatchedEnd = 0;
|
|
2937
2976
|
let width = 0;
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
}
|
|
2953
|
-
if (codePoint >= 65024 && codePoint <= 65039) {
|
|
2954
|
-
continue;
|
|
2955
|
-
}
|
|
2956
|
-
if (defaultIgnorableCodePointRegex.test(character)) {
|
|
2957
|
-
continue;
|
|
2958
|
-
}
|
|
2959
|
-
if (import_emoji_regex.default().test(character)) {
|
|
2960
|
-
width += 2;
|
|
2961
|
-
continue;
|
|
2962
|
-
}
|
|
2963
|
-
width += eastAsianWidth(codePoint, eastAsianWidthOptions);
|
|
2964
|
-
}
|
|
2965
|
-
return width;
|
|
2966
|
-
}
|
|
2967
|
-
|
|
2968
|
-
// node_modules/wrap-ansi/node_modules/ansi-styles/index.js
|
|
2969
|
-
var ANSI_BACKGROUND_OFFSET = 10;
|
|
2970
|
-
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
2971
|
-
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
2972
|
-
var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
2973
|
-
var styles = {
|
|
2974
|
-
modifier: {
|
|
2975
|
-
reset: [0, 0],
|
|
2976
|
-
bold: [1, 22],
|
|
2977
|
-
dim: [2, 22],
|
|
2978
|
-
italic: [3, 23],
|
|
2979
|
-
underline: [4, 24],
|
|
2980
|
-
overline: [53, 55],
|
|
2981
|
-
inverse: [7, 27],
|
|
2982
|
-
hidden: [8, 28],
|
|
2983
|
-
strikethrough: [9, 29]
|
|
2984
|
-
},
|
|
2985
|
-
color: {
|
|
2986
|
-
black: [30, 39],
|
|
2987
|
-
red: [31, 39],
|
|
2988
|
-
green: [32, 39],
|
|
2989
|
-
yellow: [33, 39],
|
|
2990
|
-
blue: [34, 39],
|
|
2991
|
-
magenta: [35, 39],
|
|
2992
|
-
cyan: [36, 39],
|
|
2993
|
-
white: [37, 39],
|
|
2994
|
-
blackBright: [90, 39],
|
|
2995
|
-
gray: [90, 39],
|
|
2996
|
-
grey: [90, 39],
|
|
2997
|
-
redBright: [91, 39],
|
|
2998
|
-
greenBright: [92, 39],
|
|
2999
|
-
yellowBright: [93, 39],
|
|
3000
|
-
blueBright: [94, 39],
|
|
3001
|
-
magentaBright: [95, 39],
|
|
3002
|
-
cyanBright: [96, 39],
|
|
3003
|
-
whiteBright: [97, 39]
|
|
3004
|
-
},
|
|
3005
|
-
bgColor: {
|
|
3006
|
-
bgBlack: [40, 49],
|
|
3007
|
-
bgRed: [41, 49],
|
|
3008
|
-
bgGreen: [42, 49],
|
|
3009
|
-
bgYellow: [43, 49],
|
|
3010
|
-
bgBlue: [44, 49],
|
|
3011
|
-
bgMagenta: [45, 49],
|
|
3012
|
-
bgCyan: [46, 49],
|
|
3013
|
-
bgWhite: [47, 49],
|
|
3014
|
-
bgBlackBright: [100, 49],
|
|
3015
|
-
bgGray: [100, 49],
|
|
3016
|
-
bgGrey: [100, 49],
|
|
3017
|
-
bgRedBright: [101, 49],
|
|
3018
|
-
bgGreenBright: [102, 49],
|
|
3019
|
-
bgYellowBright: [103, 49],
|
|
3020
|
-
bgBlueBright: [104, 49],
|
|
3021
|
-
bgMagentaBright: [105, 49],
|
|
3022
|
-
bgCyanBright: [106, 49],
|
|
3023
|
-
bgWhiteBright: [107, 49]
|
|
3024
|
-
}
|
|
3025
|
-
};
|
|
3026
|
-
var modifierNames = Object.keys(styles.modifier);
|
|
3027
|
-
var foregroundColorNames = Object.keys(styles.color);
|
|
3028
|
-
var backgroundColorNames = Object.keys(styles.bgColor);
|
|
3029
|
-
var colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
3030
|
-
function assembleStyles() {
|
|
3031
|
-
const codes = new Map;
|
|
3032
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
3033
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
3034
|
-
styles[styleName] = {
|
|
3035
|
-
open: `\x1B[${style[0]}m`,
|
|
3036
|
-
close: `\x1B[${style[1]}m`
|
|
3037
|
-
};
|
|
3038
|
-
group[styleName] = styles[styleName];
|
|
3039
|
-
codes.set(style[0], style[1]);
|
|
3040
|
-
}
|
|
3041
|
-
Object.defineProperty(styles, groupName, {
|
|
3042
|
-
value: group,
|
|
3043
|
-
enumerable: false
|
|
3044
|
-
});
|
|
3045
|
-
}
|
|
3046
|
-
Object.defineProperty(styles, "codes", {
|
|
3047
|
-
value: codes,
|
|
3048
|
-
enumerable: false
|
|
3049
|
-
});
|
|
3050
|
-
styles.color.close = "\x1B[39m";
|
|
3051
|
-
styles.bgColor.close = "\x1B[49m";
|
|
3052
|
-
styles.color.ansi = wrapAnsi16();
|
|
3053
|
-
styles.color.ansi256 = wrapAnsi256();
|
|
3054
|
-
styles.color.ansi16m = wrapAnsi16m();
|
|
3055
|
-
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
3056
|
-
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
3057
|
-
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
3058
|
-
Object.defineProperties(styles, {
|
|
3059
|
-
rgbToAnsi256: {
|
|
3060
|
-
value(red, green, blue) {
|
|
3061
|
-
if (red === green && green === blue) {
|
|
3062
|
-
if (red < 8) {
|
|
3063
|
-
return 16;
|
|
2977
|
+
let widthExtra = 0;
|
|
2978
|
+
outer:
|
|
2979
|
+
while (true) {
|
|
2980
|
+
if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
|
|
2981
|
+
const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
|
|
2982
|
+
lengthExtra = 0;
|
|
2983
|
+
for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
|
|
2984
|
+
const codePoint = char.codePointAt(0) || 0;
|
|
2985
|
+
if (isFullWidth(codePoint)) {
|
|
2986
|
+
widthExtra = FULL_WIDTH_WIDTH;
|
|
2987
|
+
} else if (isWideNotCJKTNotEmoji(codePoint)) {
|
|
2988
|
+
widthExtra = WIDE_WIDTH;
|
|
2989
|
+
} else {
|
|
2990
|
+
widthExtra = REGULAR_WIDTH;
|
|
3064
2991
|
}
|
|
3065
|
-
if (
|
|
3066
|
-
|
|
2992
|
+
if (width + widthExtra > truncationLimit) {
|
|
2993
|
+
truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
|
|
3067
2994
|
}
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
hexToRgb: {
|
|
3075
|
-
value(hex) {
|
|
3076
|
-
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
3077
|
-
if (!matches) {
|
|
3078
|
-
return [0, 0, 0];
|
|
3079
|
-
}
|
|
3080
|
-
let [colorString] = matches;
|
|
3081
|
-
if (colorString.length === 3) {
|
|
3082
|
-
colorString = [...colorString].map((character) => character + character).join("");
|
|
3083
|
-
}
|
|
3084
|
-
const integer = Number.parseInt(colorString, 16);
|
|
3085
|
-
return [
|
|
3086
|
-
integer >> 16 & 255,
|
|
3087
|
-
integer >> 8 & 255,
|
|
3088
|
-
integer & 255
|
|
3089
|
-
];
|
|
3090
|
-
},
|
|
3091
|
-
enumerable: false
|
|
3092
|
-
},
|
|
3093
|
-
hexToAnsi256: {
|
|
3094
|
-
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
3095
|
-
enumerable: false
|
|
3096
|
-
},
|
|
3097
|
-
ansi256ToAnsi: {
|
|
3098
|
-
value(code) {
|
|
3099
|
-
if (code < 8) {
|
|
3100
|
-
return 30 + code;
|
|
3101
|
-
}
|
|
3102
|
-
if (code < 16) {
|
|
3103
|
-
return 90 + (code - 8);
|
|
3104
|
-
}
|
|
3105
|
-
let red;
|
|
3106
|
-
let green;
|
|
3107
|
-
let blue;
|
|
3108
|
-
if (code >= 232) {
|
|
3109
|
-
red = ((code - 232) * 10 + 8) / 255;
|
|
3110
|
-
green = red;
|
|
3111
|
-
blue = red;
|
|
3112
|
-
} else {
|
|
3113
|
-
code -= 16;
|
|
3114
|
-
const remainder = code % 36;
|
|
3115
|
-
red = Math.floor(code / 36) / 5;
|
|
3116
|
-
green = Math.floor(remainder / 6) / 5;
|
|
3117
|
-
blue = remainder % 6 / 5;
|
|
3118
|
-
}
|
|
3119
|
-
const value = Math.max(red, green, blue) * 2;
|
|
3120
|
-
if (value === 0) {
|
|
3121
|
-
return 30;
|
|
2995
|
+
if (width + widthExtra > LIMIT) {
|
|
2996
|
+
truncationEnabled = true;
|
|
2997
|
+
break outer;
|
|
2998
|
+
}
|
|
2999
|
+
lengthExtra += char.length;
|
|
3000
|
+
width += widthExtra;
|
|
3122
3001
|
}
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3002
|
+
unmatchedStart = unmatchedEnd = 0;
|
|
3003
|
+
}
|
|
3004
|
+
if (index >= length) {
|
|
3005
|
+
break outer;
|
|
3006
|
+
}
|
|
3007
|
+
for (let i = 0, l = PARSE_BLOCKS.length;i < l; i++) {
|
|
3008
|
+
const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
|
|
3009
|
+
BLOCK_RE.lastIndex = index;
|
|
3010
|
+
if (BLOCK_RE.test(input)) {
|
|
3011
|
+
lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
|
|
3012
|
+
widthExtra = lengthExtra * BLOCK_WIDTH;
|
|
3013
|
+
if (width + widthExtra > truncationLimit) {
|
|
3014
|
+
truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
|
|
3015
|
+
}
|
|
3016
|
+
if (width + widthExtra > LIMIT) {
|
|
3017
|
+
truncationEnabled = true;
|
|
3018
|
+
break outer;
|
|
3019
|
+
}
|
|
3020
|
+
width += widthExtra;
|
|
3021
|
+
unmatchedStart = indexPrev;
|
|
3022
|
+
unmatchedEnd = index;
|
|
3023
|
+
index = indexPrev = BLOCK_RE.lastIndex;
|
|
3024
|
+
continue outer;
|
|
3126
3025
|
}
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
enumerable: false
|
|
3130
|
-
},
|
|
3131
|
-
rgbToAnsi: {
|
|
3132
|
-
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
3133
|
-
enumerable: false
|
|
3134
|
-
},
|
|
3135
|
-
hexToAnsi: {
|
|
3136
|
-
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
3137
|
-
enumerable: false
|
|
3026
|
+
}
|
|
3027
|
+
index += 1;
|
|
3138
3028
|
}
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3029
|
+
return {
|
|
3030
|
+
width: truncationEnabled ? truncationLimit : width,
|
|
3031
|
+
index: truncationEnabled ? truncationIndex : length,
|
|
3032
|
+
truncated: truncationEnabled,
|
|
3033
|
+
ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
|
|
3034
|
+
};
|
|
3035
|
+
};
|
|
3036
|
+
var dist_default2 = getStringTruncatedWidth;
|
|
3144
3037
|
|
|
3145
|
-
// node_modules/
|
|
3146
|
-
var
|
|
3147
|
-
|
|
3148
|
-
"
|
|
3149
|
-
|
|
3038
|
+
// ../../node_modules/.bun/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
|
|
3039
|
+
var NO_TRUNCATION2 = {
|
|
3040
|
+
limit: Infinity,
|
|
3041
|
+
ellipsis: "",
|
|
3042
|
+
ellipsisWidth: 0
|
|
3043
|
+
};
|
|
3044
|
+
var fastStringWidth = (input, options = {}) => {
|
|
3045
|
+
return dist_default2(input, NO_TRUNCATION2, options).width;
|
|
3046
|
+
};
|
|
3047
|
+
var dist_default3 = fastStringWidth;
|
|
3048
|
+
|
|
3049
|
+
// ../../node_modules/.bun/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
|
|
3050
|
+
var ESC = "\x1B";
|
|
3051
|
+
var CSI = "";
|
|
3150
3052
|
var END_CODE = 39;
|
|
3151
3053
|
var ANSI_ESCAPE_BELL = "\x07";
|
|
3152
3054
|
var ANSI_CSI = "[";
|
|
3153
3055
|
var ANSI_OSC = "]";
|
|
3154
3056
|
var ANSI_SGR_TERMINATOR = "m";
|
|
3155
3057
|
var ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
|
|
3156
|
-
var
|
|
3157
|
-
var
|
|
3158
|
-
|
|
3058
|
+
var GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
|
|
3059
|
+
var getClosingCode = (openingCode) => {
|
|
3060
|
+
if (openingCode >= 30 && openingCode <= 37)
|
|
3061
|
+
return 39;
|
|
3062
|
+
if (openingCode >= 90 && openingCode <= 97)
|
|
3063
|
+
return 39;
|
|
3064
|
+
if (openingCode >= 40 && openingCode <= 47)
|
|
3065
|
+
return 49;
|
|
3066
|
+
if (openingCode >= 100 && openingCode <= 107)
|
|
3067
|
+
return 49;
|
|
3068
|
+
if (openingCode === 1 || openingCode === 2)
|
|
3069
|
+
return 22;
|
|
3070
|
+
if (openingCode === 3)
|
|
3071
|
+
return 23;
|
|
3072
|
+
if (openingCode === 4)
|
|
3073
|
+
return 24;
|
|
3074
|
+
if (openingCode === 7)
|
|
3075
|
+
return 27;
|
|
3076
|
+
if (openingCode === 8)
|
|
3077
|
+
return 28;
|
|
3078
|
+
if (openingCode === 9)
|
|
3079
|
+
return 29;
|
|
3080
|
+
if (openingCode === 0)
|
|
3081
|
+
return 0;
|
|
3082
|
+
return;
|
|
3083
|
+
};
|
|
3084
|
+
var wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
|
|
3085
|
+
var wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
|
|
3159
3086
|
var wrapWord = (rows, word, columns) => {
|
|
3160
|
-
const characters = [
|
|
3087
|
+
const characters = word[Symbol.iterator]();
|
|
3161
3088
|
let isInsideEscape = false;
|
|
3162
3089
|
let isInsideLinkEscape = false;
|
|
3163
|
-
let
|
|
3164
|
-
|
|
3165
|
-
|
|
3090
|
+
let lastRow = rows.at(-1);
|
|
3091
|
+
let visible = lastRow === undefined ? 0 : dist_default3(lastRow);
|
|
3092
|
+
let currentCharacter = characters.next();
|
|
3093
|
+
let nextCharacter = characters.next();
|
|
3094
|
+
let rawCharacterIndex = 0;
|
|
3095
|
+
while (!currentCharacter.done) {
|
|
3096
|
+
const character = currentCharacter.value;
|
|
3097
|
+
const characterLength = dist_default3(character);
|
|
3166
3098
|
if (visible + characterLength <= columns) {
|
|
3167
3099
|
rows[rows.length - 1] += character;
|
|
3168
3100
|
} else {
|
|
3169
3101
|
rows.push(character);
|
|
3170
3102
|
visible = 0;
|
|
3171
3103
|
}
|
|
3172
|
-
if (
|
|
3104
|
+
if (character === ESC || character === CSI) {
|
|
3173
3105
|
isInsideEscape = true;
|
|
3174
|
-
|
|
3175
|
-
isInsideLinkEscape = ansiEscapeLinkCandidate === ANSI_ESCAPE_LINK;
|
|
3106
|
+
isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
|
|
3176
3107
|
}
|
|
3177
3108
|
if (isInsideEscape) {
|
|
3178
3109
|
if (isInsideLinkEscape) {
|
|
@@ -3183,23 +3114,27 @@ var wrapWord = (rows, word, columns) => {
|
|
|
3183
3114
|
} else if (character === ANSI_SGR_TERMINATOR) {
|
|
3184
3115
|
isInsideEscape = false;
|
|
3185
3116
|
}
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3117
|
+
} else {
|
|
3118
|
+
visible += characterLength;
|
|
3119
|
+
if (visible === columns && !nextCharacter.done) {
|
|
3120
|
+
rows.push("");
|
|
3121
|
+
visible = 0;
|
|
3122
|
+
}
|
|
3192
3123
|
}
|
|
3124
|
+
currentCharacter = nextCharacter;
|
|
3125
|
+
nextCharacter = characters.next();
|
|
3126
|
+
rawCharacterIndex += character.length;
|
|
3193
3127
|
}
|
|
3194
|
-
|
|
3128
|
+
lastRow = rows.at(-1);
|
|
3129
|
+
if (!visible && lastRow !== undefined && lastRow.length && rows.length > 1) {
|
|
3195
3130
|
rows[rows.length - 2] += rows.pop();
|
|
3196
3131
|
}
|
|
3197
3132
|
};
|
|
3198
3133
|
var stringVisibleTrimSpacesRight = (string) => {
|
|
3199
3134
|
const words = string.split(" ");
|
|
3200
3135
|
let last = words.length;
|
|
3201
|
-
while (last
|
|
3202
|
-
if (
|
|
3136
|
+
while (last) {
|
|
3137
|
+
if (dist_default3(words[last - 1])) {
|
|
3203
3138
|
break;
|
|
3204
3139
|
}
|
|
3205
3140
|
last--;
|
|
@@ -3216,106 +3151,134 @@ var exec = (string, columns, options = {}) => {
|
|
|
3216
3151
|
let returnValue = "";
|
|
3217
3152
|
let escapeCode;
|
|
3218
3153
|
let escapeUrl;
|
|
3219
|
-
const
|
|
3154
|
+
const words = string.split(" ");
|
|
3220
3155
|
let rows = [""];
|
|
3221
|
-
|
|
3156
|
+
let rowLength = 0;
|
|
3157
|
+
for (let index = 0;index < words.length; index++) {
|
|
3158
|
+
const word = words[index];
|
|
3222
3159
|
if (options.trim !== false) {
|
|
3223
|
-
|
|
3160
|
+
const row = rows.at(-1) ?? "";
|
|
3161
|
+
const trimmed = row.trimStart();
|
|
3162
|
+
if (row.length !== trimmed.length) {
|
|
3163
|
+
rows[rows.length - 1] = trimmed;
|
|
3164
|
+
rowLength = dist_default3(trimmed);
|
|
3165
|
+
}
|
|
3224
3166
|
}
|
|
3225
|
-
let rowLength = stringWidth(rows.at(-1));
|
|
3226
3167
|
if (index !== 0) {
|
|
3227
3168
|
if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
|
|
3228
3169
|
rows.push("");
|
|
3229
3170
|
rowLength = 0;
|
|
3230
3171
|
}
|
|
3231
|
-
if (rowLength
|
|
3172
|
+
if (rowLength || options.trim === false) {
|
|
3232
3173
|
rows[rows.length - 1] += " ";
|
|
3233
3174
|
rowLength++;
|
|
3234
3175
|
}
|
|
3235
3176
|
}
|
|
3236
|
-
|
|
3177
|
+
const wordLength = dist_default3(word);
|
|
3178
|
+
if (options.hard && wordLength > columns) {
|
|
3237
3179
|
const remainingColumns = columns - rowLength;
|
|
3238
|
-
const breaksStartingThisLine = 1 + Math.floor((
|
|
3239
|
-
const breaksStartingNextLine = Math.floor((
|
|
3180
|
+
const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
|
|
3181
|
+
const breaksStartingNextLine = Math.floor((wordLength - 1) / columns);
|
|
3240
3182
|
if (breaksStartingNextLine < breaksStartingThisLine) {
|
|
3241
3183
|
rows.push("");
|
|
3242
3184
|
}
|
|
3243
3185
|
wrapWord(rows, word, columns);
|
|
3186
|
+
rowLength = dist_default3(rows.at(-1) ?? "");
|
|
3244
3187
|
continue;
|
|
3245
3188
|
}
|
|
3246
|
-
if (rowLength +
|
|
3189
|
+
if (rowLength + wordLength > columns && rowLength && wordLength) {
|
|
3247
3190
|
if (options.wordWrap === false && rowLength < columns) {
|
|
3248
3191
|
wrapWord(rows, word, columns);
|
|
3192
|
+
rowLength = dist_default3(rows.at(-1) ?? "");
|
|
3249
3193
|
continue;
|
|
3250
3194
|
}
|
|
3251
3195
|
rows.push("");
|
|
3196
|
+
rowLength = 0;
|
|
3252
3197
|
}
|
|
3253
|
-
if (rowLength +
|
|
3198
|
+
if (rowLength + wordLength > columns && options.wordWrap === false) {
|
|
3254
3199
|
wrapWord(rows, word, columns);
|
|
3200
|
+
rowLength = dist_default3(rows.at(-1) ?? "");
|
|
3255
3201
|
continue;
|
|
3256
3202
|
}
|
|
3257
3203
|
rows[rows.length - 1] += word;
|
|
3204
|
+
rowLength += wordLength;
|
|
3258
3205
|
}
|
|
3259
3206
|
if (options.trim !== false) {
|
|
3260
3207
|
rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
|
|
3261
3208
|
}
|
|
3262
3209
|
const preString = rows.join(`
|
|
3263
3210
|
`);
|
|
3264
|
-
|
|
3265
|
-
let
|
|
3266
|
-
|
|
3211
|
+
let inSurrogate = false;
|
|
3212
|
+
for (let i = 0;i < preString.length; i++) {
|
|
3213
|
+
const character = preString[i];
|
|
3267
3214
|
returnValue += character;
|
|
3268
|
-
if (
|
|
3269
|
-
|
|
3270
|
-
if (
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3215
|
+
if (!inSurrogate) {
|
|
3216
|
+
inSurrogate = character >= "\uD800" && character <= "\uDBFF";
|
|
3217
|
+
if (inSurrogate) {
|
|
3218
|
+
continue;
|
|
3219
|
+
}
|
|
3220
|
+
} else {
|
|
3221
|
+
inSurrogate = false;
|
|
3222
|
+
}
|
|
3223
|
+
if (character === ESC || character === CSI) {
|
|
3224
|
+
GROUP_REGEX.lastIndex = i + 1;
|
|
3225
|
+
const groupsResult = GROUP_REGEX.exec(preString);
|
|
3226
|
+
const groups = groupsResult?.groups;
|
|
3227
|
+
if (groups?.code !== undefined) {
|
|
3228
|
+
const code = Number.parseFloat(groups.code);
|
|
3229
|
+
escapeCode = code === END_CODE ? undefined : code;
|
|
3230
|
+
} else if (groups?.uri !== undefined) {
|
|
3274
3231
|
escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;
|
|
3275
3232
|
}
|
|
3276
3233
|
}
|
|
3277
|
-
|
|
3278
|
-
if (pre[index + 1] === `
|
|
3234
|
+
if (preString[i + 1] === `
|
|
3279
3235
|
`) {
|
|
3280
3236
|
if (escapeUrl) {
|
|
3281
3237
|
returnValue += wrapAnsiHyperlink("");
|
|
3282
3238
|
}
|
|
3283
|
-
|
|
3284
|
-
|
|
3239
|
+
const closingCode = escapeCode ? getClosingCode(escapeCode) : undefined;
|
|
3240
|
+
if (escapeCode && closingCode) {
|
|
3241
|
+
returnValue += wrapAnsiCode(closingCode);
|
|
3285
3242
|
}
|
|
3286
3243
|
} else if (character === `
|
|
3287
3244
|
`) {
|
|
3288
|
-
if (escapeCode &&
|
|
3245
|
+
if (escapeCode && getClosingCode(escapeCode)) {
|
|
3289
3246
|
returnValue += wrapAnsiCode(escapeCode);
|
|
3290
3247
|
}
|
|
3291
3248
|
if (escapeUrl) {
|
|
3292
3249
|
returnValue += wrapAnsiHyperlink(escapeUrl);
|
|
3293
3250
|
}
|
|
3294
3251
|
}
|
|
3295
|
-
preStringIndex += character.length;
|
|
3296
3252
|
}
|
|
3297
3253
|
return returnValue;
|
|
3298
3254
|
};
|
|
3255
|
+
var CRLF_OR_LF = /\r?\n/;
|
|
3299
3256
|
function wrapAnsi(string, columns, options) {
|
|
3300
|
-
return String(string).normalize().
|
|
3301
|
-
`, `
|
|
3302
|
-
`).split(`
|
|
3303
|
-
`).map((line) => exec(line, columns, options)).join(`
|
|
3257
|
+
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join(`
|
|
3304
3258
|
`);
|
|
3305
3259
|
}
|
|
3306
3260
|
|
|
3307
|
-
// node_modules/@inquirer/core/dist/lib/utils.js
|
|
3261
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/utils.js
|
|
3308
3262
|
function breakLines(content, width) {
|
|
3309
|
-
return content.
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
`
|
|
3263
|
+
return wrapContent(content, width).text;
|
|
3264
|
+
}
|
|
3265
|
+
function wrapContent(content, width) {
|
|
3266
|
+
const wrappedLines = content.split(`
|
|
3267
|
+
`).map((line) => wrapAnsi(line, width, { trim: false, wordWrap: false }).split(`
|
|
3268
|
+
`));
|
|
3269
|
+
const finalLine = wrappedLines.at(-1) ?? [];
|
|
3270
|
+
return {
|
|
3271
|
+
text: wrappedLines.flat().map((line) => line.trimEnd()).join(`
|
|
3272
|
+
`),
|
|
3273
|
+
lastRow: finalLine.at(-1) ?? "",
|
|
3274
|
+
finalLineRows: finalLine.length
|
|
3275
|
+
};
|
|
3313
3276
|
}
|
|
3314
3277
|
function readlineWidth() {
|
|
3315
3278
|
return import_cli_width.default({ defaultWidth: 80, output: readline().output });
|
|
3316
3279
|
}
|
|
3317
3280
|
|
|
3318
|
-
// node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
3281
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/pagination/use-pagination.js
|
|
3319
3282
|
function usePointerPosition({ active, renderedItems, pageSize, loop }) {
|
|
3320
3283
|
const state = useRef({
|
|
3321
3284
|
lastPointer: active,
|
|
@@ -3381,12 +3344,25 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
3381
3344
|
return pageBuffer.filter((line) => typeof line === "string").join(`
|
|
3382
3345
|
`);
|
|
3383
3346
|
}
|
|
3384
|
-
// node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
3385
|
-
var import_mute_stream = __toESM(require_lib(), 1);
|
|
3347
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
3386
3348
|
import * as readline2 from "node:readline";
|
|
3387
3349
|
import { AsyncResource as AsyncResource3 } from "node:async_hooks";
|
|
3388
3350
|
|
|
3389
|
-
// node_modules/
|
|
3351
|
+
// ../../node_modules/.bun/@inquirer+type@4.3.1+5e10526c4bd1f370/node_modules/@inquirer/type/dist/utils.js
|
|
3352
|
+
function withResolver() {
|
|
3353
|
+
let resolve;
|
|
3354
|
+
let reject;
|
|
3355
|
+
const promise = new Promise((res, rej) => {
|
|
3356
|
+
resolve = res;
|
|
3357
|
+
reject = rej;
|
|
3358
|
+
});
|
|
3359
|
+
return { promise, resolve, reject };
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3362
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
3363
|
+
var import_mute_stream = __toESM(require_lib(), 1);
|
|
3364
|
+
|
|
3365
|
+
// ../../node_modules/.bun/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
|
3390
3366
|
var signals = [];
|
|
3391
3367
|
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
|
3392
3368
|
if (process.platform !== "win32") {
|
|
@@ -3396,7 +3372,7 @@ if (process.platform === "linux") {
|
|
|
3396
3372
|
signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
|
3397
3373
|
}
|
|
3398
3374
|
|
|
3399
|
-
// node_modules/signal-exit/dist/mjs/index.js
|
|
3375
|
+
// ../../node_modules/.bun/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
|
3400
3376
|
var processOk = (process3) => !!process3 && typeof process3 === "object" && typeof process3.removeListener === "function" && typeof process3.emit === "function" && typeof process3.reallyExit === "function" && typeof process3.listeners === "function" && typeof process3.kill === "function" && typeof process3.pid === "number" && typeof process3.on === "function";
|
|
3401
3377
|
var kExitEmitter = Symbol.for("signal-exit emitter");
|
|
3402
3378
|
var global = globalThis;
|
|
@@ -3594,26 +3570,26 @@ var {
|
|
|
3594
3570
|
unload
|
|
3595
3571
|
} = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback);
|
|
3596
3572
|
|
|
3597
|
-
// node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
3573
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
3598
3574
|
import { stripVTControlCharacters } from "node:util";
|
|
3599
3575
|
|
|
3600
|
-
// node_modules/@inquirer/ansi/dist/index.js
|
|
3601
|
-
var
|
|
3602
|
-
var cursorLeft =
|
|
3603
|
-
var cursorHide =
|
|
3604
|
-
var cursorShow =
|
|
3605
|
-
var cursorUp = (rows = 1) => rows > 0 ? `${
|
|
3606
|
-
var cursorDown = (rows = 1) => rows > 0 ? `${
|
|
3576
|
+
// ../../node_modules/.bun/@inquirer+ansi@2.1.1/node_modules/@inquirer/ansi/dist/index.js
|
|
3577
|
+
var ESC2 = "\x1B[";
|
|
3578
|
+
var cursorLeft = ESC2 + "G";
|
|
3579
|
+
var cursorHide = ESC2 + "?25l";
|
|
3580
|
+
var cursorShow = ESC2 + "?25h";
|
|
3581
|
+
var cursorUp = (rows = 1) => rows > 0 ? `${ESC2}${rows}A` : "";
|
|
3582
|
+
var cursorDown = (rows = 1) => rows > 0 ? `${ESC2}${rows}B` : "";
|
|
3607
3583
|
var cursorTo = (x, y) => {
|
|
3608
3584
|
if (typeof y === "number" && !Number.isNaN(y)) {
|
|
3609
|
-
return `${
|
|
3585
|
+
return `${ESC2}${y + 1};${x + 1}H`;
|
|
3610
3586
|
}
|
|
3611
|
-
return `${
|
|
3587
|
+
return `${ESC2}${x + 1}G`;
|
|
3612
3588
|
};
|
|
3613
|
-
var eraseLine =
|
|
3589
|
+
var eraseLine = ESC2 + "2K";
|
|
3614
3590
|
var eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + eraseLine + cursorLeft : "";
|
|
3615
3591
|
|
|
3616
|
-
// node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
3592
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
3617
3593
|
var height = (content) => content.split(`
|
|
3618
3594
|
`).length;
|
|
3619
3595
|
var lastLine = (content) => content.split(`
|
|
@@ -3643,15 +3619,18 @@ class ScreenManager {
|
|
|
3643
3619
|
this.rl.setPrompt(prompt);
|
|
3644
3620
|
this.cursorPos = this.rl.getCursorPos();
|
|
3645
3621
|
const width = readlineWidth();
|
|
3646
|
-
|
|
3622
|
+
const wrapped = wrapContent(content, width);
|
|
3623
|
+
content = wrapped.text;
|
|
3647
3624
|
bottomContent = breakLines(bottomContent, width);
|
|
3648
|
-
|
|
3625
|
+
const lastRowWidth = dist_default3(stripVTControlCharacters(wrapped.lastRow));
|
|
3626
|
+
const atRightEdge = lastRowWidth >= width;
|
|
3627
|
+
if (atRightEdge || rawPromptLine.length === 0) {
|
|
3649
3628
|
content += `
|
|
3650
3629
|
`;
|
|
3651
3630
|
}
|
|
3652
3631
|
let output = content + (bottomContent ? `
|
|
3653
3632
|
` + bottomContent : "");
|
|
3654
|
-
const promptLineUpDiff =
|
|
3633
|
+
const promptLineUpDiff = wrapped.finalLineRows - 1 + Number(atRightEdge) - this.cursorPos.rows;
|
|
3655
3634
|
const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);
|
|
3656
3635
|
if (bottomContentHeight > 0)
|
|
3657
3636
|
output += cursorUp(bottomContentHeight);
|
|
@@ -3672,28 +3651,27 @@ class ScreenManager {
|
|
|
3672
3651
|
let output = cursorDown(this.extraLinesUnderPrompt);
|
|
3673
3652
|
output += clearContent ? eraseLines(this.height) : `
|
|
3674
3653
|
`;
|
|
3654
|
+
output += cursorLeft;
|
|
3675
3655
|
output += cursorShow;
|
|
3676
3656
|
this.write(output);
|
|
3677
3657
|
this.rl.close();
|
|
3678
3658
|
}
|
|
3679
3659
|
}
|
|
3680
3660
|
|
|
3681
|
-
// node_modules/@inquirer/core/dist/lib/
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
});
|
|
3690
|
-
return { promise, resolve, reject };
|
|
3661
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
3662
|
+
import path from "node:path";
|
|
3663
|
+
var nativeSetImmediate = globalThis.setImmediate;
|
|
3664
|
+
var nativeClearImmediate = globalThis.clearImmediate;
|
|
3665
|
+
function listenTo(target, event, listener) {
|
|
3666
|
+
if ("on" in target) {
|
|
3667
|
+
target.on(event, listener);
|
|
3668
|
+
return () => target.removeListener(event, listener);
|
|
3691
3669
|
}
|
|
3670
|
+
target.addEventListener(event, listener);
|
|
3671
|
+
return () => target.removeEventListener(event, listener);
|
|
3692
3672
|
}
|
|
3693
|
-
|
|
3694
|
-
// node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
3695
3673
|
function getCallSites() {
|
|
3696
|
-
const
|
|
3674
|
+
const savedPrepareStackTrace = Error.prepareStackTrace;
|
|
3697
3675
|
let result = [];
|
|
3698
3676
|
try {
|
|
3699
3677
|
Error.prepareStackTrace = (_, callSites) => {
|
|
@@ -3705,7 +3683,7 @@ function getCallSites() {
|
|
|
3705
3683
|
} catch {
|
|
3706
3684
|
return result;
|
|
3707
3685
|
}
|
|
3708
|
-
Error.prepareStackTrace =
|
|
3686
|
+
Error.prepareStackTrace = savedPrepareStackTrace;
|
|
3709
3687
|
return result;
|
|
3710
3688
|
}
|
|
3711
3689
|
function createPrompt(view) {
|
|
@@ -3720,64 +3698,88 @@ function createPrompt(view) {
|
|
|
3720
3698
|
input,
|
|
3721
3699
|
output
|
|
3722
3700
|
});
|
|
3701
|
+
output.mute();
|
|
3723
3702
|
const screen = new ScreenManager(rl);
|
|
3724
|
-
const { promise, resolve, reject } =
|
|
3725
|
-
const cancel = () => reject(new CancelPromptError);
|
|
3726
|
-
if (signal) {
|
|
3727
|
-
const abort = () => reject(new AbortPromptError({ cause: signal.reason }));
|
|
3728
|
-
if (signal.aborted) {
|
|
3729
|
-
abort();
|
|
3730
|
-
return Object.assign(promise, { cancel });
|
|
3731
|
-
}
|
|
3732
|
-
signal.addEventListener("abort", abort);
|
|
3733
|
-
cleanups.add(() => signal.removeEventListener("abort", abort));
|
|
3734
|
-
}
|
|
3735
|
-
cleanups.add(onExit((code, signal2) => {
|
|
3736
|
-
reject(new ExitPromptError(`User force closed the prompt with ${code} ${signal2}`));
|
|
3737
|
-
}));
|
|
3738
|
-
const sigint = () => reject(new ExitPromptError(`User force closed the prompt with SIGINT`));
|
|
3739
|
-
rl.on("SIGINT", sigint);
|
|
3740
|
-
cleanups.add(() => rl.removeListener("SIGINT", sigint));
|
|
3741
|
-
const checkCursorPos = () => screen.checkCursorPos();
|
|
3742
|
-
rl.input.on("keypress", checkCursorPos);
|
|
3743
|
-
cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
|
|
3703
|
+
const { promise, resolve, reject } = withResolver();
|
|
3744
3704
|
return withHooks(rl, (cycle) => {
|
|
3745
|
-
const
|
|
3746
|
-
|
|
3747
|
-
cleanups.add(() => rl.removeListener("close", hooksCleanup));
|
|
3748
|
-
cycle(() => {
|
|
3705
|
+
const clearEffects = AsyncResource3.bind(() => effectScheduler.clearAll());
|
|
3706
|
+
const settlePrompt = (settle) => {
|
|
3749
3707
|
try {
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
});
|
|
3753
|
-
if (nextView === undefined) {
|
|
3754
|
-
const callerFilename = callSites[1]?.getFileName();
|
|
3755
|
-
throw new Error(`Prompt functions must return a string.
|
|
3756
|
-
at ${callerFilename}`);
|
|
3757
|
-
}
|
|
3758
|
-
const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
|
|
3759
|
-
screen.render(content, bottomContent);
|
|
3760
|
-
effectScheduler.run();
|
|
3708
|
+
clearEffects();
|
|
3709
|
+
settle();
|
|
3761
3710
|
} catch (error) {
|
|
3762
3711
|
reject(error);
|
|
3763
3712
|
}
|
|
3764
|
-
}
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
}, (error) => {
|
|
3769
|
-
effectScheduler.clearAll();
|
|
3770
|
-
throw error;
|
|
3771
|
-
}).finally(() => {
|
|
3713
|
+
};
|
|
3714
|
+
const resolvePrompt = (value) => settlePrompt(() => resolve(value));
|
|
3715
|
+
const rejectPrompt = (error) => settlePrompt(() => reject(error));
|
|
3716
|
+
const promptPromise = Object.assign(promise.finally(() => {
|
|
3772
3717
|
cleanups.forEach((cleanup) => cleanup());
|
|
3773
3718
|
screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
|
|
3774
3719
|
output.end();
|
|
3775
|
-
}).then(() => promise), { cancel });
|
|
3720
|
+
}).then(() => promise), { cancel: () => rejectPrompt(new CancelPromptError) });
|
|
3721
|
+
if (signal) {
|
|
3722
|
+
const abort = () => rejectPrompt(new AbortPromptError({ cause: signal.reason }));
|
|
3723
|
+
if (signal.aborted) {
|
|
3724
|
+
abort();
|
|
3725
|
+
return promptPromise;
|
|
3726
|
+
}
|
|
3727
|
+
cleanups.add(listenTo(signal, "abort", abort));
|
|
3728
|
+
}
|
|
3729
|
+
cleanups.add(onExit((code, signal2) => {
|
|
3730
|
+
rejectPrompt(new ExitPromptError(`User force closed the prompt with ${code} ${signal2}`));
|
|
3731
|
+
}));
|
|
3732
|
+
cleanups.add(listenTo(rl, "SIGINT", () => rejectPrompt(new ExitPromptError(`User force closed the prompt with SIGINT`))));
|
|
3733
|
+
const isTTY = "isTTY" in input && input.isTTY;
|
|
3734
|
+
const onReadlineClose = isTTY ? () => rejectPrompt(new ExitPromptError("User force closed the prompt with EOF")) : clearEffects;
|
|
3735
|
+
cleanups.add(listenTo(rl, "close", onReadlineClose));
|
|
3736
|
+
const startCycle = () => {
|
|
3737
|
+
cleanups.add(listenTo(rl.input, "keypress", () => screen.checkCursorPos()));
|
|
3738
|
+
let pendingDone = null;
|
|
3739
|
+
cycle(() => {
|
|
3740
|
+
let effectsSettled = false;
|
|
3741
|
+
try {
|
|
3742
|
+
const nextView = view(config, (value) => {
|
|
3743
|
+
if (effectsSettled) {
|
|
3744
|
+
resolvePrompt(value);
|
|
3745
|
+
} else {
|
|
3746
|
+
pendingDone = { value };
|
|
3747
|
+
}
|
|
3748
|
+
});
|
|
3749
|
+
if (nextView === undefined) {
|
|
3750
|
+
let callerFilename = callSites[1]?.getFileName();
|
|
3751
|
+
if (callerFilename && !callerFilename.startsWith("file://")) {
|
|
3752
|
+
callerFilename = path.resolve(callerFilename);
|
|
3753
|
+
}
|
|
3754
|
+
throw new Error(`Prompt functions must return a string.
|
|
3755
|
+
at ${callerFilename}`);
|
|
3756
|
+
}
|
|
3757
|
+
const [content, bottomContent] = typeof nextView === "string" ? [nextView] : nextView;
|
|
3758
|
+
screen.render(content, bottomContent);
|
|
3759
|
+
effectScheduler.run();
|
|
3760
|
+
} catch (error) {
|
|
3761
|
+
rejectPrompt(error);
|
|
3762
|
+
}
|
|
3763
|
+
effectsSettled = true;
|
|
3764
|
+
if (pendingDone !== null) {
|
|
3765
|
+
const { value } = pendingDone;
|
|
3766
|
+
pendingDone = null;
|
|
3767
|
+
resolvePrompt(value);
|
|
3768
|
+
}
|
|
3769
|
+
});
|
|
3770
|
+
};
|
|
3771
|
+
if ("readableFlowing" in input && isTTY) {
|
|
3772
|
+
const immediate = nativeSetImmediate(startCycle);
|
|
3773
|
+
cleanups.add(() => nativeClearImmediate(immediate));
|
|
3774
|
+
} else {
|
|
3775
|
+
startCycle();
|
|
3776
|
+
}
|
|
3777
|
+
return promptPromise;
|
|
3776
3778
|
});
|
|
3777
3779
|
};
|
|
3778
3780
|
return prompt;
|
|
3779
3781
|
}
|
|
3780
|
-
// node_modules/@inquirer/core/dist/lib/Separator.js
|
|
3782
|
+
// ../../node_modules/.bun/@inquirer+core@12.1.1+5e10526c4bd1f370/node_modules/@inquirer/core/dist/lib/Separator.js
|
|
3781
3783
|
import { styleText as styleText2 } from "node:util";
|
|
3782
3784
|
class Separator {
|
|
3783
3785
|
separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
|
|
@@ -3791,21 +3793,25 @@ class Separator {
|
|
|
3791
3793
|
return Boolean(choice && typeof choice === "object" && "type" in choice && choice.type === "separator");
|
|
3792
3794
|
}
|
|
3793
3795
|
}
|
|
3794
|
-
// node_modules/@inquirer/select/dist/index.js
|
|
3796
|
+
// ../../node_modules/.bun/@inquirer+select@5.3.1+5e10526c4bd1f370/node_modules/@inquirer/select/dist/index.js
|
|
3795
3797
|
import { styleText as styleText3 } from "node:util";
|
|
3798
|
+
var numberLineRegex = /^\d+$/;
|
|
3796
3799
|
var selectTheme = {
|
|
3797
3800
|
icon: { cursor: dist_default.pointer },
|
|
3798
3801
|
style: {
|
|
3799
|
-
disabled: (text) => styleText3("dim",
|
|
3802
|
+
disabled: (text) => styleText3("dim", text),
|
|
3800
3803
|
description: (text) => styleText3("cyan", text),
|
|
3801
3804
|
keysHelpTip: (keys) => keys.map(([key, action]) => `${styleText3("bold", key)} ${styleText3("dim", action)}`).join(styleText3("dim", " • "))
|
|
3802
3805
|
},
|
|
3803
|
-
|
|
3804
|
-
|
|
3806
|
+
i18n: { disabledError: "This option is disabled and cannot be selected." },
|
|
3807
|
+
indexMode: "hidden"
|
|
3805
3808
|
};
|
|
3806
3809
|
function isSelectable(item) {
|
|
3807
3810
|
return !Separator.isSeparator(item) && !item.disabled;
|
|
3808
3811
|
}
|
|
3812
|
+
function isNavigable(item) {
|
|
3813
|
+
return !Separator.isSeparator(item);
|
|
3814
|
+
}
|
|
3809
3815
|
function normalizeChoices(choices) {
|
|
3810
3816
|
return choices.map((choice) => {
|
|
3811
3817
|
if (Separator.isSeparator(choice))
|
|
@@ -3832,18 +3838,18 @@ function normalizeChoices(choices) {
|
|
|
3832
3838
|
return normalizedChoice;
|
|
3833
3839
|
});
|
|
3834
3840
|
}
|
|
3835
|
-
var
|
|
3841
|
+
var dist_default4 = createPrompt((config, done) => {
|
|
3836
3842
|
const { loop = true, pageSize = 7 } = config;
|
|
3837
3843
|
const theme = makeTheme(selectTheme, config.theme);
|
|
3838
|
-
const { keybindings } = theme;
|
|
3844
|
+
const { keybindings: keybindings2 } = theme;
|
|
3839
3845
|
const [status, setStatus] = useState("idle");
|
|
3840
3846
|
const prefix = usePrefix({ status, theme });
|
|
3841
3847
|
const searchTimeoutRef = useRef();
|
|
3842
|
-
const searchEnabled = !
|
|
3848
|
+
const searchEnabled = !keybindings2.includes("vim");
|
|
3843
3849
|
const items = useMemo(() => normalizeChoices(config.choices), [config.choices]);
|
|
3844
3850
|
const bounds = useMemo(() => {
|
|
3845
|
-
const first = items.findIndex(
|
|
3846
|
-
const last = items.findLastIndex(
|
|
3851
|
+
const first = items.findIndex(isNavigable);
|
|
3852
|
+
const last = items.findLastIndex(isNavigable);
|
|
3847
3853
|
if (first === -1) {
|
|
3848
3854
|
throw new ValidationError("[select prompt] No selectable choices. All choices are disabled.");
|
|
3849
3855
|
}
|
|
@@ -3856,22 +3862,33 @@ var dist_default2 = createPrompt((config, done) => {
|
|
|
3856
3862
|
}, [config.default, items]);
|
|
3857
3863
|
const [active, setActive] = useState(defaultItemIndex === -1 ? bounds.first : defaultItemIndex);
|
|
3858
3864
|
const selectedChoice = items[active];
|
|
3865
|
+
if (selectedChoice == null || Separator.isSeparator(selectedChoice)) {
|
|
3866
|
+
throw new Error("Active index does not point to a choice");
|
|
3867
|
+
}
|
|
3868
|
+
const [errorMsg, setError] = useState();
|
|
3859
3869
|
useKeypress((key, rl) => {
|
|
3860
3870
|
clearTimeout(searchTimeoutRef.current);
|
|
3871
|
+
if (errorMsg) {
|
|
3872
|
+
setError(undefined);
|
|
3873
|
+
}
|
|
3861
3874
|
if (isEnterKey(key)) {
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3875
|
+
if (selectedChoice.disabled) {
|
|
3876
|
+
setError(theme.i18n.disabledError);
|
|
3877
|
+
} else {
|
|
3878
|
+
setStatus("done");
|
|
3879
|
+
done(selectedChoice.value);
|
|
3880
|
+
}
|
|
3881
|
+
} else if (isUpKey(key, keybindings2) || isDownKey(key, keybindings2)) {
|
|
3865
3882
|
rl.clearLine(0);
|
|
3866
|
-
if (loop || isUpKey(key,
|
|
3867
|
-
const offset = isUpKey(key,
|
|
3883
|
+
if (loop || isUpKey(key, keybindings2) && active !== bounds.first || isDownKey(key, keybindings2) && active !== bounds.last) {
|
|
3884
|
+
const offset = isUpKey(key, keybindings2) ? -1 : 1;
|
|
3868
3885
|
let next = active;
|
|
3869
3886
|
do {
|
|
3870
3887
|
next = (next + offset + items.length) % items.length;
|
|
3871
|
-
} while (!
|
|
3888
|
+
} while (!isNavigable(items[next]));
|
|
3872
3889
|
setActive(next);
|
|
3873
3890
|
}
|
|
3874
|
-
} else if (isNumberKey(key) &&
|
|
3891
|
+
} else if (isNumberKey(key) && numberLineRegex.test(rl.line)) {
|
|
3875
3892
|
const selectedIndex = Number(rl.line) - 1;
|
|
3876
3893
|
let selectableIndex = -1;
|
|
3877
3894
|
const position = items.findIndex((item2) => {
|
|
@@ -3921,13 +3938,14 @@ var dist_default2 = createPrompt((config, done) => {
|
|
|
3921
3938
|
separatorCount++;
|
|
3922
3939
|
return ` ${item.separator}`;
|
|
3923
3940
|
}
|
|
3941
|
+
const cursor = isActive ? theme.icon.cursor : " ";
|
|
3924
3942
|
const indexLabel = theme.indexMode === "number" ? `${index + 1 - separatorCount}. ` : "";
|
|
3925
3943
|
if (item.disabled) {
|
|
3926
3944
|
const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
|
|
3927
|
-
|
|
3945
|
+
const disabledCursor = isActive ? theme.icon.cursor : "-";
|
|
3946
|
+
return theme.style.disabled(`${disabledCursor} ${indexLabel}${item.name} ${disabledLabel}`);
|
|
3928
3947
|
}
|
|
3929
3948
|
const color = isActive ? theme.style.highlight : (x) => x;
|
|
3930
|
-
const cursor = isActive ? theme.icon.cursor : ` `;
|
|
3931
3949
|
return color(`${cursor} ${indexLabel}${item.name}`);
|
|
3932
3950
|
},
|
|
3933
3951
|
pageSize,
|
|
@@ -3942,6 +3960,7 @@ var dist_default2 = createPrompt((config, done) => {
|
|
|
3942
3960
|
page,
|
|
3943
3961
|
" ",
|
|
3944
3962
|
description ? theme.style.description(description) : "",
|
|
3963
|
+
errorMsg ? theme.style.error(errorMsg) : "",
|
|
3945
3964
|
helpLine
|
|
3946
3965
|
].filter(Boolean).join(`
|
|
3947
3966
|
`).trimEnd();
|
|
@@ -4320,22 +4339,241 @@ ${DIM}── ${timestamp()} ─────────────────
|
|
|
4320
4339
|
await sleep(waitSeconds);
|
|
4321
4340
|
}
|
|
4322
4341
|
}
|
|
4342
|
+
// ../../packages/core/src/git.ts
|
|
4343
|
+
import { execFile } from "node:child_process";
|
|
4344
|
+
import { promisify } from "node:util";
|
|
4345
|
+
var execFileAsync = promisify(execFile);
|
|
4346
|
+
function githubSlug(remoteUrl) {
|
|
4347
|
+
if (!remoteUrl)
|
|
4348
|
+
return null;
|
|
4349
|
+
const match = remoteUrl.match(/github\.com[:/]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);
|
|
4350
|
+
return match ? `${match[1]}/${match[2]}` : null;
|
|
4351
|
+
}
|
|
4352
|
+
// ../../packages/core/src/discover.ts
|
|
4353
|
+
var SKIPPED = new Set([
|
|
4354
|
+
"node_modules",
|
|
4355
|
+
"vendor",
|
|
4356
|
+
"Library",
|
|
4357
|
+
"Applications",
|
|
4358
|
+
"Pictures",
|
|
4359
|
+
"Music",
|
|
4360
|
+
"Movies",
|
|
4361
|
+
"Public",
|
|
4362
|
+
"snap",
|
|
4363
|
+
"go",
|
|
4364
|
+
"target",
|
|
4365
|
+
"dist",
|
|
4366
|
+
"build",
|
|
4367
|
+
"tmp"
|
|
4368
|
+
]);
|
|
4369
|
+
// ../../packages/core/src/projects.ts
|
|
4370
|
+
var SOURCE_KINDS = ["github", "sentry", "linear", "jira"];
|
|
4371
|
+
// ../../packages/core/src/evidence.ts
|
|
4372
|
+
import { execFile as execFile2 } from "node:child_process";
|
|
4373
|
+
import { existsSync as existsSync3 } from "node:fs";
|
|
4374
|
+
import { appendFile, mkdir, mkdtemp, readFile, rm } from "node:fs/promises";
|
|
4375
|
+
import { tmpdir } from "node:os";
|
|
4376
|
+
import { basename, dirname, join as join4, resolve } from "node:path";
|
|
4377
|
+
import { pathToFileURL } from "node:url";
|
|
4378
|
+
import { promisify as promisify2 } from "node:util";
|
|
4379
|
+
var execFileAsync2 = promisify2(execFile2);
|
|
4380
|
+
var EVIDENCE_BRANCH = "mdless-evidence";
|
|
4381
|
+
var CHROME_PATHS = [
|
|
4382
|
+
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
|
|
4383
|
+
"/Applications/Chromium.app/Contents/MacOS/Chromium",
|
|
4384
|
+
"/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary",
|
|
4385
|
+
"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge",
|
|
4386
|
+
"/Applications/Brave Browser.app/Contents/MacOS/Brave Browser",
|
|
4387
|
+
"/usr/bin/google-chrome",
|
|
4388
|
+
"/usr/bin/google-chrome-stable",
|
|
4389
|
+
"/usr/bin/chromium",
|
|
4390
|
+
"/usr/bin/chromium-browser",
|
|
4391
|
+
"/snap/bin/chromium"
|
|
4392
|
+
];
|
|
4393
|
+
function findChrome(candidates = CHROME_PATHS, exists = existsSync3, env = process.env) {
|
|
4394
|
+
const all = env.MDLESS_CHROME ? [env.MDLESS_CHROME, ...candidates] : candidates;
|
|
4395
|
+
return all.find((path2) => exists(path2)) ?? null;
|
|
4396
|
+
}
|
|
4397
|
+
async function renderHtmlToPng(htmlPath, outPng, options = {}) {
|
|
4398
|
+
const { width = 1200, height: height2 = 800 } = options;
|
|
4399
|
+
const chrome = options.chromePath ?? findChrome(options.searchPaths);
|
|
4400
|
+
if (!chrome) {
|
|
4401
|
+
throw new Error("Chrome or Chromium not found. Install Google Chrome, or set MDLESS_CHROME to the path of a Chromium-based browser.");
|
|
4402
|
+
}
|
|
4403
|
+
const html = resolve(htmlPath);
|
|
4404
|
+
if (!existsSync3(html))
|
|
4405
|
+
throw new Error(`HTML file not found: ${htmlPath}`);
|
|
4406
|
+
const out = resolve(outPng);
|
|
4407
|
+
await mkdir(dirname(out), { recursive: true });
|
|
4408
|
+
await execFileAsync2(chrome, [
|
|
4409
|
+
"--headless=new",
|
|
4410
|
+
"--disable-gpu",
|
|
4411
|
+
"--hide-scrollbars",
|
|
4412
|
+
"--no-first-run",
|
|
4413
|
+
"--no-default-browser-check",
|
|
4414
|
+
`--screenshot=${out}`,
|
|
4415
|
+
`--window-size=${width},${height2}`,
|
|
4416
|
+
pathToFileURL(html).href
|
|
4417
|
+
], { timeout: 60000 });
|
|
4418
|
+
if (!existsSync3(out))
|
|
4419
|
+
throw new Error(`Chrome did not write ${outPng}`);
|
|
4420
|
+
return out;
|
|
4421
|
+
}
|
|
4422
|
+
function evidenceUrl(slug, prBranch, file) {
|
|
4423
|
+
const path2 = [...prBranch.split("/"), file].map(encodeURIComponent).join("/");
|
|
4424
|
+
return `https://github.com/${slug}/raw/${EVIDENCE_BRANCH}/${path2}`;
|
|
4425
|
+
}
|
|
4426
|
+
async function git(cwd, args, env) {
|
|
4427
|
+
const { stdout } = await execFileAsync2("git", args, { cwd, env: env ?? process.env, maxBuffer: 16 * 1024 * 1024 });
|
|
4428
|
+
return stdout.trim();
|
|
4429
|
+
}
|
|
4430
|
+
async function publishEvidence(repoPath, prBranch, files, options = {}) {
|
|
4431
|
+
const { remote = "origin" } = options;
|
|
4432
|
+
if (files.length === 0)
|
|
4433
|
+
throw new Error("No files to publish.");
|
|
4434
|
+
for (const file of files)
|
|
4435
|
+
if (!existsSync3(file))
|
|
4436
|
+
throw new Error(`File not found: ${file}`);
|
|
4437
|
+
const names = files.map((file) => basename(file));
|
|
4438
|
+
if (new Set(names).size !== names.length)
|
|
4439
|
+
throw new Error("Two files have the same name.");
|
|
4440
|
+
const remoteUrl = await git(repoPath, ["config", "--get", `remote.${remote}.url`]).catch(() => "");
|
|
4441
|
+
const slug = githubSlug(remoteUrl || null);
|
|
4442
|
+
if (!slug)
|
|
4443
|
+
throw new Error(`The "${remote}" remote is not a GitHub repository.`);
|
|
4444
|
+
const tmp = await mkdtemp(join4(tmpdir(), "mdless-evidence-"));
|
|
4445
|
+
const env = { ...process.env, GIT_INDEX_FILE: join4(tmp, "index") };
|
|
4446
|
+
const trackingRef = `refs/remotes/${remote}/${EVIDENCE_BRANCH}`;
|
|
4447
|
+
try {
|
|
4448
|
+
for (let attempt = 0;; attempt++) {
|
|
4449
|
+
await rm(env.GIT_INDEX_FILE, { force: true });
|
|
4450
|
+
await git(repoPath, ["fetch", remote, `+refs/heads/${EVIDENCE_BRANCH}:${trackingRef}`]).catch(() => "");
|
|
4451
|
+
const parent = await git(repoPath, ["rev-parse", "--verify", "--quiet", trackingRef]).catch(() => "");
|
|
4452
|
+
await git(repoPath, parent ? ["read-tree", parent] : ["read-tree", "--empty"], env);
|
|
4453
|
+
for (let i = 0;i < files.length; i++) {
|
|
4454
|
+
const blob = await git(repoPath, ["hash-object", "-w", resolve(files[i])]);
|
|
4455
|
+
await git(repoPath, ["update-index", "--add", "--cacheinfo", `100644,${blob},${prBranch}/${names[i]}`], env);
|
|
4456
|
+
}
|
|
4457
|
+
const tree = await git(repoPath, ["write-tree"], env);
|
|
4458
|
+
const message = options.message ?? `evidence: ${prBranch}`;
|
|
4459
|
+
const commit = await git(repoPath, ["commit-tree", tree, ...parent ? ["-p", parent] : [], "-m", message]);
|
|
4460
|
+
try {
|
|
4461
|
+
await git(repoPath, ["push", remote, `${commit}:refs/heads/${EVIDENCE_BRANCH}`]);
|
|
4462
|
+
await git(repoPath, ["update-ref", trackingRef, commit]).catch(() => "");
|
|
4463
|
+
break;
|
|
4464
|
+
} catch (err) {
|
|
4465
|
+
if (attempt >= 1)
|
|
4466
|
+
throw err;
|
|
4467
|
+
}
|
|
4468
|
+
}
|
|
4469
|
+
} finally {
|
|
4470
|
+
await rm(tmp, { recursive: true, force: true });
|
|
4471
|
+
}
|
|
4472
|
+
return names.map((name) => evidenceUrl(slug, prBranch, name));
|
|
4473
|
+
}
|
|
4474
|
+
var EVIDENCE_DIR = ".mdless-evidence";
|
|
4475
|
+
async function excludeEvidenceDir(repoPath) {
|
|
4476
|
+
const excludePath = resolve(repoPath, await git(repoPath, ["rev-parse", "--git-path", "info/exclude"]));
|
|
4477
|
+
const entry = `${EVIDENCE_DIR}/`;
|
|
4478
|
+
const existing = existsSync3(excludePath) ? await readFile(excludePath, "utf8") : "";
|
|
4479
|
+
if (existing.split(`
|
|
4480
|
+
`).some((line) => line.trim() === entry))
|
|
4481
|
+
return;
|
|
4482
|
+
await mkdir(dirname(excludePath), { recursive: true });
|
|
4483
|
+
const prefix = !existing || existing.endsWith(`
|
|
4484
|
+
`) ? "" : `
|
|
4485
|
+
`;
|
|
4486
|
+
await appendFile(excludePath, `${prefix}${entry}
|
|
4487
|
+
`);
|
|
4488
|
+
}
|
|
4489
|
+
async function currentBranch(repoPath) {
|
|
4490
|
+
const branch = await git(repoPath, ["rev-parse", "--abbrev-ref", "HEAD"]);
|
|
4491
|
+
if (!branch || branch === "HEAD")
|
|
4492
|
+
throw new Error("Not on a branch.");
|
|
4493
|
+
return branch;
|
|
4494
|
+
}
|
|
4495
|
+
// ../../packages/core/src/sources.ts
|
|
4496
|
+
import { execFile as execFile3 } from "node:child_process";
|
|
4497
|
+
import { promisify as promisify3 } from "node:util";
|
|
4498
|
+
var execFileAsync3 = promisify3(execFile3);
|
|
4499
|
+
var SYNC_JSON_SCHEMA = JSON.stringify({
|
|
4500
|
+
type: "object",
|
|
4501
|
+
properties: {
|
|
4502
|
+
items: {
|
|
4503
|
+
type: "array",
|
|
4504
|
+
items: {
|
|
4505
|
+
type: "object",
|
|
4506
|
+
properties: {
|
|
4507
|
+
source: { type: "string", enum: [...SOURCE_KINDS] },
|
|
4508
|
+
sourceId: { type: "string" },
|
|
4509
|
+
sourceUrl: { type: "string" },
|
|
4510
|
+
title: { type: "string" },
|
|
4511
|
+
body: { type: "string" }
|
|
4512
|
+
},
|
|
4513
|
+
required: ["source", "sourceId", "title", "body"]
|
|
4514
|
+
}
|
|
4515
|
+
},
|
|
4516
|
+
staleSourceIds: {
|
|
4517
|
+
type: "array",
|
|
4518
|
+
items: { type: "string" }
|
|
4519
|
+
},
|
|
4520
|
+
errors: {
|
|
4521
|
+
type: "array",
|
|
4522
|
+
items: {
|
|
4523
|
+
type: "object",
|
|
4524
|
+
properties: {
|
|
4525
|
+
source: { type: "string" },
|
|
4526
|
+
message: { type: "string" }
|
|
4527
|
+
},
|
|
4528
|
+
required: ["source", "message"]
|
|
4529
|
+
}
|
|
4530
|
+
}
|
|
4531
|
+
},
|
|
4532
|
+
required: ["items", "staleSourceIds", "errors"]
|
|
4533
|
+
});
|
|
4534
|
+
// src/commands/evidence.ts
|
|
4535
|
+
function fail(err) {
|
|
4536
|
+
console.error(`✗ ${err instanceof Error ? err.message : String(err)}`);
|
|
4537
|
+
process.exit(1);
|
|
4538
|
+
}
|
|
4539
|
+
async function evidenceRenderCommand(html, png, options) {
|
|
4540
|
+
try {
|
|
4541
|
+
await excludeEvidenceDir(process.cwd()).catch(() => {});
|
|
4542
|
+
const out = await renderHtmlToPng(html, png, options);
|
|
4543
|
+
console.log(`✓ rendered ${out}`);
|
|
4544
|
+
} catch (err) {
|
|
4545
|
+
fail(err);
|
|
4546
|
+
}
|
|
4547
|
+
}
|
|
4548
|
+
async function evidencePublishCommand(files, options) {
|
|
4549
|
+
try {
|
|
4550
|
+
const cwd = process.cwd();
|
|
4551
|
+
const branch = options.branch ?? await currentBranch(cwd);
|
|
4552
|
+
const urls = await publishEvidence(cwd, branch, files);
|
|
4553
|
+
for (const url of urls) {
|
|
4554
|
+
const name = decodeURIComponent(url.split("/").pop() ?? "evidence").replace(/\.[^.]+$/, "");
|
|
4555
|
+
console.log(``);
|
|
4556
|
+
}
|
|
4557
|
+
} catch (err) {
|
|
4558
|
+
fail(err);
|
|
4559
|
+
}
|
|
4560
|
+
}
|
|
4323
4561
|
|
|
4324
4562
|
// src/commands/init.ts
|
|
4325
4563
|
import {
|
|
4326
4564
|
appendFileSync,
|
|
4327
4565
|
copyFileSync,
|
|
4328
|
-
existsSync as
|
|
4566
|
+
existsSync as existsSync4,
|
|
4329
4567
|
mkdirSync,
|
|
4330
4568
|
readFileSync as readFileSync3,
|
|
4331
4569
|
readdirSync as readdirSync2
|
|
4332
4570
|
} from "node:fs";
|
|
4333
|
-
import { join as
|
|
4334
|
-
var BUNDLED_PROMPTS_DIR =
|
|
4335
|
-
var GITIGNORE_ENTRIES = [".mdless/worktrees/"];
|
|
4571
|
+
import { join as join5 } from "node:path";
|
|
4572
|
+
var BUNDLED_PROMPTS_DIR = join5(PACKAGE_ROOT, "src", "agents", "prompts");
|
|
4573
|
+
var GITIGNORE_ENTRIES = [".mdless/worktrees/", ".mdless-evidence/"];
|
|
4336
4574
|
function ensureGitignore() {
|
|
4337
|
-
const gitignore =
|
|
4338
|
-
const existing =
|
|
4575
|
+
const gitignore = join5(process.cwd(), ".gitignore");
|
|
4576
|
+
const existing = existsSync4(gitignore) ? readFileSync3(gitignore, "utf8") : "";
|
|
4339
4577
|
const lines = new Set(existing.split(`
|
|
4340
4578
|
`).map((l) => l.trim()));
|
|
4341
4579
|
const missing = GITIGNORE_ENTRIES.filter((e) => !lines.has(e));
|
|
@@ -4351,7 +4589,7 @@ function ensureGitignore() {
|
|
|
4351
4589
|
}
|
|
4352
4590
|
}
|
|
4353
4591
|
async function initCommand() {
|
|
4354
|
-
const targetDir =
|
|
4592
|
+
const targetDir = join5(process.cwd(), ".mdless", "agents");
|
|
4355
4593
|
mkdirSync(targetDir, { recursive: true });
|
|
4356
4594
|
ensureGitignore();
|
|
4357
4595
|
const files = readdirSync2(BUNDLED_PROMPTS_DIR).filter((f) => f.endsWith(".md"));
|
|
@@ -4362,13 +4600,13 @@ async function initCommand() {
|
|
|
4362
4600
|
let copied = 0;
|
|
4363
4601
|
let skipped = 0;
|
|
4364
4602
|
for (const file of files) {
|
|
4365
|
-
const dest =
|
|
4366
|
-
if (
|
|
4603
|
+
const dest = join5(targetDir, file);
|
|
4604
|
+
if (existsSync4(dest)) {
|
|
4367
4605
|
console.log(`! ${file} already exists in .mdless/agents/ (skipped)`);
|
|
4368
4606
|
skipped++;
|
|
4369
4607
|
continue;
|
|
4370
4608
|
}
|
|
4371
|
-
copyFileSync(
|
|
4609
|
+
copyFileSync(join5(BUNDLED_PROMPTS_DIR, file), dest);
|
|
4372
4610
|
console.log(`✓ ${file}`);
|
|
4373
4611
|
copied++;
|
|
4374
4612
|
}
|
|
@@ -4411,7 +4649,7 @@ async function interactiveMode() {
|
|
|
4411
4649
|
console.log(banner);
|
|
4412
4650
|
console.log(`\x1B[2m Mind less, ship more. v${packageVersion()}\x1B[0m
|
|
4413
4651
|
`);
|
|
4414
|
-
const choice = await withExitHandler(
|
|
4652
|
+
const choice = await withExitHandler(dist_default4({
|
|
4415
4653
|
message: "What would you like to do?",
|
|
4416
4654
|
choices: [
|
|
4417
4655
|
...commands.map((cmd) => ({
|
|
@@ -4441,13 +4679,16 @@ program2.command("agent [name]").description("Run a single agent — reads the p
|
|
|
4441
4679
|
console.error("✗ no agents found — run `mdless init` to create the default prompts.");
|
|
4442
4680
|
process.exit(1);
|
|
4443
4681
|
}
|
|
4444
|
-
name = await withExitHandler(
|
|
4682
|
+
name = await withExitHandler(dist_default4({
|
|
4445
4683
|
message: "Which agent would you like to run?",
|
|
4446
4684
|
choices: agents.map((a) => ({ name: a, value: a }))
|
|
4447
4685
|
}));
|
|
4448
4686
|
}
|
|
4449
4687
|
agentCommand(name, options);
|
|
4450
4688
|
});
|
|
4689
|
+
var evidence2 = program2.command("evidence").description("Make and publish evidence (screenshots, diagrams) for a pull request");
|
|
4690
|
+
evidence2.command("render <html> <png>").description("Render an HTML file to a PNG with headless Chrome").option("--width <px>", "Width of the image", (v) => parseInt(v, 10)).option("--height <px>", "Height of the image", (v) => parseInt(v, 10)).action(evidenceRenderCommand);
|
|
4691
|
+
evidence2.command("publish <files...>").description("Push images to the mdless-evidence branch and print Markdown links for the PR body").option("--branch <name>", "PR branch the images belong to (default: the current branch)").action(evidencePublishCommand);
|
|
4451
4692
|
if (process.argv.length <= 2) {
|
|
4452
4693
|
interactiveMode();
|
|
4453
4694
|
} else {
|