knowns 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +513 -329
- package/dist/mcp/server.js +19 -9
- package/dist/ui/assets/{index-C8kGgSuS.js → index-chP3fK4X.js} +95 -95
- package/dist/ui/index.html +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1552,15 +1552,15 @@ var require_loader = __commonJS({
|
|
|
1552
1552
|
}
|
|
1553
1553
|
}
|
|
1554
1554
|
var directiveHandlers = {
|
|
1555
|
-
YAML: function handleYamlDirective(state, name,
|
|
1555
|
+
YAML: function handleYamlDirective(state, name, args2) {
|
|
1556
1556
|
var match, major, minor;
|
|
1557
1557
|
if (state.version !== null) {
|
|
1558
1558
|
throwError(state, "duplication of %YAML directive");
|
|
1559
1559
|
}
|
|
1560
|
-
if (
|
|
1560
|
+
if (args2.length !== 1) {
|
|
1561
1561
|
throwError(state, "YAML directive accepts exactly one argument");
|
|
1562
1562
|
}
|
|
1563
|
-
match = /^([0-9]+)\.([0-9]+)$/.exec(
|
|
1563
|
+
match = /^([0-9]+)\.([0-9]+)$/.exec(args2[0]);
|
|
1564
1564
|
if (match === null) {
|
|
1565
1565
|
throwError(state, "ill-formed argument of the YAML directive");
|
|
1566
1566
|
}
|
|
@@ -1569,19 +1569,19 @@ var require_loader = __commonJS({
|
|
|
1569
1569
|
if (major !== 1) {
|
|
1570
1570
|
throwError(state, "unacceptable YAML version of the document");
|
|
1571
1571
|
}
|
|
1572
|
-
state.version =
|
|
1572
|
+
state.version = args2[0];
|
|
1573
1573
|
state.checkLineBreaks = minor < 2;
|
|
1574
1574
|
if (minor !== 1 && minor !== 2) {
|
|
1575
1575
|
throwWarning(state, "unsupported YAML version of the document");
|
|
1576
1576
|
}
|
|
1577
1577
|
},
|
|
1578
|
-
TAG: function handleTagDirective(state, name,
|
|
1578
|
+
TAG: function handleTagDirective(state, name, args2) {
|
|
1579
1579
|
var handle, prefix;
|
|
1580
|
-
if (
|
|
1580
|
+
if (args2.length !== 2) {
|
|
1581
1581
|
throwError(state, "TAG directive accepts exactly two arguments");
|
|
1582
1582
|
}
|
|
1583
|
-
handle =
|
|
1584
|
-
prefix =
|
|
1583
|
+
handle = args2[0];
|
|
1584
|
+
prefix = args2[1];
|
|
1585
1585
|
if (!PATTERN_TAG_HANDLE.test(handle)) {
|
|
1586
1586
|
throwError(state, "ill-formed tag handle (first argument) of the TAG directive");
|
|
1587
1587
|
}
|
|
@@ -3803,9 +3803,9 @@ var require_help = __commonJS({
|
|
|
3803
3803
|
* @returns {string}
|
|
3804
3804
|
*/
|
|
3805
3805
|
subcommandTerm(cmd) {
|
|
3806
|
-
const
|
|
3806
|
+
const args2 = cmd.registeredArguments.map((arg) => humanReadableArgName(arg)).join(" ");
|
|
3807
3807
|
return cmd._name + (cmd._aliases[0] ? "|" + cmd._aliases[0] : "") + (cmd.options.length ? " [options]" : "") + // simplistic check for non-help option
|
|
3808
|
-
(
|
|
3808
|
+
(args2 ? " " + args2 : "");
|
|
3809
3809
|
}
|
|
3810
3810
|
/**
|
|
3811
3811
|
* Get the option term to show in the list of options.
|
|
@@ -4583,7 +4583,7 @@ var require_command = __commonJS({
|
|
|
4583
4583
|
desc = null;
|
|
4584
4584
|
}
|
|
4585
4585
|
opts = opts || {};
|
|
4586
|
-
const [, name,
|
|
4586
|
+
const [, name, args2] = nameAndArgs.match(/([^ ]+) *(.*)/);
|
|
4587
4587
|
const cmd = this.createCommand(name);
|
|
4588
4588
|
if (desc) {
|
|
4589
4589
|
cmd.description(desc);
|
|
@@ -4592,7 +4592,7 @@ var require_command = __commonJS({
|
|
|
4592
4592
|
if (opts.isDefault) this._defaultCommandName = cmd._name;
|
|
4593
4593
|
cmd._hidden = !!(opts.noHelp || opts.hidden);
|
|
4594
4594
|
cmd._executableFile = opts.executableFile || null;
|
|
4595
|
-
if (
|
|
4595
|
+
if (args2) cmd.arguments(args2);
|
|
4596
4596
|
this._registerCommand(cmd);
|
|
4597
4597
|
cmd.parent = this;
|
|
4598
4598
|
cmd.copyInheritedSettings(this);
|
|
@@ -4905,9 +4905,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
4905
4905
|
* @return {Command} `this` command for chaining
|
|
4906
4906
|
*/
|
|
4907
4907
|
action(fn) {
|
|
4908
|
-
const listener = (
|
|
4908
|
+
const listener = (args2) => {
|
|
4909
4909
|
const expectedArgsCount = this.registeredArguments.length;
|
|
4910
|
-
const actionArgs =
|
|
4910
|
+
const actionArgs = args2.slice(0, expectedArgsCount);
|
|
4911
4911
|
if (this._storeOptionsAsProperties) {
|
|
4912
4912
|
actionArgs[expectedArgsCount] = this;
|
|
4913
4913
|
} else {
|
|
@@ -5386,8 +5386,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5386
5386
|
*
|
|
5387
5387
|
* @private
|
|
5388
5388
|
*/
|
|
5389
|
-
_executeSubCommand(subcommand,
|
|
5390
|
-
|
|
5389
|
+
_executeSubCommand(subcommand, args2) {
|
|
5390
|
+
args2 = args2.slice();
|
|
5391
5391
|
let launchWithNode = false;
|
|
5392
5392
|
const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"];
|
|
5393
5393
|
function findFile(baseDir, baseName) {
|
|
@@ -5436,16 +5436,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5436
5436
|
let proc;
|
|
5437
5437
|
if (process5.platform !== "win32") {
|
|
5438
5438
|
if (launchWithNode) {
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
proc = childProcess.spawn(process5.argv[0],
|
|
5439
|
+
args2.unshift(executableFile);
|
|
5440
|
+
args2 = incrementNodeInspectorPort(process5.execArgv).concat(args2);
|
|
5441
|
+
proc = childProcess.spawn(process5.argv[0], args2, { stdio: "inherit" });
|
|
5442
5442
|
} else {
|
|
5443
|
-
proc = childProcess.spawn(executableFile,
|
|
5443
|
+
proc = childProcess.spawn(executableFile, args2, { stdio: "inherit" });
|
|
5444
5444
|
}
|
|
5445
5445
|
} else {
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
proc = childProcess.spawn(process5.execPath,
|
|
5446
|
+
args2.unshift(executableFile);
|
|
5447
|
+
args2 = incrementNodeInspectorPort(process5.execArgv).concat(args2);
|
|
5448
|
+
proc = childProcess.spawn(process5.execPath, args2, { stdio: "inherit" });
|
|
5449
5449
|
}
|
|
5450
5450
|
if (!proc.killed) {
|
|
5451
5451
|
const signals = ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"];
|
|
@@ -5830,16 +5830,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5830
5830
|
const operands = [];
|
|
5831
5831
|
const unknown2 = [];
|
|
5832
5832
|
let dest = operands;
|
|
5833
|
-
const
|
|
5833
|
+
const args2 = argv.slice();
|
|
5834
5834
|
function maybeOption(arg) {
|
|
5835
5835
|
return arg.length > 1 && arg[0] === "-";
|
|
5836
5836
|
}
|
|
5837
5837
|
let activeVariadicOption = null;
|
|
5838
|
-
while (
|
|
5839
|
-
const arg =
|
|
5838
|
+
while (args2.length) {
|
|
5839
|
+
const arg = args2.shift();
|
|
5840
5840
|
if (arg === "--") {
|
|
5841
5841
|
if (dest === unknown2) dest.push(arg);
|
|
5842
|
-
dest.push(...
|
|
5842
|
+
dest.push(...args2);
|
|
5843
5843
|
break;
|
|
5844
5844
|
}
|
|
5845
5845
|
if (activeVariadicOption && !maybeOption(arg)) {
|
|
@@ -5851,13 +5851,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5851
5851
|
const option = this._findOption(arg);
|
|
5852
5852
|
if (option) {
|
|
5853
5853
|
if (option.required) {
|
|
5854
|
-
const value =
|
|
5854
|
+
const value = args2.shift();
|
|
5855
5855
|
if (value === void 0) this.optionMissingArgument(option);
|
|
5856
5856
|
this.emit(`option:${option.name()}`, value);
|
|
5857
5857
|
} else if (option.optional) {
|
|
5858
5858
|
let value = null;
|
|
5859
|
-
if (
|
|
5860
|
-
value =
|
|
5859
|
+
if (args2.length > 0 && !maybeOption(args2[0])) {
|
|
5860
|
+
value = args2.shift();
|
|
5861
5861
|
}
|
|
5862
5862
|
this.emit(`option:${option.name()}`, value);
|
|
5863
5863
|
} else {
|
|
@@ -5874,7 +5874,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5874
5874
|
this.emit(`option:${option.name()}`, arg.slice(2));
|
|
5875
5875
|
} else {
|
|
5876
5876
|
this.emit(`option:${option.name()}`);
|
|
5877
|
-
|
|
5877
|
+
args2.unshift(`-${arg.slice(2)}`);
|
|
5878
5878
|
}
|
|
5879
5879
|
continue;
|
|
5880
5880
|
}
|
|
@@ -5893,21 +5893,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
5893
5893
|
if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown2.length === 0) {
|
|
5894
5894
|
if (this._findCommand(arg)) {
|
|
5895
5895
|
operands.push(arg);
|
|
5896
|
-
if (
|
|
5896
|
+
if (args2.length > 0) unknown2.push(...args2);
|
|
5897
5897
|
break;
|
|
5898
5898
|
} else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) {
|
|
5899
5899
|
operands.push(arg);
|
|
5900
|
-
if (
|
|
5900
|
+
if (args2.length > 0) operands.push(...args2);
|
|
5901
5901
|
break;
|
|
5902
5902
|
} else if (this._defaultCommandName) {
|
|
5903
5903
|
unknown2.push(arg);
|
|
5904
|
-
if (
|
|
5904
|
+
if (args2.length > 0) unknown2.push(...args2);
|
|
5905
5905
|
break;
|
|
5906
5906
|
}
|
|
5907
5907
|
}
|
|
5908
5908
|
if (this._passThroughOptions) {
|
|
5909
5909
|
dest.push(arg);
|
|
5910
|
-
if (
|
|
5910
|
+
if (args2.length > 0) dest.push(...args2);
|
|
5911
5911
|
break;
|
|
5912
5912
|
}
|
|
5913
5913
|
dest.push(arg);
|
|
@@ -6236,13 +6236,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
6236
6236
|
usage(str2) {
|
|
6237
6237
|
if (str2 === void 0) {
|
|
6238
6238
|
if (this._usage) return this._usage;
|
|
6239
|
-
const
|
|
6239
|
+
const args2 = this.registeredArguments.map((arg) => {
|
|
6240
6240
|
return humanReadableArgName(arg);
|
|
6241
6241
|
});
|
|
6242
6242
|
return [].concat(
|
|
6243
6243
|
this.options.length || this._helpOption !== null ? "[options]" : [],
|
|
6244
6244
|
this.commands.length ? "[command]" : [],
|
|
6245
|
-
this.registeredArguments.length ?
|
|
6245
|
+
this.registeredArguments.length ? args2 : []
|
|
6246
6246
|
).join(" ");
|
|
6247
6247
|
}
|
|
6248
6248
|
this._usage = str2;
|
|
@@ -6454,17 +6454,17 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
6454
6454
|
* @param {Array} args - array of options to search for help flags
|
|
6455
6455
|
* @private
|
|
6456
6456
|
*/
|
|
6457
|
-
_outputHelpIfRequested(
|
|
6457
|
+
_outputHelpIfRequested(args2) {
|
|
6458
6458
|
const helpOption = this._getHelpOption();
|
|
6459
|
-
const helpRequested = helpOption &&
|
|
6459
|
+
const helpRequested = helpOption && args2.find((arg) => helpOption.is(arg));
|
|
6460
6460
|
if (helpRequested) {
|
|
6461
6461
|
this.outputHelp();
|
|
6462
6462
|
this._exit(0, "commander.helpDisplayed", "(outputHelp)");
|
|
6463
6463
|
}
|
|
6464
6464
|
}
|
|
6465
6465
|
};
|
|
6466
|
-
function incrementNodeInspectorPort(
|
|
6467
|
-
return
|
|
6466
|
+
function incrementNodeInspectorPort(args2) {
|
|
6467
|
+
return args2.map((arg) => {
|
|
6468
6468
|
if (!arg.startsWith("--inspect")) {
|
|
6469
6469
|
return arg;
|
|
6470
6470
|
}
|
|
@@ -7027,9 +7027,9 @@ var require_text = __commonJS({
|
|
|
7027
7027
|
}
|
|
7028
7028
|
function _asyncToGenerator(fn) {
|
|
7029
7029
|
return function() {
|
|
7030
|
-
var self = this,
|
|
7030
|
+
var self = this, args2 = arguments;
|
|
7031
7031
|
return new Promise(function(resolve, reject) {
|
|
7032
|
-
var gen = fn.apply(self,
|
|
7032
|
+
var gen = fn.apply(self, args2);
|
|
7033
7033
|
function _next(value) {
|
|
7034
7034
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
7035
7035
|
}
|
|
@@ -7766,9 +7766,9 @@ var require_date = __commonJS({
|
|
|
7766
7766
|
}
|
|
7767
7767
|
function _asyncToGenerator(fn) {
|
|
7768
7768
|
return function() {
|
|
7769
|
-
var self = this,
|
|
7769
|
+
var self = this, args2 = arguments;
|
|
7770
7770
|
return new Promise(function(resolve, reject) {
|
|
7771
|
-
var gen = fn.apply(self,
|
|
7771
|
+
var gen = fn.apply(self, args2);
|
|
7772
7772
|
function _next(value) {
|
|
7773
7773
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
7774
7774
|
}
|
|
@@ -7992,9 +7992,9 @@ var require_number = __commonJS({
|
|
|
7992
7992
|
}
|
|
7993
7993
|
function _asyncToGenerator(fn) {
|
|
7994
7994
|
return function() {
|
|
7995
|
-
var self = this,
|
|
7995
|
+
var self = this, args2 = arguments;
|
|
7996
7996
|
return new Promise(function(resolve, reject) {
|
|
7997
|
-
var gen = fn.apply(self,
|
|
7997
|
+
var gen = fn.apply(self, args2);
|
|
7998
7998
|
function _next(value) {
|
|
7999
7999
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
8000
8000
|
}
|
|
@@ -8438,9 +8438,9 @@ var require_autocomplete = __commonJS({
|
|
|
8438
8438
|
}
|
|
8439
8439
|
function _asyncToGenerator(fn) {
|
|
8440
8440
|
return function() {
|
|
8441
|
-
var self = this,
|
|
8441
|
+
var self = this, args2 = arguments;
|
|
8442
8442
|
return new Promise(function(resolve, reject) {
|
|
8443
|
-
var gen = fn.apply(self,
|
|
8443
|
+
var gen = fn.apply(self, args2);
|
|
8444
8444
|
function _next(value) {
|
|
8445
8445
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
8446
8446
|
}
|
|
@@ -8929,59 +8929,59 @@ var require_prompts = __commonJS({
|
|
|
8929
8929
|
var $ = exports2;
|
|
8930
8930
|
var el = require_elements();
|
|
8931
8931
|
var noop = (v) => v;
|
|
8932
|
-
function toPrompt(type,
|
|
8932
|
+
function toPrompt(type, args2, opts = {}) {
|
|
8933
8933
|
return new Promise((res, rej) => {
|
|
8934
|
-
const p = new el[type](
|
|
8934
|
+
const p = new el[type](args2);
|
|
8935
8935
|
const onAbort = opts.onAbort || noop;
|
|
8936
8936
|
const onSubmit = opts.onSubmit || noop;
|
|
8937
8937
|
const onExit = opts.onExit || noop;
|
|
8938
|
-
p.on("state",
|
|
8938
|
+
p.on("state", args2.onState || noop);
|
|
8939
8939
|
p.on("submit", (x) => res(onSubmit(x)));
|
|
8940
8940
|
p.on("exit", (x) => res(onExit(x)));
|
|
8941
8941
|
p.on("abort", (x) => rej(onAbort(x)));
|
|
8942
8942
|
});
|
|
8943
8943
|
}
|
|
8944
|
-
$.text = (
|
|
8945
|
-
$.password = (
|
|
8946
|
-
|
|
8947
|
-
return $.text(
|
|
8948
|
-
};
|
|
8949
|
-
$.invisible = (
|
|
8950
|
-
|
|
8951
|
-
return $.text(
|
|
8952
|
-
};
|
|
8953
|
-
$.number = (
|
|
8954
|
-
$.date = (
|
|
8955
|
-
$.confirm = (
|
|
8956
|
-
$.list = (
|
|
8957
|
-
const sep =
|
|
8958
|
-
return toPrompt("TextPrompt",
|
|
8944
|
+
$.text = (args2) => toPrompt("TextPrompt", args2);
|
|
8945
|
+
$.password = (args2) => {
|
|
8946
|
+
args2.style = "password";
|
|
8947
|
+
return $.text(args2);
|
|
8948
|
+
};
|
|
8949
|
+
$.invisible = (args2) => {
|
|
8950
|
+
args2.style = "invisible";
|
|
8951
|
+
return $.text(args2);
|
|
8952
|
+
};
|
|
8953
|
+
$.number = (args2) => toPrompt("NumberPrompt", args2);
|
|
8954
|
+
$.date = (args2) => toPrompt("DatePrompt", args2);
|
|
8955
|
+
$.confirm = (args2) => toPrompt("ConfirmPrompt", args2);
|
|
8956
|
+
$.list = (args2) => {
|
|
8957
|
+
const sep = args2.separator || ",";
|
|
8958
|
+
return toPrompt("TextPrompt", args2, {
|
|
8959
8959
|
onSubmit: (str2) => str2.split(sep).map((s) => s.trim())
|
|
8960
8960
|
});
|
|
8961
8961
|
};
|
|
8962
|
-
$.toggle = (
|
|
8963
|
-
$.select = (
|
|
8964
|
-
$.multiselect = (
|
|
8965
|
-
|
|
8962
|
+
$.toggle = (args2) => toPrompt("TogglePrompt", args2);
|
|
8963
|
+
$.select = (args2) => toPrompt("SelectPrompt", args2);
|
|
8964
|
+
$.multiselect = (args2) => {
|
|
8965
|
+
args2.choices = [].concat(args2.choices || []);
|
|
8966
8966
|
const toSelected = (items) => items.filter((item) => item.selected).map((item) => item.value);
|
|
8967
|
-
return toPrompt("MultiselectPrompt",
|
|
8967
|
+
return toPrompt("MultiselectPrompt", args2, {
|
|
8968
8968
|
onAbort: toSelected,
|
|
8969
8969
|
onSubmit: toSelected
|
|
8970
8970
|
});
|
|
8971
8971
|
};
|
|
8972
|
-
$.autocompleteMultiselect = (
|
|
8973
|
-
|
|
8972
|
+
$.autocompleteMultiselect = (args2) => {
|
|
8973
|
+
args2.choices = [].concat(args2.choices || []);
|
|
8974
8974
|
const toSelected = (items) => items.filter((item) => item.selected).map((item) => item.value);
|
|
8975
|
-
return toPrompt("AutocompleteMultiselectPrompt",
|
|
8975
|
+
return toPrompt("AutocompleteMultiselectPrompt", args2, {
|
|
8976
8976
|
onAbort: toSelected,
|
|
8977
8977
|
onSubmit: toSelected
|
|
8978
8978
|
});
|
|
8979
8979
|
};
|
|
8980
8980
|
var byTitle = (input, choices) => Promise.resolve(choices.filter((item) => item.title.slice(0, input.length).toLowerCase() === input.toLowerCase()));
|
|
8981
|
-
$.autocomplete = (
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
return toPrompt("AutocompletePrompt",
|
|
8981
|
+
$.autocomplete = (args2) => {
|
|
8982
|
+
args2.suggest = args2.suggest || byTitle;
|
|
8983
|
+
args2.choices = [].concat(args2.choices || []);
|
|
8984
|
+
return toPrompt("AutocompletePrompt", args2);
|
|
8985
8985
|
};
|
|
8986
8986
|
}
|
|
8987
8987
|
});
|
|
@@ -9092,9 +9092,9 @@ var require_dist = __commonJS({
|
|
|
9092
9092
|
}
|
|
9093
9093
|
function _asyncToGenerator(fn) {
|
|
9094
9094
|
return function() {
|
|
9095
|
-
var self = this,
|
|
9095
|
+
var self = this, args2 = arguments;
|
|
9096
9096
|
return new Promise(function(resolve, reject) {
|
|
9097
|
-
var gen = fn.apply(self,
|
|
9097
|
+
var gen = fn.apply(self, args2);
|
|
9098
9098
|
function _next(value) {
|
|
9099
9099
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
9100
9100
|
}
|
|
@@ -11219,50 +11219,50 @@ var require_prompts2 = __commonJS({
|
|
|
11219
11219
|
var $ = exports2;
|
|
11220
11220
|
var el = require_elements2();
|
|
11221
11221
|
var noop = (v) => v;
|
|
11222
|
-
function toPrompt(type,
|
|
11222
|
+
function toPrompt(type, args2, opts = {}) {
|
|
11223
11223
|
return new Promise((res, rej) => {
|
|
11224
|
-
const p = new el[type](
|
|
11224
|
+
const p = new el[type](args2);
|
|
11225
11225
|
const onAbort = opts.onAbort || noop;
|
|
11226
11226
|
const onSubmit = opts.onSubmit || noop;
|
|
11227
11227
|
const onExit = opts.onExit || noop;
|
|
11228
|
-
p.on("state",
|
|
11228
|
+
p.on("state", args2.onState || noop);
|
|
11229
11229
|
p.on("submit", (x) => res(onSubmit(x)));
|
|
11230
11230
|
p.on("exit", (x) => res(onExit(x)));
|
|
11231
11231
|
p.on("abort", (x) => rej(onAbort(x)));
|
|
11232
11232
|
});
|
|
11233
11233
|
}
|
|
11234
|
-
$.text = (
|
|
11235
|
-
$.password = (
|
|
11236
|
-
|
|
11237
|
-
return $.text(
|
|
11238
|
-
};
|
|
11239
|
-
$.invisible = (
|
|
11240
|
-
|
|
11241
|
-
return $.text(
|
|
11242
|
-
};
|
|
11243
|
-
$.number = (
|
|
11244
|
-
$.date = (
|
|
11245
|
-
$.confirm = (
|
|
11246
|
-
$.list = (
|
|
11247
|
-
const sep =
|
|
11248
|
-
return toPrompt("TextPrompt",
|
|
11234
|
+
$.text = (args2) => toPrompt("TextPrompt", args2);
|
|
11235
|
+
$.password = (args2) => {
|
|
11236
|
+
args2.style = "password";
|
|
11237
|
+
return $.text(args2);
|
|
11238
|
+
};
|
|
11239
|
+
$.invisible = (args2) => {
|
|
11240
|
+
args2.style = "invisible";
|
|
11241
|
+
return $.text(args2);
|
|
11242
|
+
};
|
|
11243
|
+
$.number = (args2) => toPrompt("NumberPrompt", args2);
|
|
11244
|
+
$.date = (args2) => toPrompt("DatePrompt", args2);
|
|
11245
|
+
$.confirm = (args2) => toPrompt("ConfirmPrompt", args2);
|
|
11246
|
+
$.list = (args2) => {
|
|
11247
|
+
const sep = args2.separator || ",";
|
|
11248
|
+
return toPrompt("TextPrompt", args2, {
|
|
11249
11249
|
onSubmit: (str2) => str2.split(sep).map((s) => s.trim())
|
|
11250
11250
|
});
|
|
11251
11251
|
};
|
|
11252
|
-
$.toggle = (
|
|
11253
|
-
$.select = (
|
|
11254
|
-
$.multiselect = (
|
|
11255
|
-
|
|
11252
|
+
$.toggle = (args2) => toPrompt("TogglePrompt", args2);
|
|
11253
|
+
$.select = (args2) => toPrompt("SelectPrompt", args2);
|
|
11254
|
+
$.multiselect = (args2) => {
|
|
11255
|
+
args2.choices = [].concat(args2.choices || []);
|
|
11256
11256
|
const toSelected = (items) => items.filter((item) => item.selected).map((item) => item.value);
|
|
11257
|
-
return toPrompt("MultiselectPrompt",
|
|
11257
|
+
return toPrompt("MultiselectPrompt", args2, {
|
|
11258
11258
|
onAbort: toSelected,
|
|
11259
11259
|
onSubmit: toSelected
|
|
11260
11260
|
});
|
|
11261
11261
|
};
|
|
11262
|
-
$.autocompleteMultiselect = (
|
|
11263
|
-
|
|
11262
|
+
$.autocompleteMultiselect = (args2) => {
|
|
11263
|
+
args2.choices = [].concat(args2.choices || []);
|
|
11264
11264
|
const toSelected = (items) => items.filter((item) => item.selected).map((item) => item.value);
|
|
11265
|
-
return toPrompt("AutocompleteMultiselectPrompt",
|
|
11265
|
+
return toPrompt("AutocompleteMultiselectPrompt", args2, {
|
|
11266
11266
|
onAbort: toSelected,
|
|
11267
11267
|
onSubmit: toSelected
|
|
11268
11268
|
});
|
|
@@ -11270,10 +11270,10 @@ var require_prompts2 = __commonJS({
|
|
|
11270
11270
|
var byTitle = (input, choices) => Promise.resolve(
|
|
11271
11271
|
choices.filter((item) => item.title.slice(0, input.length).toLowerCase() === input.toLowerCase())
|
|
11272
11272
|
);
|
|
11273
|
-
$.autocomplete = (
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
return toPrompt("AutocompletePrompt",
|
|
11273
|
+
$.autocomplete = (args2) => {
|
|
11274
|
+
args2.suggest = args2.suggest || byTitle;
|
|
11275
|
+
args2.choices = [].concat(args2.choices || []);
|
|
11276
|
+
return toPrompt("AutocompletePrompt", args2);
|
|
11277
11277
|
};
|
|
11278
11278
|
}
|
|
11279
11279
|
});
|
|
@@ -11867,7 +11867,7 @@ var require_common2 = __commonJS({
|
|
|
11867
11867
|
let enableOverride = null;
|
|
11868
11868
|
let namespacesCache;
|
|
11869
11869
|
let enabledCache;
|
|
11870
|
-
function debug(...
|
|
11870
|
+
function debug(...args2) {
|
|
11871
11871
|
if (!debug.enabled) {
|
|
11872
11872
|
return;
|
|
11873
11873
|
}
|
|
@@ -11878,28 +11878,28 @@ var require_common2 = __commonJS({
|
|
|
11878
11878
|
self.prev = prevTime;
|
|
11879
11879
|
self.curr = curr;
|
|
11880
11880
|
prevTime = curr;
|
|
11881
|
-
|
|
11882
|
-
if (typeof
|
|
11883
|
-
|
|
11881
|
+
args2[0] = createDebug.coerce(args2[0]);
|
|
11882
|
+
if (typeof args2[0] !== "string") {
|
|
11883
|
+
args2.unshift("%O");
|
|
11884
11884
|
}
|
|
11885
11885
|
let index = 0;
|
|
11886
|
-
|
|
11886
|
+
args2[0] = args2[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
11887
11887
|
if (match === "%%") {
|
|
11888
11888
|
return "%";
|
|
11889
11889
|
}
|
|
11890
11890
|
index++;
|
|
11891
11891
|
const formatter = createDebug.formatters[format];
|
|
11892
11892
|
if (typeof formatter === "function") {
|
|
11893
|
-
const val =
|
|
11893
|
+
const val = args2[index];
|
|
11894
11894
|
match = formatter.call(self, val);
|
|
11895
|
-
|
|
11895
|
+
args2.splice(index, 1);
|
|
11896
11896
|
index--;
|
|
11897
11897
|
}
|
|
11898
11898
|
return match;
|
|
11899
11899
|
});
|
|
11900
|
-
createDebug.formatArgs.call(self,
|
|
11900
|
+
createDebug.formatArgs.call(self, args2);
|
|
11901
11901
|
const logFn = self.log || createDebug.log;
|
|
11902
|
-
logFn.apply(self,
|
|
11902
|
+
logFn.apply(self, args2);
|
|
11903
11903
|
}
|
|
11904
11904
|
debug.namespace = namespace;
|
|
11905
11905
|
debug.useColors = createDebug.useColors();
|
|
@@ -12121,16 +12121,16 @@ var require_browser = __commonJS({
|
|
|
12121
12121
|
typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
|
12122
12122
|
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
12123
12123
|
}
|
|
12124
|
-
function formatArgs(
|
|
12125
|
-
|
|
12124
|
+
function formatArgs(args2) {
|
|
12125
|
+
args2[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args2[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
|
|
12126
12126
|
if (!this.useColors) {
|
|
12127
12127
|
return;
|
|
12128
12128
|
}
|
|
12129
12129
|
const c = "color: " + this.color;
|
|
12130
|
-
|
|
12130
|
+
args2.splice(1, 0, c, "color: inherit");
|
|
12131
12131
|
let index = 0;
|
|
12132
12132
|
let lastC = 0;
|
|
12133
|
-
|
|
12133
|
+
args2[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
12134
12134
|
if (match === "%%") {
|
|
12135
12135
|
return;
|
|
12136
12136
|
}
|
|
@@ -12139,7 +12139,7 @@ var require_browser = __commonJS({
|
|
|
12139
12139
|
lastC = index;
|
|
12140
12140
|
}
|
|
12141
12141
|
});
|
|
12142
|
-
|
|
12142
|
+
args2.splice(lastC, 0, c);
|
|
12143
12143
|
}
|
|
12144
12144
|
exports2.log = console.debug || console.log || (() => {
|
|
12145
12145
|
});
|
|
@@ -12432,16 +12432,16 @@ var require_node = __commonJS({
|
|
|
12432
12432
|
function useColors() {
|
|
12433
12433
|
return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty2.isatty(process.stderr.fd);
|
|
12434
12434
|
}
|
|
12435
|
-
function formatArgs(
|
|
12435
|
+
function formatArgs(args2) {
|
|
12436
12436
|
const { namespace: name, useColors: useColors2 } = this;
|
|
12437
12437
|
if (useColors2) {
|
|
12438
12438
|
const c = this.color;
|
|
12439
12439
|
const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
|
|
12440
12440
|
const prefix = ` ${colorCode};1m${name} \x1B[0m`;
|
|
12441
|
-
|
|
12442
|
-
|
|
12441
|
+
args2[0] = prefix + args2[0].split("\n").join("\n" + prefix);
|
|
12442
|
+
args2.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
|
|
12443
12443
|
} else {
|
|
12444
|
-
|
|
12444
|
+
args2[0] = getDate() + name + " " + args2[0];
|
|
12445
12445
|
}
|
|
12446
12446
|
}
|
|
12447
12447
|
function getDate() {
|
|
@@ -12450,8 +12450,8 @@ var require_node = __commonJS({
|
|
|
12450
12450
|
}
|
|
12451
12451
|
return (/* @__PURE__ */ new Date()).toISOString() + " ";
|
|
12452
12452
|
}
|
|
12453
|
-
function log(...
|
|
12454
|
-
return process.stderr.write(util2.formatWithOptions(exports2.inspectOpts, ...
|
|
12453
|
+
function log(...args2) {
|
|
12454
|
+
return process.stderr.write(util2.formatWithOptions(exports2.inspectOpts, ...args2) + "\n");
|
|
12455
12455
|
}
|
|
12456
12456
|
function save(namespaces) {
|
|
12457
12457
|
if (namespaces) {
|
|
@@ -12710,7 +12710,7 @@ var require_depd = __commonJS({
|
|
|
12710
12710
|
if (typeof fn !== "function") {
|
|
12711
12711
|
throw new TypeError("argument fn must be a function");
|
|
12712
12712
|
}
|
|
12713
|
-
var
|
|
12713
|
+
var args2 = createArgumentsString(fn.length);
|
|
12714
12714
|
var stack = getStack();
|
|
12715
12715
|
var site = callSiteLocation(stack[1]);
|
|
12716
12716
|
site.name = fn.name;
|
|
@@ -12720,7 +12720,7 @@ var require_depd = __commonJS({
|
|
|
12720
12720
|
"deprecate",
|
|
12721
12721
|
"message",
|
|
12722
12722
|
"site",
|
|
12723
|
-
'"use strict"\nreturn function (' +
|
|
12723
|
+
'"use strict"\nreturn function (' + args2 + ") {log.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n}"
|
|
12724
12724
|
)(fn, log, this, message, site);
|
|
12725
12725
|
return deprecatedfn;
|
|
12726
12726
|
}
|
|
@@ -17197,9 +17197,9 @@ var require_raw_body = __commonJS({
|
|
|
17197
17197
|
stream.on("error", onEnd);
|
|
17198
17198
|
sync = false;
|
|
17199
17199
|
function done() {
|
|
17200
|
-
var
|
|
17201
|
-
for (var i = 0; i <
|
|
17202
|
-
|
|
17200
|
+
var args2 = new Array(arguments.length);
|
|
17201
|
+
for (var i = 0; i < args2.length; i++) {
|
|
17202
|
+
args2[i] = arguments[i];
|
|
17203
17203
|
}
|
|
17204
17204
|
complete = true;
|
|
17205
17205
|
if (sync) {
|
|
@@ -17209,10 +17209,10 @@ var require_raw_body = __commonJS({
|
|
|
17209
17209
|
}
|
|
17210
17210
|
function invokeCallback() {
|
|
17211
17211
|
cleanup();
|
|
17212
|
-
if (
|
|
17212
|
+
if (args2[0]) {
|
|
17213
17213
|
halt(stream);
|
|
17214
17214
|
}
|
|
17215
|
-
callback.apply(null,
|
|
17215
|
+
callback.apply(null, args2);
|
|
17216
17216
|
}
|
|
17217
17217
|
}
|
|
17218
17218
|
function onAborted() {
|
|
@@ -17328,13 +17328,13 @@ var require_ee_first = __commonJS({
|
|
|
17328
17328
|
}
|
|
17329
17329
|
function listener(event, done) {
|
|
17330
17330
|
return function onevent(arg1) {
|
|
17331
|
-
var
|
|
17331
|
+
var args2 = new Array(arguments.length);
|
|
17332
17332
|
var ee = this;
|
|
17333
17333
|
var err = event === "error" ? arg1 : null;
|
|
17334
|
-
for (var i = 0; i <
|
|
17335
|
-
|
|
17334
|
+
for (var i = 0; i < args2.length; i++) {
|
|
17335
|
+
args2[i] = arguments[i];
|
|
17336
17336
|
}
|
|
17337
|
-
done(err, ee, event,
|
|
17337
|
+
done(err, ee, event, args2);
|
|
17338
17338
|
};
|
|
17339
17339
|
}
|
|
17340
17340
|
}
|
|
@@ -28494,13 +28494,13 @@ var require_implementation = __commonJS({
|
|
|
28494
28494
|
if (typeof target !== "function" || toStr.apply(target) !== funcType) {
|
|
28495
28495
|
throw new TypeError(ERROR_MESSAGE + target);
|
|
28496
28496
|
}
|
|
28497
|
-
var
|
|
28497
|
+
var args2 = slicy(arguments, 1);
|
|
28498
28498
|
var bound;
|
|
28499
28499
|
var binder = function() {
|
|
28500
28500
|
if (this instanceof bound) {
|
|
28501
28501
|
var result = target.apply(
|
|
28502
28502
|
this,
|
|
28503
|
-
concatty(
|
|
28503
|
+
concatty(args2, arguments)
|
|
28504
28504
|
);
|
|
28505
28505
|
if (Object(result) === result) {
|
|
28506
28506
|
return result;
|
|
@@ -28509,10 +28509,10 @@ var require_implementation = __commonJS({
|
|
|
28509
28509
|
}
|
|
28510
28510
|
return target.apply(
|
|
28511
28511
|
that,
|
|
28512
|
-
concatty(
|
|
28512
|
+
concatty(args2, arguments)
|
|
28513
28513
|
);
|
|
28514
28514
|
};
|
|
28515
|
-
var boundLength = max(0, target.length -
|
|
28515
|
+
var boundLength = max(0, target.length - args2.length);
|
|
28516
28516
|
var boundArgs = [];
|
|
28517
28517
|
for (var i = 0; i < boundLength; i++) {
|
|
28518
28518
|
boundArgs[i] = "$" + i;
|
|
@@ -28583,11 +28583,11 @@ var require_call_bind_apply_helpers = __commonJS({
|
|
|
28583
28583
|
var $TypeError = require_type2();
|
|
28584
28584
|
var $call = require_functionCall();
|
|
28585
28585
|
var $actualApply = require_actualApply();
|
|
28586
|
-
module2.exports = function callBindBasic(
|
|
28587
|
-
if (
|
|
28586
|
+
module2.exports = function callBindBasic(args2) {
|
|
28587
|
+
if (args2.length < 1 || typeof args2[0] !== "function") {
|
|
28588
28588
|
throw new $TypeError("a function is required");
|
|
28589
28589
|
}
|
|
28590
|
-
return $actualApply(bind, $call,
|
|
28590
|
+
return $actualApply(bind, $call, args2);
|
|
28591
28591
|
};
|
|
28592
28592
|
}
|
|
28593
28593
|
});
|
|
@@ -30378,10 +30378,10 @@ var require_view = __commonJS({
|
|
|
30378
30378
|
var debug = require_src2()("express:view");
|
|
30379
30379
|
var path = __require("node:path");
|
|
30380
30380
|
var fs = __require("node:fs");
|
|
30381
|
-
var
|
|
30381
|
+
var dirname5 = path.dirname;
|
|
30382
30382
|
var basename3 = path.basename;
|
|
30383
30383
|
var extname = path.extname;
|
|
30384
|
-
var
|
|
30384
|
+
var join23 = path.join;
|
|
30385
30385
|
var resolve = path.resolve;
|
|
30386
30386
|
module2.exports = View;
|
|
30387
30387
|
function View(name, options2) {
|
|
@@ -30417,7 +30417,7 @@ var require_view = __commonJS({
|
|
|
30417
30417
|
for (var i = 0; i < roots.length && !path2; i++) {
|
|
30418
30418
|
var root = roots[i];
|
|
30419
30419
|
var loc = resolve(root, name);
|
|
30420
|
-
var dir =
|
|
30420
|
+
var dir = dirname5(loc);
|
|
30421
30421
|
var file3 = basename3(loc);
|
|
30422
30422
|
path2 = this.resolve(dir, file3);
|
|
30423
30423
|
}
|
|
@@ -30430,25 +30430,25 @@ var require_view = __commonJS({
|
|
|
30430
30430
|
if (!sync) {
|
|
30431
30431
|
return callback.apply(this, arguments);
|
|
30432
30432
|
}
|
|
30433
|
-
var
|
|
30433
|
+
var args2 = new Array(arguments.length);
|
|
30434
30434
|
var cntx = this;
|
|
30435
30435
|
for (var i = 0; i < arguments.length; i++) {
|
|
30436
|
-
|
|
30436
|
+
args2[i] = arguments[i];
|
|
30437
30437
|
}
|
|
30438
30438
|
return process.nextTick(function renderTick() {
|
|
30439
|
-
return callback.apply(cntx,
|
|
30439
|
+
return callback.apply(cntx, args2);
|
|
30440
30440
|
});
|
|
30441
30441
|
});
|
|
30442
30442
|
sync = false;
|
|
30443
30443
|
};
|
|
30444
30444
|
View.prototype.resolve = function resolve2(dir, file3) {
|
|
30445
30445
|
var ext = this.ext;
|
|
30446
|
-
var path2 =
|
|
30446
|
+
var path2 = join23(dir, file3);
|
|
30447
30447
|
var stat3 = tryStat(path2);
|
|
30448
30448
|
if (stat3 && stat3.isFile()) {
|
|
30449
30449
|
return path2;
|
|
30450
30450
|
}
|
|
30451
|
-
path2 =
|
|
30451
|
+
path2 = join23(dir, basename3(file3, ext), "index" + ext);
|
|
30452
30452
|
stat3 = tryStat(path2);
|
|
30453
30453
|
if (stat3 && stat3.isFile()) {
|
|
30454
30454
|
return path2;
|
|
@@ -31475,12 +31475,12 @@ var require_wrappy = __commonJS({
|
|
|
31475
31475
|
});
|
|
31476
31476
|
return wrapper;
|
|
31477
31477
|
function wrapper() {
|
|
31478
|
-
var
|
|
31479
|
-
for (var i = 0; i <
|
|
31480
|
-
|
|
31478
|
+
var args2 = new Array(arguments.length);
|
|
31479
|
+
for (var i = 0; i < args2.length; i++) {
|
|
31480
|
+
args2[i] = arguments[i];
|
|
31481
31481
|
}
|
|
31482
|
-
var ret = fn.apply(this,
|
|
31483
|
-
var cb2 =
|
|
31482
|
+
var ret = fn.apply(this, args2);
|
|
31483
|
+
var cb2 = args2[args2.length - 1];
|
|
31484
31484
|
if (typeof ret === "function" && ret !== cb2) {
|
|
31485
31485
|
Object.keys(cb2).forEach(function(k) {
|
|
31486
31486
|
ret[k] = cb2[k];
|
|
@@ -32559,12 +32559,12 @@ var require_router = __commonJS({
|
|
|
32559
32559
|
}
|
|
32560
32560
|
function wrap2(old, fn) {
|
|
32561
32561
|
return function proxy() {
|
|
32562
|
-
const
|
|
32563
|
-
|
|
32562
|
+
const args2 = new Array(arguments.length + 1);
|
|
32563
|
+
args2[0] = old;
|
|
32564
32564
|
for (let i = 0, len = arguments.length; i < len; i++) {
|
|
32565
|
-
|
|
32565
|
+
args2[i + 1] = arguments[i];
|
|
32566
32566
|
}
|
|
32567
|
-
fn.apply(this,
|
|
32567
|
+
fn.apply(this, args2);
|
|
32568
32568
|
};
|
|
32569
32569
|
}
|
|
32570
32570
|
}
|
|
@@ -32767,9 +32767,9 @@ var require_application = __commonJS({
|
|
|
32767
32767
|
});
|
|
32768
32768
|
app.all = function all(path) {
|
|
32769
32769
|
var route = this.route(path);
|
|
32770
|
-
var
|
|
32770
|
+
var args2 = slice.call(arguments, 1);
|
|
32771
32771
|
for (var i = 0; i < methods.length; i++) {
|
|
32772
|
-
route[methods[i]].apply(route,
|
|
32772
|
+
route[methods[i]].apply(route, args2);
|
|
32773
32773
|
}
|
|
32774
32774
|
return this;
|
|
32775
32775
|
};
|
|
@@ -32811,12 +32811,12 @@ var require_application = __commonJS({
|
|
|
32811
32811
|
};
|
|
32812
32812
|
app.listen = function listen() {
|
|
32813
32813
|
var server2 = http.createServer(this);
|
|
32814
|
-
var
|
|
32815
|
-
if (typeof
|
|
32816
|
-
var done =
|
|
32814
|
+
var args2 = slice.call(arguments);
|
|
32815
|
+
if (typeof args2[args2.length - 1] === "function") {
|
|
32816
|
+
var done = args2[args2.length - 1] = once(args2[args2.length - 1]);
|
|
32817
32817
|
server2.once("error", done);
|
|
32818
32818
|
}
|
|
32819
|
-
return server2.listen.apply(server2,
|
|
32819
|
+
return server2.listen.apply(server2, args2);
|
|
32820
32820
|
};
|
|
32821
32821
|
function logerror(err) {
|
|
32822
32822
|
if (this.get("env") !== "test") console.error(err.stack || err.toString());
|
|
@@ -34093,7 +34093,7 @@ var require_send = __commonJS({
|
|
|
34093
34093
|
var Stream = __require("stream");
|
|
34094
34094
|
var util2 = __require("util");
|
|
34095
34095
|
var extname = path.extname;
|
|
34096
|
-
var
|
|
34096
|
+
var join23 = path.join;
|
|
34097
34097
|
var normalize = path.normalize;
|
|
34098
34098
|
var resolve = path.resolve;
|
|
34099
34099
|
var sep = path.sep;
|
|
@@ -34265,7 +34265,7 @@ var require_send = __commonJS({
|
|
|
34265
34265
|
return res;
|
|
34266
34266
|
}
|
|
34267
34267
|
parts = path2.split(sep);
|
|
34268
|
-
path2 = normalize(
|
|
34268
|
+
path2 = normalize(join23(root, path2));
|
|
34269
34269
|
} else {
|
|
34270
34270
|
if (UP_PATH_REGEXP.test(path2)) {
|
|
34271
34271
|
debug('malicious path "%s"', path2);
|
|
@@ -34398,7 +34398,7 @@ var require_send = __commonJS({
|
|
|
34398
34398
|
if (err) return self.onStatError(err);
|
|
34399
34399
|
return self.error(404);
|
|
34400
34400
|
}
|
|
34401
|
-
var p =
|
|
34401
|
+
var p = join23(path2, self._index[i]);
|
|
34402
34402
|
debug('stat "%s"', p);
|
|
34403
34403
|
fs.stat(p, function(err2, stat3) {
|
|
34404
34404
|
if (err2) return next(err2);
|
|
@@ -35235,23 +35235,23 @@ var require_code = __commonJS({
|
|
|
35235
35235
|
};
|
|
35236
35236
|
exports2._Code = _Code;
|
|
35237
35237
|
exports2.nil = new _Code("");
|
|
35238
|
-
function _(strs, ...
|
|
35238
|
+
function _(strs, ...args2) {
|
|
35239
35239
|
const code = [strs[0]];
|
|
35240
35240
|
let i = 0;
|
|
35241
|
-
while (i <
|
|
35242
|
-
addCodeArg(code,
|
|
35241
|
+
while (i < args2.length) {
|
|
35242
|
+
addCodeArg(code, args2[i]);
|
|
35243
35243
|
code.push(strs[++i]);
|
|
35244
35244
|
}
|
|
35245
35245
|
return new _Code(code);
|
|
35246
35246
|
}
|
|
35247
35247
|
exports2._ = _;
|
|
35248
35248
|
var plus = new _Code("+");
|
|
35249
|
-
function str2(strs, ...
|
|
35249
|
+
function str2(strs, ...args2) {
|
|
35250
35250
|
const expr = [safeStringify(strs[0])];
|
|
35251
35251
|
let i = 0;
|
|
35252
|
-
while (i <
|
|
35252
|
+
while (i < args2.length) {
|
|
35253
35253
|
expr.push(plus);
|
|
35254
|
-
addCodeArg(expr,
|
|
35254
|
+
addCodeArg(expr, args2[i]);
|
|
35255
35255
|
expr.push(plus, safeStringify(strs[++i]));
|
|
35256
35256
|
}
|
|
35257
35257
|
optimize(expr);
|
|
@@ -35806,10 +35806,10 @@ var require_codegen = __commonJS({
|
|
|
35806
35806
|
}
|
|
35807
35807
|
};
|
|
35808
35808
|
var Func = class extends BlockNode {
|
|
35809
|
-
constructor(name,
|
|
35809
|
+
constructor(name, args2, async) {
|
|
35810
35810
|
super();
|
|
35811
35811
|
this.name = name;
|
|
35812
|
-
this.args =
|
|
35812
|
+
this.args = args2;
|
|
35813
35813
|
this.async = async;
|
|
35814
35814
|
}
|
|
35815
35815
|
render(opts) {
|
|
@@ -36084,8 +36084,8 @@ var require_codegen = __commonJS({
|
|
|
36084
36084
|
return this;
|
|
36085
36085
|
}
|
|
36086
36086
|
// `function` heading (or definition if funcBody is passed)
|
|
36087
|
-
func(name,
|
|
36088
|
-
this._blockNode(new Func(name,
|
|
36087
|
+
func(name, args2 = code_1.nil, async, funcBody) {
|
|
36088
|
+
this._blockNode(new Func(name, args2, async));
|
|
36089
36089
|
if (funcBody)
|
|
36090
36090
|
this.code(funcBody).endFunc();
|
|
36091
36091
|
return this;
|
|
@@ -36179,13 +36179,13 @@ var require_codegen = __commonJS({
|
|
|
36179
36179
|
}
|
|
36180
36180
|
exports2.not = not;
|
|
36181
36181
|
var andCode = mappend(exports2.operators.AND);
|
|
36182
|
-
function and(...
|
|
36183
|
-
return
|
|
36182
|
+
function and(...args2) {
|
|
36183
|
+
return args2.reduce(andCode);
|
|
36184
36184
|
}
|
|
36185
36185
|
exports2.and = and;
|
|
36186
36186
|
var orCode = mappend(exports2.operators.OR);
|
|
36187
|
-
function or(...
|
|
36188
|
-
return
|
|
36187
|
+
function or(...args2) {
|
|
36188
|
+
return args2.reduce(orCode);
|
|
36189
36189
|
}
|
|
36190
36190
|
exports2.or = or;
|
|
36191
36191
|
function mappend(op) {
|
|
@@ -36918,8 +36918,8 @@ var require_code2 = __commonJS({
|
|
|
36918
36918
|
];
|
|
36919
36919
|
if (it.opts.dynamicRef)
|
|
36920
36920
|
valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);
|
|
36921
|
-
const
|
|
36922
|
-
return context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${
|
|
36921
|
+
const args2 = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`;
|
|
36922
|
+
return context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args2})` : (0, codegen_1._)`${func}(${args2})`;
|
|
36923
36923
|
}
|
|
36924
36924
|
exports2.callValidateCode = callValidateCode;
|
|
36925
36925
|
var newRegExp = (0, codegen_1._)`new RegExp`;
|
|
@@ -41943,6 +41943,7 @@ import { existsSync as existsSync2 } from "node:fs";
|
|
|
41943
41943
|
import { basename, join as join4 } from "node:path";
|
|
41944
41944
|
|
|
41945
41945
|
// src/storage/file-store.ts
|
|
41946
|
+
import { randomInt } from "node:crypto";
|
|
41946
41947
|
import { mkdir as mkdir2, readdir, rename, unlink as unlink2 } from "node:fs/promises";
|
|
41947
41948
|
import { join as join2 } from "node:path";
|
|
41948
41949
|
|
|
@@ -42786,18 +42787,27 @@ var FileStore = class {
|
|
|
42786
42787
|
}
|
|
42787
42788
|
}
|
|
42788
42789
|
/**
|
|
42789
|
-
* Generate
|
|
42790
|
+
* Generate a unique task ID (task-{6_char_base36}) with collision retries
|
|
42790
42791
|
*/
|
|
42791
42792
|
async generateTaskId(parentId) {
|
|
42792
42793
|
const tasks = await this.getAllTasks();
|
|
42793
|
-
|
|
42794
|
-
|
|
42795
|
-
|
|
42796
|
-
|
|
42794
|
+
const existingIds = new Set(tasks.map((t) => t.id));
|
|
42795
|
+
const maxAttempts = 10;
|
|
42796
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
42797
|
+
const candidate = this.generateRandomTaskId();
|
|
42798
|
+
if (!existingIds.has(candidate)) {
|
|
42799
|
+
return candidate;
|
|
42800
|
+
}
|
|
42797
42801
|
}
|
|
42798
|
-
|
|
42799
|
-
|
|
42800
|
-
|
|
42802
|
+
throw new Error("Failed to generate unique task ID after 10 attempts");
|
|
42803
|
+
}
|
|
42804
|
+
/**
|
|
42805
|
+
* Create a 6-character base36 task ID
|
|
42806
|
+
*/
|
|
42807
|
+
generateRandomTaskId() {
|
|
42808
|
+
const max = 36 ** 6;
|
|
42809
|
+
const value = randomInt(0, max);
|
|
42810
|
+
return value.toString(36).padStart(6, "0");
|
|
42801
42811
|
}
|
|
42802
42812
|
/**
|
|
42803
42813
|
* Get subtasks of a task
|
|
@@ -43628,7 +43638,7 @@ function checkGitExists(projectRoot) {
|
|
|
43628
43638
|
}
|
|
43629
43639
|
}
|
|
43630
43640
|
async function updateGitignoreForIgnoredMode(projectRoot) {
|
|
43631
|
-
const { appendFileSync, readFileSync:
|
|
43641
|
+
const { appendFileSync, readFileSync: readFileSync3, writeFileSync: writeFileSync2 } = await import("node:fs");
|
|
43632
43642
|
const gitignorePath = join4(projectRoot, ".gitignore");
|
|
43633
43643
|
const knownsIgnorePattern = `
|
|
43634
43644
|
# knowns (ignore all except docs)
|
|
@@ -43637,7 +43647,7 @@ async function updateGitignoreForIgnoredMode(projectRoot) {
|
|
|
43637
43647
|
!.knowns/docs/**
|
|
43638
43648
|
`;
|
|
43639
43649
|
if (existsSync2(gitignorePath)) {
|
|
43640
|
-
const content =
|
|
43650
|
+
const content = readFileSync3(gitignorePath, "utf-8");
|
|
43641
43651
|
if (content.includes(".knowns/*")) {
|
|
43642
43652
|
console.log(source_default.gray(" .gitignore already has knowns pattern"));
|
|
43643
43653
|
return;
|
|
@@ -43645,7 +43655,7 @@ async function updateGitignoreForIgnoredMode(projectRoot) {
|
|
|
43645
43655
|
appendFileSync(gitignorePath, knownsIgnorePattern);
|
|
43646
43656
|
console.log(source_default.green("\u2713 Updated .gitignore with knowns pattern"));
|
|
43647
43657
|
} else {
|
|
43648
|
-
|
|
43658
|
+
writeFileSync2(gitignorePath, `${knownsIgnorePattern.trim()}
|
|
43649
43659
|
`, "utf-8");
|
|
43650
43660
|
console.log(source_default.green("\u2713 Created .gitignore with knowns pattern"));
|
|
43651
43661
|
}
|
|
@@ -44473,7 +44483,7 @@ function isValidISODate(dateString) {
|
|
|
44473
44483
|
return !Number.isNaN(date5.getTime());
|
|
44474
44484
|
}
|
|
44475
44485
|
function extractTaskIdFromFilename(filename) {
|
|
44476
|
-
const match = filename.match(/^task-(
|
|
44486
|
+
const match = filename.match(/^task-([a-z0-9]+(?:\.[a-z0-9]+)?)\s*-/i);
|
|
44477
44487
|
return match ? match[1] : void 0;
|
|
44478
44488
|
}
|
|
44479
44489
|
|
|
@@ -44865,20 +44875,22 @@ function formatTaskList(tasks, plain = false) {
|
|
|
44865
44875
|
if (tasks.length === 0) {
|
|
44866
44876
|
return source_default.gray("No tasks found");
|
|
44867
44877
|
}
|
|
44878
|
+
const maxIdWidth = Math.max(...tasks.map((t) => t.id.length), 4);
|
|
44868
44879
|
const output = [];
|
|
44880
|
+
const sep = source_default.gray(" | ");
|
|
44869
44881
|
for (const task of tasks) {
|
|
44870
44882
|
const statusColor = getStatusColor(task.status);
|
|
44871
44883
|
const priorityColor = getPriorityColor(task.priority);
|
|
44872
44884
|
const parts = [
|
|
44873
|
-
source_default.bold(task.id),
|
|
44874
|
-
statusColor(task.status.padEnd(
|
|
44885
|
+
source_default.bold(task.id.padEnd(maxIdWidth)),
|
|
44886
|
+
statusColor(task.status.padEnd(11)),
|
|
44875
44887
|
priorityColor(task.priority.padEnd(6)),
|
|
44876
44888
|
task.title
|
|
44877
44889
|
];
|
|
44878
44890
|
if (task.assignee) {
|
|
44879
44891
|
parts.push(source_default.cyan(`(${task.assignee})`));
|
|
44880
44892
|
}
|
|
44881
|
-
output.push(parts.join(
|
|
44893
|
+
output.push(parts.join(sep));
|
|
44882
44894
|
}
|
|
44883
44895
|
return output.join("\n");
|
|
44884
44896
|
}
|
|
@@ -46067,22 +46079,62 @@ var searchCommand = new Command("search").description("Search tasks and document
|
|
|
46067
46079
|
docResults = await searchDocs(query, projectRoot);
|
|
46068
46080
|
}
|
|
46069
46081
|
if (options2.plain) {
|
|
46070
|
-
if (taskResults.length > 0) {
|
|
46071
|
-
console.log("type,id,title,status,priority");
|
|
46072
|
-
for (const task of taskResults) {
|
|
46073
|
-
console.log(`task,${task.id},${task.title},${task.status},${task.priority}`);
|
|
46074
|
-
}
|
|
46075
|
-
}
|
|
46076
|
-
if (docResults.length > 0) {
|
|
46077
|
-
if (taskResults.length === 0) {
|
|
46078
|
-
console.log("type,filename,title,description");
|
|
46079
|
-
}
|
|
46080
|
-
for (const doc of docResults) {
|
|
46081
|
-
console.log(`doc,${doc.filename},"${doc.metadata.title}","${doc.metadata.description || ""}"`);
|
|
46082
|
-
}
|
|
46083
|
-
}
|
|
46084
46082
|
if (taskResults.length === 0 && docResults.length === 0) {
|
|
46085
46083
|
console.log("No results found");
|
|
46084
|
+
} else {
|
|
46085
|
+
if (taskResults.length > 0) {
|
|
46086
|
+
console.log("Tasks:");
|
|
46087
|
+
const statusGroups = {};
|
|
46088
|
+
const statusOrder = ["todo", "in-progress", "in-review", "blocked", "done"];
|
|
46089
|
+
const statusNames = {
|
|
46090
|
+
todo: "To Do",
|
|
46091
|
+
"in-progress": "In Progress",
|
|
46092
|
+
"in-review": "In Review",
|
|
46093
|
+
blocked: "Blocked",
|
|
46094
|
+
done: "Done"
|
|
46095
|
+
};
|
|
46096
|
+
for (const task of taskResults) {
|
|
46097
|
+
if (!statusGroups[task.status]) {
|
|
46098
|
+
statusGroups[task.status] = [];
|
|
46099
|
+
}
|
|
46100
|
+
statusGroups[task.status].push(task);
|
|
46101
|
+
}
|
|
46102
|
+
const priorityOrder = { high: 0, medium: 1, low: 2 };
|
|
46103
|
+
for (const status of statusOrder) {
|
|
46104
|
+
const tasks = statusGroups[status];
|
|
46105
|
+
if (!tasks || tasks.length === 0) continue;
|
|
46106
|
+
tasks.sort((a, b) => priorityOrder[a.priority] - priorityOrder[b.priority]);
|
|
46107
|
+
console.log(` ${statusNames[status]}:`);
|
|
46108
|
+
for (const task of tasks) {
|
|
46109
|
+
console.log(` [${task.priority.toUpperCase()}] ${task.id} - ${task.title}`);
|
|
46110
|
+
}
|
|
46111
|
+
}
|
|
46112
|
+
}
|
|
46113
|
+
if (docResults.length > 0) {
|
|
46114
|
+
if (taskResults.length > 0) console.log("");
|
|
46115
|
+
console.log("Docs:");
|
|
46116
|
+
const pathGroups = {};
|
|
46117
|
+
for (const doc of docResults) {
|
|
46118
|
+
const parts = doc.filename.split("/");
|
|
46119
|
+
const folder = parts.length > 1 ? `${parts.slice(0, -1).join("/")}/` : "(root)";
|
|
46120
|
+
if (!pathGroups[folder]) {
|
|
46121
|
+
pathGroups[folder] = [];
|
|
46122
|
+
}
|
|
46123
|
+
pathGroups[folder].push(doc);
|
|
46124
|
+
}
|
|
46125
|
+
const sortedPaths = Object.keys(pathGroups).sort((a, b) => {
|
|
46126
|
+
if (a === "(root)") return -1;
|
|
46127
|
+
if (b === "(root)") return 1;
|
|
46128
|
+
return a.localeCompare(b);
|
|
46129
|
+
});
|
|
46130
|
+
for (const path of sortedPaths) {
|
|
46131
|
+
console.log(` ${path}:`);
|
|
46132
|
+
for (const doc of pathGroups[path]) {
|
|
46133
|
+
const filename = doc.filename.split("/").pop() || doc.filename;
|
|
46134
|
+
console.log(` ${filename} - ${doc.metadata.title}`);
|
|
46135
|
+
}
|
|
46136
|
+
}
|
|
46137
|
+
}
|
|
46086
46138
|
}
|
|
46087
46139
|
} else {
|
|
46088
46140
|
const totalResults = taskResults.length + docResults.length;
|
|
@@ -49468,8 +49520,8 @@ function getLengthableOrigin(input) {
|
|
|
49468
49520
|
return "string";
|
|
49469
49521
|
return "unknown";
|
|
49470
49522
|
}
|
|
49471
|
-
function issue(...
|
|
49472
|
-
const [iss, input, inst] =
|
|
49523
|
+
function issue(...args2) {
|
|
49524
|
+
const [iss, input, inst] = args2;
|
|
49473
49525
|
if (typeof iss === "string") {
|
|
49474
49526
|
return {
|
|
49475
49527
|
message: iss,
|
|
@@ -49855,20 +49907,20 @@ var domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
|
|
|
49855
49907
|
var e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
|
|
49856
49908
|
var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
49857
49909
|
var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
|
|
49858
|
-
function timeSource(
|
|
49910
|
+
function timeSource(args2) {
|
|
49859
49911
|
const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
|
|
49860
|
-
const regex = typeof
|
|
49912
|
+
const regex = typeof args2.precision === "number" ? args2.precision === -1 ? `${hhmm}` : args2.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args2.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
|
|
49861
49913
|
return regex;
|
|
49862
49914
|
}
|
|
49863
|
-
function time(
|
|
49864
|
-
return new RegExp(`^${timeSource(
|
|
49915
|
+
function time(args2) {
|
|
49916
|
+
return new RegExp(`^${timeSource(args2)}$`);
|
|
49865
49917
|
}
|
|
49866
|
-
function datetime(
|
|
49867
|
-
const time3 = timeSource({ precision:
|
|
49918
|
+
function datetime(args2) {
|
|
49919
|
+
const time3 = timeSource({ precision: args2.precision });
|
|
49868
49920
|
const opts = ["Z"];
|
|
49869
|
-
if (
|
|
49921
|
+
if (args2.local)
|
|
49870
49922
|
opts.push("");
|
|
49871
|
-
if (
|
|
49923
|
+
if (args2.offset)
|
|
49872
49924
|
opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
|
|
49873
49925
|
const timeRegex2 = `${time3}(?:${opts.join("|")})`;
|
|
49874
49926
|
return new RegExp(`^${dateSource}T(?:${timeRegex2})$`);
|
|
@@ -50452,11 +50504,11 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
|
|
|
50452
50504
|
|
|
50453
50505
|
// node_modules/zod/v4/core/doc.js
|
|
50454
50506
|
var Doc = class {
|
|
50455
|
-
constructor(
|
|
50507
|
+
constructor(args2 = []) {
|
|
50456
50508
|
this.content = [];
|
|
50457
50509
|
this.indent = 0;
|
|
50458
50510
|
if (this)
|
|
50459
|
-
this.args =
|
|
50511
|
+
this.args = args2;
|
|
50460
50512
|
}
|
|
50461
50513
|
indented(fn) {
|
|
50462
50514
|
this.indent += 1;
|
|
@@ -50479,10 +50531,10 @@ var Doc = class {
|
|
|
50479
50531
|
}
|
|
50480
50532
|
compile() {
|
|
50481
50533
|
const F = Function;
|
|
50482
|
-
const
|
|
50534
|
+
const args2 = this?.args;
|
|
50483
50535
|
const content = this?.content ?? [``];
|
|
50484
50536
|
const lines = [...content.map((x) => ` ${x}`)];
|
|
50485
|
-
return new F(...
|
|
50537
|
+
return new F(...args2, lines.join("\n"));
|
|
50486
50538
|
}
|
|
50487
50539
|
};
|
|
50488
50540
|
|
|
@@ -52274,8 +52326,8 @@ var $ZodFunction = /* @__PURE__ */ $constructor("$ZodFunction", (inst, def) => {
|
|
|
52274
52326
|
if (typeof func !== "function") {
|
|
52275
52327
|
throw new Error("implement() must be called with a function");
|
|
52276
52328
|
}
|
|
52277
|
-
return function(...
|
|
52278
|
-
const parsedArgs = inst._def.input ? parse2(inst._def.input,
|
|
52329
|
+
return function(...args2) {
|
|
52330
|
+
const parsedArgs = inst._def.input ? parse2(inst._def.input, args2) : args2;
|
|
52279
52331
|
const result = Reflect.apply(func, this, parsedArgs);
|
|
52280
52332
|
if (inst._def.output) {
|
|
52281
52333
|
return parse2(inst._def.output, result);
|
|
@@ -52287,8 +52339,8 @@ var $ZodFunction = /* @__PURE__ */ $constructor("$ZodFunction", (inst, def) => {
|
|
|
52287
52339
|
if (typeof func !== "function") {
|
|
52288
52340
|
throw new Error("implementAsync() must be called with a function");
|
|
52289
52341
|
}
|
|
52290
|
-
return async function(...
|
|
52291
|
-
const parsedArgs = inst._def.input ? await parseAsync(inst._def.input,
|
|
52342
|
+
return async function(...args2) {
|
|
52343
|
+
const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args2) : args2;
|
|
52292
52344
|
const result = await Reflect.apply(func, this, parsedArgs);
|
|
52293
52345
|
if (inst._def.output) {
|
|
52294
52346
|
return await parseAsync(inst._def.output, result);
|
|
@@ -52314,22 +52366,22 @@ var $ZodFunction = /* @__PURE__ */ $constructor("$ZodFunction", (inst, def) => {
|
|
|
52314
52366
|
}
|
|
52315
52367
|
return payload;
|
|
52316
52368
|
};
|
|
52317
|
-
inst.input = (...
|
|
52369
|
+
inst.input = (...args2) => {
|
|
52318
52370
|
const F = inst.constructor;
|
|
52319
|
-
if (Array.isArray(
|
|
52371
|
+
if (Array.isArray(args2[0])) {
|
|
52320
52372
|
return new F({
|
|
52321
52373
|
type: "function",
|
|
52322
52374
|
input: new $ZodTuple({
|
|
52323
52375
|
type: "tuple",
|
|
52324
|
-
items:
|
|
52325
|
-
rest:
|
|
52376
|
+
items: args2[0],
|
|
52377
|
+
rest: args2[1]
|
|
52326
52378
|
}),
|
|
52327
52379
|
output: inst._def.output
|
|
52328
52380
|
});
|
|
52329
52381
|
}
|
|
52330
52382
|
return new F({
|
|
52331
52383
|
type: "function",
|
|
52332
|
-
input:
|
|
52384
|
+
input: args2[0],
|
|
52333
52385
|
output: inst._def.output
|
|
52334
52386
|
});
|
|
52335
52387
|
};
|
|
@@ -60406,12 +60458,12 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
60406
60458
|
},
|
|
60407
60459
|
configurable: true
|
|
60408
60460
|
});
|
|
60409
|
-
inst.meta = (...
|
|
60410
|
-
if (
|
|
60461
|
+
inst.meta = (...args2) => {
|
|
60462
|
+
if (args2.length === 0) {
|
|
60411
60463
|
return globalRegistry.get(inst);
|
|
60412
60464
|
}
|
|
60413
60465
|
const cl = inst.clone();
|
|
60414
|
-
globalRegistry.add(cl,
|
|
60466
|
+
globalRegistry.add(cl, args2[0]);
|
|
60415
60467
|
return cl;
|
|
60416
60468
|
};
|
|
60417
60469
|
inst.isOptional = () => inst.safeParse(void 0).success;
|
|
@@ -60426,18 +60478,18 @@ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
|
60426
60478
|
inst.format = bag.format ?? null;
|
|
60427
60479
|
inst.minLength = bag.minimum ?? null;
|
|
60428
60480
|
inst.maxLength = bag.maximum ?? null;
|
|
60429
|
-
inst.regex = (...
|
|
60430
|
-
inst.includes = (...
|
|
60431
|
-
inst.startsWith = (...
|
|
60432
|
-
inst.endsWith = (...
|
|
60433
|
-
inst.min = (...
|
|
60434
|
-
inst.max = (...
|
|
60435
|
-
inst.length = (...
|
|
60436
|
-
inst.nonempty = (...
|
|
60481
|
+
inst.regex = (...args2) => inst.check(_regex(...args2));
|
|
60482
|
+
inst.includes = (...args2) => inst.check(_includes(...args2));
|
|
60483
|
+
inst.startsWith = (...args2) => inst.check(_startsWith(...args2));
|
|
60484
|
+
inst.endsWith = (...args2) => inst.check(_endsWith(...args2));
|
|
60485
|
+
inst.min = (...args2) => inst.check(_minLength(...args2));
|
|
60486
|
+
inst.max = (...args2) => inst.check(_maxLength(...args2));
|
|
60487
|
+
inst.length = (...args2) => inst.check(_length(...args2));
|
|
60488
|
+
inst.nonempty = (...args2) => inst.check(_minLength(1, ...args2));
|
|
60437
60489
|
inst.lowercase = (params) => inst.check(_lowercase(params));
|
|
60438
60490
|
inst.uppercase = (params) => inst.check(_uppercase(params));
|
|
60439
60491
|
inst.trim = () => inst.check(_trim());
|
|
60440
|
-
inst.normalize = (...
|
|
60492
|
+
inst.normalize = (...args2) => inst.check(_normalize(...args2));
|
|
60441
60493
|
inst.toLowerCase = () => inst.check(_toLowerCase());
|
|
60442
60494
|
inst.toUpperCase = () => inst.check(_toUpperCase());
|
|
60443
60495
|
inst.slugify = () => inst.check(_slugify());
|
|
@@ -60857,8 +60909,8 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
|
60857
60909
|
inst.merge = (other) => util_exports.merge(inst, other);
|
|
60858
60910
|
inst.pick = (mask) => util_exports.pick(inst, mask);
|
|
60859
60911
|
inst.omit = (mask) => util_exports.omit(inst, mask);
|
|
60860
|
-
inst.partial = (...
|
|
60861
|
-
inst.required = (...
|
|
60912
|
+
inst.partial = (...args2) => util_exports.partial(ZodOptional, inst, args2[0]);
|
|
60913
|
+
inst.required = (...args2) => util_exports.required(ZodNonOptional, inst, args2[0]);
|
|
60862
60914
|
});
|
|
60863
60915
|
function object(shape, params) {
|
|
60864
60916
|
const def = {
|
|
@@ -61008,10 +61060,10 @@ var ZodSet = /* @__PURE__ */ $constructor("ZodSet", (inst, def) => {
|
|
|
61008
61060
|
$ZodSet.init(inst, def);
|
|
61009
61061
|
ZodType.init(inst, def);
|
|
61010
61062
|
inst._zod.processJSONSchema = (ctx, json2, params) => setProcessor(inst, ctx, json2, params);
|
|
61011
|
-
inst.min = (...
|
|
61063
|
+
inst.min = (...args2) => inst.check(_minSize(...args2));
|
|
61012
61064
|
inst.nonempty = (params) => inst.check(_minSize(1, params));
|
|
61013
|
-
inst.max = (...
|
|
61014
|
-
inst.size = (...
|
|
61065
|
+
inst.max = (...args2) => inst.check(_maxSize(...args2));
|
|
61066
|
+
inst.size = (...args2) => inst.check(_size(...args2));
|
|
61015
61067
|
});
|
|
61016
61068
|
function set(valueType, params) {
|
|
61017
61069
|
return new ZodSet({
|
|
@@ -61373,11 +61425,11 @@ function _instanceof(cls, params = {
|
|
|
61373
61425
|
inst._zod.bag.Class = cls;
|
|
61374
61426
|
return inst;
|
|
61375
61427
|
}
|
|
61376
|
-
var stringbool = (...
|
|
61428
|
+
var stringbool = (...args2) => _stringbool({
|
|
61377
61429
|
Codec: ZodCodec,
|
|
61378
61430
|
Boolean: ZodBoolean,
|
|
61379
61431
|
String: ZodString
|
|
61380
|
-
}, ...
|
|
61432
|
+
}, ...args2);
|
|
61381
61433
|
function json(params) {
|
|
61382
61434
|
const jsonSchema = lazy(() => {
|
|
61383
61435
|
return union([string2(params), number2(), boolean2(), _null3(), array(jsonSchema), record(string2(), jsonSchema)]);
|
|
@@ -62867,24 +62919,24 @@ var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=)
|
|
|
62867
62919
|
var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
|
|
62868
62920
|
var dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
62869
62921
|
var dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
62870
|
-
function timeRegexSource(
|
|
62922
|
+
function timeRegexSource(args2) {
|
|
62871
62923
|
let secondsRegexSource = `[0-5]\\d`;
|
|
62872
|
-
if (
|
|
62873
|
-
secondsRegexSource = `${secondsRegexSource}\\.\\d{${
|
|
62874
|
-
} else if (
|
|
62924
|
+
if (args2.precision) {
|
|
62925
|
+
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args2.precision}}`;
|
|
62926
|
+
} else if (args2.precision == null) {
|
|
62875
62927
|
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
|
|
62876
62928
|
}
|
|
62877
|
-
const secondsQuantifier =
|
|
62929
|
+
const secondsQuantifier = args2.precision ? "+" : "?";
|
|
62878
62930
|
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
|
62879
62931
|
}
|
|
62880
|
-
function timeRegex(
|
|
62881
|
-
return new RegExp(`^${timeRegexSource(
|
|
62932
|
+
function timeRegex(args2) {
|
|
62933
|
+
return new RegExp(`^${timeRegexSource(args2)}$`);
|
|
62882
62934
|
}
|
|
62883
|
-
function datetimeRegex(
|
|
62884
|
-
let regex = `${dateRegexSource}T${timeRegexSource(
|
|
62935
|
+
function datetimeRegex(args2) {
|
|
62936
|
+
let regex = `${dateRegexSource}T${timeRegexSource(args2)}`;
|
|
62885
62937
|
const opts = [];
|
|
62886
|
-
opts.push(
|
|
62887
|
-
if (
|
|
62938
|
+
opts.push(args2.local ? `Z?` : `Z`);
|
|
62939
|
+
if (args2.offset)
|
|
62888
62940
|
opts.push(`([+-]\\d{2}:?\\d{2})`);
|
|
62889
62941
|
regex = `${regex}(${opts.join("|")})`;
|
|
62890
62942
|
return new RegExp(`^${regex}$`);
|
|
@@ -65192,9 +65244,9 @@ var ZodFunction2 = class _ZodFunction extends ZodType2 {
|
|
|
65192
65244
|
});
|
|
65193
65245
|
return INVALID;
|
|
65194
65246
|
}
|
|
65195
|
-
function makeArgsIssue(
|
|
65247
|
+
function makeArgsIssue(args2, error46) {
|
|
65196
65248
|
return makeIssue({
|
|
65197
|
-
data:
|
|
65249
|
+
data: args2,
|
|
65198
65250
|
path: ctx.path,
|
|
65199
65251
|
errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap2(), en_default2].filter((x) => !!x),
|
|
65200
65252
|
issueData: {
|
|
@@ -65218,10 +65270,10 @@ var ZodFunction2 = class _ZodFunction extends ZodType2 {
|
|
|
65218
65270
|
const fn = ctx.data;
|
|
65219
65271
|
if (this._def.returns instanceof ZodPromise2) {
|
|
65220
65272
|
const me = this;
|
|
65221
|
-
return OK(async function(...
|
|
65273
|
+
return OK(async function(...args2) {
|
|
65222
65274
|
const error46 = new ZodError2([]);
|
|
65223
|
-
const parsedArgs = await me._def.args.parseAsync(
|
|
65224
|
-
error46.addIssue(makeArgsIssue(
|
|
65275
|
+
const parsedArgs = await me._def.args.parseAsync(args2, params).catch((e) => {
|
|
65276
|
+
error46.addIssue(makeArgsIssue(args2, e));
|
|
65225
65277
|
throw error46;
|
|
65226
65278
|
});
|
|
65227
65279
|
const result = await Reflect.apply(fn, this, parsedArgs);
|
|
@@ -65233,10 +65285,10 @@ var ZodFunction2 = class _ZodFunction extends ZodType2 {
|
|
|
65233
65285
|
});
|
|
65234
65286
|
} else {
|
|
65235
65287
|
const me = this;
|
|
65236
|
-
return OK(function(...
|
|
65237
|
-
const parsedArgs = me._def.args.safeParse(
|
|
65288
|
+
return OK(function(...args2) {
|
|
65289
|
+
const parsedArgs = me._def.args.safeParse(args2, params);
|
|
65238
65290
|
if (!parsedArgs.success) {
|
|
65239
|
-
throw new ZodError2([makeArgsIssue(
|
|
65291
|
+
throw new ZodError2([makeArgsIssue(args2, parsedArgs.error)]);
|
|
65240
65292
|
}
|
|
65241
65293
|
const result = Reflect.apply(fn, this, parsedArgs.data);
|
|
65242
65294
|
const parsedReturns = me._def.returns.safeParse(result, params);
|
|
@@ -65273,9 +65325,9 @@ var ZodFunction2 = class _ZodFunction extends ZodType2 {
|
|
|
65273
65325
|
const validatedFunc = this.parse(func);
|
|
65274
65326
|
return validatedFunc;
|
|
65275
65327
|
}
|
|
65276
|
-
static create(
|
|
65328
|
+
static create(args2, returns, params) {
|
|
65277
65329
|
return new _ZodFunction({
|
|
65278
|
-
args:
|
|
65330
|
+
args: args2 ? args2 : ZodTuple2.create([]).rest(ZodUnknown2.create()),
|
|
65279
65331
|
returns: returns || ZodUnknown2.create(),
|
|
65280
65332
|
typeName: ZodFirstPartyTypeKind2.ZodFunction,
|
|
65281
65333
|
...processCreateParams(params)
|
|
@@ -69294,8 +69346,8 @@ var taskTools = [
|
|
|
69294
69346
|
}
|
|
69295
69347
|
}
|
|
69296
69348
|
];
|
|
69297
|
-
async function handleCreateTask(
|
|
69298
|
-
const input = createTaskSchema.parse(
|
|
69349
|
+
async function handleCreateTask(args2, fileStore2) {
|
|
69350
|
+
const input = createTaskSchema.parse(args2);
|
|
69299
69351
|
const task = await fileStore2.createTask({
|
|
69300
69352
|
title: input.title,
|
|
69301
69353
|
description: input.description,
|
|
@@ -69319,8 +69371,8 @@ async function handleCreateTask(args, fileStore2) {
|
|
|
69319
69371
|
}
|
|
69320
69372
|
});
|
|
69321
69373
|
}
|
|
69322
|
-
async function handleGetTask(
|
|
69323
|
-
const input = getTaskSchema.parse(
|
|
69374
|
+
async function handleGetTask(args2, fileStore2) {
|
|
69375
|
+
const input = getTaskSchema.parse(args2);
|
|
69324
69376
|
const task = await fileStore2.getTask(input.taskId);
|
|
69325
69377
|
if (!task) {
|
|
69326
69378
|
return errorResponse(`Task ${input.taskId} not found`);
|
|
@@ -69342,8 +69394,8 @@ async function handleGetTask(args, fileStore2) {
|
|
|
69342
69394
|
}
|
|
69343
69395
|
});
|
|
69344
69396
|
}
|
|
69345
|
-
async function handleUpdateTask(
|
|
69346
|
-
const input = updateTaskSchema.parse(
|
|
69397
|
+
async function handleUpdateTask(args2, fileStore2) {
|
|
69398
|
+
const input = updateTaskSchema.parse(args2);
|
|
69347
69399
|
const updates = {};
|
|
69348
69400
|
if (input.title) updates.title = input.title;
|
|
69349
69401
|
if (input.description) updates.description = input.description;
|
|
@@ -69362,8 +69414,8 @@ async function handleUpdateTask(args, fileStore2) {
|
|
|
69362
69414
|
}
|
|
69363
69415
|
});
|
|
69364
69416
|
}
|
|
69365
|
-
async function handleListTasks(
|
|
69366
|
-
const input = listTasksSchema.parse(
|
|
69417
|
+
async function handleListTasks(args2, fileStore2) {
|
|
69418
|
+
const input = listTasksSchema.parse(args2);
|
|
69367
69419
|
let tasks = await fileStore2.getAllTasks();
|
|
69368
69420
|
if (input.status) {
|
|
69369
69421
|
tasks = tasks.filter((t) => t.status === input.status);
|
|
@@ -69389,8 +69441,8 @@ async function handleListTasks(args, fileStore2) {
|
|
|
69389
69441
|
}))
|
|
69390
69442
|
});
|
|
69391
69443
|
}
|
|
69392
|
-
async function handleSearchTasks(
|
|
69393
|
-
const input = searchTasksSchema.parse(
|
|
69444
|
+
async function handleSearchTasks(args2, fileStore2) {
|
|
69445
|
+
const input = searchTasksSchema.parse(args2);
|
|
69394
69446
|
const tasks = await fileStore2.getAllTasks();
|
|
69395
69447
|
const query = input.query.toLowerCase();
|
|
69396
69448
|
const results = tasks.filter(
|
|
@@ -69489,8 +69541,8 @@ var timeTools = [
|
|
|
69489
69541
|
}
|
|
69490
69542
|
}
|
|
69491
69543
|
];
|
|
69492
|
-
async function handleStartTime(
|
|
69493
|
-
const input = startTimeSchema.parse(
|
|
69544
|
+
async function handleStartTime(args2, fileStore2) {
|
|
69545
|
+
const input = startTimeSchema.parse(args2);
|
|
69494
69546
|
const task = await fileStore2.getTask(input.taskId);
|
|
69495
69547
|
if (!task) {
|
|
69496
69548
|
return errorResponse(`Task ${input.taskId} not found`);
|
|
@@ -69521,8 +69573,8 @@ async function handleStartTime(args, fileStore2) {
|
|
|
69521
69573
|
startedAt: newEntry.startedAt
|
|
69522
69574
|
});
|
|
69523
69575
|
}
|
|
69524
|
-
async function handleStopTime(
|
|
69525
|
-
const input = stopTimeSchema.parse(
|
|
69576
|
+
async function handleStopTime(args2, fileStore2) {
|
|
69577
|
+
const input = stopTimeSchema.parse(args2);
|
|
69526
69578
|
const task = await fileStore2.getTask(input.taskId);
|
|
69527
69579
|
if (!task) {
|
|
69528
69580
|
return errorResponse(`Task ${input.taskId} not found`);
|
|
@@ -69553,8 +69605,8 @@ async function handleStopTime(args, fileStore2) {
|
|
|
69553
69605
|
totalTime: formatDuration2(newTimeSpent)
|
|
69554
69606
|
});
|
|
69555
69607
|
}
|
|
69556
|
-
async function handleAddTime(
|
|
69557
|
-
const input = addTimeSchema.parse(
|
|
69608
|
+
async function handleAddTime(args2, fileStore2) {
|
|
69609
|
+
const input = addTimeSchema.parse(args2);
|
|
69558
69610
|
const task = await fileStore2.getTask(input.taskId);
|
|
69559
69611
|
if (!task) {
|
|
69560
69612
|
return errorResponse(`Task ${input.taskId} not found`);
|
|
@@ -69579,8 +69631,8 @@ async function handleAddTime(args, fileStore2) {
|
|
|
69579
69631
|
totalTime: formatDuration2(newTimeSpent)
|
|
69580
69632
|
});
|
|
69581
69633
|
}
|
|
69582
|
-
async function handleGetTimeReport(
|
|
69583
|
-
const input = getTimeReportSchema.parse(
|
|
69634
|
+
async function handleGetTimeReport(args2, fileStore2) {
|
|
69635
|
+
const input = getTimeReportSchema.parse(args2);
|
|
69584
69636
|
const tasks = await fileStore2.getAllTasks();
|
|
69585
69637
|
let fromDate;
|
|
69586
69638
|
let toDate;
|
|
@@ -69870,8 +69922,8 @@ async function resolveDocPath2(name) {
|
|
|
69870
69922
|
}
|
|
69871
69923
|
return null;
|
|
69872
69924
|
}
|
|
69873
|
-
async function handleListDocs(
|
|
69874
|
-
const input = listDocsSchema.parse(
|
|
69925
|
+
async function handleListDocs(args2) {
|
|
69926
|
+
const input = listDocsSchema.parse(args2);
|
|
69875
69927
|
await ensureDocsDir2();
|
|
69876
69928
|
const mdFiles = await getAllMdFiles2(DOCS_DIR2);
|
|
69877
69929
|
if (mdFiles.length === 0) {
|
|
@@ -69902,8 +69954,8 @@ async function handleListDocs(args) {
|
|
|
69902
69954
|
docs
|
|
69903
69955
|
});
|
|
69904
69956
|
}
|
|
69905
|
-
async function handleGetDoc(
|
|
69906
|
-
const input = getDocSchema.parse(
|
|
69957
|
+
async function handleGetDoc(args2) {
|
|
69958
|
+
const input = getDocSchema.parse(args2);
|
|
69907
69959
|
const resolved = await resolveDocPath2(input.path);
|
|
69908
69960
|
if (!resolved) {
|
|
69909
69961
|
return errorResponse(`Documentation not found: ${input.path}`);
|
|
@@ -69923,8 +69975,8 @@ async function handleGetDoc(args) {
|
|
|
69923
69975
|
}
|
|
69924
69976
|
});
|
|
69925
69977
|
}
|
|
69926
|
-
async function handleCreateDoc(
|
|
69927
|
-
const input = createDocSchema.parse(
|
|
69978
|
+
async function handleCreateDoc(args2) {
|
|
69979
|
+
const input = createDocSchema.parse(args2);
|
|
69928
69980
|
await ensureDocsDir2();
|
|
69929
69981
|
const filename = `${titleToFilename2(input.title)}.md`;
|
|
69930
69982
|
let targetDir = DOCS_DIR2;
|
|
@@ -69967,8 +70019,8 @@ async function handleCreateDoc(args) {
|
|
|
69967
70019
|
}
|
|
69968
70020
|
});
|
|
69969
70021
|
}
|
|
69970
|
-
async function handleUpdateDoc(
|
|
69971
|
-
const input = updateDocSchema.parse(
|
|
70022
|
+
async function handleUpdateDoc(args2) {
|
|
70023
|
+
const input = updateDocSchema.parse(args2);
|
|
69972
70024
|
const resolved = await resolveDocPath2(input.path);
|
|
69973
70025
|
if (!resolved) {
|
|
69974
70026
|
return errorResponse(`Documentation not found: ${input.path}`);
|
|
@@ -70003,8 +70055,8 @@ ${input.appendContent}`;
|
|
|
70003
70055
|
}
|
|
70004
70056
|
});
|
|
70005
70057
|
}
|
|
70006
|
-
async function handleSearchDocs(
|
|
70007
|
-
const input = searchDocsSchema.parse(
|
|
70058
|
+
async function handleSearchDocs(args2) {
|
|
70059
|
+
const input = searchDocsSchema.parse(args2);
|
|
70008
70060
|
await ensureDocsDir2();
|
|
70009
70061
|
const mdFiles = await getAllMdFiles2(DOCS_DIR2);
|
|
70010
70062
|
const query = input.query.toLowerCase();
|
|
@@ -70065,43 +70117,43 @@ server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
|
70065
70117
|
return { tools };
|
|
70066
70118
|
});
|
|
70067
70119
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
70068
|
-
const { name, arguments:
|
|
70120
|
+
const { name, arguments: args2 } = request.params;
|
|
70069
70121
|
try {
|
|
70070
70122
|
switch (name) {
|
|
70071
70123
|
// Task handlers
|
|
70072
70124
|
case "create_task":
|
|
70073
|
-
return await handleCreateTask(
|
|
70125
|
+
return await handleCreateTask(args2, fileStore);
|
|
70074
70126
|
case "get_task":
|
|
70075
|
-
return await handleGetTask(
|
|
70127
|
+
return await handleGetTask(args2, fileStore);
|
|
70076
70128
|
case "update_task":
|
|
70077
|
-
return await handleUpdateTask(
|
|
70129
|
+
return await handleUpdateTask(args2, fileStore);
|
|
70078
70130
|
case "list_tasks":
|
|
70079
|
-
return await handleListTasks(
|
|
70131
|
+
return await handleListTasks(args2, fileStore);
|
|
70080
70132
|
case "search_tasks":
|
|
70081
|
-
return await handleSearchTasks(
|
|
70133
|
+
return await handleSearchTasks(args2, fileStore);
|
|
70082
70134
|
// Time handlers
|
|
70083
70135
|
case "start_time":
|
|
70084
|
-
return await handleStartTime(
|
|
70136
|
+
return await handleStartTime(args2, fileStore);
|
|
70085
70137
|
case "stop_time":
|
|
70086
|
-
return await handleStopTime(
|
|
70138
|
+
return await handleStopTime(args2, fileStore);
|
|
70087
70139
|
case "add_time":
|
|
70088
|
-
return await handleAddTime(
|
|
70140
|
+
return await handleAddTime(args2, fileStore);
|
|
70089
70141
|
case "get_time_report":
|
|
70090
|
-
return await handleGetTimeReport(
|
|
70142
|
+
return await handleGetTimeReport(args2, fileStore);
|
|
70091
70143
|
// Board handlers
|
|
70092
70144
|
case "get_board":
|
|
70093
70145
|
return await handleGetBoard(fileStore);
|
|
70094
70146
|
// Doc handlers
|
|
70095
70147
|
case "list_docs":
|
|
70096
|
-
return await handleListDocs(
|
|
70148
|
+
return await handleListDocs(args2);
|
|
70097
70149
|
case "get_doc":
|
|
70098
|
-
return await handleGetDoc(
|
|
70150
|
+
return await handleGetDoc(args2);
|
|
70099
70151
|
case "create_doc":
|
|
70100
|
-
return await handleCreateDoc(
|
|
70152
|
+
return await handleCreateDoc(args2);
|
|
70101
70153
|
case "update_doc":
|
|
70102
|
-
return await handleUpdateDoc(
|
|
70154
|
+
return await handleUpdateDoc(args2);
|
|
70103
70155
|
case "search_docs":
|
|
70104
|
-
return await handleSearchDocs(
|
|
70156
|
+
return await handleSearchDocs(args2);
|
|
70105
70157
|
default:
|
|
70106
70158
|
return errorResponse(`Unknown tool: ${name}`);
|
|
70107
70159
|
}
|
|
@@ -70281,10 +70333,137 @@ function showConfigInfo() {
|
|
|
70281
70333
|
console.log("");
|
|
70282
70334
|
}
|
|
70283
70335
|
|
|
70336
|
+
// src/utils/update-notifier.ts
|
|
70337
|
+
import { existsSync as existsSync18, readFileSync as readFileSync2, writeFileSync } from "node:fs";
|
|
70338
|
+
import { mkdir as mkdir10 } from "node:fs/promises";
|
|
70339
|
+
import { dirname as dirname4, join as join22 } from "node:path";
|
|
70340
|
+
var DEFAULT_TTL_MS = 60 * 60 * 1e3;
|
|
70341
|
+
var DEFAULT_TIMEOUT_MS = 2e3;
|
|
70342
|
+
function detectPackageManager(cwd) {
|
|
70343
|
+
const override = (process.env.KNOWN_PREFERRED_PM || "").toLowerCase();
|
|
70344
|
+
if (override === "npm" || override === "pnpm" || override === "yarn" || override === "bun") {
|
|
70345
|
+
return override;
|
|
70346
|
+
}
|
|
70347
|
+
const ua = process.env.npm_config_user_agent || "";
|
|
70348
|
+
if (ua.startsWith("pnpm/")) return "pnpm";
|
|
70349
|
+
if (ua.startsWith("yarn/")) return "yarn";
|
|
70350
|
+
if (ua.startsWith("bun/")) return "bun";
|
|
70351
|
+
if (ua.startsWith("npm/")) return "npm";
|
|
70352
|
+
if (existsSync18(join22(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
70353
|
+
if (existsSync18(join22(cwd, "yarn.lock"))) return "yarn";
|
|
70354
|
+
if (existsSync18(join22(cwd, "bun.lock"))) return "bun";
|
|
70355
|
+
if (existsSync18(join22(cwd, "package-lock.json"))) return "npm";
|
|
70356
|
+
return "npm";
|
|
70357
|
+
}
|
|
70358
|
+
function compareVersions(a, b) {
|
|
70359
|
+
const strip = (v) => v.replace(/^v/, "");
|
|
70360
|
+
const partsA = strip(a).split(".").map((p) => Number.parseInt(p, 10) || 0);
|
|
70361
|
+
const partsB = strip(b).split(".").map((p) => Number.parseInt(p, 10) || 0);
|
|
70362
|
+
const len = Math.max(partsA.length, partsB.length);
|
|
70363
|
+
for (let i = 0; i < len; i++) {
|
|
70364
|
+
const diff = (partsA[i] || 0) - (partsB[i] || 0);
|
|
70365
|
+
if (diff !== 0) return diff > 0 ? 1 : -1;
|
|
70366
|
+
}
|
|
70367
|
+
return 0;
|
|
70368
|
+
}
|
|
70369
|
+
function shouldSkip(args2, force) {
|
|
70370
|
+
if (force) return false;
|
|
70371
|
+
if (process.env.NO_UPDATE_CHECK === "1") return true;
|
|
70372
|
+
if (process.env.CI) return true;
|
|
70373
|
+
if (process.env.NODE_ENV === "test" || process.env.VITEST) return true;
|
|
70374
|
+
if (args2?.includes("--plain")) return true;
|
|
70375
|
+
return false;
|
|
70376
|
+
}
|
|
70377
|
+
function getCachePath(cwd, explicit) {
|
|
70378
|
+
if (explicit) return explicit;
|
|
70379
|
+
const projectRoot = findProjectRoot(cwd);
|
|
70380
|
+
if (!projectRoot) return null;
|
|
70381
|
+
return join22(projectRoot, ".knowns", "cli-cache.json");
|
|
70382
|
+
}
|
|
70383
|
+
function readCache(cachePath) {
|
|
70384
|
+
try {
|
|
70385
|
+
const raw = readFileSync2(cachePath, "utf-8");
|
|
70386
|
+
const data = JSON.parse(raw);
|
|
70387
|
+
if (typeof data.lastChecked === "number" && typeof data.latestVersion === "string") {
|
|
70388
|
+
return data;
|
|
70389
|
+
}
|
|
70390
|
+
} catch {
|
|
70391
|
+
return null;
|
|
70392
|
+
}
|
|
70393
|
+
return null;
|
|
70394
|
+
}
|
|
70395
|
+
async function writeCache(cachePath, data) {
|
|
70396
|
+
const dir = dirname4(cachePath);
|
|
70397
|
+
if (dir && !existsSync18(dir)) {
|
|
70398
|
+
await mkdir10(dir, { recursive: true });
|
|
70399
|
+
}
|
|
70400
|
+
writeFileSync(cachePath, JSON.stringify(data, null, 2), "utf-8");
|
|
70401
|
+
}
|
|
70402
|
+
async function fetchLatestVersion(packageName) {
|
|
70403
|
+
try {
|
|
70404
|
+
const controller = new AbortController();
|
|
70405
|
+
const timer = setTimeout(() => controller.abort(), DEFAULT_TIMEOUT_MS);
|
|
70406
|
+
const res = await fetch(`https://registry.npmjs.org/${packageName}/latest`, {
|
|
70407
|
+
signal: controller.signal,
|
|
70408
|
+
headers: { accept: "application/json" }
|
|
70409
|
+
});
|
|
70410
|
+
clearTimeout(timer);
|
|
70411
|
+
if (!res.ok) return null;
|
|
70412
|
+
const data = await res.json();
|
|
70413
|
+
return data.version ?? null;
|
|
70414
|
+
} catch {
|
|
70415
|
+
return null;
|
|
70416
|
+
}
|
|
70417
|
+
}
|
|
70418
|
+
async function notifyCliUpdate(options2) {
|
|
70419
|
+
const {
|
|
70420
|
+
currentVersion,
|
|
70421
|
+
args: args2,
|
|
70422
|
+
cwd = process.cwd(),
|
|
70423
|
+
cachePath: explicitCachePath,
|
|
70424
|
+
cacheTtlMs = DEFAULT_TTL_MS,
|
|
70425
|
+
force = process.env.KNOWNS_UPDATE_CHECK === "1",
|
|
70426
|
+
packageName = "knowns",
|
|
70427
|
+
packageManager,
|
|
70428
|
+
fetchLatest = () => fetchLatestVersion(packageName),
|
|
70429
|
+
now = () => /* @__PURE__ */ new Date(),
|
|
70430
|
+
logger = (message2) => console.log(message2)
|
|
70431
|
+
} = options2;
|
|
70432
|
+
if (shouldSkip(args2, force)) {
|
|
70433
|
+
return;
|
|
70434
|
+
}
|
|
70435
|
+
const cachePath = getCachePath(cwd, explicitCachePath);
|
|
70436
|
+
if (!cachePath) {
|
|
70437
|
+
return;
|
|
70438
|
+
}
|
|
70439
|
+
const pm = packageManager || detectPackageManager(cwd);
|
|
70440
|
+
const cache = readCache(cachePath);
|
|
70441
|
+
const isFresh = cache && now().getTime() - cache.lastChecked < cacheTtlMs;
|
|
70442
|
+
const latestFromCache = isFresh ? cache?.latestVersion : null;
|
|
70443
|
+
let latest = latestFromCache;
|
|
70444
|
+
if (!latestFromCache) {
|
|
70445
|
+
const fetched = await fetchLatest();
|
|
70446
|
+
if (fetched) {
|
|
70447
|
+
latest = fetched;
|
|
70448
|
+
await writeCache(cachePath, { latestVersion: fetched, lastChecked: now().getTime() });
|
|
70449
|
+
} else {
|
|
70450
|
+
return;
|
|
70451
|
+
}
|
|
70452
|
+
}
|
|
70453
|
+
if (!latest || compareVersions(latest, currentVersion) <= 0) {
|
|
70454
|
+
return;
|
|
70455
|
+
}
|
|
70456
|
+
const installCmd = pm === "pnpm" ? "pnpm add -g knowns" : pm === "yarn" ? "yarn global add knowns" : pm === "bun" ? "bun add -g knowns" : "npm i -g knowns";
|
|
70457
|
+
const message = source_default.bgYellow.black(" UPDATE ") + source_default.yellowBright(` v${latest} available (current v${currentVersion}) `) + source_default.gray(`\u2192 ${installCmd}`);
|
|
70458
|
+
logger("");
|
|
70459
|
+
logger(message);
|
|
70460
|
+
logger("");
|
|
70461
|
+
}
|
|
70462
|
+
|
|
70284
70463
|
// package.json
|
|
70285
70464
|
var package_default = {
|
|
70286
70465
|
name: "knowns",
|
|
70287
|
-
version: "0.
|
|
70466
|
+
version: "0.8.0",
|
|
70288
70467
|
description: "CLI tool for dev teams to manage tasks and documentation",
|
|
70289
70468
|
module: "index.ts",
|
|
70290
70469
|
type: "module",
|
|
@@ -70436,10 +70615,15 @@ program2.addCommand(docCommand);
|
|
|
70436
70615
|
program2.addCommand(configCommand);
|
|
70437
70616
|
program2.addCommand(agentsCommand);
|
|
70438
70617
|
program2.addCommand(mcpCommand);
|
|
70439
|
-
|
|
70618
|
+
var args = process.argv.slice(2);
|
|
70619
|
+
if (args.length === 0) {
|
|
70440
70620
|
showBanner();
|
|
70621
|
+
await notifyCliUpdate({ currentVersion: package_default.version, args });
|
|
70441
70622
|
} else {
|
|
70442
|
-
program2.
|
|
70623
|
+
program2.hook("postAction", async () => {
|
|
70624
|
+
await notifyCliUpdate({ currentVersion: package_default.version, args });
|
|
70625
|
+
});
|
|
70626
|
+
await program2.parseAsync();
|
|
70443
70627
|
}
|
|
70444
70628
|
/*! Bundled license information:
|
|
70445
70629
|
|