@settlemint/sdk-mcp 1.1.16-pr3bed4c3a → 1.1.16-pr7a391c74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mcp.js +195 -453
- package/dist/mcp.js.map +10 -10
- package/package.json +5 -5
package/dist/mcp.js
CHANGED
|
@@ -37542,18 +37542,18 @@ var require_help = __commonJS((exports) => {
|
|
|
37542
37542
|
class Help {
|
|
37543
37543
|
constructor() {
|
|
37544
37544
|
this.helpWidth = undefined;
|
|
37545
|
-
this.minWidthToWrap = 40;
|
|
37546
37545
|
this.sortSubcommands = false;
|
|
37547
37546
|
this.sortOptions = false;
|
|
37548
37547
|
this.showGlobalOptions = false;
|
|
37549
37548
|
}
|
|
37550
|
-
prepareContext(contextOptions) {
|
|
37551
|
-
this.helpWidth = this.helpWidth ?? contextOptions.helpWidth ?? 80;
|
|
37552
|
-
}
|
|
37553
37549
|
visibleCommands(cmd) {
|
|
37554
37550
|
const visibleCommands = cmd.commands.filter((cmd2) => !cmd2._hidden);
|
|
37555
|
-
|
|
37556
|
-
|
|
37551
|
+
if (cmd._hasImplicitHelpCommand()) {
|
|
37552
|
+
const [, helpName, helpArgs] = cmd._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/);
|
|
37553
|
+
const helpCommand = cmd.createCommand(helpName).helpOption(false);
|
|
37554
|
+
helpCommand.description(cmd._helpCommandDescription);
|
|
37555
|
+
if (helpArgs)
|
|
37556
|
+
helpCommand.arguments(helpArgs);
|
|
37557
37557
|
visibleCommands.push(helpCommand);
|
|
37558
37558
|
}
|
|
37559
37559
|
if (this.sortSubcommands) {
|
|
@@ -37571,17 +37571,18 @@ var require_help = __commonJS((exports) => {
|
|
|
37571
37571
|
}
|
|
37572
37572
|
visibleOptions(cmd) {
|
|
37573
37573
|
const visibleOptions = cmd.options.filter((option) => !option.hidden);
|
|
37574
|
-
const
|
|
37575
|
-
|
|
37576
|
-
|
|
37577
|
-
|
|
37578
|
-
if (!
|
|
37579
|
-
|
|
37580
|
-
} else if (
|
|
37581
|
-
|
|
37582
|
-
} else
|
|
37583
|
-
|
|
37574
|
+
const showShortHelpFlag = cmd._hasHelpOption && cmd._helpShortFlag && !cmd._findOption(cmd._helpShortFlag);
|
|
37575
|
+
const showLongHelpFlag = cmd._hasHelpOption && !cmd._findOption(cmd._helpLongFlag);
|
|
37576
|
+
if (showShortHelpFlag || showLongHelpFlag) {
|
|
37577
|
+
let helpOption;
|
|
37578
|
+
if (!showShortHelpFlag) {
|
|
37579
|
+
helpOption = cmd.createOption(cmd._helpLongFlag, cmd._helpDescription);
|
|
37580
|
+
} else if (!showLongHelpFlag) {
|
|
37581
|
+
helpOption = cmd.createOption(cmd._helpShortFlag, cmd._helpDescription);
|
|
37582
|
+
} else {
|
|
37583
|
+
helpOption = cmd.createOption(cmd._helpFlags, cmd._helpDescription);
|
|
37584
37584
|
}
|
|
37585
|
+
visibleOptions.push(helpOption);
|
|
37585
37586
|
}
|
|
37586
37587
|
if (this.sortOptions) {
|
|
37587
37588
|
visibleOptions.sort(this.compareOptions);
|
|
@@ -37624,22 +37625,22 @@ var require_help = __commonJS((exports) => {
|
|
|
37624
37625
|
}
|
|
37625
37626
|
longestSubcommandTermLength(cmd, helper) {
|
|
37626
37627
|
return helper.visibleCommands(cmd).reduce((max, command) => {
|
|
37627
|
-
return Math.max(max,
|
|
37628
|
+
return Math.max(max, helper.subcommandTerm(command).length);
|
|
37628
37629
|
}, 0);
|
|
37629
37630
|
}
|
|
37630
37631
|
longestOptionTermLength(cmd, helper) {
|
|
37631
37632
|
return helper.visibleOptions(cmd).reduce((max, option) => {
|
|
37632
|
-
return Math.max(max,
|
|
37633
|
+
return Math.max(max, helper.optionTerm(option).length);
|
|
37633
37634
|
}, 0);
|
|
37634
37635
|
}
|
|
37635
37636
|
longestGlobalOptionTermLength(cmd, helper) {
|
|
37636
37637
|
return helper.visibleGlobalOptions(cmd).reduce((max, option) => {
|
|
37637
|
-
return Math.max(max,
|
|
37638
|
+
return Math.max(max, helper.optionTerm(option).length);
|
|
37638
37639
|
}, 0);
|
|
37639
37640
|
}
|
|
37640
37641
|
longestArgumentTermLength(cmd, helper) {
|
|
37641
37642
|
return helper.visibleArguments(cmd).reduce((max, argument) => {
|
|
37642
|
-
return Math.max(max,
|
|
37643
|
+
return Math.max(max, helper.argumentTerm(argument).length);
|
|
37643
37644
|
}, 0);
|
|
37644
37645
|
}
|
|
37645
37646
|
commandUsage(cmd) {
|
|
@@ -37690,199 +37691,95 @@ var require_help = __commonJS((exports) => {
|
|
|
37690
37691
|
extraInfo.push(`default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`);
|
|
37691
37692
|
}
|
|
37692
37693
|
if (extraInfo.length > 0) {
|
|
37693
|
-
const
|
|
37694
|
+
const extraDescripton = `(${extraInfo.join(", ")})`;
|
|
37694
37695
|
if (argument.description) {
|
|
37695
|
-
return `${argument.description} ${
|
|
37696
|
+
return `${argument.description} ${extraDescripton}`;
|
|
37696
37697
|
}
|
|
37697
|
-
return
|
|
37698
|
+
return extraDescripton;
|
|
37698
37699
|
}
|
|
37699
37700
|
return argument.description;
|
|
37700
37701
|
}
|
|
37701
37702
|
formatHelp(cmd, helper) {
|
|
37702
37703
|
const termWidth = helper.padWidth(cmd, helper);
|
|
37703
|
-
const helpWidth = helper.helpWidth
|
|
37704
|
-
|
|
37705
|
-
|
|
37704
|
+
const helpWidth = helper.helpWidth || 80;
|
|
37705
|
+
const itemIndentWidth = 2;
|
|
37706
|
+
const itemSeparatorWidth = 2;
|
|
37707
|
+
function formatItem(term, description) {
|
|
37708
|
+
if (description) {
|
|
37709
|
+
const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`;
|
|
37710
|
+
return helper.wrap(fullText, helpWidth - itemIndentWidth, termWidth + itemSeparatorWidth);
|
|
37711
|
+
}
|
|
37712
|
+
return term;
|
|
37706
37713
|
}
|
|
37707
|
-
|
|
37708
|
-
|
|
37709
|
-
|
|
37710
|
-
|
|
37714
|
+
function formatList(textArray) {
|
|
37715
|
+
return textArray.join(`
|
|
37716
|
+
`).replace(/^/gm, " ".repeat(itemIndentWidth));
|
|
37717
|
+
}
|
|
37718
|
+
let output = [`Usage: ${helper.commandUsage(cmd)}`, ""];
|
|
37711
37719
|
const commandDescription = helper.commandDescription(cmd);
|
|
37712
37720
|
if (commandDescription.length > 0) {
|
|
37713
|
-
output = output.concat([
|
|
37714
|
-
helper.boxWrap(helper.styleCommandDescription(commandDescription), helpWidth),
|
|
37715
|
-
""
|
|
37716
|
-
]);
|
|
37721
|
+
output = output.concat([helper.wrap(commandDescription, helpWidth, 0), ""]);
|
|
37717
37722
|
}
|
|
37718
37723
|
const argumentList = helper.visibleArguments(cmd).map((argument) => {
|
|
37719
|
-
return
|
|
37724
|
+
return formatItem(helper.argumentTerm(argument), helper.argumentDescription(argument));
|
|
37720
37725
|
});
|
|
37721
37726
|
if (argumentList.length > 0) {
|
|
37722
|
-
output = output.concat([
|
|
37723
|
-
helper.styleTitle("Arguments:"),
|
|
37724
|
-
...argumentList,
|
|
37725
|
-
""
|
|
37726
|
-
]);
|
|
37727
|
+
output = output.concat(["Arguments:", formatList(argumentList), ""]);
|
|
37727
37728
|
}
|
|
37728
37729
|
const optionList = helper.visibleOptions(cmd).map((option) => {
|
|
37729
|
-
return
|
|
37730
|
+
return formatItem(helper.optionTerm(option), helper.optionDescription(option));
|
|
37730
37731
|
});
|
|
37731
37732
|
if (optionList.length > 0) {
|
|
37732
|
-
output = output.concat([
|
|
37733
|
-
helper.styleTitle("Options:"),
|
|
37734
|
-
...optionList,
|
|
37735
|
-
""
|
|
37736
|
-
]);
|
|
37733
|
+
output = output.concat(["Options:", formatList(optionList), ""]);
|
|
37737
37734
|
}
|
|
37738
|
-
if (
|
|
37735
|
+
if (this.showGlobalOptions) {
|
|
37739
37736
|
const globalOptionList = helper.visibleGlobalOptions(cmd).map((option) => {
|
|
37740
|
-
return
|
|
37737
|
+
return formatItem(helper.optionTerm(option), helper.optionDescription(option));
|
|
37741
37738
|
});
|
|
37742
37739
|
if (globalOptionList.length > 0) {
|
|
37743
|
-
output = output.concat([
|
|
37744
|
-
helper.styleTitle("Global Options:"),
|
|
37745
|
-
...globalOptionList,
|
|
37746
|
-
""
|
|
37747
|
-
]);
|
|
37740
|
+
output = output.concat(["Global Options:", formatList(globalOptionList), ""]);
|
|
37748
37741
|
}
|
|
37749
37742
|
}
|
|
37750
37743
|
const commandList = helper.visibleCommands(cmd).map((cmd2) => {
|
|
37751
|
-
return
|
|
37744
|
+
return formatItem(helper.subcommandTerm(cmd2), helper.subcommandDescription(cmd2));
|
|
37752
37745
|
});
|
|
37753
37746
|
if (commandList.length > 0) {
|
|
37754
|
-
output = output.concat([
|
|
37755
|
-
helper.styleTitle("Commands:"),
|
|
37756
|
-
...commandList,
|
|
37757
|
-
""
|
|
37758
|
-
]);
|
|
37747
|
+
output = output.concat(["Commands:", formatList(commandList), ""]);
|
|
37759
37748
|
}
|
|
37760
37749
|
return output.join(`
|
|
37761
37750
|
`);
|
|
37762
37751
|
}
|
|
37763
|
-
displayWidth(str) {
|
|
37764
|
-
return stripColor(str).length;
|
|
37765
|
-
}
|
|
37766
|
-
styleTitle(str) {
|
|
37767
|
-
return str;
|
|
37768
|
-
}
|
|
37769
|
-
styleUsage(str) {
|
|
37770
|
-
return str.split(" ").map((word) => {
|
|
37771
|
-
if (word === "[options]")
|
|
37772
|
-
return this.styleOptionText(word);
|
|
37773
|
-
if (word === "[command]")
|
|
37774
|
-
return this.styleSubcommandText(word);
|
|
37775
|
-
if (word[0] === "[" || word[0] === "<")
|
|
37776
|
-
return this.styleArgumentText(word);
|
|
37777
|
-
return this.styleCommandText(word);
|
|
37778
|
-
}).join(" ");
|
|
37779
|
-
}
|
|
37780
|
-
styleCommandDescription(str) {
|
|
37781
|
-
return this.styleDescriptionText(str);
|
|
37782
|
-
}
|
|
37783
|
-
styleOptionDescription(str) {
|
|
37784
|
-
return this.styleDescriptionText(str);
|
|
37785
|
-
}
|
|
37786
|
-
styleSubcommandDescription(str) {
|
|
37787
|
-
return this.styleDescriptionText(str);
|
|
37788
|
-
}
|
|
37789
|
-
styleArgumentDescription(str) {
|
|
37790
|
-
return this.styleDescriptionText(str);
|
|
37791
|
-
}
|
|
37792
|
-
styleDescriptionText(str) {
|
|
37793
|
-
return str;
|
|
37794
|
-
}
|
|
37795
|
-
styleOptionTerm(str) {
|
|
37796
|
-
return this.styleOptionText(str);
|
|
37797
|
-
}
|
|
37798
|
-
styleSubcommandTerm(str) {
|
|
37799
|
-
return str.split(" ").map((word) => {
|
|
37800
|
-
if (word === "[options]")
|
|
37801
|
-
return this.styleOptionText(word);
|
|
37802
|
-
if (word[0] === "[" || word[0] === "<")
|
|
37803
|
-
return this.styleArgumentText(word);
|
|
37804
|
-
return this.styleSubcommandText(word);
|
|
37805
|
-
}).join(" ");
|
|
37806
|
-
}
|
|
37807
|
-
styleArgumentTerm(str) {
|
|
37808
|
-
return this.styleArgumentText(str);
|
|
37809
|
-
}
|
|
37810
|
-
styleOptionText(str) {
|
|
37811
|
-
return str;
|
|
37812
|
-
}
|
|
37813
|
-
styleArgumentText(str) {
|
|
37814
|
-
return str;
|
|
37815
|
-
}
|
|
37816
|
-
styleSubcommandText(str) {
|
|
37817
|
-
return str;
|
|
37818
|
-
}
|
|
37819
|
-
styleCommandText(str) {
|
|
37820
|
-
return str;
|
|
37821
|
-
}
|
|
37822
37752
|
padWidth(cmd, helper) {
|
|
37823
37753
|
return Math.max(helper.longestOptionTermLength(cmd, helper), helper.longestGlobalOptionTermLength(cmd, helper), helper.longestSubcommandTermLength(cmd, helper), helper.longestArgumentTermLength(cmd, helper));
|
|
37824
37754
|
}
|
|
37825
|
-
|
|
37826
|
-
|
|
37827
|
-
|
|
37828
|
-
|
|
37829
|
-
const itemIndent = 2;
|
|
37830
|
-
const itemIndentStr = " ".repeat(itemIndent);
|
|
37831
|
-
if (!description)
|
|
37832
|
-
return itemIndentStr + term;
|
|
37833
|
-
const paddedTerm = term.padEnd(termWidth + term.length - helper.displayWidth(term));
|
|
37834
|
-
const spacerWidth = 2;
|
|
37835
|
-
const helpWidth = this.helpWidth ?? 80;
|
|
37836
|
-
const remainingWidth = helpWidth - termWidth - spacerWidth - itemIndent;
|
|
37837
|
-
let formattedDescription;
|
|
37838
|
-
if (remainingWidth < this.minWidthToWrap || helper.preformatted(description)) {
|
|
37839
|
-
formattedDescription = description;
|
|
37840
|
-
} else {
|
|
37841
|
-
const wrappedDescription = helper.boxWrap(description, remainingWidth);
|
|
37842
|
-
formattedDescription = wrappedDescription.replace(/\n/g, `
|
|
37843
|
-
` + " ".repeat(termWidth + spacerWidth));
|
|
37844
|
-
}
|
|
37845
|
-
return itemIndentStr + paddedTerm + " ".repeat(spacerWidth) + formattedDescription.replace(/\n/g, `
|
|
37846
|
-
${itemIndentStr}`);
|
|
37847
|
-
}
|
|
37848
|
-
boxWrap(str, width) {
|
|
37849
|
-
if (width < this.minWidthToWrap)
|
|
37755
|
+
wrap(str, width, indent2, minColumnWidth = 40) {
|
|
37756
|
+
const indents = " \\f\\t\\v - \uFEFF";
|
|
37757
|
+
const manualIndent = new RegExp(`[\\n][${indents}]+`);
|
|
37758
|
+
if (str.match(manualIndent))
|
|
37850
37759
|
return str;
|
|
37851
|
-
const
|
|
37852
|
-
|
|
37853
|
-
|
|
37854
|
-
|
|
37855
|
-
|
|
37856
|
-
|
|
37857
|
-
|
|
37858
|
-
|
|
37859
|
-
|
|
37860
|
-
|
|
37861
|
-
|
|
37862
|
-
|
|
37863
|
-
|
|
37864
|
-
|
|
37865
|
-
|
|
37866
|
-
|
|
37867
|
-
|
|
37868
|
-
|
|
37869
|
-
|
|
37870
|
-
const nextChunk = chunk.trimStart();
|
|
37871
|
-
sumChunks = [nextChunk];
|
|
37872
|
-
sumWidth = this.displayWidth(nextChunk);
|
|
37873
|
-
});
|
|
37874
|
-
wrappedLines.push(sumChunks.join(""));
|
|
37875
|
-
});
|
|
37876
|
-
return wrappedLines.join(`
|
|
37760
|
+
const columnWidth = width - indent2;
|
|
37761
|
+
if (columnWidth < minColumnWidth)
|
|
37762
|
+
return str;
|
|
37763
|
+
const leadingStr = str.slice(0, indent2);
|
|
37764
|
+
const columnText = str.slice(indent2).replace(`\r
|
|
37765
|
+
`, `
|
|
37766
|
+
`);
|
|
37767
|
+
const indentString = " ".repeat(indent2);
|
|
37768
|
+
const zeroWidthSpace = "";
|
|
37769
|
+
const breaks = `\\s${zeroWidthSpace}`;
|
|
37770
|
+
const regex = new RegExp(`
|
|
37771
|
+
|.{1,${columnWidth - 1}}([${breaks}]|$)|[^${breaks}]+?([${breaks}]|$)`, "g");
|
|
37772
|
+
const lines = columnText.match(regex) || [];
|
|
37773
|
+
return leadingStr + lines.map((line, i) => {
|
|
37774
|
+
if (line === `
|
|
37775
|
+
`)
|
|
37776
|
+
return "";
|
|
37777
|
+
return (i > 0 ? indentString : "") + line.trimEnd();
|
|
37778
|
+
}).join(`
|
|
37877
37779
|
`);
|
|
37878
37780
|
}
|
|
37879
37781
|
}
|
|
37880
|
-
function stripColor(str) {
|
|
37881
|
-
const sgrPattern = /\x1b\[\d*(;\d*)*m/g;
|
|
37882
|
-
return str.replace(sgrPattern, "");
|
|
37883
|
-
}
|
|
37884
37782
|
exports.Help = Help;
|
|
37885
|
-
exports.stripColor = stripColor;
|
|
37886
37783
|
});
|
|
37887
37784
|
|
|
37888
37785
|
// ../../node_modules/commander/lib/option.js
|
|
@@ -37977,10 +37874,7 @@ var require_option = __commonJS((exports) => {
|
|
|
37977
37874
|
return this.short.replace(/^-/, "");
|
|
37978
37875
|
}
|
|
37979
37876
|
attributeName() {
|
|
37980
|
-
|
|
37981
|
-
return camelcase(this.name().replace(/^no-/, ""));
|
|
37982
|
-
}
|
|
37983
|
-
return camelcase(this.name());
|
|
37877
|
+
return camelcase(this.name().replace(/^no-/, ""));
|
|
37984
37878
|
}
|
|
37985
37879
|
is(arg) {
|
|
37986
37880
|
return this.short === arg || this.long === arg;
|
|
@@ -38025,41 +37919,18 @@ var require_option = __commonJS((exports) => {
|
|
|
38025
37919
|
function splitOptionFlags(flags) {
|
|
38026
37920
|
let shortFlag;
|
|
38027
37921
|
let longFlag;
|
|
38028
|
-
const
|
|
38029
|
-
|
|
38030
|
-
const flagParts = flags.split(/[ |,]+/).concat("guard");
|
|
38031
|
-
if (shortFlagExp.test(flagParts[0]))
|
|
37922
|
+
const flagParts = flags.split(/[ |,]+/);
|
|
37923
|
+
if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1]))
|
|
38032
37924
|
shortFlag = flagParts.shift();
|
|
38033
|
-
|
|
38034
|
-
|
|
38035
|
-
if (!shortFlag && shortFlagExp.test(flagParts[0]))
|
|
38036
|
-
shortFlag = flagParts.shift();
|
|
38037
|
-
if (!shortFlag && longFlagExp.test(flagParts[0])) {
|
|
37925
|
+
longFlag = flagParts.shift();
|
|
37926
|
+
if (!shortFlag && /^-[^-]$/.test(longFlag)) {
|
|
38038
37927
|
shortFlag = longFlag;
|
|
38039
|
-
longFlag =
|
|
38040
|
-
}
|
|
38041
|
-
if (flagParts[0].startsWith("-")) {
|
|
38042
|
-
const unsupportedFlag = flagParts[0];
|
|
38043
|
-
const baseError = `option creation failed due to '${unsupportedFlag}' in option flags '${flags}'`;
|
|
38044
|
-
if (/^-[^-][^-]/.test(unsupportedFlag))
|
|
38045
|
-
throw new Error(`${baseError}
|
|
38046
|
-
- a short flag is a single dash and a single character
|
|
38047
|
-
- either use a single dash and a single character (for a short flag)
|
|
38048
|
-
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`);
|
|
38049
|
-
if (shortFlagExp.test(unsupportedFlag))
|
|
38050
|
-
throw new Error(`${baseError}
|
|
38051
|
-
- too many short flags`);
|
|
38052
|
-
if (longFlagExp.test(unsupportedFlag))
|
|
38053
|
-
throw new Error(`${baseError}
|
|
38054
|
-
- too many long flags`);
|
|
38055
|
-
throw new Error(`${baseError}
|
|
38056
|
-
- unrecognised flag format`);
|
|
38057
|
-
}
|
|
38058
|
-
if (shortFlag === undefined && longFlag === undefined)
|
|
38059
|
-
throw new Error(`option creation failed due to no flags found in '${flags}'.`);
|
|
37928
|
+
longFlag = undefined;
|
|
37929
|
+
}
|
|
38060
37930
|
return { shortFlag, longFlag };
|
|
38061
37931
|
}
|
|
38062
37932
|
exports.Option = Option;
|
|
37933
|
+
exports.splitOptionFlags = splitOptionFlags;
|
|
38063
37934
|
exports.DualOptions = DualOptions;
|
|
38064
37935
|
});
|
|
38065
37936
|
|
|
@@ -38138,15 +38009,15 @@ var require_suggestSimilar = __commonJS((exports) => {
|
|
|
38138
38009
|
|
|
38139
38010
|
// ../../node_modules/commander/lib/command.js
|
|
38140
38011
|
var require_command = __commonJS((exports) => {
|
|
38141
|
-
var EventEmitter2 = __require("
|
|
38142
|
-
var childProcess = __require("
|
|
38143
|
-
var path2 = __require("
|
|
38144
|
-
var fs = __require("
|
|
38145
|
-
var process3 = __require("
|
|
38012
|
+
var EventEmitter2 = __require("events").EventEmitter;
|
|
38013
|
+
var childProcess = __require("child_process");
|
|
38014
|
+
var path2 = __require("path");
|
|
38015
|
+
var fs = __require("fs");
|
|
38016
|
+
var process3 = __require("process");
|
|
38146
38017
|
var { Argument, humanReadableArgName } = require_argument();
|
|
38147
38018
|
var { CommanderError } = require_error3();
|
|
38148
|
-
var { Help
|
|
38149
|
-
var { Option, DualOptions } = require_option();
|
|
38019
|
+
var { Help } = require_help();
|
|
38020
|
+
var { Option, splitOptionFlags, DualOptions } = require_option();
|
|
38150
38021
|
var { suggestSimilar } = require_suggestSimilar();
|
|
38151
38022
|
|
|
38152
38023
|
class Command extends EventEmitter2 {
|
|
@@ -38156,7 +38027,7 @@ var require_command = __commonJS((exports) => {
|
|
|
38156
38027
|
this.options = [];
|
|
38157
38028
|
this.parent = null;
|
|
38158
38029
|
this._allowUnknownOption = false;
|
|
38159
|
-
this._allowExcessArguments =
|
|
38030
|
+
this._allowExcessArguments = true;
|
|
38160
38031
|
this.registeredArguments = [];
|
|
38161
38032
|
this._args = this.registeredArguments;
|
|
38162
38033
|
this.args = [];
|
|
@@ -38183,27 +38054,35 @@ var require_command = __commonJS((exports) => {
|
|
|
38183
38054
|
this._lifeCycleHooks = {};
|
|
38184
38055
|
this._showHelpAfterError = false;
|
|
38185
38056
|
this._showSuggestionAfterError = true;
|
|
38186
|
-
this._savedState = null;
|
|
38187
38057
|
this._outputConfiguration = {
|
|
38188
38058
|
writeOut: (str) => process3.stdout.write(str),
|
|
38189
38059
|
writeErr: (str) => process3.stderr.write(str),
|
|
38190
|
-
outputError: (str, write) => write(str),
|
|
38191
38060
|
getOutHelpWidth: () => process3.stdout.isTTY ? process3.stdout.columns : undefined,
|
|
38192
38061
|
getErrHelpWidth: () => process3.stderr.isTTY ? process3.stderr.columns : undefined,
|
|
38193
|
-
|
|
38194
|
-
getErrHasColors: () => useColor() ?? (process3.stderr.isTTY && process3.stderr.hasColors?.()),
|
|
38195
|
-
stripColor: (str) => stripColor(str)
|
|
38062
|
+
outputError: (str, write) => write(str)
|
|
38196
38063
|
};
|
|
38197
38064
|
this._hidden = false;
|
|
38198
|
-
this.
|
|
38065
|
+
this._hasHelpOption = true;
|
|
38066
|
+
this._helpFlags = "-h, --help";
|
|
38067
|
+
this._helpDescription = "display help for command";
|
|
38068
|
+
this._helpShortFlag = "-h";
|
|
38069
|
+
this._helpLongFlag = "--help";
|
|
38199
38070
|
this._addImplicitHelpCommand = undefined;
|
|
38200
|
-
this.
|
|
38071
|
+
this._helpCommandName = "help";
|
|
38072
|
+
this._helpCommandnameAndArgs = "help [command]";
|
|
38073
|
+
this._helpCommandDescription = "display help for command";
|
|
38201
38074
|
this._helpConfiguration = {};
|
|
38202
38075
|
}
|
|
38203
38076
|
copyInheritedSettings(sourceCommand) {
|
|
38204
38077
|
this._outputConfiguration = sourceCommand._outputConfiguration;
|
|
38205
|
-
this.
|
|
38206
|
-
this.
|
|
38078
|
+
this._hasHelpOption = sourceCommand._hasHelpOption;
|
|
38079
|
+
this._helpFlags = sourceCommand._helpFlags;
|
|
38080
|
+
this._helpDescription = sourceCommand._helpDescription;
|
|
38081
|
+
this._helpShortFlag = sourceCommand._helpShortFlag;
|
|
38082
|
+
this._helpLongFlag = sourceCommand._helpLongFlag;
|
|
38083
|
+
this._helpCommandName = sourceCommand._helpCommandName;
|
|
38084
|
+
this._helpCommandnameAndArgs = sourceCommand._helpCommandnameAndArgs;
|
|
38085
|
+
this._helpCommandDescription = sourceCommand._helpCommandDescription;
|
|
38207
38086
|
this._helpConfiguration = sourceCommand._helpConfiguration;
|
|
38208
38087
|
this._exitCallback = sourceCommand._exitCallback;
|
|
38209
38088
|
this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;
|
|
@@ -38241,7 +38120,7 @@ var require_command = __commonJS((exports) => {
|
|
|
38241
38120
|
cmd._executableFile = opts.executableFile || null;
|
|
38242
38121
|
if (args)
|
|
38243
38122
|
cmd.arguments(args);
|
|
38244
|
-
this.
|
|
38123
|
+
this.commands.push(cmd);
|
|
38245
38124
|
cmd.parent = this;
|
|
38246
38125
|
cmd.copyInheritedSettings(this);
|
|
38247
38126
|
if (desc)
|
|
@@ -38286,9 +38165,8 @@ var require_command = __commonJS((exports) => {
|
|
|
38286
38165
|
this._defaultCommandName = cmd._name;
|
|
38287
38166
|
if (opts.noHelp || opts.hidden)
|
|
38288
38167
|
cmd._hidden = true;
|
|
38289
|
-
this.
|
|
38168
|
+
this.commands.push(cmd);
|
|
38290
38169
|
cmd.parent = this;
|
|
38291
|
-
cmd._checkForBrokenPassThrough();
|
|
38292
38170
|
return this;
|
|
38293
38171
|
}
|
|
38294
38172
|
createArgument(name, description) {
|
|
@@ -38321,42 +38199,24 @@ var require_command = __commonJS((exports) => {
|
|
|
38321
38199
|
this.registeredArguments.push(argument);
|
|
38322
38200
|
return this;
|
|
38323
38201
|
}
|
|
38324
|
-
|
|
38325
|
-
if (
|
|
38326
|
-
this._addImplicitHelpCommand =
|
|
38327
|
-
|
|
38328
|
-
|
|
38329
|
-
|
|
38330
|
-
|
|
38331
|
-
|
|
38332
|
-
|
|
38333
|
-
|
|
38334
|
-
if (helpArgs)
|
|
38335
|
-
helpCommand.arguments(helpArgs);
|
|
38336
|
-
if (helpDescription)
|
|
38337
|
-
helpCommand.description(helpDescription);
|
|
38338
|
-
this._addImplicitHelpCommand = true;
|
|
38339
|
-
this._helpCommand = helpCommand;
|
|
38340
|
-
return this;
|
|
38341
|
-
}
|
|
38342
|
-
addHelpCommand(helpCommand, deprecatedDescription) {
|
|
38343
|
-
if (typeof helpCommand !== "object") {
|
|
38344
|
-
this.helpCommand(helpCommand, deprecatedDescription);
|
|
38345
|
-
return this;
|
|
38202
|
+
addHelpCommand(enableOrNameAndArgs, description) {
|
|
38203
|
+
if (enableOrNameAndArgs === false) {
|
|
38204
|
+
this._addImplicitHelpCommand = false;
|
|
38205
|
+
} else {
|
|
38206
|
+
this._addImplicitHelpCommand = true;
|
|
38207
|
+
if (typeof enableOrNameAndArgs === "string") {
|
|
38208
|
+
this._helpCommandName = enableOrNameAndArgs.split(" ")[0];
|
|
38209
|
+
this._helpCommandnameAndArgs = enableOrNameAndArgs;
|
|
38210
|
+
}
|
|
38211
|
+
this._helpCommandDescription = description || this._helpCommandDescription;
|
|
38346
38212
|
}
|
|
38347
|
-
this._addImplicitHelpCommand = true;
|
|
38348
|
-
this._helpCommand = helpCommand;
|
|
38349
38213
|
return this;
|
|
38350
38214
|
}
|
|
38351
|
-
|
|
38352
|
-
|
|
38353
|
-
|
|
38354
|
-
if (this._helpCommand === undefined) {
|
|
38355
|
-
this.helpCommand(undefined, undefined);
|
|
38356
|
-
}
|
|
38357
|
-
return this._helpCommand;
|
|
38215
|
+
_hasImplicitHelpCommand() {
|
|
38216
|
+
if (this._addImplicitHelpCommand === undefined) {
|
|
38217
|
+
return this.commands.length && !this._actionHandler && !this._findCommand("help");
|
|
38358
38218
|
}
|
|
38359
|
-
return
|
|
38219
|
+
return this._addImplicitHelpCommand;
|
|
38360
38220
|
}
|
|
38361
38221
|
hook(event, listener) {
|
|
38362
38222
|
const allowedValues = ["preSubcommand", "preAction", "postAction"];
|
|
@@ -38418,29 +38278,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
38418
38278
|
throw err;
|
|
38419
38279
|
}
|
|
38420
38280
|
}
|
|
38421
|
-
_registerOption(option) {
|
|
38422
|
-
const matchingOption = option.short && this._findOption(option.short) || option.long && this._findOption(option.long);
|
|
38423
|
-
if (matchingOption) {
|
|
38424
|
-
const matchingFlag = option.long && this._findOption(option.long) ? option.long : option.short;
|
|
38425
|
-
throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}'
|
|
38426
|
-
- already used by option '${matchingOption.flags}'`);
|
|
38427
|
-
}
|
|
38428
|
-
this.options.push(option);
|
|
38429
|
-
}
|
|
38430
|
-
_registerCommand(command) {
|
|
38431
|
-
const knownBy = (cmd) => {
|
|
38432
|
-
return [cmd.name()].concat(cmd.aliases());
|
|
38433
|
-
};
|
|
38434
|
-
const alreadyUsed = knownBy(command).find((name) => this._findCommand(name));
|
|
38435
|
-
if (alreadyUsed) {
|
|
38436
|
-
const existingCmd = knownBy(this._findCommand(alreadyUsed)).join("|");
|
|
38437
|
-
const newCmd = knownBy(command).join("|");
|
|
38438
|
-
throw new Error(`cannot add command '${newCmd}' as already have command '${existingCmd}'`);
|
|
38439
|
-
}
|
|
38440
|
-
this.commands.push(command);
|
|
38441
|
-
}
|
|
38442
38281
|
addOption(option) {
|
|
38443
|
-
this._registerOption(option);
|
|
38444
38282
|
const oname = option.name();
|
|
38445
38283
|
const name = option.attributeName();
|
|
38446
38284
|
if (option.negate) {
|
|
@@ -38451,6 +38289,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
38451
38289
|
} else if (option.defaultValue !== undefined) {
|
|
38452
38290
|
this.setOptionValueWithSource(name, option.defaultValue, "default");
|
|
38453
38291
|
}
|
|
38292
|
+
this.options.push(option);
|
|
38454
38293
|
const handleOptionValue = (val, invalidValueMessage, valueSource) => {
|
|
38455
38294
|
if (val == null && option.presetArg !== undefined) {
|
|
38456
38295
|
val = option.presetArg;
|
|
@@ -38528,21 +38367,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
38528
38367
|
}
|
|
38529
38368
|
passThroughOptions(passThrough = true) {
|
|
38530
38369
|
this._passThroughOptions = !!passThrough;
|
|
38531
|
-
this.
|
|
38532
|
-
|
|
38533
|
-
}
|
|
38534
|
-
_checkForBrokenPassThrough() {
|
|
38535
|
-
if (this.parent && this._passThroughOptions && !this.parent._enablePositionalOptions) {
|
|
38536
|
-
throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`);
|
|
38370
|
+
if (!!this.parent && passThrough && !this.parent._enablePositionalOptions) {
|
|
38371
|
+
throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");
|
|
38537
38372
|
}
|
|
38373
|
+
return this;
|
|
38538
38374
|
}
|
|
38539
38375
|
storeOptionsAsProperties(storeAsProperties = true) {
|
|
38540
38376
|
if (this.options.length) {
|
|
38541
38377
|
throw new Error("call .storeOptionsAsProperties() before adding options");
|
|
38542
38378
|
}
|
|
38543
|
-
if (Object.keys(this._optionValues).length) {
|
|
38544
|
-
throw new Error("call .storeOptionsAsProperties() before setting option values");
|
|
38545
|
-
}
|
|
38546
38379
|
this._storeOptionsAsProperties = !!storeAsProperties;
|
|
38547
38380
|
return this;
|
|
38548
38381
|
}
|
|
@@ -38581,17 +38414,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
38581
38414
|
throw new Error("first parameter to parse must be array or undefined");
|
|
38582
38415
|
}
|
|
38583
38416
|
parseOptions = parseOptions || {};
|
|
38584
|
-
if (argv === undefined && parseOptions.from === undefined) {
|
|
38585
|
-
if (process3.versions?.electron) {
|
|
38586
|
-
parseOptions.from = "electron";
|
|
38587
|
-
}
|
|
38588
|
-
const execArgv = process3.execArgv ?? [];
|
|
38589
|
-
if (execArgv.includes("-e") || execArgv.includes("--eval") || execArgv.includes("-p") || execArgv.includes("--print")) {
|
|
38590
|
-
parseOptions.from = "eval";
|
|
38591
|
-
}
|
|
38592
|
-
}
|
|
38593
38417
|
if (argv === undefined) {
|
|
38594
38418
|
argv = process3.argv;
|
|
38419
|
+
if (process3.versions && process3.versions.electron) {
|
|
38420
|
+
parseOptions.from = "electron";
|
|
38421
|
+
}
|
|
38595
38422
|
}
|
|
38596
38423
|
this.rawArgs = argv.slice();
|
|
38597
38424
|
let userArgs;
|
|
@@ -38612,9 +38439,6 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
38612
38439
|
case "user":
|
|
38613
38440
|
userArgs = argv.slice(0);
|
|
38614
38441
|
break;
|
|
38615
|
-
case "eval":
|
|
38616
|
-
userArgs = argv.slice(1);
|
|
38617
|
-
break;
|
|
38618
38442
|
default:
|
|
38619
38443
|
throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`);
|
|
38620
38444
|
}
|
|
@@ -38624,53 +38448,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
38624
38448
|
return userArgs;
|
|
38625
38449
|
}
|
|
38626
38450
|
parse(argv, parseOptions) {
|
|
38627
|
-
this._prepareForParse();
|
|
38628
38451
|
const userArgs = this._prepareUserArgs(argv, parseOptions);
|
|
38629
38452
|
this._parseCommand([], userArgs);
|
|
38630
38453
|
return this;
|
|
38631
38454
|
}
|
|
38632
38455
|
async parseAsync(argv, parseOptions) {
|
|
38633
|
-
this._prepareForParse();
|
|
38634
38456
|
const userArgs = this._prepareUserArgs(argv, parseOptions);
|
|
38635
38457
|
await this._parseCommand([], userArgs);
|
|
38636
38458
|
return this;
|
|
38637
38459
|
}
|
|
38638
|
-
_prepareForParse() {
|
|
38639
|
-
if (this._savedState === null) {
|
|
38640
|
-
this.saveStateBeforeParse();
|
|
38641
|
-
} else {
|
|
38642
|
-
this.restoreStateBeforeParse();
|
|
38643
|
-
}
|
|
38644
|
-
}
|
|
38645
|
-
saveStateBeforeParse() {
|
|
38646
|
-
this._savedState = {
|
|
38647
|
-
_name: this._name,
|
|
38648
|
-
_optionValues: { ...this._optionValues },
|
|
38649
|
-
_optionValueSources: { ...this._optionValueSources }
|
|
38650
|
-
};
|
|
38651
|
-
}
|
|
38652
|
-
restoreStateBeforeParse() {
|
|
38653
|
-
if (this._storeOptionsAsProperties)
|
|
38654
|
-
throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
38655
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);
|
|
38656
|
-
this._name = this._savedState._name;
|
|
38657
|
-
this._scriptPath = null;
|
|
38658
|
-
this.rawArgs = [];
|
|
38659
|
-
this._optionValues = { ...this._savedState._optionValues };
|
|
38660
|
-
this._optionValueSources = { ...this._savedState._optionValueSources };
|
|
38661
|
-
this.args = [];
|
|
38662
|
-
this.processedArgs = [];
|
|
38663
|
-
}
|
|
38664
|
-
_checkForMissingExecutable(executableFile, executableDir, subcommandName) {
|
|
38665
|
-
if (fs.existsSync(executableFile))
|
|
38666
|
-
return;
|
|
38667
|
-
const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
|
|
38668
|
-
const executableMissing = `'${executableFile}' does not exist
|
|
38669
|
-
- if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
38670
|
-
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
38671
|
-
- ${executableDirMessage}`;
|
|
38672
|
-
throw new Error(executableMissing);
|
|
38673
|
-
}
|
|
38674
38460
|
_executeSubCommand(subcommand, args) {
|
|
38675
38461
|
args = args.slice();
|
|
38676
38462
|
let launchWithNode = false;
|
|
@@ -38694,7 +38480,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
38694
38480
|
let resolvedScriptPath;
|
|
38695
38481
|
try {
|
|
38696
38482
|
resolvedScriptPath = fs.realpathSync(this._scriptPath);
|
|
38697
|
-
} catch {
|
|
38483
|
+
} catch (err) {
|
|
38698
38484
|
resolvedScriptPath = this._scriptPath;
|
|
38699
38485
|
}
|
|
38700
38486
|
executableDir = path2.resolve(path2.dirname(resolvedScriptPath), executableDir);
|
|
@@ -38720,7 +38506,6 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
38720
38506
|
proc2 = childProcess.spawn(executableFile, args, { stdio: "inherit" });
|
|
38721
38507
|
}
|
|
38722
38508
|
} else {
|
|
38723
|
-
this._checkForMissingExecutable(executableFile, executableDir, subcommand._name);
|
|
38724
38509
|
args.unshift(executableFile);
|
|
38725
38510
|
args = incrementNodeInspectorPort(process3.execArgv).concat(args);
|
|
38726
38511
|
proc2 = childProcess.spawn(process3.execPath, args, { stdio: "inherit" });
|
|
@@ -38736,17 +38521,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
38736
38521
|
});
|
|
38737
38522
|
}
|
|
38738
38523
|
const exitCallback = this._exitCallback;
|
|
38739
|
-
|
|
38740
|
-
|
|
38741
|
-
|
|
38742
|
-
|
|
38743
|
-
|
|
38744
|
-
|
|
38745
|
-
|
|
38746
|
-
});
|
|
38524
|
+
if (!exitCallback) {
|
|
38525
|
+
proc2.on("close", process3.exit.bind(process3));
|
|
38526
|
+
} else {
|
|
38527
|
+
proc2.on("close", () => {
|
|
38528
|
+
exitCallback(new CommanderError(process3.exitCode || 0, "commander.executeSubCommandAsync", "(close)"));
|
|
38529
|
+
});
|
|
38530
|
+
}
|
|
38747
38531
|
proc2.on("error", (err) => {
|
|
38748
38532
|
if (err.code === "ENOENT") {
|
|
38749
|
-
|
|
38533
|
+
const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory";
|
|
38534
|
+
const executableMissing = `'${executableFile}' does not exist
|
|
38535
|
+
- if '${subcommand._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
38536
|
+
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
38537
|
+
- ${executableDirMessage}`;
|
|
38538
|
+
throw new Error(executableMissing);
|
|
38750
38539
|
} else if (err.code === "EACCES") {
|
|
38751
38540
|
throw new Error(`'${executableFile}' not executable`);
|
|
38752
38541
|
}
|
|
@@ -38764,7 +38553,6 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
38764
38553
|
const subCommand = this._findCommand(commandName);
|
|
38765
38554
|
if (!subCommand)
|
|
38766
38555
|
this.help({ error: true });
|
|
38767
|
-
subCommand._prepareForParse();
|
|
38768
38556
|
let promiseChain;
|
|
38769
38557
|
promiseChain = this._chainOrCallSubCommandHook(promiseChain, subCommand, "preSubcommand");
|
|
38770
38558
|
promiseChain = this._chainOrCall(promiseChain, () => {
|
|
@@ -38784,7 +38572,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
38784
38572
|
if (subCommand && !subCommand._executableHandler) {
|
|
38785
38573
|
subCommand.help();
|
|
38786
38574
|
}
|
|
38787
|
-
return this._dispatchSubcommand(subcommandName, [], [
|
|
38575
|
+
return this._dispatchSubcommand(subcommandName, [], [
|
|
38576
|
+
this._helpLongFlag || this._helpShortFlag
|
|
38577
|
+
]);
|
|
38788
38578
|
}
|
|
38789
38579
|
_checkNumberOfArguments() {
|
|
38790
38580
|
this.registeredArguments.forEach((arg, i) => {
|
|
@@ -38878,17 +38668,17 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
38878
38668
|
if (operands && this._findCommand(operands[0])) {
|
|
38879
38669
|
return this._dispatchSubcommand(operands[0], operands.slice(1), unknown2);
|
|
38880
38670
|
}
|
|
38881
|
-
if (this.
|
|
38671
|
+
if (this._hasImplicitHelpCommand() && operands[0] === this._helpCommandName) {
|
|
38882
38672
|
return this._dispatchHelpCommand(operands[1]);
|
|
38883
38673
|
}
|
|
38884
38674
|
if (this._defaultCommandName) {
|
|
38885
|
-
this
|
|
38675
|
+
outputHelpIfRequested(this, unknown2);
|
|
38886
38676
|
return this._dispatchSubcommand(this._defaultCommandName, operands, unknown2);
|
|
38887
38677
|
}
|
|
38888
38678
|
if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) {
|
|
38889
38679
|
this.help({ error: true });
|
|
38890
38680
|
}
|
|
38891
|
-
this
|
|
38681
|
+
outputHelpIfRequested(this, parsed.unknown);
|
|
38892
38682
|
this._checkForMissingMandatoryOptions();
|
|
38893
38683
|
this._checkForConflictingOptions();
|
|
38894
38684
|
const checkForUnknownOptions = () => {
|
|
@@ -39045,7 +38835,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
39045
38835
|
if (args.length > 0)
|
|
39046
38836
|
unknown2.push(...args);
|
|
39047
38837
|
break;
|
|
39048
|
-
} else if (this.
|
|
38838
|
+
} else if (arg === this._helpCommandName && this._hasImplicitHelpCommand()) {
|
|
39049
38839
|
operands.push(arg);
|
|
39050
38840
|
if (args.length > 0)
|
|
39051
38841
|
operands.push(...args);
|
|
@@ -39207,7 +38997,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
39207
38997
|
description = description || "output the version number";
|
|
39208
38998
|
const versionOption = this.createOption(flags, description);
|
|
39209
38999
|
this._versionOptionName = versionOption.attributeName();
|
|
39210
|
-
this.
|
|
39000
|
+
this.options.push(versionOption);
|
|
39211
39001
|
this.on("option:" + versionOption.name(), () => {
|
|
39212
39002
|
this._outputConfiguration.writeOut(`${str}
|
|
39213
39003
|
`);
|
|
@@ -39239,11 +39029,6 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
39239
39029
|
}
|
|
39240
39030
|
if (alias === command._name)
|
|
39241
39031
|
throw new Error("Command alias can't be the same as its name");
|
|
39242
|
-
const matchingCommand = this.parent?._findCommand(alias);
|
|
39243
|
-
if (matchingCommand) {
|
|
39244
|
-
const existingCmd = [matchingCommand.name()].concat(matchingCommand.aliases()).join("|");
|
|
39245
|
-
throw new Error(`cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'`);
|
|
39246
|
-
}
|
|
39247
39032
|
command._aliases.push(alias);
|
|
39248
39033
|
return this;
|
|
39249
39034
|
}
|
|
@@ -39260,7 +39045,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
39260
39045
|
const args = this.registeredArguments.map((arg) => {
|
|
39261
39046
|
return humanReadableArgName(arg);
|
|
39262
39047
|
});
|
|
39263
|
-
return [].concat(this.options.length || this.
|
|
39048
|
+
return [].concat(this.options.length || this._hasHelpOption ? "[options]" : [], this.commands.length ? "[command]" : [], this.registeredArguments.length ? args : []).join(" ");
|
|
39264
39049
|
}
|
|
39265
39050
|
this._usage = str;
|
|
39266
39051
|
return this;
|
|
@@ -39283,38 +39068,23 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
39283
39068
|
}
|
|
39284
39069
|
helpInformation(contextOptions) {
|
|
39285
39070
|
const helper = this.createHelp();
|
|
39286
|
-
|
|
39287
|
-
|
|
39288
|
-
|
|
39289
|
-
|
|
39290
|
-
outputHasColors: context.hasColors
|
|
39291
|
-
});
|
|
39292
|
-
const text = helper.formatHelp(this, helper);
|
|
39293
|
-
if (context.hasColors)
|
|
39294
|
-
return text;
|
|
39295
|
-
return this._outputConfiguration.stripColor(text);
|
|
39071
|
+
if (helper.helpWidth === undefined) {
|
|
39072
|
+
helper.helpWidth = contextOptions && contextOptions.error ? this._outputConfiguration.getErrHelpWidth() : this._outputConfiguration.getOutHelpWidth();
|
|
39073
|
+
}
|
|
39074
|
+
return helper.formatHelp(this, helper);
|
|
39296
39075
|
}
|
|
39297
|
-
|
|
39076
|
+
_getHelpContext(contextOptions) {
|
|
39298
39077
|
contextOptions = contextOptions || {};
|
|
39299
|
-
const
|
|
39300
|
-
let
|
|
39301
|
-
|
|
39302
|
-
|
|
39303
|
-
if (error) {
|
|
39304
|
-
baseWrite = (str) => this._outputConfiguration.writeErr(str);
|
|
39305
|
-
hasColors2 = this._outputConfiguration.getErrHasColors();
|
|
39306
|
-
helpWidth = this._outputConfiguration.getErrHelpWidth();
|
|
39078
|
+
const context = { error: !!contextOptions.error };
|
|
39079
|
+
let write;
|
|
39080
|
+
if (context.error) {
|
|
39081
|
+
write = (arg) => this._outputConfiguration.writeErr(arg);
|
|
39307
39082
|
} else {
|
|
39308
|
-
|
|
39309
|
-
|
|
39310
|
-
|
|
39311
|
-
|
|
39312
|
-
|
|
39313
|
-
if (!hasColors2)
|
|
39314
|
-
str = this._outputConfiguration.stripColor(str);
|
|
39315
|
-
return baseWrite(str);
|
|
39316
|
-
};
|
|
39317
|
-
return { error, write, hasColors: hasColors2, helpWidth };
|
|
39083
|
+
write = (arg) => this._outputConfiguration.writeOut(arg);
|
|
39084
|
+
}
|
|
39085
|
+
context.write = contextOptions.write || write;
|
|
39086
|
+
context.command = this;
|
|
39087
|
+
return context;
|
|
39318
39088
|
}
|
|
39319
39089
|
outputHelp(contextOptions) {
|
|
39320
39090
|
let deprecatedCallback;
|
|
@@ -39322,55 +39092,38 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
39322
39092
|
deprecatedCallback = contextOptions;
|
|
39323
39093
|
contextOptions = undefined;
|
|
39324
39094
|
}
|
|
39325
|
-
const
|
|
39326
|
-
|
|
39327
|
-
|
|
39328
|
-
|
|
39329
|
-
command: this
|
|
39330
|
-
};
|
|
39331
|
-
this._getCommandAndAncestors().reverse().forEach((command) => command.emit("beforeAllHelp", eventContext));
|
|
39332
|
-
this.emit("beforeHelp", eventContext);
|
|
39333
|
-
let helpInformation = this.helpInformation({ error: outputContext.error });
|
|
39095
|
+
const context = this._getHelpContext(contextOptions);
|
|
39096
|
+
this._getCommandAndAncestors().reverse().forEach((command) => command.emit("beforeAllHelp", context));
|
|
39097
|
+
this.emit("beforeHelp", context);
|
|
39098
|
+
let helpInformation = this.helpInformation(context);
|
|
39334
39099
|
if (deprecatedCallback) {
|
|
39335
39100
|
helpInformation = deprecatedCallback(helpInformation);
|
|
39336
39101
|
if (typeof helpInformation !== "string" && !Buffer.isBuffer(helpInformation)) {
|
|
39337
39102
|
throw new Error("outputHelp callback must return a string or a Buffer");
|
|
39338
39103
|
}
|
|
39339
39104
|
}
|
|
39340
|
-
|
|
39341
|
-
if (this.
|
|
39342
|
-
this.emit(this.
|
|
39105
|
+
context.write(helpInformation);
|
|
39106
|
+
if (this._helpLongFlag) {
|
|
39107
|
+
this.emit(this._helpLongFlag);
|
|
39343
39108
|
}
|
|
39344
|
-
this.emit("afterHelp",
|
|
39345
|
-
this._getCommandAndAncestors().forEach((command) => command.emit("afterAllHelp",
|
|
39109
|
+
this.emit("afterHelp", context);
|
|
39110
|
+
this._getCommandAndAncestors().forEach((command) => command.emit("afterAllHelp", context));
|
|
39346
39111
|
}
|
|
39347
39112
|
helpOption(flags, description) {
|
|
39348
39113
|
if (typeof flags === "boolean") {
|
|
39349
|
-
|
|
39350
|
-
this._helpOption = this._helpOption ?? undefined;
|
|
39351
|
-
} else {
|
|
39352
|
-
this._helpOption = null;
|
|
39353
|
-
}
|
|
39114
|
+
this._hasHelpOption = flags;
|
|
39354
39115
|
return this;
|
|
39355
39116
|
}
|
|
39356
|
-
|
|
39357
|
-
|
|
39358
|
-
|
|
39359
|
-
|
|
39360
|
-
|
|
39361
|
-
_getHelpOption() {
|
|
39362
|
-
if (this._helpOption === undefined) {
|
|
39363
|
-
this.helpOption(undefined, undefined);
|
|
39364
|
-
}
|
|
39365
|
-
return this._helpOption;
|
|
39366
|
-
}
|
|
39367
|
-
addHelpOption(option) {
|
|
39368
|
-
this._helpOption = option;
|
|
39117
|
+
this._helpFlags = flags || this._helpFlags;
|
|
39118
|
+
this._helpDescription = description || this._helpDescription;
|
|
39119
|
+
const helpFlags = splitOptionFlags(this._helpFlags);
|
|
39120
|
+
this._helpShortFlag = helpFlags.shortFlag;
|
|
39121
|
+
this._helpLongFlag = helpFlags.longFlag;
|
|
39369
39122
|
return this;
|
|
39370
39123
|
}
|
|
39371
39124
|
help(contextOptions) {
|
|
39372
39125
|
this.outputHelp(contextOptions);
|
|
39373
|
-
let exitCode =
|
|
39126
|
+
let exitCode = process3.exitCode || 0;
|
|
39374
39127
|
if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
|
|
39375
39128
|
exitCode = 1;
|
|
39376
39129
|
}
|
|
@@ -39397,13 +39150,12 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
39397
39150
|
});
|
|
39398
39151
|
return this;
|
|
39399
39152
|
}
|
|
39400
|
-
|
|
39401
|
-
|
|
39402
|
-
|
|
39403
|
-
|
|
39404
|
-
|
|
39405
|
-
|
|
39406
|
-
}
|
|
39153
|
+
}
|
|
39154
|
+
function outputHelpIfRequested(cmd, args) {
|
|
39155
|
+
const helpOption = cmd._hasHelpOption && args.find((arg) => arg === cmd._helpLongFlag || arg === cmd._helpShortFlag);
|
|
39156
|
+
if (helpOption) {
|
|
39157
|
+
cmd.outputHelp();
|
|
39158
|
+
cmd._exit(0, "commander.helpDisplayed", "(outputHelp)");
|
|
39407
39159
|
}
|
|
39408
39160
|
}
|
|
39409
39161
|
function incrementNodeInspectorPort(args) {
|
|
@@ -39435,28 +39187,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
39435
39187
|
return arg;
|
|
39436
39188
|
});
|
|
39437
39189
|
}
|
|
39438
|
-
function useColor() {
|
|
39439
|
-
if (process3.env.NO_COLOR || process3.env.FORCE_COLOR === "0" || process3.env.FORCE_COLOR === "false")
|
|
39440
|
-
return false;
|
|
39441
|
-
if (process3.env.FORCE_COLOR || process3.env.CLICOLOR_FORCE !== undefined)
|
|
39442
|
-
return true;
|
|
39443
|
-
return;
|
|
39444
|
-
}
|
|
39445
39190
|
exports.Command = Command;
|
|
39446
|
-
exports.useColor = useColor;
|
|
39447
39191
|
});
|
|
39448
39192
|
|
|
39449
39193
|
// ../../node_modules/commander/index.js
|
|
39450
|
-
var require_commander = __commonJS((exports) => {
|
|
39194
|
+
var require_commander = __commonJS((exports, module) => {
|
|
39451
39195
|
var { Argument } = require_argument();
|
|
39452
39196
|
var { Command } = require_command();
|
|
39453
39197
|
var { CommanderError, InvalidArgumentError } = require_error3();
|
|
39454
39198
|
var { Help } = require_help();
|
|
39455
39199
|
var { Option } = require_option();
|
|
39456
|
-
exports.
|
|
39457
|
-
exports.
|
|
39458
|
-
exports.createOption = (flags, description) => new Option(flags, description);
|
|
39459
|
-
exports.createArgument = (name, description) => new Argument(name, description);
|
|
39200
|
+
exports = module.exports = new Command;
|
|
39201
|
+
exports.program = exports;
|
|
39460
39202
|
exports.Command = Command;
|
|
39461
39203
|
exports.Option = Option;
|
|
39462
39204
|
exports.Argument = Argument;
|
|
@@ -62835,7 +62577,7 @@ var {
|
|
|
62835
62577
|
var package_default = {
|
|
62836
62578
|
name: "@settlemint/sdk-mcp",
|
|
62837
62579
|
description: "MCP interface for SettleMint SDK, providing development tools and project management capabilities",
|
|
62838
|
-
version: "1.1.16-
|
|
62580
|
+
version: "1.1.16-pr7a391c74",
|
|
62839
62581
|
type: "module",
|
|
62840
62582
|
private: false,
|
|
62841
62583
|
license: "FSL-1.1-MIT",
|
|
@@ -62878,10 +62620,10 @@ var package_default = {
|
|
|
62878
62620
|
"@graphql-tools/load": "8.0.17",
|
|
62879
62621
|
"@graphql-tools/url-loader": "8.0.29",
|
|
62880
62622
|
"@modelcontextprotocol/sdk": "1.6.1",
|
|
62881
|
-
"@settlemint/sdk-js": "1.1.16-
|
|
62882
|
-
"@settlemint/sdk-utils": "1.1.16-
|
|
62883
|
-
"@commander-js/extra-typings": "
|
|
62884
|
-
commander: "
|
|
62623
|
+
"@settlemint/sdk-js": "1.1.16-pr7a391c74",
|
|
62624
|
+
"@settlemint/sdk-utils": "1.1.16-pr7a391c74",
|
|
62625
|
+
"@commander-js/extra-typings": "11.1.0",
|
|
62626
|
+
commander: "11.1.0",
|
|
62885
62627
|
zod: "3.24.2"
|
|
62886
62628
|
},
|
|
62887
62629
|
devDependencies: {},
|
|
@@ -68548,4 +68290,4 @@ main().catch((error2) => {
|
|
|
68548
68290
|
process.exit(1);
|
|
68549
68291
|
});
|
|
68550
68292
|
|
|
68551
|
-
//# debugId=
|
|
68293
|
+
//# debugId=9E6B760D85C472F764756E2164756E21
|