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