tasqmate 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tasqmate.js +608 -165
- package/package.json +2 -2
package/dist/tasqmate.js
CHANGED
|
@@ -639,8 +639,8 @@ var require_help = __commonJS({
|
|
|
639
639
|
* @param {string} str
|
|
640
640
|
* @returns {number}
|
|
641
641
|
*/
|
|
642
|
-
displayWidth(
|
|
643
|
-
return stripColor(
|
|
642
|
+
displayWidth(str2) {
|
|
643
|
+
return stripColor(str2).length;
|
|
644
644
|
}
|
|
645
645
|
/**
|
|
646
646
|
* Style the title for displaying in the help. Called with 'Usage:', 'Options:', etc.
|
|
@@ -648,11 +648,11 @@ var require_help = __commonJS({
|
|
|
648
648
|
* @param {string} str
|
|
649
649
|
* @returns {string}
|
|
650
650
|
*/
|
|
651
|
-
styleTitle(
|
|
652
|
-
return
|
|
651
|
+
styleTitle(str2) {
|
|
652
|
+
return str2;
|
|
653
653
|
}
|
|
654
|
-
styleUsage(
|
|
655
|
-
return
|
|
654
|
+
styleUsage(str2) {
|
|
655
|
+
return str2.split(" ").map((word) => {
|
|
656
656
|
if (word === "[options]") return this.styleOptionText(word);
|
|
657
657
|
if (word === "[command]") return this.styleSubcommandText(word);
|
|
658
658
|
if (word[0] === "[" || word[0] === "<")
|
|
@@ -660,46 +660,46 @@ var require_help = __commonJS({
|
|
|
660
660
|
return this.styleCommandText(word);
|
|
661
661
|
}).join(" ");
|
|
662
662
|
}
|
|
663
|
-
styleCommandDescription(
|
|
664
|
-
return this.styleDescriptionText(
|
|
663
|
+
styleCommandDescription(str2) {
|
|
664
|
+
return this.styleDescriptionText(str2);
|
|
665
665
|
}
|
|
666
|
-
styleOptionDescription(
|
|
667
|
-
return this.styleDescriptionText(
|
|
666
|
+
styleOptionDescription(str2) {
|
|
667
|
+
return this.styleDescriptionText(str2);
|
|
668
668
|
}
|
|
669
|
-
styleSubcommandDescription(
|
|
670
|
-
return this.styleDescriptionText(
|
|
669
|
+
styleSubcommandDescription(str2) {
|
|
670
|
+
return this.styleDescriptionText(str2);
|
|
671
671
|
}
|
|
672
|
-
styleArgumentDescription(
|
|
673
|
-
return this.styleDescriptionText(
|
|
672
|
+
styleArgumentDescription(str2) {
|
|
673
|
+
return this.styleDescriptionText(str2);
|
|
674
674
|
}
|
|
675
|
-
styleDescriptionText(
|
|
676
|
-
return
|
|
675
|
+
styleDescriptionText(str2) {
|
|
676
|
+
return str2;
|
|
677
677
|
}
|
|
678
|
-
styleOptionTerm(
|
|
679
|
-
return this.styleOptionText(
|
|
678
|
+
styleOptionTerm(str2) {
|
|
679
|
+
return this.styleOptionText(str2);
|
|
680
680
|
}
|
|
681
|
-
styleSubcommandTerm(
|
|
682
|
-
return
|
|
681
|
+
styleSubcommandTerm(str2) {
|
|
682
|
+
return str2.split(" ").map((word) => {
|
|
683
683
|
if (word === "[options]") return this.styleOptionText(word);
|
|
684
684
|
if (word[0] === "[" || word[0] === "<")
|
|
685
685
|
return this.styleArgumentText(word);
|
|
686
686
|
return this.styleSubcommandText(word);
|
|
687
687
|
}).join(" ");
|
|
688
688
|
}
|
|
689
|
-
styleArgumentTerm(
|
|
690
|
-
return this.styleArgumentText(
|
|
689
|
+
styleArgumentTerm(str2) {
|
|
690
|
+
return this.styleArgumentText(str2);
|
|
691
691
|
}
|
|
692
|
-
styleOptionText(
|
|
693
|
-
return
|
|
692
|
+
styleOptionText(str2) {
|
|
693
|
+
return str2;
|
|
694
694
|
}
|
|
695
|
-
styleArgumentText(
|
|
696
|
-
return
|
|
695
|
+
styleArgumentText(str2) {
|
|
696
|
+
return str2;
|
|
697
697
|
}
|
|
698
|
-
styleSubcommandText(
|
|
699
|
-
return
|
|
698
|
+
styleSubcommandText(str2) {
|
|
699
|
+
return str2;
|
|
700
700
|
}
|
|
701
|
-
styleCommandText(
|
|
702
|
-
return
|
|
701
|
+
styleCommandText(str2) {
|
|
702
|
+
return str2;
|
|
703
703
|
}
|
|
704
704
|
/**
|
|
705
705
|
* Calculate the pad width from the maximum term length.
|
|
@@ -722,8 +722,8 @@ var require_help = __commonJS({
|
|
|
722
722
|
* @param {string} str
|
|
723
723
|
* @returns {boolean}
|
|
724
724
|
*/
|
|
725
|
-
preformatted(
|
|
726
|
-
return /\n[^\S\r\n]/.test(
|
|
725
|
+
preformatted(str2) {
|
|
726
|
+
return /\n[^\S\r\n]/.test(str2);
|
|
727
727
|
}
|
|
728
728
|
/**
|
|
729
729
|
* Format the "item", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.
|
|
@@ -769,9 +769,9 @@ ${itemIndentStr}`);
|
|
|
769
769
|
* @param {number} width
|
|
770
770
|
* @returns {string}
|
|
771
771
|
*/
|
|
772
|
-
boxWrap(
|
|
773
|
-
if (width < this.minWidthToWrap) return
|
|
774
|
-
const rawLines =
|
|
772
|
+
boxWrap(str2, width) {
|
|
773
|
+
if (width < this.minWidthToWrap) return str2;
|
|
774
|
+
const rawLines = str2.split(/\r\n|\n/);
|
|
775
775
|
const chunkPattern = /[\s]*[^\s]+/g;
|
|
776
776
|
const wrappedLines = [];
|
|
777
777
|
rawLines.forEach((line2) => {
|
|
@@ -799,9 +799,9 @@ ${itemIndentStr}`);
|
|
|
799
799
|
return wrappedLines.join("\n");
|
|
800
800
|
}
|
|
801
801
|
};
|
|
802
|
-
function stripColor(
|
|
802
|
+
function stripColor(str2) {
|
|
803
803
|
const sgrPattern = /\x1b\[\d*(;\d*)*m/g;
|
|
804
|
-
return
|
|
804
|
+
return str2.replace(sgrPattern, "");
|
|
805
805
|
}
|
|
806
806
|
exports.Help = Help2;
|
|
807
807
|
exports.stripColor = stripColor;
|
|
@@ -1073,9 +1073,9 @@ var require_option = __commonJS({
|
|
|
1073
1073
|
return option.negate === (negativeValue === value);
|
|
1074
1074
|
}
|
|
1075
1075
|
};
|
|
1076
|
-
function camelcase(
|
|
1077
|
-
return
|
|
1078
|
-
return
|
|
1076
|
+
function camelcase(str2) {
|
|
1077
|
+
return str2.split("-").reduce((str3, word) => {
|
|
1078
|
+
return str3 + word[0].toUpperCase() + word.slice(1);
|
|
1079
1079
|
});
|
|
1080
1080
|
}
|
|
1081
1081
|
function splitOptionFlags(flags) {
|
|
@@ -1258,14 +1258,14 @@ var require_command = __commonJS({
|
|
|
1258
1258
|
this._showSuggestionAfterError = true;
|
|
1259
1259
|
this._savedState = null;
|
|
1260
1260
|
this._outputConfiguration = {
|
|
1261
|
-
writeOut: (
|
|
1262
|
-
writeErr: (
|
|
1263
|
-
outputError: (
|
|
1261
|
+
writeOut: (str2) => process3.stdout.write(str2),
|
|
1262
|
+
writeErr: (str2) => process3.stderr.write(str2),
|
|
1263
|
+
outputError: (str2, write) => write(str2),
|
|
1264
1264
|
getOutHelpWidth: () => process3.stdout.isTTY ? process3.stdout.columns : void 0,
|
|
1265
1265
|
getErrHelpWidth: () => process3.stderr.isTTY ? process3.stderr.columns : void 0,
|
|
1266
1266
|
getOutHasColors: () => useColor() ?? (process3.stdout.isTTY && process3.stdout.hasColors?.()),
|
|
1267
1267
|
getErrHasColors: () => useColor() ?? (process3.stderr.isTTY && process3.stderr.hasColors?.()),
|
|
1268
|
-
stripColor: (
|
|
1268
|
+
stripColor: (str2) => stripColor(str2)
|
|
1269
1269
|
};
|
|
1270
1270
|
this._hidden = false;
|
|
1271
1271
|
this._helpOption = void 0;
|
|
@@ -2989,18 +2989,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2989
2989
|
* @param {string} [description]
|
|
2990
2990
|
* @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments
|
|
2991
2991
|
*/
|
|
2992
|
-
version(
|
|
2993
|
-
if (
|
|
2994
|
-
this._version =
|
|
2992
|
+
version(str2, flags, description) {
|
|
2993
|
+
if (str2 === void 0) return this._version;
|
|
2994
|
+
this._version = str2;
|
|
2995
2995
|
flags = flags || "-V, --version";
|
|
2996
2996
|
description = description || "output the version number";
|
|
2997
2997
|
const versionOption = this.createOption(flags, description);
|
|
2998
2998
|
this._versionOptionName = versionOption.attributeName();
|
|
2999
2999
|
this._registerOption(versionOption);
|
|
3000
3000
|
this.on("option:" + versionOption.name(), () => {
|
|
3001
|
-
this._outputConfiguration.writeOut(`${
|
|
3001
|
+
this._outputConfiguration.writeOut(`${str2}
|
|
3002
3002
|
`);
|
|
3003
|
-
this._exit(0, "commander.version",
|
|
3003
|
+
this._exit(0, "commander.version", str2);
|
|
3004
3004
|
});
|
|
3005
3005
|
return this;
|
|
3006
3006
|
}
|
|
@@ -3011,10 +3011,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3011
3011
|
* @param {object} [argsDescription]
|
|
3012
3012
|
* @return {(string|Command)}
|
|
3013
3013
|
*/
|
|
3014
|
-
description(
|
|
3015
|
-
if (
|
|
3014
|
+
description(str2, argsDescription) {
|
|
3015
|
+
if (str2 === void 0 && argsDescription === void 0)
|
|
3016
3016
|
return this._description;
|
|
3017
|
-
this._description =
|
|
3017
|
+
this._description = str2;
|
|
3018
3018
|
if (argsDescription) {
|
|
3019
3019
|
this._argsDescription = argsDescription;
|
|
3020
3020
|
}
|
|
@@ -3026,9 +3026,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3026
3026
|
* @param {string} [str]
|
|
3027
3027
|
* @return {(string|Command)}
|
|
3028
3028
|
*/
|
|
3029
|
-
summary(
|
|
3030
|
-
if (
|
|
3031
|
-
this._summary =
|
|
3029
|
+
summary(str2) {
|
|
3030
|
+
if (str2 === void 0) return this._summary;
|
|
3031
|
+
this._summary = str2;
|
|
3032
3032
|
return this;
|
|
3033
3033
|
}
|
|
3034
3034
|
/**
|
|
@@ -3076,8 +3076,8 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3076
3076
|
* @param {string} [str]
|
|
3077
3077
|
* @return {(string|Command)}
|
|
3078
3078
|
*/
|
|
3079
|
-
usage(
|
|
3080
|
-
if (
|
|
3079
|
+
usage(str2) {
|
|
3080
|
+
if (str2 === void 0) {
|
|
3081
3081
|
if (this._usage) return this._usage;
|
|
3082
3082
|
const args = this.registeredArguments.map((arg) => {
|
|
3083
3083
|
return humanReadableArgName(arg);
|
|
@@ -3088,7 +3088,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3088
3088
|
this.registeredArguments.length ? args : []
|
|
3089
3089
|
).join(" ");
|
|
3090
3090
|
}
|
|
3091
|
-
this._usage =
|
|
3091
|
+
this._usage = str2;
|
|
3092
3092
|
return this;
|
|
3093
3093
|
}
|
|
3094
3094
|
/**
|
|
@@ -3097,9 +3097,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3097
3097
|
* @param {string} [str]
|
|
3098
3098
|
* @return {(string|Command)}
|
|
3099
3099
|
*/
|
|
3100
|
-
name(
|
|
3101
|
-
if (
|
|
3102
|
-
this._name =
|
|
3100
|
+
name(str2) {
|
|
3101
|
+
if (str2 === void 0) return this._name;
|
|
3102
|
+
this._name = str2;
|
|
3103
3103
|
return this;
|
|
3104
3104
|
}
|
|
3105
3105
|
/**
|
|
@@ -3233,17 +3233,17 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3233
3233
|
let hasColors;
|
|
3234
3234
|
let helpWidth;
|
|
3235
3235
|
if (error48) {
|
|
3236
|
-
baseWrite = (
|
|
3236
|
+
baseWrite = (str2) => this._outputConfiguration.writeErr(str2);
|
|
3237
3237
|
hasColors = this._outputConfiguration.getErrHasColors();
|
|
3238
3238
|
helpWidth = this._outputConfiguration.getErrHelpWidth();
|
|
3239
3239
|
} else {
|
|
3240
|
-
baseWrite = (
|
|
3240
|
+
baseWrite = (str2) => this._outputConfiguration.writeOut(str2);
|
|
3241
3241
|
hasColors = this._outputConfiguration.getOutHasColors();
|
|
3242
3242
|
helpWidth = this._outputConfiguration.getOutHelpWidth();
|
|
3243
3243
|
}
|
|
3244
|
-
const write = (
|
|
3245
|
-
if (!hasColors)
|
|
3246
|
-
return baseWrite(
|
|
3244
|
+
const write = (str2) => {
|
|
3245
|
+
if (!hasColors) str2 = this._outputConfiguration.stripColor(str2);
|
|
3246
|
+
return baseWrite(str2);
|
|
3247
3247
|
};
|
|
3248
3248
|
return { error: error48, write, hasColors, helpWidth };
|
|
3249
3249
|
}
|
|
@@ -3612,39 +3612,39 @@ var require_utils = __commonJS({
|
|
|
3612
3612
|
function codeRegex(capture) {
|
|
3613
3613
|
return capture ? /\u001b\[((?:\d*;){0,5}\d*)m/g : /\u001b\[(?:\d*;){0,5}\d*m/g;
|
|
3614
3614
|
}
|
|
3615
|
-
function strlen(
|
|
3615
|
+
function strlen(str2) {
|
|
3616
3616
|
let code = codeRegex();
|
|
3617
|
-
let stripped = ("" +
|
|
3617
|
+
let stripped = ("" + str2).replace(code, "");
|
|
3618
3618
|
let split = stripped.split("\n");
|
|
3619
3619
|
return split.reduce(function(memo, s) {
|
|
3620
3620
|
return stringWidth(s) > memo ? stringWidth(s) : memo;
|
|
3621
3621
|
}, 0);
|
|
3622
3622
|
}
|
|
3623
|
-
function repeat(
|
|
3624
|
-
return Array(times + 1).join(
|
|
3623
|
+
function repeat(str2, times) {
|
|
3624
|
+
return Array(times + 1).join(str2);
|
|
3625
3625
|
}
|
|
3626
|
-
function pad(
|
|
3627
|
-
let length = strlen(
|
|
3626
|
+
function pad(str2, len, pad2, dir) {
|
|
3627
|
+
let length = strlen(str2);
|
|
3628
3628
|
if (len + 1 >= length) {
|
|
3629
3629
|
let padlen = len - length;
|
|
3630
3630
|
switch (dir) {
|
|
3631
3631
|
case "right": {
|
|
3632
|
-
|
|
3632
|
+
str2 = repeat(pad2, padlen) + str2;
|
|
3633
3633
|
break;
|
|
3634
3634
|
}
|
|
3635
3635
|
case "center": {
|
|
3636
3636
|
let right = Math.ceil(padlen / 2);
|
|
3637
3637
|
let left = padlen - right;
|
|
3638
|
-
|
|
3638
|
+
str2 = repeat(pad2, left) + str2 + repeat(pad2, right);
|
|
3639
3639
|
break;
|
|
3640
3640
|
}
|
|
3641
3641
|
default: {
|
|
3642
|
-
|
|
3642
|
+
str2 = str2 + repeat(pad2, padlen);
|
|
3643
3643
|
break;
|
|
3644
3644
|
}
|
|
3645
3645
|
}
|
|
3646
3646
|
}
|
|
3647
|
-
return
|
|
3647
|
+
return str2;
|
|
3648
3648
|
}
|
|
3649
3649
|
var codeCache = {};
|
|
3650
3650
|
function addToCodeCache(name, on, off) {
|
|
@@ -3728,25 +3728,25 @@ var require_utils = __commonJS({
|
|
|
3728
3728
|
}
|
|
3729
3729
|
return ret;
|
|
3730
3730
|
}
|
|
3731
|
-
function truncateWidth(
|
|
3732
|
-
if (
|
|
3733
|
-
return
|
|
3731
|
+
function truncateWidth(str2, desiredLength) {
|
|
3732
|
+
if (str2.length === strlen(str2)) {
|
|
3733
|
+
return str2.substr(0, desiredLength);
|
|
3734
3734
|
}
|
|
3735
|
-
while (strlen(
|
|
3736
|
-
|
|
3735
|
+
while (strlen(str2) > desiredLength) {
|
|
3736
|
+
str2 = str2.slice(0, -1);
|
|
3737
3737
|
}
|
|
3738
|
-
return
|
|
3738
|
+
return str2;
|
|
3739
3739
|
}
|
|
3740
|
-
function truncateWidthWithAnsi(
|
|
3740
|
+
function truncateWidthWithAnsi(str2, desiredLength) {
|
|
3741
3741
|
let code = codeRegex(true);
|
|
3742
|
-
let split =
|
|
3742
|
+
let split = str2.split(codeRegex());
|
|
3743
3743
|
let splitIndex = 0;
|
|
3744
3744
|
let retLen = 0;
|
|
3745
3745
|
let ret = "";
|
|
3746
3746
|
let myArray;
|
|
3747
3747
|
let state = {};
|
|
3748
3748
|
while (retLen < desiredLength) {
|
|
3749
|
-
myArray = code.exec(
|
|
3749
|
+
myArray = code.exec(str2);
|
|
3750
3750
|
let toAdd = split[splitIndex];
|
|
3751
3751
|
splitIndex++;
|
|
3752
3752
|
if (retLen + strlen(toAdd) > desiredLength) {
|
|
@@ -3764,17 +3764,17 @@ var require_utils = __commonJS({
|
|
|
3764
3764
|
}
|
|
3765
3765
|
return unwindState(state, ret);
|
|
3766
3766
|
}
|
|
3767
|
-
function truncate(
|
|
3767
|
+
function truncate(str2, desiredLength, truncateChar) {
|
|
3768
3768
|
truncateChar = truncateChar || "\u2026";
|
|
3769
|
-
let lengthOfStr = strlen(
|
|
3769
|
+
let lengthOfStr = strlen(str2);
|
|
3770
3770
|
if (lengthOfStr <= desiredLength) {
|
|
3771
|
-
return
|
|
3771
|
+
return str2;
|
|
3772
3772
|
}
|
|
3773
3773
|
desiredLength -= strlen(truncateChar);
|
|
3774
|
-
let ret = truncateWidthWithAnsi(
|
|
3774
|
+
let ret = truncateWidthWithAnsi(str2, desiredLength);
|
|
3775
3775
|
ret += truncateChar;
|
|
3776
3776
|
const hrefTag = "\x1B]8;;\x07";
|
|
3777
|
-
if (
|
|
3777
|
+
if (str2.includes(hrefTag) && !ret.includes(hrefTag)) {
|
|
3778
3778
|
ret += hrefTag;
|
|
3779
3779
|
}
|
|
3780
3780
|
return ret;
|
|
@@ -3853,9 +3853,9 @@ var require_utils = __commonJS({
|
|
|
3853
3853
|
function textWrap(maxLength, input) {
|
|
3854
3854
|
let lines = [];
|
|
3855
3855
|
let line2 = "";
|
|
3856
|
-
function pushLine(
|
|
3856
|
+
function pushLine(str2, ws) {
|
|
3857
3857
|
if (line2.length && ws) line2 += ws;
|
|
3858
|
-
line2 +=
|
|
3858
|
+
line2 += str2;
|
|
3859
3859
|
while (line2.length > maxLength) {
|
|
3860
3860
|
lines.push(line2.slice(0, maxLength));
|
|
3861
3861
|
line2 = line2.slice(maxLength);
|
|
@@ -4444,25 +4444,25 @@ var require_colors = __commonJS({
|
|
|
4444
4444
|
colors.disable = function() {
|
|
4445
4445
|
colors.enabled = false;
|
|
4446
4446
|
};
|
|
4447
|
-
colors.stripColors = colors.strip = function(
|
|
4448
|
-
return ("" +
|
|
4447
|
+
colors.stripColors = colors.strip = function(str2) {
|
|
4448
|
+
return ("" + str2).replace(/\x1B\[\d+m/g, "");
|
|
4449
4449
|
};
|
|
4450
|
-
var stylize = colors.stylize = function stylize2(
|
|
4450
|
+
var stylize = colors.stylize = function stylize2(str2, style) {
|
|
4451
4451
|
if (!colors.enabled) {
|
|
4452
|
-
return
|
|
4452
|
+
return str2 + "";
|
|
4453
4453
|
}
|
|
4454
4454
|
var styleMap = ansiStyles[style];
|
|
4455
4455
|
if (!styleMap && style in colors) {
|
|
4456
|
-
return colors[style](
|
|
4456
|
+
return colors[style](str2);
|
|
4457
4457
|
}
|
|
4458
|
-
return styleMap.open +
|
|
4458
|
+
return styleMap.open + str2 + styleMap.close;
|
|
4459
4459
|
};
|
|
4460
4460
|
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
|
|
4461
|
-
var escapeStringRegexp = function(
|
|
4462
|
-
if (typeof
|
|
4461
|
+
var escapeStringRegexp = function(str2) {
|
|
4462
|
+
if (typeof str2 !== "string") {
|
|
4463
4463
|
throw new TypeError("Expected a string");
|
|
4464
4464
|
}
|
|
4465
|
-
return
|
|
4465
|
+
return str2.replace(matchOperatorsRe, "\\$&");
|
|
4466
4466
|
};
|
|
4467
4467
|
function build(_styles) {
|
|
4468
4468
|
var builder = function builder2() {
|
|
@@ -4489,29 +4489,29 @@ var require_colors = __commonJS({
|
|
|
4489
4489
|
}, styles);
|
|
4490
4490
|
function applyStyle() {
|
|
4491
4491
|
var args = Array.prototype.slice.call(arguments);
|
|
4492
|
-
var
|
|
4492
|
+
var str2 = args.map(function(arg) {
|
|
4493
4493
|
if (arg != null && arg.constructor === String) {
|
|
4494
4494
|
return arg;
|
|
4495
4495
|
} else {
|
|
4496
4496
|
return util.inspect(arg);
|
|
4497
4497
|
}
|
|
4498
4498
|
}).join(" ");
|
|
4499
|
-
if (!colors.enabled || !
|
|
4500
|
-
return
|
|
4499
|
+
if (!colors.enabled || !str2) {
|
|
4500
|
+
return str2;
|
|
4501
4501
|
}
|
|
4502
|
-
var newLinesPresent =
|
|
4502
|
+
var newLinesPresent = str2.indexOf("\n") != -1;
|
|
4503
4503
|
var nestedStyles = this._styles;
|
|
4504
4504
|
var i = nestedStyles.length;
|
|
4505
4505
|
while (i--) {
|
|
4506
4506
|
var code = ansiStyles[nestedStyles[i]];
|
|
4507
|
-
|
|
4507
|
+
str2 = code.open + str2.replace(code.closeRe, code.open) + code.close;
|
|
4508
4508
|
if (newLinesPresent) {
|
|
4509
|
-
|
|
4509
|
+
str2 = str2.replace(newLineRegex, function(match) {
|
|
4510
4510
|
return code.close + match + code.open;
|
|
4511
4511
|
});
|
|
4512
4512
|
}
|
|
4513
4513
|
}
|
|
4514
|
-
return
|
|
4514
|
+
return str2;
|
|
4515
4515
|
}
|
|
4516
4516
|
colors.setTheme = function(theme) {
|
|
4517
4517
|
if (typeof theme === "string") {
|
|
@@ -4520,15 +4520,15 @@ var require_colors = __commonJS({
|
|
|
4520
4520
|
}
|
|
4521
4521
|
for (var style in theme) {
|
|
4522
4522
|
(function(style2) {
|
|
4523
|
-
colors[style2] = function(
|
|
4523
|
+
colors[style2] = function(str2) {
|
|
4524
4524
|
if (typeof theme[style2] === "object") {
|
|
4525
|
-
var out =
|
|
4525
|
+
var out = str2;
|
|
4526
4526
|
for (var i in theme[style2]) {
|
|
4527
4527
|
out = colors[theme[style2][i]](out);
|
|
4528
4528
|
}
|
|
4529
4529
|
return out;
|
|
4530
4530
|
}
|
|
4531
|
-
return colors[theme[style2]](
|
|
4531
|
+
return colors[theme[style2]](str2);
|
|
4532
4532
|
};
|
|
4533
4533
|
})(style);
|
|
4534
4534
|
}
|
|
@@ -4544,8 +4544,8 @@ var require_colors = __commonJS({
|
|
|
4544
4544
|
});
|
|
4545
4545
|
return ret;
|
|
4546
4546
|
}
|
|
4547
|
-
var sequencer = function sequencer2(map3,
|
|
4548
|
-
var exploded =
|
|
4547
|
+
var sequencer = function sequencer2(map3, str2) {
|
|
4548
|
+
var exploded = str2.split("");
|
|
4549
4549
|
exploded = exploded.map(map3);
|
|
4550
4550
|
return exploded.join("");
|
|
4551
4551
|
};
|
|
@@ -4558,8 +4558,8 @@ var require_colors = __commonJS({
|
|
|
4558
4558
|
colors.maps.random = require_random()(colors);
|
|
4559
4559
|
for (map2 in colors.maps) {
|
|
4560
4560
|
(function(map3) {
|
|
4561
|
-
colors[map3] = function(
|
|
4562
|
-
return sequencer(colors.maps[map3],
|
|
4561
|
+
colors[map3] = function(str2) {
|
|
4562
|
+
return sequencer(colors.maps[map3], str2);
|
|
4563
4563
|
};
|
|
4564
4564
|
})(map2);
|
|
4565
4565
|
}
|
|
@@ -5268,8 +5268,8 @@ var require_table = __commonJS({
|
|
|
5268
5268
|
return result.join("\n");
|
|
5269
5269
|
}
|
|
5270
5270
|
get width() {
|
|
5271
|
-
let
|
|
5272
|
-
return
|
|
5271
|
+
let str2 = this.toString().split("\n");
|
|
5272
|
+
return str2[0].length;
|
|
5273
5273
|
}
|
|
5274
5274
|
};
|
|
5275
5275
|
Table2.reset = () => debug.reset();
|
|
@@ -5278,8 +5278,8 @@ var require_table = __commonJS({
|
|
|
5278
5278
|
row.forEach(function(cell2) {
|
|
5279
5279
|
line2.push(cell2.draw(lineNum));
|
|
5280
5280
|
});
|
|
5281
|
-
let
|
|
5282
|
-
if (
|
|
5281
|
+
let str2 = line2.join("");
|
|
5282
|
+
if (str2.length) result.push(str2);
|
|
5283
5283
|
}
|
|
5284
5284
|
module.exports = Table2;
|
|
5285
5285
|
}
|
|
@@ -7094,6 +7094,28 @@ var TasqmateClient = class _TasqmateClient {
|
|
|
7094
7094
|
`/workspaces/${encodeURIComponent(slug)}/agents/me/chats/${encodeURIComponent(chatId)}/reply`,
|
|
7095
7095
|
{ method: "POST", body: JSON.stringify(reply) }
|
|
7096
7096
|
),
|
|
7097
|
+
/**
|
|
7098
|
+
* Open a run for one of this agent's wakes (CHAT-2). Opening the same
|
|
7099
|
+
* wake again while its run is still going returns that run.
|
|
7100
|
+
*/
|
|
7101
|
+
openRun: (slug, input) => this.#request(
|
|
7102
|
+
`/workspaces/${encodeURIComponent(slug)}/agents/me/runs`,
|
|
7103
|
+
{ method: "POST", body: JSON.stringify(input) }
|
|
7104
|
+
),
|
|
7105
|
+
/**
|
|
7106
|
+
* Post a batch of a run's steps (at most 100). A `seq` already stored is
|
|
7107
|
+
* skipped, so a retried batch is harmless. The answer says whether
|
|
7108
|
+
* someone pressed Stop.
|
|
7109
|
+
*/
|
|
7110
|
+
postRunEvents: (slug, runId, events) => this.#request(
|
|
7111
|
+
`/workspaces/${encodeURIComponent(slug)}/agents/me/runs/${encodeURIComponent(runId)}/events`,
|
|
7112
|
+
{ method: "POST", body: JSON.stringify({ events }) }
|
|
7113
|
+
),
|
|
7114
|
+
/** End a run: `done`, `failed` or `stopped`, with one line on how it went. */
|
|
7115
|
+
finishRun: (slug, runId, finish) => this.#request(
|
|
7116
|
+
`/workspaces/${encodeURIComponent(slug)}/agents/me/runs/${encodeURIComponent(runId)}/finish`,
|
|
7117
|
+
{ method: "POST", body: JSON.stringify(finish) }
|
|
7118
|
+
),
|
|
7097
7119
|
/** The bridge unpairs itself: its record and this key are revoked. */
|
|
7098
7120
|
unpairBridge: (slug) => this.#request(
|
|
7099
7121
|
`/workspaces/${encodeURIComponent(slug)}/agents/me/bridge`,
|
|
@@ -7343,7 +7365,7 @@ function reportError(error48, io2) {
|
|
|
7343
7365
|
// package.json
|
|
7344
7366
|
var package_default = {
|
|
7345
7367
|
name: "tasqmate",
|
|
7346
|
-
version: "0.
|
|
7368
|
+
version: "0.4.0",
|
|
7347
7369
|
description: "Command-line client for Tasqmate, for humans and agents alike. Installs the tasqmate and tasqmate commands.",
|
|
7348
7370
|
keywords: [
|
|
7349
7371
|
"tasqmate",
|
|
@@ -9255,14 +9277,14 @@ function promiseAllObject(promisesObj) {
|
|
|
9255
9277
|
}
|
|
9256
9278
|
function randomString(length = 10) {
|
|
9257
9279
|
const chars = "abcdefghijklmnopqrstuvwxyz";
|
|
9258
|
-
let
|
|
9280
|
+
let str2 = "";
|
|
9259
9281
|
for (let i = 0; i < length; i++) {
|
|
9260
|
-
|
|
9282
|
+
str2 += chars[Math.floor(Math.random() * chars.length)];
|
|
9261
9283
|
}
|
|
9262
|
-
return
|
|
9284
|
+
return str2;
|
|
9263
9285
|
}
|
|
9264
|
-
function esc(
|
|
9265
|
-
return JSON.stringify(
|
|
9286
|
+
function esc(str2) {
|
|
9287
|
+
return JSON.stringify(str2);
|
|
9266
9288
|
}
|
|
9267
9289
|
function slugify(input) {
|
|
9268
9290
|
return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
@@ -9362,8 +9384,8 @@ var getParsedType = (data) => {
|
|
|
9362
9384
|
};
|
|
9363
9385
|
var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
|
|
9364
9386
|
var primitiveTypes = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
|
|
9365
|
-
function escapeRegex(
|
|
9366
|
-
return
|
|
9387
|
+
function escapeRegex(str2) {
|
|
9388
|
+
return str2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
9367
9389
|
}
|
|
9368
9390
|
function clone(inst, def, params) {
|
|
9369
9391
|
const cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
@@ -22268,6 +22290,104 @@ function fileLog(path, echo, now = () => /* @__PURE__ */ new Date()) {
|
|
|
22268
22290
|
};
|
|
22269
22291
|
}
|
|
22270
22292
|
|
|
22293
|
+
// src/bridge/steps.ts
|
|
22294
|
+
import { isAbsolute, relative } from "path";
|
|
22295
|
+
var noSteps = () => {
|
|
22296
|
+
};
|
|
22297
|
+
function displayPath(path, cwd) {
|
|
22298
|
+
if (!isAbsolute(path)) return path;
|
|
22299
|
+
const inside2 = relative(cwd, path);
|
|
22300
|
+
return inside2 !== "" && !inside2.startsWith("..") && !isAbsolute(inside2) ? inside2 : path;
|
|
22301
|
+
}
|
|
22302
|
+
function lineCount(text) {
|
|
22303
|
+
return text === "" ? 0 : text.split("\n").length;
|
|
22304
|
+
}
|
|
22305
|
+
var textSchema = external_exports.string().min(1);
|
|
22306
|
+
function str(input, ...keys) {
|
|
22307
|
+
for (const key of keys) {
|
|
22308
|
+
const value = textSchema.safeParse(input[key]);
|
|
22309
|
+
if (value.success) return value.data;
|
|
22310
|
+
}
|
|
22311
|
+
return null;
|
|
22312
|
+
}
|
|
22313
|
+
function toolDetail(tool, path, lines) {
|
|
22314
|
+
const detail = { tool };
|
|
22315
|
+
if (path !== null) detail.path = path;
|
|
22316
|
+
if (lines !== void 0) {
|
|
22317
|
+
detail.added = lines.added;
|
|
22318
|
+
if (lines.removed !== void 0) detail.removed = lines.removed;
|
|
22319
|
+
}
|
|
22320
|
+
return detail;
|
|
22321
|
+
}
|
|
22322
|
+
function quoted(text) {
|
|
22323
|
+
const line2 = text.replace(/\s+/g, " ").trim();
|
|
22324
|
+
return `\u201C${line2.length <= 60 ? line2 : `${line2.slice(0, 59)}\u2026`}\u201D`;
|
|
22325
|
+
}
|
|
22326
|
+
function mcpToolName(name) {
|
|
22327
|
+
const parts = name.split("__");
|
|
22328
|
+
return (parts.at(-1) ?? name).replace(/[_-]+/g, " ").trim();
|
|
22329
|
+
}
|
|
22330
|
+
function describeTool(name, input, cwd) {
|
|
22331
|
+
const path = str(input, "file_path", "notebook_path", "path");
|
|
22332
|
+
const shown = path === null ? null : displayPath(path, cwd);
|
|
22333
|
+
const tool = name;
|
|
22334
|
+
switch (name) {
|
|
22335
|
+
case "Read":
|
|
22336
|
+
case "NotebookRead":
|
|
22337
|
+
return { kind: "action", title: `Opened ${shown ?? "a file"}`, detail: toolDetail(tool, shown) };
|
|
22338
|
+
case "Edit":
|
|
22339
|
+
case "MultiEdit":
|
|
22340
|
+
case "NotebookEdit": {
|
|
22341
|
+
const oldText = str(input, "old_string") ?? "";
|
|
22342
|
+
const newText = str(input, "new_string", "new_source") ?? "";
|
|
22343
|
+
return {
|
|
22344
|
+
kind: "action",
|
|
22345
|
+
title: `Edited ${shown ?? "a file"}`,
|
|
22346
|
+
detail: toolDetail(tool, shown, { added: lineCount(newText), removed: lineCount(oldText) })
|
|
22347
|
+
};
|
|
22348
|
+
}
|
|
22349
|
+
case "Write":
|
|
22350
|
+
return {
|
|
22351
|
+
kind: "action",
|
|
22352
|
+
title: `Wrote ${shown ?? "a file"}`,
|
|
22353
|
+
detail: toolDetail(tool, shown, { added: lineCount(str(input, "content") ?? "") })
|
|
22354
|
+
};
|
|
22355
|
+
case "Glob":
|
|
22356
|
+
return { kind: "action", title: `Listed files matching ${quoted(str(input, "pattern") ?? "*")}`, detail: { tool } };
|
|
22357
|
+
case "Grep":
|
|
22358
|
+
return { kind: "action", title: `Searched for ${quoted(str(input, "pattern") ?? "")}`, detail: { tool } };
|
|
22359
|
+
case "Bash":
|
|
22360
|
+
return { kind: "action", title: `Ran ${quoted(str(input, "command") ?? "a command")}`, detail: { tool } };
|
|
22361
|
+
default:
|
|
22362
|
+
if (name.startsWith("mcp__")) {
|
|
22363
|
+
return { kind: "action", title: `Tasqmate: ${mcpToolName(name)}`, detail: { tool } };
|
|
22364
|
+
}
|
|
22365
|
+
return { kind: "action", title: `Used ${name}`, detail: { tool } };
|
|
22366
|
+
}
|
|
22367
|
+
}
|
|
22368
|
+
function planStep(entries) {
|
|
22369
|
+
const done = entries.filter((entry) => entry.status === "completed").length;
|
|
22370
|
+
return {
|
|
22371
|
+
kind: "plan",
|
|
22372
|
+
title: `Plan \xB7 ${done} of ${entries.length} done`,
|
|
22373
|
+
detail: { entries: entries.slice(0, 50).map((entry) => ({ ...entry, text: entry.text.slice(0, 300) })) }
|
|
22374
|
+
};
|
|
22375
|
+
}
|
|
22376
|
+
function planStatus(status) {
|
|
22377
|
+
if (status === "completed" || status === "done") return "completed";
|
|
22378
|
+
if (status === "in_progress" || status === "inProgress" || status === "active") return "in_progress";
|
|
22379
|
+
return "pending";
|
|
22380
|
+
}
|
|
22381
|
+
function thoughtStep(text) {
|
|
22382
|
+
return { kind: "thought", title: "Thinking\u2026", detail: { text } };
|
|
22383
|
+
}
|
|
22384
|
+
function messageStep(text) {
|
|
22385
|
+
return { kind: "message", title: text.replace(/\s+/g, " ").trim().slice(0, 200) || "Reply", detail: { text } };
|
|
22386
|
+
}
|
|
22387
|
+
function errorStep(text) {
|
|
22388
|
+
return { kind: "error", title: text };
|
|
22389
|
+
}
|
|
22390
|
+
|
|
22271
22391
|
// src/bridge/adapters/claude.ts
|
|
22272
22392
|
var CLAUDE_SDK_PACKAGE = "@anthropic-ai/claude-agent-sdk";
|
|
22273
22393
|
var CLAUDE_SDK_RANGE = "^0.3.314";
|
|
@@ -22323,9 +22443,41 @@ var resultSchema = external_exports.object({
|
|
|
22323
22443
|
var assistantSchema = external_exports.object({
|
|
22324
22444
|
type: external_exports.literal("assistant"),
|
|
22325
22445
|
message: external_exports.object({
|
|
22326
|
-
content: external_exports.array(
|
|
22446
|
+
content: external_exports.array(
|
|
22447
|
+
external_exports.object({
|
|
22448
|
+
type: external_exports.string(),
|
|
22449
|
+
text: external_exports.string().optional(),
|
|
22450
|
+
/** A `thinking` block's text. */
|
|
22451
|
+
thinking: external_exports.string().optional(),
|
|
22452
|
+
/** A `tool_use` block's tool and input. */
|
|
22453
|
+
name: external_exports.string().optional(),
|
|
22454
|
+
input: external_exports.json().optional()
|
|
22455
|
+
})
|
|
22456
|
+
)
|
|
22327
22457
|
})
|
|
22328
22458
|
});
|
|
22459
|
+
var todosSchema = external_exports.object({
|
|
22460
|
+
todos: external_exports.array(external_exports.object({ content: external_exports.string(), status: external_exports.string() }))
|
|
22461
|
+
});
|
|
22462
|
+
function reportClaudeBlocks(blocks, cwd, step) {
|
|
22463
|
+
for (const block of blocks) {
|
|
22464
|
+
if (block.type === "thinking" && block.thinking?.trim()) {
|
|
22465
|
+
step(thoughtStep(block.thinking.trim()));
|
|
22466
|
+
} else if (block.type === "text" && block.text?.trim()) {
|
|
22467
|
+
step(messageStep(block.text.trim()));
|
|
22468
|
+
} else if (block.type === "tool_use" && block.name !== void 0) {
|
|
22469
|
+
const input = asToolInput(block.input ?? {});
|
|
22470
|
+
if (block.name === "TodoWrite") {
|
|
22471
|
+
const todos = todosSchema.safeParse(input);
|
|
22472
|
+
if (todos.success) {
|
|
22473
|
+
step(planStep(todos.data.todos.map((todo) => ({ text: todo.content, status: planStatus(todo.status) }))));
|
|
22474
|
+
continue;
|
|
22475
|
+
}
|
|
22476
|
+
}
|
|
22477
|
+
step(describeTool(block.name, input, cwd));
|
|
22478
|
+
}
|
|
22479
|
+
}
|
|
22480
|
+
}
|
|
22329
22481
|
var initSchema = external_exports.object({
|
|
22330
22482
|
type: external_exports.literal("system"),
|
|
22331
22483
|
subtype: external_exports.literal("init"),
|
|
@@ -22409,6 +22561,7 @@ function claudeAdapter(sdk) {
|
|
|
22409
22561
|
const assistant = assistantSchema.safeParse(message);
|
|
22410
22562
|
if (assistant.success) {
|
|
22411
22563
|
assistantTurns += 1;
|
|
22564
|
+
reportClaudeBlocks(assistant.data.message.content, run.cwd, run.step ?? noSteps);
|
|
22412
22565
|
const text = assistant.data.message.content.flatMap((block) => block.type === "text" && block.text ? [block.text] : []).join("\n").trim();
|
|
22413
22566
|
if (text !== "") lastText = text;
|
|
22414
22567
|
}
|
|
@@ -22472,11 +22625,57 @@ var itemSchema = external_exports.object({
|
|
|
22472
22625
|
item: external_exports.object({
|
|
22473
22626
|
id: external_exports.string(),
|
|
22474
22627
|
type: external_exports.string(),
|
|
22475
|
-
changes: external_exports.array(
|
|
22628
|
+
changes: external_exports.array(
|
|
22629
|
+
external_exports.object({
|
|
22630
|
+
path: external_exports.string(),
|
|
22631
|
+
/** `add`, `delete` or `update`, as a string or `{ type }`. */
|
|
22632
|
+
kind: external_exports.union([external_exports.string(), external_exports.object({ type: external_exports.string() }).transform((kind) => kind.type)]).optional()
|
|
22633
|
+
})
|
|
22634
|
+
).optional(),
|
|
22476
22635
|
/** An `agentMessage` item's text: the last one is the turn's answer. */
|
|
22477
|
-
text: external_exports.string().optional()
|
|
22636
|
+
text: external_exports.string().optional(),
|
|
22637
|
+
/** A `reasoning` item's summary. */
|
|
22638
|
+
summary: external_exports.array(external_exports.string()).optional(),
|
|
22639
|
+
/** A `commandExecution` item's command line. */
|
|
22640
|
+
command: external_exports.string().optional(),
|
|
22641
|
+
/** An `mcpToolCall` item's server and tool. */
|
|
22642
|
+
server: external_exports.string().optional(),
|
|
22643
|
+
tool: external_exports.string().optional()
|
|
22478
22644
|
})
|
|
22479
22645
|
});
|
|
22646
|
+
var deltaSchema = external_exports.object({ itemId: external_exports.string(), delta: external_exports.string() });
|
|
22647
|
+
var planUpdateSchema = external_exports.object({
|
|
22648
|
+
plan: external_exports.array(external_exports.object({ step: external_exports.string(), status: external_exports.string() }))
|
|
22649
|
+
});
|
|
22650
|
+
function changeVerb(kind) {
|
|
22651
|
+
if (kind === "add") return "Created";
|
|
22652
|
+
if (kind === "delete") return "Deleted";
|
|
22653
|
+
return "Edited";
|
|
22654
|
+
}
|
|
22655
|
+
function codexItemSteps(item, cwd) {
|
|
22656
|
+
switch (item.type) {
|
|
22657
|
+
case "reasoning": {
|
|
22658
|
+
const text = (item.summary ?? []).join("\n").trim();
|
|
22659
|
+
return text === "" ? [] : [thoughtStep(text)];
|
|
22660
|
+
}
|
|
22661
|
+
case "commandExecution": {
|
|
22662
|
+
const line2 = (item.command ?? "a command").replace(/\s+/g, " ").trim();
|
|
22663
|
+
return [{ kind: "action", title: `Ran \u201C${line2.length <= 60 ? line2 : `${line2.slice(0, 59)}\u2026`}\u201D`, detail: { tool: "commandExecution" } }];
|
|
22664
|
+
}
|
|
22665
|
+
case "fileChange":
|
|
22666
|
+
return (item.changes ?? []).map((change) => {
|
|
22667
|
+
const path = displayPath(change.path, cwd);
|
|
22668
|
+
return { kind: "action", title: `${changeVerb(change.kind)} ${path}`, detail: { tool: "fileChange", path } };
|
|
22669
|
+
});
|
|
22670
|
+
case "mcpToolCall":
|
|
22671
|
+
case "dynamicToolCall": {
|
|
22672
|
+
const name = (item.tool ?? "a tool").replace(/[_-]+/g, " ");
|
|
22673
|
+
return [{ kind: "action", title: item.server === "tasqmate" ? `Tasqmate: ${name}` : `Used ${name}`, detail: { tool: item.tool ?? item.type } }];
|
|
22674
|
+
}
|
|
22675
|
+
default:
|
|
22676
|
+
return [];
|
|
22677
|
+
}
|
|
22678
|
+
}
|
|
22480
22679
|
var commandApprovalSchema = external_exports.object({
|
|
22481
22680
|
itemId: external_exports.string(),
|
|
22482
22681
|
command: external_exports.string().nullable().optional()
|
|
@@ -22564,6 +22763,8 @@ function codexAdapter(version2, spawnImpl = spawnCodex) {
|
|
|
22564
22763
|
let actions = 0;
|
|
22565
22764
|
let settled = false;
|
|
22566
22765
|
let lastMessage = null;
|
|
22766
|
+
const step = run.step ?? noSteps;
|
|
22767
|
+
const streamed = /* @__PURE__ */ new Set();
|
|
22567
22768
|
const finish = (result) => {
|
|
22568
22769
|
if (settled) return;
|
|
22569
22770
|
settled = true;
|
|
@@ -22627,12 +22828,31 @@ function codexAdapter(version2, spawnImpl = spawnCodex) {
|
|
|
22627
22828
|
}
|
|
22628
22829
|
};
|
|
22629
22830
|
peer.onNotification = (method, params) => {
|
|
22831
|
+
if (method === "item/agentMessage/delta") {
|
|
22832
|
+
const parsed = deltaSchema.safeParse(params);
|
|
22833
|
+
if (parsed.success && parsed.data.delta !== "") {
|
|
22834
|
+
streamed.add(parsed.data.itemId);
|
|
22835
|
+
step(messageStep(parsed.data.delta));
|
|
22836
|
+
}
|
|
22837
|
+
return;
|
|
22838
|
+
}
|
|
22839
|
+
if (method === "turn/plan/updated") {
|
|
22840
|
+
const parsed = planUpdateSchema.safeParse(params);
|
|
22841
|
+
if (parsed.success) {
|
|
22842
|
+
step(planStep(parsed.data.plan.map((entry) => ({ text: entry.step, status: planStatus(entry.status) }))));
|
|
22843
|
+
}
|
|
22844
|
+
return;
|
|
22845
|
+
}
|
|
22630
22846
|
if (method === "item/started" || method === "item/completed") {
|
|
22631
22847
|
const parsed = itemSchema.safeParse(params);
|
|
22632
22848
|
if (!parsed.success) return;
|
|
22633
22849
|
if (method === "item/completed" && parsed.data.item.type === "agentMessage") {
|
|
22634
22850
|
const text = parsed.data.item.text?.trim() ?? "";
|
|
22635
22851
|
if (text !== "") lastMessage = text;
|
|
22852
|
+
if (text !== "" && !streamed.has(parsed.data.item.id)) step(messageStep(text));
|
|
22853
|
+
}
|
|
22854
|
+
if (method === "item/completed") {
|
|
22855
|
+
for (const itemStep of codexItemSteps(parsed.data.item, run.cwd)) step(itemStep);
|
|
22636
22856
|
}
|
|
22637
22857
|
if (parsed.data.item.changes !== void 0) {
|
|
22638
22858
|
changes.set(parsed.data.item.id, parsed.data.item.changes.map((change) => change.path));
|
|
@@ -22718,7 +22938,7 @@ import { createInterface as createInterface3 } from "readline";
|
|
|
22718
22938
|
// src/bridge/exec.ts
|
|
22719
22939
|
import { spawn as spawn2 } from "child_process";
|
|
22720
22940
|
import { accessSync, constants } from "fs";
|
|
22721
|
-
import { delimiter, isAbsolute, join as join4 } from "path";
|
|
22941
|
+
import { delimiter, isAbsolute as isAbsolute2, join as join4 } from "path";
|
|
22722
22942
|
var exec = (command, args, options = {}) => new Promise((resolve3) => {
|
|
22723
22943
|
const child = spawn2(command, [...args], {
|
|
22724
22944
|
cwd: options.cwd,
|
|
@@ -22748,7 +22968,7 @@ var exec = (command, args, options = {}) => new Promise((resolve3) => {
|
|
|
22748
22968
|
child.stdin.end(options.input ?? "");
|
|
22749
22969
|
});
|
|
22750
22970
|
function which(name, env = process.env, platform = process.platform) {
|
|
22751
|
-
if (
|
|
22971
|
+
if (isAbsolute2(name)) return isExecutable(name) ? name : null;
|
|
22752
22972
|
const extensions = platform === "win32" ? (env.PATHEXT ?? ".EXE;.CMD;.BAT;.COM").split(";") : [""];
|
|
22753
22973
|
for (const dir of (env.PATH ?? "").split(delimiter)) {
|
|
22754
22974
|
if (dir === "") continue;
|
|
@@ -22939,9 +23159,45 @@ var rawEditInputSchema = external_exports.object({
|
|
|
22939
23159
|
var sessionUpdateSchema = external_exports.object({
|
|
22940
23160
|
update: external_exports.object({
|
|
22941
23161
|
sessionUpdate: external_exports.string(),
|
|
22942
|
-
content: external_exports.
|
|
23162
|
+
content: external_exports.unknown().optional(),
|
|
23163
|
+
/** A `tool_call`'s one line and the files it touches. */
|
|
23164
|
+
title: external_exports.string().optional(),
|
|
23165
|
+
kind: external_exports.string().optional(),
|
|
23166
|
+
locations: external_exports.array(external_exports.object({ path: external_exports.string() })).optional(),
|
|
23167
|
+
/** A `plan`'s entries. */
|
|
23168
|
+
entries: external_exports.array(external_exports.object({ content: external_exports.string(), status: external_exports.string() })).optional()
|
|
22943
23169
|
})
|
|
22944
23170
|
});
|
|
23171
|
+
var textContentSchema = external_exports.object({ type: external_exports.literal("text"), text: external_exports.string() });
|
|
23172
|
+
function chunkText(update) {
|
|
23173
|
+
const parsed = textContentSchema.safeParse(update.content);
|
|
23174
|
+
return parsed.success ? parsed.data.text : null;
|
|
23175
|
+
}
|
|
23176
|
+
function acpUpdateStep(update, cwd) {
|
|
23177
|
+
switch (update.sessionUpdate) {
|
|
23178
|
+
case "agent_thought_chunk": {
|
|
23179
|
+
const text = chunkText(update);
|
|
23180
|
+
return text ? thoughtStep(text) : null;
|
|
23181
|
+
}
|
|
23182
|
+
case "agent_message_chunk": {
|
|
23183
|
+
const text = chunkText(update);
|
|
23184
|
+
return text ? messageStep(text) : null;
|
|
23185
|
+
}
|
|
23186
|
+
case "tool_call": {
|
|
23187
|
+
const path = update.locations?.[0]?.path;
|
|
23188
|
+
const shown = path === void 0 ? void 0 : displayPath(path, cwd);
|
|
23189
|
+
return {
|
|
23190
|
+
kind: "action",
|
|
23191
|
+
title: update.title?.trim() || `Used ${update.kind ?? "a tool"}`,
|
|
23192
|
+
detail: toolDetail(update.kind ?? "tool", shown ?? null)
|
|
23193
|
+
};
|
|
23194
|
+
}
|
|
23195
|
+
case "plan":
|
|
23196
|
+
return planStep((update.entries ?? []).map((entry) => ({ text: entry.content, status: planStatus(entry.status) })));
|
|
23197
|
+
default:
|
|
23198
|
+
return null;
|
|
23199
|
+
}
|
|
23200
|
+
}
|
|
22945
23201
|
var initializeResultSchema = external_exports.object({
|
|
22946
23202
|
agentCapabilities: external_exports.object({ loadSession: external_exports.boolean().optional() }).nullable().optional()
|
|
22947
23203
|
});
|
|
@@ -23055,6 +23311,7 @@ function hermesAdapter(version2, spawnImpl = spawnHermes) {
|
|
|
23055
23311
|
let settled = false;
|
|
23056
23312
|
let prompting = false;
|
|
23057
23313
|
let spoken = "";
|
|
23314
|
+
const step = run.step ?? noSteps;
|
|
23058
23315
|
const finish = (result) => {
|
|
23059
23316
|
if (settled) return;
|
|
23060
23317
|
settled = true;
|
|
@@ -23113,8 +23370,10 @@ function hermesAdapter(version2, spawnImpl = spawnHermes) {
|
|
|
23113
23370
|
const parsed = sessionUpdateSchema.safeParse(params);
|
|
23114
23371
|
if (!parsed.success || !prompting) return;
|
|
23115
23372
|
const { update } = parsed.data;
|
|
23373
|
+
const reported = acpUpdateStep(update, run.cwd);
|
|
23374
|
+
if (reported !== null) step(reported);
|
|
23116
23375
|
if (update.sessionUpdate === "agent_message_chunk") {
|
|
23117
|
-
|
|
23376
|
+
spoken += chunkText(update) ?? "";
|
|
23118
23377
|
return;
|
|
23119
23378
|
}
|
|
23120
23379
|
if (update.sessionUpdate !== "tool_call") return;
|
|
@@ -23683,7 +23942,7 @@ import { mkdirSync as mkdirSync5 } from "fs";
|
|
|
23683
23942
|
|
|
23684
23943
|
// src/bridge/guard.ts
|
|
23685
23944
|
import { existsSync as existsSync3, realpathSync } from "fs";
|
|
23686
|
-
import { dirname as dirname2, isAbsolute as
|
|
23945
|
+
import { dirname as dirname2, isAbsolute as isAbsolute3, relative as relative2, resolve, sep } from "path";
|
|
23687
23946
|
var TASQMATE_TOOL_PREFIX = "mcp__tasqmate__";
|
|
23688
23947
|
var READ_TOOLS = /* @__PURE__ */ new Map([
|
|
23689
23948
|
["Read", "file_path"],
|
|
@@ -23717,8 +23976,8 @@ function realish(path) {
|
|
|
23717
23976
|
return resolve(realpathSync(current), ...tail);
|
|
23718
23977
|
}
|
|
23719
23978
|
function inside(root, path) {
|
|
23720
|
-
const rel =
|
|
23721
|
-
return rel === "" || !rel.startsWith("..") && !
|
|
23979
|
+
const rel = relative2(root, path);
|
|
23980
|
+
return rel === "" || !rel.startsWith("..") && !isAbsolute3(rel);
|
|
23722
23981
|
}
|
|
23723
23982
|
function createGuard(folder) {
|
|
23724
23983
|
const root = realish(resolve(folder));
|
|
@@ -23729,7 +23988,7 @@ function createGuard(folder) {
|
|
|
23729
23988
|
if (!inside(root, target)) {
|
|
23730
23989
|
return { allow: false, reason: `${path} is outside this run's folder (${root}); edits stay inside it.` };
|
|
23731
23990
|
}
|
|
23732
|
-
const segments =
|
|
23991
|
+
const segments = relative2(root, target).split(sep);
|
|
23733
23992
|
const protectedDir = segments.find((segment) => PROTECTED_DIRS.includes(segment));
|
|
23734
23993
|
if (protectedDir !== void 0) {
|
|
23735
23994
|
return {
|
|
@@ -23746,7 +24005,7 @@ function createGuard(folder) {
|
|
|
23746
24005
|
if (readKey !== void 0) {
|
|
23747
24006
|
const path = pathIn(input, readKey) ?? root;
|
|
23748
24007
|
const pattern = pathIn(input, "pattern");
|
|
23749
|
-
if (tool === "Glob" && pattern !== null &&
|
|
24008
|
+
if (tool === "Glob" && pattern !== null && isAbsolute3(pattern)) {
|
|
23750
24009
|
const fixed = pattern.split(GLOB_CHARS)[0] ?? pattern;
|
|
23751
24010
|
const fixedDecision = decideRead(fixed === "" ? sep : fixed);
|
|
23752
24011
|
if (!fixedDecision.allow) return fixedDecision;
|
|
@@ -23945,6 +24204,117 @@ function buildChatPrompt(input) {
|
|
|
23945
24204
|
return sections.join("\n\n");
|
|
23946
24205
|
}
|
|
23947
24206
|
|
|
24207
|
+
// src/bridge/run-events.ts
|
|
24208
|
+
var FLUSH_MS = 300;
|
|
24209
|
+
var STOP_POLL_MS = 1e3;
|
|
24210
|
+
var MAX_EVENTS = 500;
|
|
24211
|
+
var BATCH_MAX = 100;
|
|
24212
|
+
var DETAIL_MAX_BYTES = 4096;
|
|
24213
|
+
var CHATTER_LIMIT = 400;
|
|
24214
|
+
var TEXT_MAX = 3e3;
|
|
24215
|
+
var TITLE_MAX = 200;
|
|
24216
|
+
function byteLength(value) {
|
|
24217
|
+
return new TextEncoder().encode(JSON.stringify(value)).length;
|
|
24218
|
+
}
|
|
24219
|
+
function clip(text, max) {
|
|
24220
|
+
return text.length <= max ? text : `${text.slice(0, max - 1)}\u2026`;
|
|
24221
|
+
}
|
|
24222
|
+
function toEventInput(step, seq, at) {
|
|
24223
|
+
const title = clip(step.title.replace(/\s+/g, " ").trim(), TITLE_MAX) || step.kind;
|
|
24224
|
+
let detail = step.detail ?? null;
|
|
24225
|
+
if (detail?.text !== void 0) detail = { ...detail, text: clip(detail.text, TEXT_MAX) };
|
|
24226
|
+
if (detail !== null && byteLength(detail) > DETAIL_MAX_BYTES) {
|
|
24227
|
+
detail = detail.text === void 0 ? null : { text: clip(detail.text, 1e3) };
|
|
24228
|
+
}
|
|
24229
|
+
return { seq, kind: step.kind, title, detail, at: at.toISOString() };
|
|
24230
|
+
}
|
|
24231
|
+
function createRunReporter(options) {
|
|
24232
|
+
const { client, slug, runId, log } = options;
|
|
24233
|
+
const now = options.now ?? (() => /* @__PURE__ */ new Date());
|
|
24234
|
+
const stopPollMs = options.stopPollMs ?? STOP_POLL_MS;
|
|
24235
|
+
const queue = [];
|
|
24236
|
+
const stopListeners = [];
|
|
24237
|
+
let seq = 0;
|
|
24238
|
+
let sending = null;
|
|
24239
|
+
let sendingCount = 0;
|
|
24240
|
+
let lastContact = now().getTime();
|
|
24241
|
+
let stopRequested = false;
|
|
24242
|
+
let gone = false;
|
|
24243
|
+
let warned = false;
|
|
24244
|
+
const send = async () => {
|
|
24245
|
+
if (gone) return;
|
|
24246
|
+
const batch = queue.slice(0, BATCH_MAX);
|
|
24247
|
+
sendingCount = batch.length;
|
|
24248
|
+
try {
|
|
24249
|
+
const answer = await client.postRunEvents(slug, runId, batch);
|
|
24250
|
+
queue.splice(0, batch.length);
|
|
24251
|
+
lastContact = now().getTime();
|
|
24252
|
+
warned = false;
|
|
24253
|
+
if (answer.stopRequested && !stopRequested) {
|
|
24254
|
+
stopRequested = true;
|
|
24255
|
+
log.info("someone pressed Stop in Tasqmate; stopping the run");
|
|
24256
|
+
for (const listener of stopListeners) listener();
|
|
24257
|
+
}
|
|
24258
|
+
} catch (error48) {
|
|
24259
|
+
if (error48 instanceof TasqmateApiError && (error48.status === 404 || error48.status === 400)) {
|
|
24260
|
+
gone = true;
|
|
24261
|
+
queue.length = 0;
|
|
24262
|
+
log.warn(`the run's steps can't be posted (${error48.message}); working on without them`);
|
|
24263
|
+
return;
|
|
24264
|
+
}
|
|
24265
|
+
if (!warned) log.warn(`could not post the run's steps (${error48 instanceof Error ? error48.message : String(error48)}); retrying`);
|
|
24266
|
+
warned = true;
|
|
24267
|
+
} finally {
|
|
24268
|
+
sendingCount = 0;
|
|
24269
|
+
}
|
|
24270
|
+
};
|
|
24271
|
+
const tick = () => {
|
|
24272
|
+
if (sending !== null || gone) return;
|
|
24273
|
+
const due = queue.length > 0 || now().getTime() - lastContact >= stopPollMs;
|
|
24274
|
+
if (!due) return;
|
|
24275
|
+
sending = send().finally(() => {
|
|
24276
|
+
sending = null;
|
|
24277
|
+
});
|
|
24278
|
+
};
|
|
24279
|
+
const timer = setInterval(tick, options.flushMs ?? FLUSH_MS);
|
|
24280
|
+
timer.unref?.();
|
|
24281
|
+
return {
|
|
24282
|
+
push: (step) => {
|
|
24283
|
+
if (gone) return;
|
|
24284
|
+
const chatter = step.kind === "message" || step.kind === "thought";
|
|
24285
|
+
if (seq >= MAX_EVENTS - 1 && step.kind !== "error") return;
|
|
24286
|
+
if (seq >= MAX_EVENTS) return;
|
|
24287
|
+
const last = queue.at(-1);
|
|
24288
|
+
const lastIsWaiting = last !== void 0 && queue.length > sendingCount;
|
|
24289
|
+
if (chatter && lastIsWaiting && last.kind === step.kind && (last.detail?.text?.length ?? 0) + (step.detail?.text?.length ?? 0) <= TEXT_MAX) {
|
|
24290
|
+
const text = `${last.detail?.text ?? ""}${step.detail?.text ?? ""}`;
|
|
24291
|
+
last.detail = { text };
|
|
24292
|
+
if (step.kind === "message") last.title = clip(text.replace(/\s+/g, " ").trim(), TITLE_MAX) || last.title;
|
|
24293
|
+
return;
|
|
24294
|
+
}
|
|
24295
|
+
if (chatter && seq >= CHATTER_LIMIT) return;
|
|
24296
|
+
seq += 1;
|
|
24297
|
+
queue.push(toEventInput(step, seq, now()));
|
|
24298
|
+
},
|
|
24299
|
+
get stopRequested() {
|
|
24300
|
+
return stopRequested;
|
|
24301
|
+
},
|
|
24302
|
+
onStop: (listener) => {
|
|
24303
|
+
stopListeners.push(listener);
|
|
24304
|
+
},
|
|
24305
|
+
close: async () => {
|
|
24306
|
+
clearInterval(timer);
|
|
24307
|
+
if (sending !== null) await sending;
|
|
24308
|
+
for (let failures = 0; failures < 3 && queue.length > 0 && !gone; ) {
|
|
24309
|
+
const before = queue.length;
|
|
24310
|
+
await send();
|
|
24311
|
+
failures = queue.length < before ? 0 : failures + 1;
|
|
24312
|
+
}
|
|
24313
|
+
if (queue.length > 0 && !gone) log.warn(`dropped ${queue.length} steps the server did not take`);
|
|
24314
|
+
}
|
|
24315
|
+
};
|
|
24316
|
+
}
|
|
24317
|
+
|
|
23948
24318
|
// src/bridge/loop.ts
|
|
23949
24319
|
var BRIDGE_WAKE_KINDS = /* @__PURE__ */ new Set([
|
|
23950
24320
|
"mention",
|
|
@@ -23973,6 +24343,64 @@ function replyBody(text) {
|
|
|
23973
24343
|
|
|
23974
24344
|
(Reply cut short: it was too long.)`;
|
|
23975
24345
|
}
|
|
24346
|
+
var STOPPED_REASON = "someone pressed Stop in Tasqmate";
|
|
24347
|
+
async function trackRun(deps, event) {
|
|
24348
|
+
const { client, config: config2, log } = deps;
|
|
24349
|
+
const slug = config2.workspace;
|
|
24350
|
+
const stop = new AbortController();
|
|
24351
|
+
const { openRun, postRunEvents, finishRun } = client.agents;
|
|
24352
|
+
let reporter = null;
|
|
24353
|
+
let runId = null;
|
|
24354
|
+
if (openRun !== void 0 && postRunEvents !== void 0) {
|
|
24355
|
+
try {
|
|
24356
|
+
runId = (await openRun(slug, { eventId: event.id, harness: config2.harness })).run.id;
|
|
24357
|
+
reporter = createRunReporter({ client: { postRunEvents }, slug, runId, log });
|
|
24358
|
+
reporter.onStop(() => stop.abort(new Error(STOPPED_REASON)));
|
|
24359
|
+
} catch (error48) {
|
|
24360
|
+
log.warn(
|
|
24361
|
+
`${label(event)}: could not open a run (${error48 instanceof Error ? error48.message : String(error48)}); working without live steps`
|
|
24362
|
+
);
|
|
24363
|
+
}
|
|
24364
|
+
}
|
|
24365
|
+
return {
|
|
24366
|
+
step: reporter === null ? noSteps : reporter.push,
|
|
24367
|
+
stopSignal: stop.signal,
|
|
24368
|
+
get stopped() {
|
|
24369
|
+
return stop.signal.aborted;
|
|
24370
|
+
},
|
|
24371
|
+
finish: async (result) => {
|
|
24372
|
+
if (reporter === null || runId === null) return;
|
|
24373
|
+
const stopped = stop.signal.aborted;
|
|
24374
|
+
if (!result.ok && !stopped) reporter.push(errorStep(result.summary));
|
|
24375
|
+
await reporter.close();
|
|
24376
|
+
const refused = result.denied === 0 ? "" : `, ${result.denied} refused`;
|
|
24377
|
+
const summary = stopped ? "Stopped from Tasqmate" : `${result.summary}${refused}`;
|
|
24378
|
+
await finishRun?.(slug, runId, {
|
|
24379
|
+
state: stopped ? "stopped" : result.ok ? "done" : "failed",
|
|
24380
|
+
summary: summary.slice(0, 200)
|
|
24381
|
+
}).catch((error48) => log.warn(`${label(event)}: could not finish the run (${error48.message})`));
|
|
24382
|
+
}
|
|
24383
|
+
};
|
|
24384
|
+
}
|
|
24385
|
+
function stopSignals(deps, tracker) {
|
|
24386
|
+
return deps.signal === void 0 ? tracker.stopSignal : AbortSignal.any([deps.signal, tracker.stopSignal]);
|
|
24387
|
+
}
|
|
24388
|
+
async function finishing(tracker, work) {
|
|
24389
|
+
let result;
|
|
24390
|
+
try {
|
|
24391
|
+
result = await work();
|
|
24392
|
+
} catch (error48) {
|
|
24393
|
+
await tracker.finish({
|
|
24394
|
+
ok: false,
|
|
24395
|
+
sessionId: null,
|
|
24396
|
+
denied: 0,
|
|
24397
|
+
summary: `failed: ${error48 instanceof Error ? error48.message : String(error48)}`
|
|
24398
|
+
});
|
|
24399
|
+
throw error48;
|
|
24400
|
+
}
|
|
24401
|
+
await tracker.finish(result);
|
|
24402
|
+
return result;
|
|
24403
|
+
}
|
|
23976
24404
|
async function whileRunning(deps, event, work) {
|
|
23977
24405
|
const { client, config: config2, log } = deps;
|
|
23978
24406
|
const slug = config2.workspace;
|
|
@@ -24018,6 +24446,7 @@ async function handleChat(deps, event, chat) {
|
|
|
24018
24446
|
if (!folder.mapped) mkdirSync5(folder.folder, { recursive: true, mode: 448 });
|
|
24019
24447
|
const subject = `chat:${chat.id}`;
|
|
24020
24448
|
const stored = deps.sessions.get(subject, config2.harness);
|
|
24449
|
+
const tracker = await trackRun(deps, event);
|
|
24021
24450
|
const attempt = (resumeSessionId) => deps.limiter.run(
|
|
24022
24451
|
(signal) => deps.adapter.run({
|
|
24023
24452
|
prompt: buildChatPrompt({
|
|
@@ -24040,24 +24469,29 @@ async function handleChat(deps, event, chat) {
|
|
|
24040
24469
|
resumeSessionId,
|
|
24041
24470
|
guard: createGuard(folder.folder),
|
|
24042
24471
|
signal,
|
|
24043
|
-
log
|
|
24472
|
+
log,
|
|
24473
|
+
step: tracker.step
|
|
24044
24474
|
}),
|
|
24045
|
-
deps
|
|
24475
|
+
stopSignals(deps, tracker),
|
|
24046
24476
|
"chat"
|
|
24047
24477
|
);
|
|
24048
24478
|
log.info(
|
|
24049
24479
|
`${label(event)}: ${stored === null ? "starting" : "resuming"} ${config2.harness} in ${folder.mapped ? folder.folder : "the scratch folder"}`
|
|
24050
24480
|
);
|
|
24051
|
-
const result = await whileRunning(
|
|
24052
|
-
|
|
24053
|
-
|
|
24054
|
-
|
|
24055
|
-
|
|
24056
|
-
|
|
24481
|
+
const result = await whileRunning(
|
|
24482
|
+
deps,
|
|
24483
|
+
event,
|
|
24484
|
+
() => finishing(tracker, async () => {
|
|
24485
|
+
const first = await attempt(stored);
|
|
24486
|
+
if (!first.resumeFailed) return first;
|
|
24487
|
+
log.info(`${label(event)}: ${first.summary}; starting a fresh session with the chat's history`);
|
|
24488
|
+
return attempt(null);
|
|
24489
|
+
})
|
|
24490
|
+
);
|
|
24057
24491
|
if (result.sessionId !== null) deps.sessions.record(subject, config2.harness, result.sessionId);
|
|
24058
24492
|
const refused = result.denied === 0 ? "" : `, ${result.denied} refused`;
|
|
24059
24493
|
const said = result.finalMessage?.trim() ?? "";
|
|
24060
|
-
const body = result.ok ? said === "" ? "(Finished, with nothing to say.)" : said : [said, `_I couldn't finish this turn: ${result.summary}._`].filter((part) => part !== "").join("\n\n");
|
|
24494
|
+
const body = tracker.stopped ? [said, "_Stopped before finishing._"].filter((part) => part !== "").join("\n\n") : result.ok ? said === "" ? "(Finished, with nothing to say.)" : said : [said, `_I couldn't finish this turn: ${result.summary}._`].filter((part) => part !== "").join("\n\n");
|
|
24061
24495
|
try {
|
|
24062
24496
|
await client.agents.replyToChat(slug, chat.id, { body: replyBody(body), eventId: event.id });
|
|
24063
24497
|
} catch (error48) {
|
|
@@ -24133,24 +24567,29 @@ async function handle(deps, event) {
|
|
|
24133
24567
|
await report();
|
|
24134
24568
|
const heartbeat = setInterval(report, HEARTBEAT_MS);
|
|
24135
24569
|
log.info(`${label(event)}: starting ${config2.harness} in ${folder.mapped ? folder.folder : "the scratch folder"}`);
|
|
24570
|
+
const tracker = await trackRun(deps, event);
|
|
24136
24571
|
try {
|
|
24137
|
-
const result = await
|
|
24138
|
-
|
|
24139
|
-
|
|
24140
|
-
|
|
24141
|
-
|
|
24142
|
-
|
|
24143
|
-
|
|
24144
|
-
|
|
24145
|
-
|
|
24146
|
-
|
|
24147
|
-
|
|
24148
|
-
|
|
24149
|
-
|
|
24150
|
-
|
|
24151
|
-
|
|
24152
|
-
|
|
24153
|
-
|
|
24572
|
+
const result = await finishing(
|
|
24573
|
+
tracker,
|
|
24574
|
+
() => deps.limiter.run(
|
|
24575
|
+
(signal) => deps.adapter.run({
|
|
24576
|
+
prompt,
|
|
24577
|
+
cwd: folder.folder,
|
|
24578
|
+
harnessPath: config2.harnessPath,
|
|
24579
|
+
mcp: config2.mcpCommand,
|
|
24580
|
+
tasqmateEnv: {
|
|
24581
|
+
TASQMATE_API_KEY: deps.key,
|
|
24582
|
+
TASQMATE_API_URL: config2.apiUrl,
|
|
24583
|
+
TASQMATE_WORKSPACE: slug
|
|
24584
|
+
},
|
|
24585
|
+
maxTurns: deps.limiter.limits.maxTurns,
|
|
24586
|
+
guard: createGuard(folder.folder),
|
|
24587
|
+
signal,
|
|
24588
|
+
log,
|
|
24589
|
+
step: tracker.step
|
|
24590
|
+
}),
|
|
24591
|
+
stopSignals(deps, tracker)
|
|
24592
|
+
)
|
|
24154
24593
|
);
|
|
24155
24594
|
if (result.sessionId !== null) {
|
|
24156
24595
|
deps.sessions.record(event.taskId ?? event.threadId ?? event.id, config2.harness, result.sessionId);
|
|
@@ -24160,6 +24599,10 @@ async function handle(deps, event) {
|
|
|
24160
24599
|
log.info(`${label(event)}: ${result.summary}${refused}`);
|
|
24161
24600
|
return true;
|
|
24162
24601
|
}
|
|
24602
|
+
if (tracker.stopped) {
|
|
24603
|
+
log.info(`${label(event)}: stopped from Tasqmate${refused}; acknowledged`);
|
|
24604
|
+
return true;
|
|
24605
|
+
}
|
|
24163
24606
|
log.warn(`${label(event)}: ${result.summary}${refused}; left for redelivery`);
|
|
24164
24607
|
return false;
|
|
24165
24608
|
} finally {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tasqmate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Command-line client for Tasqmate, for humans and agents alike. Installs the tasqmate and tasqmate commands.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tasqmate",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"zod": "4.3.6"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@tasqmate/sdk": "0.
|
|
54
|
+
"@tasqmate/sdk": "0.4.0",
|
|
55
55
|
"@types/bun": "^1.3.12",
|
|
56
56
|
"tsup": "^8.5.0",
|
|
57
57
|
"typescript": "^5.7.2"
|