visionclaw 0.1.195-dev.simplify-google-client-setup.1 → 0.1.195-dev.simplify-google-client-setup.3
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/onboarding/index.d.ts.map +1 -1
- package/dist/onboarding/index.js +30 -10
- package/dist/onboarding/index.js.map +1 -1
- package/dist/onboarding/macos-permissions.d.ts.map +1 -1
- package/dist/onboarding/macos-permissions.js +48 -26
- package/dist/onboarding/macos-permissions.js.map +1 -1
- package/dist-agent/bundle.cjs +549 -501
- package/package.json +1 -1
package/dist-agent/bundle.cjs
CHANGED
|
@@ -16090,12 +16090,12 @@ var require_prompt = __commonJS({
|
|
|
16090
16090
|
"use strict";
|
|
16091
16091
|
var readline13 = require("readline");
|
|
16092
16092
|
var _require = require_util();
|
|
16093
|
-
var
|
|
16093
|
+
var action2 = _require.action;
|
|
16094
16094
|
var EventEmitter7 = require("events");
|
|
16095
16095
|
var _require2 = require_src();
|
|
16096
16096
|
var beep = _require2.beep;
|
|
16097
16097
|
var cursor2 = _require2.cursor;
|
|
16098
|
-
var
|
|
16098
|
+
var color3 = require_kleur();
|
|
16099
16099
|
var Prompt = class extends EventEmitter7 {
|
|
16100
16100
|
constructor(opts = {}) {
|
|
16101
16101
|
super();
|
|
@@ -16111,7 +16111,7 @@ var require_prompt = __commonJS({
|
|
|
16111
16111
|
if (this.in.isTTY) this.in.setRawMode(true);
|
|
16112
16112
|
const isSelect = ["SelectPrompt", "MultiselectPrompt"].indexOf(this.constructor.name) > -1;
|
|
16113
16113
|
const keypress = (str3, key) => {
|
|
16114
|
-
let a11 =
|
|
16114
|
+
let a11 = action2(key, isSelect);
|
|
16115
16115
|
if (a11 === false) {
|
|
16116
16116
|
this._ && this._(str3, key);
|
|
16117
16117
|
} else if (typeof this[a11] === "function") {
|
|
@@ -16141,7 +16141,7 @@ var require_prompt = __commonJS({
|
|
|
16141
16141
|
this.out.write(beep);
|
|
16142
16142
|
}
|
|
16143
16143
|
render() {
|
|
16144
|
-
this.onRender(
|
|
16144
|
+
this.onRender(color3);
|
|
16145
16145
|
if (this.firstRender) this.firstRender = false;
|
|
16146
16146
|
}
|
|
16147
16147
|
};
|
|
@@ -16182,7 +16182,7 @@ var require_text = __commonJS({
|
|
|
16182
16182
|
});
|
|
16183
16183
|
};
|
|
16184
16184
|
}
|
|
16185
|
-
var
|
|
16185
|
+
var color3 = require_kleur();
|
|
16186
16186
|
var Prompt = require_prompt();
|
|
16187
16187
|
var _require = require_src();
|
|
16188
16188
|
var erase = _require.erase;
|
|
@@ -16210,7 +16210,7 @@ var require_text = __commonJS({
|
|
|
16210
16210
|
set value(v15) {
|
|
16211
16211
|
if (!v15 && this.initial) {
|
|
16212
16212
|
this.placeholder = true;
|
|
16213
|
-
this.rendered =
|
|
16213
|
+
this.rendered = color3.gray(this.transform.render(this.initial));
|
|
16214
16214
|
} else {
|
|
16215
16215
|
this.placeholder = false;
|
|
16216
16216
|
this.rendered = this.transform.render(v15);
|
|
@@ -16352,11 +16352,11 @@ var require_text = __commonJS({
|
|
|
16352
16352
|
}
|
|
16353
16353
|
super.render();
|
|
16354
16354
|
this.outputError = "";
|
|
16355
|
-
this.outputText = [style.symbol(this.done, this.aborted),
|
|
16355
|
+
this.outputText = [style.symbol(this.done, this.aborted), color3.bold(this.msg), style.delimiter(this.done), this.red ? color3.red(this.rendered) : this.rendered].join(` `);
|
|
16356
16356
|
if (this.error) {
|
|
16357
16357
|
this.outputError += this.errorMsg.split(`
|
|
16358
16358
|
`).reduce((a11, l11, i12) => a11 + `
|
|
16359
|
-
${i12 ? " " : figures.pointerSmall} ${
|
|
16359
|
+
${i12 ? " " : figures.pointerSmall} ${color3.red().italic(l11)}`, ``);
|
|
16360
16360
|
}
|
|
16361
16361
|
this.out.write(erase.line + cursor2.to(0) + this.outputText + cursor2.save + this.outputError + cursor2.restore + cursor2.move(this.cursorOffset, 0));
|
|
16362
16362
|
}
|
|
@@ -16369,7 +16369,7 @@ ${i12 ? " " : figures.pointerSmall} ${color.red().italic(l11)}`, ``);
|
|
|
16369
16369
|
var require_select = __commonJS({
|
|
16370
16370
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/select.js"(exports2, module2) {
|
|
16371
16371
|
"use strict";
|
|
16372
|
-
var
|
|
16372
|
+
var color3 = require_kleur();
|
|
16373
16373
|
var Prompt = require_prompt();
|
|
16374
16374
|
var _require = require_util();
|
|
16375
16375
|
var style = _require.style;
|
|
@@ -16474,7 +16474,7 @@ var require_select = __commonJS({
|
|
|
16474
16474
|
else this.out.write(clear(this.outputText, this.out.columns));
|
|
16475
16475
|
super.render();
|
|
16476
16476
|
let _entriesToDisplay = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage), startIndex = _entriesToDisplay.startIndex, endIndex = _entriesToDisplay.endIndex;
|
|
16477
|
-
this.outputText = [style.symbol(this.done, this.aborted),
|
|
16477
|
+
this.outputText = [style.symbol(this.done, this.aborted), color3.bold(this.msg), style.delimiter(false), this.done ? this.selection.title : this.selection.disabled ? color3.yellow(this.warn) : color3.gray(this.hint)].join(" ");
|
|
16478
16478
|
if (!this.done) {
|
|
16479
16479
|
this.outputText += "\n";
|
|
16480
16480
|
for (let i12 = startIndex; i12 < endIndex; i12++) {
|
|
@@ -16487,11 +16487,11 @@ var require_select = __commonJS({
|
|
|
16487
16487
|
prefix = " ";
|
|
16488
16488
|
}
|
|
16489
16489
|
if (v15.disabled) {
|
|
16490
|
-
title = this.cursor === i12 ?
|
|
16491
|
-
prefix = (this.cursor === i12 ?
|
|
16490
|
+
title = this.cursor === i12 ? color3.gray().underline(v15.title) : color3.strikethrough().gray(v15.title);
|
|
16491
|
+
prefix = (this.cursor === i12 ? color3.bold().gray(figures.pointer) + " " : " ") + prefix;
|
|
16492
16492
|
} else {
|
|
16493
|
-
title = this.cursor === i12 ?
|
|
16494
|
-
prefix = (this.cursor === i12 ?
|
|
16493
|
+
title = this.cursor === i12 ? color3.cyan().underline(v15.title) : v15.title;
|
|
16494
|
+
prefix = (this.cursor === i12 ? color3.cyan(figures.pointer) + " " : " ") + prefix;
|
|
16495
16495
|
if (v15.description && this.cursor === i12) {
|
|
16496
16496
|
desc = ` - ${v15.description}`;
|
|
16497
16497
|
if (prefix.length + title.length + desc.length >= this.out.columns || v15.description.split(/\r?\n/).length > 1) {
|
|
@@ -16502,7 +16502,7 @@ var require_select = __commonJS({
|
|
|
16502
16502
|
}
|
|
16503
16503
|
}
|
|
16504
16504
|
}
|
|
16505
|
-
this.outputText += `${prefix} ${title}${
|
|
16505
|
+
this.outputText += `${prefix} ${title}${color3.gray(desc)}
|
|
16506
16506
|
`;
|
|
16507
16507
|
}
|
|
16508
16508
|
}
|
|
@@ -16517,7 +16517,7 @@ var require_select = __commonJS({
|
|
|
16517
16517
|
var require_toggle = __commonJS({
|
|
16518
16518
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/toggle.js"(exports2, module2) {
|
|
16519
16519
|
"use strict";
|
|
16520
|
-
var
|
|
16520
|
+
var color3 = require_kleur();
|
|
16521
16521
|
var Prompt = require_prompt();
|
|
16522
16522
|
var _require = require_util();
|
|
16523
16523
|
var style = _require.style;
|
|
@@ -16603,7 +16603,7 @@ var require_toggle = __commonJS({
|
|
|
16603
16603
|
if (this.firstRender) this.out.write(cursor2.hide);
|
|
16604
16604
|
else this.out.write(clear(this.outputText, this.out.columns));
|
|
16605
16605
|
super.render();
|
|
16606
|
-
this.outputText = [style.symbol(this.done, this.aborted),
|
|
16606
|
+
this.outputText = [style.symbol(this.done, this.aborted), color3.bold(this.msg), style.delimiter(this.done), this.value ? this.inactive : color3.cyan().underline(this.inactive), color3.gray("/"), this.value ? color3.cyan().underline(this.active) : this.active].join(" ");
|
|
16607
16607
|
this.out.write(erase.line + cursor2.to(0) + this.outputText);
|
|
16608
16608
|
}
|
|
16609
16609
|
};
|
|
@@ -16921,7 +16921,7 @@ var require_date = __commonJS({
|
|
|
16921
16921
|
});
|
|
16922
16922
|
};
|
|
16923
16923
|
}
|
|
16924
|
-
var
|
|
16924
|
+
var color3 = require_kleur();
|
|
16925
16925
|
var Prompt = require_prompt();
|
|
16926
16926
|
var _require = require_util();
|
|
16927
16927
|
var style = _require.style;
|
|
@@ -17102,10 +17102,10 @@ var require_date = __commonJS({
|
|
|
17102
17102
|
if (this.firstRender) this.out.write(cursor2.hide);
|
|
17103
17103
|
else this.out.write(clear(this.outputText, this.out.columns));
|
|
17104
17104
|
super.render();
|
|
17105
|
-
this.outputText = [style.symbol(this.done, this.aborted),
|
|
17105
|
+
this.outputText = [style.symbol(this.done, this.aborted), color3.bold(this.msg), style.delimiter(false), this.parts.reduce((arr, p10, idx) => arr.concat(idx === this.cursor && !this.done ? color3.cyan().underline(p10.toString()) : p10), []).join("")].join(" ");
|
|
17106
17106
|
if (this.error) {
|
|
17107
17107
|
this.outputText += this.errorMsg.split("\n").reduce((a11, l11, i12) => a11 + `
|
|
17108
|
-
${i12 ? ` ` : figures.pointerSmall} ${
|
|
17108
|
+
${i12 ? ` ` : figures.pointerSmall} ${color3.red().italic(l11)}`, ``);
|
|
17109
17109
|
}
|
|
17110
17110
|
this.out.write(erase.line + cursor2.to(0) + this.outputText);
|
|
17111
17111
|
}
|
|
@@ -17147,7 +17147,7 @@ var require_number = __commonJS({
|
|
|
17147
17147
|
});
|
|
17148
17148
|
};
|
|
17149
17149
|
}
|
|
17150
|
-
var
|
|
17150
|
+
var color3 = require_kleur();
|
|
17151
17151
|
var Prompt = require_prompt();
|
|
17152
17152
|
var _require = require_src();
|
|
17153
17153
|
var cursor2 = _require.cursor;
|
|
@@ -17185,7 +17185,7 @@ var require_number = __commonJS({
|
|
|
17185
17185
|
set value(v15) {
|
|
17186
17186
|
if (!v15 && v15 !== 0) {
|
|
17187
17187
|
this.placeholder = true;
|
|
17188
|
-
this.rendered =
|
|
17188
|
+
this.rendered = color3.gray(this.transform.render(`${this.initial}`));
|
|
17189
17189
|
this._value = ``;
|
|
17190
17190
|
} else {
|
|
17191
17191
|
this.placeholder = false;
|
|
@@ -17316,11 +17316,11 @@ var require_number = __commonJS({
|
|
|
17316
17316
|
}
|
|
17317
17317
|
super.render();
|
|
17318
17318
|
this.outputError = "";
|
|
17319
|
-
this.outputText = [style.symbol(this.done, this.aborted),
|
|
17319
|
+
this.outputText = [style.symbol(this.done, this.aborted), color3.bold(this.msg), style.delimiter(this.done), !this.done || !this.done && !this.placeholder ? color3[this.color]().underline(this.rendered) : this.rendered].join(` `);
|
|
17320
17320
|
if (this.error) {
|
|
17321
17321
|
this.outputError += this.errorMsg.split(`
|
|
17322
17322
|
`).reduce((a11, l11, i12) => a11 + `
|
|
17323
|
-
${i12 ? ` ` : figures.pointerSmall} ${
|
|
17323
|
+
${i12 ? ` ` : figures.pointerSmall} ${color3.red().italic(l11)}`, ``);
|
|
17324
17324
|
}
|
|
17325
17325
|
this.out.write(erase.line + cursor2.to(0) + this.outputText + cursor2.save + this.outputError + cursor2.restore);
|
|
17326
17326
|
}
|
|
@@ -17333,7 +17333,7 @@ ${i12 ? ` ` : figures.pointerSmall} ${color.red().italic(l11)}`, ``);
|
|
|
17333
17333
|
var require_multiselect = __commonJS({
|
|
17334
17334
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/multiselect.js"(exports2, module2) {
|
|
17335
17335
|
"use strict";
|
|
17336
|
-
var
|
|
17336
|
+
var color3 = require_kleur();
|
|
17337
17337
|
var _require = require_src();
|
|
17338
17338
|
var cursor2 = _require.cursor;
|
|
17339
17339
|
var Prompt = require_prompt();
|
|
@@ -17488,12 +17488,12 @@ Instructions:
|
|
|
17488
17488
|
return "";
|
|
17489
17489
|
}
|
|
17490
17490
|
renderOption(cursor3, v15, i12, arrowIndicator) {
|
|
17491
|
-
const prefix = (v15.selected ?
|
|
17491
|
+
const prefix = (v15.selected ? color3.green(figures.radioOn) : figures.radioOff) + " " + arrowIndicator + " ";
|
|
17492
17492
|
let title, desc;
|
|
17493
17493
|
if (v15.disabled) {
|
|
17494
|
-
title = cursor3 === i12 ?
|
|
17494
|
+
title = cursor3 === i12 ? color3.gray().underline(v15.title) : color3.strikethrough().gray(v15.title);
|
|
17495
17495
|
} else {
|
|
17496
|
-
title = cursor3 === i12 ?
|
|
17496
|
+
title = cursor3 === i12 ? color3.cyan().underline(v15.title) : v15.title;
|
|
17497
17497
|
if (cursor3 === i12 && v15.description) {
|
|
17498
17498
|
desc = ` - ${v15.description}`;
|
|
17499
17499
|
if (prefix.length + title.length + desc.length >= this.out.columns || v15.description.split(/\r?\n/).length > 1) {
|
|
@@ -17504,12 +17504,12 @@ Instructions:
|
|
|
17504
17504
|
}
|
|
17505
17505
|
}
|
|
17506
17506
|
}
|
|
17507
|
-
return prefix + title +
|
|
17507
|
+
return prefix + title + color3.gray(desc || "");
|
|
17508
17508
|
}
|
|
17509
17509
|
// shared with autocompleteMultiselect
|
|
17510
17510
|
paginateOptions(options3) {
|
|
17511
17511
|
if (options3.length === 0) {
|
|
17512
|
-
return
|
|
17512
|
+
return color3.red("No matches for this query.");
|
|
17513
17513
|
}
|
|
17514
17514
|
let _entriesToDisplay = entriesToDisplay(this.cursor, options3.length, this.optionsPerPage), startIndex = _entriesToDisplay.startIndex, endIndex = _entriesToDisplay.endIndex;
|
|
17515
17515
|
let prefix, styledOptions = [];
|
|
@@ -17536,9 +17536,9 @@ Instructions:
|
|
|
17536
17536
|
if (this.done) {
|
|
17537
17537
|
return this.value.filter((e11) => e11.selected).map((v15) => v15.title).join(", ");
|
|
17538
17538
|
}
|
|
17539
|
-
const output2 = [
|
|
17539
|
+
const output2 = [color3.gray(this.hint), this.renderInstructions()];
|
|
17540
17540
|
if (this.value[this.cursor].disabled) {
|
|
17541
|
-
output2.push(
|
|
17541
|
+
output2.push(color3.yellow(this.warn));
|
|
17542
17542
|
}
|
|
17543
17543
|
return output2.join(" ");
|
|
17544
17544
|
}
|
|
@@ -17546,9 +17546,9 @@ Instructions:
|
|
|
17546
17546
|
if (this.closed) return;
|
|
17547
17547
|
if (this.firstRender) this.out.write(cursor2.hide);
|
|
17548
17548
|
super.render();
|
|
17549
|
-
let prompt = [style.symbol(this.done, this.aborted),
|
|
17549
|
+
let prompt = [style.symbol(this.done, this.aborted), color3.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
|
|
17550
17550
|
if (this.showMinError) {
|
|
17551
|
-
prompt +=
|
|
17551
|
+
prompt += color3.red(`You must select a minimum of ${this.minSelected} choices.`);
|
|
17552
17552
|
this.showMinError = false;
|
|
17553
17553
|
}
|
|
17554
17554
|
prompt += this.renderOptions(this.value);
|
|
@@ -17593,7 +17593,7 @@ var require_autocomplete = __commonJS({
|
|
|
17593
17593
|
});
|
|
17594
17594
|
};
|
|
17595
17595
|
}
|
|
17596
|
-
var
|
|
17596
|
+
var color3 = require_kleur();
|
|
17597
17597
|
var Prompt = require_prompt();
|
|
17598
17598
|
var _require = require_src();
|
|
17599
17599
|
var erase = _require.erase;
|
|
@@ -17783,8 +17783,8 @@ var require_autocomplete = __commonJS({
|
|
|
17783
17783
|
renderOption(v15, hovered, isStart, isEnd) {
|
|
17784
17784
|
let desc;
|
|
17785
17785
|
let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : " ";
|
|
17786
|
-
let title = hovered ?
|
|
17787
|
-
prefix = (hovered ?
|
|
17786
|
+
let title = hovered ? color3.cyan().underline(v15.title) : v15.title;
|
|
17787
|
+
prefix = (hovered ? color3.cyan(figures.pointer) + " " : " ") + prefix;
|
|
17788
17788
|
if (v15.description) {
|
|
17789
17789
|
desc = ` - ${v15.description}`;
|
|
17790
17790
|
if (prefix.length + title.length + desc.length >= this.out.columns || v15.description.split(/\r?\n/).length > 1) {
|
|
@@ -17794,7 +17794,7 @@ var require_autocomplete = __commonJS({
|
|
|
17794
17794
|
});
|
|
17795
17795
|
}
|
|
17796
17796
|
}
|
|
17797
|
-
return prefix + " " + title +
|
|
17797
|
+
return prefix + " " + title + color3.gray(desc || "");
|
|
17798
17798
|
}
|
|
17799
17799
|
render() {
|
|
17800
17800
|
if (this.closed) return;
|
|
@@ -17802,11 +17802,11 @@ var require_autocomplete = __commonJS({
|
|
|
17802
17802
|
else this.out.write(clear(this.outputText, this.out.columns));
|
|
17803
17803
|
super.render();
|
|
17804
17804
|
let _entriesToDisplay = entriesToDisplay(this.select, this.choices.length, this.limit), startIndex = _entriesToDisplay.startIndex, endIndex = _entriesToDisplay.endIndex;
|
|
17805
|
-
this.outputText = [style.symbol(this.done, this.aborted, this.exited),
|
|
17805
|
+
this.outputText = [style.symbol(this.done, this.aborted, this.exited), color3.bold(this.msg), style.delimiter(this.completing), this.done && this.suggestions[this.select] ? this.suggestions[this.select].title : this.rendered = this.transform.render(this.input)].join(" ");
|
|
17806
17806
|
if (!this.done) {
|
|
17807
17807
|
const suggestions = this.suggestions.slice(startIndex, endIndex).map((item, i12) => this.renderOption(item, this.select === i12 + startIndex, i12 === 0 && startIndex > 0, i12 + startIndex === endIndex - 1 && endIndex < this.choices.length)).join("\n");
|
|
17808
17808
|
this.outputText += `
|
|
17809
|
-
` + (suggestions ||
|
|
17809
|
+
` + (suggestions || color3.gray(this.fallback.title));
|
|
17810
17810
|
}
|
|
17811
17811
|
this.out.write(erase.line + cursor2.to(0) + this.outputText);
|
|
17812
17812
|
}
|
|
@@ -17819,7 +17819,7 @@ var require_autocomplete = __commonJS({
|
|
|
17819
17819
|
var require_autocompleteMultiselect = __commonJS({
|
|
17820
17820
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocompleteMultiselect.js"(exports2, module2) {
|
|
17821
17821
|
"use strict";
|
|
17822
|
-
var
|
|
17822
|
+
var color3 = require_kleur();
|
|
17823
17823
|
var _require = require_src();
|
|
17824
17824
|
var cursor2 = _require.cursor;
|
|
17825
17825
|
var MultiselectPrompt = require_multiselect();
|
|
@@ -17937,22 +17937,22 @@ Instructions:
|
|
|
17937
17937
|
}
|
|
17938
17938
|
renderCurrentInput() {
|
|
17939
17939
|
return `
|
|
17940
|
-
Filtered results for: ${this.inputValue ? this.inputValue :
|
|
17940
|
+
Filtered results for: ${this.inputValue ? this.inputValue : color3.gray("Enter something to filter")}
|
|
17941
17941
|
`;
|
|
17942
17942
|
}
|
|
17943
17943
|
renderOption(cursor3, v15, i12) {
|
|
17944
17944
|
let title;
|
|
17945
|
-
if (v15.disabled) title = cursor3 === i12 ?
|
|
17946
|
-
else title = cursor3 === i12 ?
|
|
17947
|
-
return (v15.selected ?
|
|
17945
|
+
if (v15.disabled) title = cursor3 === i12 ? color3.gray().underline(v15.title) : color3.strikethrough().gray(v15.title);
|
|
17946
|
+
else title = cursor3 === i12 ? color3.cyan().underline(v15.title) : v15.title;
|
|
17947
|
+
return (v15.selected ? color3.green(figures.radioOn) : figures.radioOff) + " " + title;
|
|
17948
17948
|
}
|
|
17949
17949
|
renderDoneOrInstructions() {
|
|
17950
17950
|
if (this.done) {
|
|
17951
17951
|
return this.value.filter((e11) => e11.selected).map((v15) => v15.title).join(", ");
|
|
17952
17952
|
}
|
|
17953
|
-
const output2 = [
|
|
17953
|
+
const output2 = [color3.gray(this.hint), this.renderInstructions(), this.renderCurrentInput()];
|
|
17954
17954
|
if (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) {
|
|
17955
|
-
output2.push(
|
|
17955
|
+
output2.push(color3.yellow(this.warn));
|
|
17956
17956
|
}
|
|
17957
17957
|
return output2.join(" ");
|
|
17958
17958
|
}
|
|
@@ -17960,9 +17960,9 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter so
|
|
|
17960
17960
|
if (this.closed) return;
|
|
17961
17961
|
if (this.firstRender) this.out.write(cursor2.hide);
|
|
17962
17962
|
super.render();
|
|
17963
|
-
let prompt = [style.symbol(this.done, this.aborted),
|
|
17963
|
+
let prompt = [style.symbol(this.done, this.aborted), color3.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
|
|
17964
17964
|
if (this.showMinError) {
|
|
17965
|
-
prompt +=
|
|
17965
|
+
prompt += color3.red(`You must select a minimum of ${this.minSelected} choices.`);
|
|
17966
17966
|
this.showMinError = false;
|
|
17967
17967
|
}
|
|
17968
17968
|
prompt += this.renderOptions(this.filteredOptions);
|
|
@@ -17978,7 +17978,7 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter so
|
|
|
17978
17978
|
var require_confirm = __commonJS({
|
|
17979
17979
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/confirm.js"(exports2, module2) {
|
|
17980
17980
|
"use strict";
|
|
17981
|
-
var
|
|
17981
|
+
var color3 = require_kleur();
|
|
17982
17982
|
var Prompt = require_prompt();
|
|
17983
17983
|
var _require = require_util();
|
|
17984
17984
|
var style = _require.style;
|
|
@@ -18038,7 +18038,7 @@ var require_confirm = __commonJS({
|
|
|
18038
18038
|
if (this.firstRender) this.out.write(cursor2.hide);
|
|
18039
18039
|
else this.out.write(clear(this.outputText, this.out.columns));
|
|
18040
18040
|
super.render();
|
|
18041
|
-
this.outputText = [style.symbol(this.done, this.aborted),
|
|
18041
|
+
this.outputText = [style.symbol(this.done, this.aborted), color3.bold(this.msg), style.delimiter(this.done), this.done ? this.value ? this.yesMsg : this.noMsg : color3.gray(this.initialValue ? this.yesOption : this.noOption)].join(" ");
|
|
18042
18042
|
this.out.write(erase.line + cursor2.to(0) + this.outputText);
|
|
18043
18043
|
}
|
|
18044
18044
|
};
|
|
@@ -18555,10 +18555,10 @@ var require_prompt2 = __commonJS({
|
|
|
18555
18555
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/prompt.js"(exports2, module2) {
|
|
18556
18556
|
"use strict";
|
|
18557
18557
|
var readline13 = require("readline");
|
|
18558
|
-
var { action } = require_util2();
|
|
18558
|
+
var { action: action2 } = require_util2();
|
|
18559
18559
|
var EventEmitter7 = require("events");
|
|
18560
18560
|
var { beep, cursor: cursor2 } = require_src();
|
|
18561
|
-
var
|
|
18561
|
+
var color3 = require_kleur();
|
|
18562
18562
|
var Prompt = class extends EventEmitter7 {
|
|
18563
18563
|
constructor(opts = {}) {
|
|
18564
18564
|
super();
|
|
@@ -18571,7 +18571,7 @@ var require_prompt2 = __commonJS({
|
|
|
18571
18571
|
if (this.in.isTTY) this.in.setRawMode(true);
|
|
18572
18572
|
const isSelect = ["SelectPrompt", "MultiselectPrompt"].indexOf(this.constructor.name) > -1;
|
|
18573
18573
|
const keypress = (str3, key) => {
|
|
18574
|
-
let a11 =
|
|
18574
|
+
let a11 = action2(key, isSelect);
|
|
18575
18575
|
if (a11 === false) {
|
|
18576
18576
|
this._ && this._(str3, key);
|
|
18577
18577
|
} else if (typeof this[a11] === "function") {
|
|
@@ -18601,7 +18601,7 @@ var require_prompt2 = __commonJS({
|
|
|
18601
18601
|
this.out.write(beep);
|
|
18602
18602
|
}
|
|
18603
18603
|
render() {
|
|
18604
|
-
this.onRender(
|
|
18604
|
+
this.onRender(color3);
|
|
18605
18605
|
if (this.firstRender) this.firstRender = false;
|
|
18606
18606
|
}
|
|
18607
18607
|
};
|
|
@@ -18612,7 +18612,7 @@ var require_prompt2 = __commonJS({
|
|
|
18612
18612
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/text.js
|
|
18613
18613
|
var require_text2 = __commonJS({
|
|
18614
18614
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/text.js"(exports2, module2) {
|
|
18615
|
-
var
|
|
18615
|
+
var color3 = require_kleur();
|
|
18616
18616
|
var Prompt = require_prompt2();
|
|
18617
18617
|
var { erase, cursor: cursor2 } = require_src();
|
|
18618
18618
|
var { style, clear, lines, figures } = require_util2();
|
|
@@ -18634,7 +18634,7 @@ var require_text2 = __commonJS({
|
|
|
18634
18634
|
set value(v15) {
|
|
18635
18635
|
if (!v15 && this.initial) {
|
|
18636
18636
|
this.placeholder = true;
|
|
18637
|
-
this.rendered =
|
|
18637
|
+
this.rendered = color3.gray(this.transform.render(this.initial));
|
|
18638
18638
|
} else {
|
|
18639
18639
|
this.placeholder = false;
|
|
18640
18640
|
this.rendered = this.transform.render(v15);
|
|
@@ -18773,14 +18773,14 @@ var require_text2 = __commonJS({
|
|
|
18773
18773
|
this.outputError = "";
|
|
18774
18774
|
this.outputText = [
|
|
18775
18775
|
style.symbol(this.done, this.aborted),
|
|
18776
|
-
|
|
18776
|
+
color3.bold(this.msg),
|
|
18777
18777
|
style.delimiter(this.done),
|
|
18778
|
-
this.red ?
|
|
18778
|
+
this.red ? color3.red(this.rendered) : this.rendered
|
|
18779
18779
|
].join(` `);
|
|
18780
18780
|
if (this.error) {
|
|
18781
18781
|
this.outputError += this.errorMsg.split(`
|
|
18782
18782
|
`).reduce((a11, l11, i12) => a11 + `
|
|
18783
|
-
${i12 ? " " : figures.pointerSmall} ${
|
|
18783
|
+
${i12 ? " " : figures.pointerSmall} ${color3.red().italic(l11)}`, ``);
|
|
18784
18784
|
}
|
|
18785
18785
|
this.out.write(erase.line + cursor2.to(0) + this.outputText + cursor2.save + this.outputError + cursor2.restore + cursor2.move(this.cursorOffset, 0));
|
|
18786
18786
|
}
|
|
@@ -18793,7 +18793,7 @@ ${i12 ? " " : figures.pointerSmall} ${color.red().italic(l11)}`, ``);
|
|
|
18793
18793
|
var require_select2 = __commonJS({
|
|
18794
18794
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/select.js"(exports2, module2) {
|
|
18795
18795
|
"use strict";
|
|
18796
|
-
var
|
|
18796
|
+
var color3 = require_kleur();
|
|
18797
18797
|
var Prompt = require_prompt2();
|
|
18798
18798
|
var { style, clear, figures, wrap, entriesToDisplay } = require_util2();
|
|
18799
18799
|
var { cursor: cursor2 } = require_src();
|
|
@@ -18893,9 +18893,9 @@ var require_select2 = __commonJS({
|
|
|
18893
18893
|
let { startIndex, endIndex } = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage);
|
|
18894
18894
|
this.outputText = [
|
|
18895
18895
|
style.symbol(this.done, this.aborted),
|
|
18896
|
-
|
|
18896
|
+
color3.bold(this.msg),
|
|
18897
18897
|
style.delimiter(false),
|
|
18898
|
-
this.done ? this.selection.title : this.selection.disabled ?
|
|
18898
|
+
this.done ? this.selection.title : this.selection.disabled ? color3.yellow(this.warn) : color3.gray(this.hint)
|
|
18899
18899
|
].join(" ");
|
|
18900
18900
|
if (!this.done) {
|
|
18901
18901
|
this.outputText += "\n";
|
|
@@ -18909,11 +18909,11 @@ var require_select2 = __commonJS({
|
|
|
18909
18909
|
prefix = " ";
|
|
18910
18910
|
}
|
|
18911
18911
|
if (v15.disabled) {
|
|
18912
|
-
title = this.cursor === i12 ?
|
|
18913
|
-
prefix = (this.cursor === i12 ?
|
|
18912
|
+
title = this.cursor === i12 ? color3.gray().underline(v15.title) : color3.strikethrough().gray(v15.title);
|
|
18913
|
+
prefix = (this.cursor === i12 ? color3.bold().gray(figures.pointer) + " " : " ") + prefix;
|
|
18914
18914
|
} else {
|
|
18915
|
-
title = this.cursor === i12 ?
|
|
18916
|
-
prefix = (this.cursor === i12 ?
|
|
18915
|
+
title = this.cursor === i12 ? color3.cyan().underline(v15.title) : v15.title;
|
|
18916
|
+
prefix = (this.cursor === i12 ? color3.cyan(figures.pointer) + " " : " ") + prefix;
|
|
18917
18917
|
if (v15.description && this.cursor === i12) {
|
|
18918
18918
|
desc = ` - ${v15.description}`;
|
|
18919
18919
|
if (prefix.length + title.length + desc.length >= this.out.columns || v15.description.split(/\r?\n/).length > 1) {
|
|
@@ -18921,7 +18921,7 @@ var require_select2 = __commonJS({
|
|
|
18921
18921
|
}
|
|
18922
18922
|
}
|
|
18923
18923
|
}
|
|
18924
|
-
this.outputText += `${prefix} ${title}${
|
|
18924
|
+
this.outputText += `${prefix} ${title}${color3.gray(desc)}
|
|
18925
18925
|
`;
|
|
18926
18926
|
}
|
|
18927
18927
|
}
|
|
@@ -18935,7 +18935,7 @@ var require_select2 = __commonJS({
|
|
|
18935
18935
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/toggle.js
|
|
18936
18936
|
var require_toggle2 = __commonJS({
|
|
18937
18937
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/toggle.js"(exports2, module2) {
|
|
18938
|
-
var
|
|
18938
|
+
var color3 = require_kleur();
|
|
18939
18939
|
var Prompt = require_prompt2();
|
|
18940
18940
|
var { style, clear } = require_util2();
|
|
18941
18941
|
var { cursor: cursor2, erase } = require_src();
|
|
@@ -19019,11 +19019,11 @@ var require_toggle2 = __commonJS({
|
|
|
19019
19019
|
super.render();
|
|
19020
19020
|
this.outputText = [
|
|
19021
19021
|
style.symbol(this.done, this.aborted),
|
|
19022
|
-
|
|
19022
|
+
color3.bold(this.msg),
|
|
19023
19023
|
style.delimiter(this.done),
|
|
19024
|
-
this.value ? this.inactive :
|
|
19025
|
-
|
|
19026
|
-
this.value ?
|
|
19024
|
+
this.value ? this.inactive : color3.cyan().underline(this.inactive),
|
|
19025
|
+
color3.gray("/"),
|
|
19026
|
+
this.value ? color3.cyan().underline(this.active) : this.active
|
|
19027
19027
|
].join(" ");
|
|
19028
19028
|
this.out.write(erase.line + cursor2.to(0) + this.outputText);
|
|
19029
19029
|
}
|
|
@@ -19309,7 +19309,7 @@ var require_dateparts2 = __commonJS({
|
|
|
19309
19309
|
var require_date2 = __commonJS({
|
|
19310
19310
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/date.js"(exports2, module2) {
|
|
19311
19311
|
"use strict";
|
|
19312
|
-
var
|
|
19312
|
+
var color3 = require_kleur();
|
|
19313
19313
|
var Prompt = require_prompt2();
|
|
19314
19314
|
var { style, clear, figures } = require_util2();
|
|
19315
19315
|
var { erase, cursor: cursor2 } = require_src();
|
|
@@ -19466,14 +19466,14 @@ var require_date2 = __commonJS({
|
|
|
19466
19466
|
super.render();
|
|
19467
19467
|
this.outputText = [
|
|
19468
19468
|
style.symbol(this.done, this.aborted),
|
|
19469
|
-
|
|
19469
|
+
color3.bold(this.msg),
|
|
19470
19470
|
style.delimiter(false),
|
|
19471
|
-
this.parts.reduce((arr, p10, idx) => arr.concat(idx === this.cursor && !this.done ?
|
|
19471
|
+
this.parts.reduce((arr, p10, idx) => arr.concat(idx === this.cursor && !this.done ? color3.cyan().underline(p10.toString()) : p10), []).join("")
|
|
19472
19472
|
].join(" ");
|
|
19473
19473
|
if (this.error) {
|
|
19474
19474
|
this.outputText += this.errorMsg.split("\n").reduce(
|
|
19475
19475
|
(a11, l11, i12) => a11 + `
|
|
19476
|
-
${i12 ? ` ` : figures.pointerSmall} ${
|
|
19476
|
+
${i12 ? ` ` : figures.pointerSmall} ${color3.red().italic(l11)}`,
|
|
19477
19477
|
``
|
|
19478
19478
|
);
|
|
19479
19479
|
}
|
|
@@ -19487,7 +19487,7 @@ ${i12 ? ` ` : figures.pointerSmall} ${color.red().italic(l11)}`,
|
|
|
19487
19487
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/number.js
|
|
19488
19488
|
var require_number2 = __commonJS({
|
|
19489
19489
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/number.js"(exports2, module2) {
|
|
19490
|
-
var
|
|
19490
|
+
var color3 = require_kleur();
|
|
19491
19491
|
var Prompt = require_prompt2();
|
|
19492
19492
|
var { cursor: cursor2, erase } = require_src();
|
|
19493
19493
|
var { style, figures, clear, lines } = require_util2();
|
|
@@ -19519,7 +19519,7 @@ var require_number2 = __commonJS({
|
|
|
19519
19519
|
set value(v15) {
|
|
19520
19520
|
if (!v15 && v15 !== 0) {
|
|
19521
19521
|
this.placeholder = true;
|
|
19522
|
-
this.rendered =
|
|
19522
|
+
this.rendered = color3.gray(this.transform.render(`${this.initial}`));
|
|
19523
19523
|
this._value = ``;
|
|
19524
19524
|
} else {
|
|
19525
19525
|
this.placeholder = false;
|
|
@@ -19647,14 +19647,14 @@ var require_number2 = __commonJS({
|
|
|
19647
19647
|
this.outputError = "";
|
|
19648
19648
|
this.outputText = [
|
|
19649
19649
|
style.symbol(this.done, this.aborted),
|
|
19650
|
-
|
|
19650
|
+
color3.bold(this.msg),
|
|
19651
19651
|
style.delimiter(this.done),
|
|
19652
|
-
!this.done || !this.done && !this.placeholder ?
|
|
19652
|
+
!this.done || !this.done && !this.placeholder ? color3[this.color]().underline(this.rendered) : this.rendered
|
|
19653
19653
|
].join(` `);
|
|
19654
19654
|
if (this.error) {
|
|
19655
19655
|
this.outputError += this.errorMsg.split(`
|
|
19656
19656
|
`).reduce((a11, l11, i12) => a11 + `
|
|
19657
|
-
${i12 ? ` ` : figures.pointerSmall} ${
|
|
19657
|
+
${i12 ? ` ` : figures.pointerSmall} ${color3.red().italic(l11)}`, ``);
|
|
19658
19658
|
}
|
|
19659
19659
|
this.out.write(erase.line + cursor2.to(0) + this.outputText + cursor2.save + this.outputError + cursor2.restore);
|
|
19660
19660
|
}
|
|
@@ -19667,7 +19667,7 @@ ${i12 ? ` ` : figures.pointerSmall} ${color.red().italic(l11)}`, ``);
|
|
|
19667
19667
|
var require_multiselect2 = __commonJS({
|
|
19668
19668
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/multiselect.js"(exports2, module2) {
|
|
19669
19669
|
"use strict";
|
|
19670
|
-
var
|
|
19670
|
+
var color3 = require_kleur();
|
|
19671
19671
|
var { cursor: cursor2 } = require_src();
|
|
19672
19672
|
var Prompt = require_prompt2();
|
|
19673
19673
|
var { clear, figures, style, wrap, entriesToDisplay } = require_util2();
|
|
@@ -19814,12 +19814,12 @@ Instructions:
|
|
|
19814
19814
|
return "";
|
|
19815
19815
|
}
|
|
19816
19816
|
renderOption(cursor3, v15, i12, arrowIndicator) {
|
|
19817
|
-
const prefix = (v15.selected ?
|
|
19817
|
+
const prefix = (v15.selected ? color3.green(figures.radioOn) : figures.radioOff) + " " + arrowIndicator + " ";
|
|
19818
19818
|
let title, desc;
|
|
19819
19819
|
if (v15.disabled) {
|
|
19820
|
-
title = cursor3 === i12 ?
|
|
19820
|
+
title = cursor3 === i12 ? color3.gray().underline(v15.title) : color3.strikethrough().gray(v15.title);
|
|
19821
19821
|
} else {
|
|
19822
|
-
title = cursor3 === i12 ?
|
|
19822
|
+
title = cursor3 === i12 ? color3.cyan().underline(v15.title) : v15.title;
|
|
19823
19823
|
if (cursor3 === i12 && v15.description) {
|
|
19824
19824
|
desc = ` - ${v15.description}`;
|
|
19825
19825
|
if (prefix.length + title.length + desc.length >= this.out.columns || v15.description.split(/\r?\n/).length > 1) {
|
|
@@ -19827,12 +19827,12 @@ Instructions:
|
|
|
19827
19827
|
}
|
|
19828
19828
|
}
|
|
19829
19829
|
}
|
|
19830
|
-
return prefix + title +
|
|
19830
|
+
return prefix + title + color3.gray(desc || "");
|
|
19831
19831
|
}
|
|
19832
19832
|
// shared with autocompleteMultiselect
|
|
19833
19833
|
paginateOptions(options3) {
|
|
19834
19834
|
if (options3.length === 0) {
|
|
19835
|
-
return
|
|
19835
|
+
return color3.red("No matches for this query.");
|
|
19836
19836
|
}
|
|
19837
19837
|
let { startIndex, endIndex } = entriesToDisplay(this.cursor, options3.length, this.optionsPerPage);
|
|
19838
19838
|
let prefix, styledOptions = [];
|
|
@@ -19859,9 +19859,9 @@ Instructions:
|
|
|
19859
19859
|
if (this.done) {
|
|
19860
19860
|
return this.value.filter((e11) => e11.selected).map((v15) => v15.title).join(", ");
|
|
19861
19861
|
}
|
|
19862
|
-
const output2 = [
|
|
19862
|
+
const output2 = [color3.gray(this.hint), this.renderInstructions()];
|
|
19863
19863
|
if (this.value[this.cursor].disabled) {
|
|
19864
|
-
output2.push(
|
|
19864
|
+
output2.push(color3.yellow(this.warn));
|
|
19865
19865
|
}
|
|
19866
19866
|
return output2.join(" ");
|
|
19867
19867
|
}
|
|
@@ -19871,12 +19871,12 @@ Instructions:
|
|
|
19871
19871
|
super.render();
|
|
19872
19872
|
let prompt = [
|
|
19873
19873
|
style.symbol(this.done, this.aborted),
|
|
19874
|
-
|
|
19874
|
+
color3.bold(this.msg),
|
|
19875
19875
|
style.delimiter(false),
|
|
19876
19876
|
this.renderDoneOrInstructions()
|
|
19877
19877
|
].join(" ");
|
|
19878
19878
|
if (this.showMinError) {
|
|
19879
|
-
prompt +=
|
|
19879
|
+
prompt += color3.red(`You must select a minimum of ${this.minSelected} choices.`);
|
|
19880
19880
|
this.showMinError = false;
|
|
19881
19881
|
}
|
|
19882
19882
|
prompt += this.renderOptions(this.value);
|
|
@@ -19892,7 +19892,7 @@ Instructions:
|
|
|
19892
19892
|
var require_autocomplete2 = __commonJS({
|
|
19893
19893
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocomplete.js"(exports2, module2) {
|
|
19894
19894
|
"use strict";
|
|
19895
|
-
var
|
|
19895
|
+
var color3 = require_kleur();
|
|
19896
19896
|
var Prompt = require_prompt2();
|
|
19897
19897
|
var { erase, cursor: cursor2 } = require_src();
|
|
19898
19898
|
var { style, clear, figures, wrap, entriesToDisplay } = require_util2();
|
|
@@ -20065,15 +20065,15 @@ var require_autocomplete2 = __commonJS({
|
|
|
20065
20065
|
renderOption(v15, hovered, isStart, isEnd) {
|
|
20066
20066
|
let desc;
|
|
20067
20067
|
let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : " ";
|
|
20068
|
-
let title = hovered ?
|
|
20069
|
-
prefix = (hovered ?
|
|
20068
|
+
let title = hovered ? color3.cyan().underline(v15.title) : v15.title;
|
|
20069
|
+
prefix = (hovered ? color3.cyan(figures.pointer) + " " : " ") + prefix;
|
|
20070
20070
|
if (v15.description) {
|
|
20071
20071
|
desc = ` - ${v15.description}`;
|
|
20072
20072
|
if (prefix.length + title.length + desc.length >= this.out.columns || v15.description.split(/\r?\n/).length > 1) {
|
|
20073
20073
|
desc = "\n" + wrap(v15.description, { margin: 3, width: this.out.columns });
|
|
20074
20074
|
}
|
|
20075
20075
|
}
|
|
20076
|
-
return prefix + " " + title +
|
|
20076
|
+
return prefix + " " + title + color3.gray(desc || "");
|
|
20077
20077
|
}
|
|
20078
20078
|
render() {
|
|
20079
20079
|
if (this.closed) return;
|
|
@@ -20083,7 +20083,7 @@ var require_autocomplete2 = __commonJS({
|
|
|
20083
20083
|
let { startIndex, endIndex } = entriesToDisplay(this.select, this.choices.length, this.limit);
|
|
20084
20084
|
this.outputText = [
|
|
20085
20085
|
style.symbol(this.done, this.aborted, this.exited),
|
|
20086
|
-
|
|
20086
|
+
color3.bold(this.msg),
|
|
20087
20087
|
style.delimiter(this.completing),
|
|
20088
20088
|
this.done && this.suggestions[this.select] ? this.suggestions[this.select].title : this.rendered = this.transform.render(this.input)
|
|
20089
20089
|
].join(" ");
|
|
@@ -20095,7 +20095,7 @@ var require_autocomplete2 = __commonJS({
|
|
|
20095
20095
|
i12 + startIndex === endIndex - 1 && endIndex < this.choices.length
|
|
20096
20096
|
)).join("\n");
|
|
20097
20097
|
this.outputText += `
|
|
20098
|
-
` + (suggestions ||
|
|
20098
|
+
` + (suggestions || color3.gray(this.fallback.title));
|
|
20099
20099
|
}
|
|
20100
20100
|
this.out.write(erase.line + cursor2.to(0) + this.outputText);
|
|
20101
20101
|
}
|
|
@@ -20108,7 +20108,7 @@ var require_autocomplete2 = __commonJS({
|
|
|
20108
20108
|
var require_autocompleteMultiselect2 = __commonJS({
|
|
20109
20109
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocompleteMultiselect.js"(exports2, module2) {
|
|
20110
20110
|
"use strict";
|
|
20111
|
-
var
|
|
20111
|
+
var color3 = require_kleur();
|
|
20112
20112
|
var { cursor: cursor2 } = require_src();
|
|
20113
20113
|
var MultiselectPrompt = require_multiselect2();
|
|
20114
20114
|
var { clear, style, figures } = require_util2();
|
|
@@ -20222,22 +20222,22 @@ Instructions:
|
|
|
20222
20222
|
}
|
|
20223
20223
|
renderCurrentInput() {
|
|
20224
20224
|
return `
|
|
20225
|
-
Filtered results for: ${this.inputValue ? this.inputValue :
|
|
20225
|
+
Filtered results for: ${this.inputValue ? this.inputValue : color3.gray("Enter something to filter")}
|
|
20226
20226
|
`;
|
|
20227
20227
|
}
|
|
20228
20228
|
renderOption(cursor3, v15, i12) {
|
|
20229
20229
|
let title;
|
|
20230
|
-
if (v15.disabled) title = cursor3 === i12 ?
|
|
20231
|
-
else title = cursor3 === i12 ?
|
|
20232
|
-
return (v15.selected ?
|
|
20230
|
+
if (v15.disabled) title = cursor3 === i12 ? color3.gray().underline(v15.title) : color3.strikethrough().gray(v15.title);
|
|
20231
|
+
else title = cursor3 === i12 ? color3.cyan().underline(v15.title) : v15.title;
|
|
20232
|
+
return (v15.selected ? color3.green(figures.radioOn) : figures.radioOff) + " " + title;
|
|
20233
20233
|
}
|
|
20234
20234
|
renderDoneOrInstructions() {
|
|
20235
20235
|
if (this.done) {
|
|
20236
20236
|
return this.value.filter((e11) => e11.selected).map((v15) => v15.title).join(", ");
|
|
20237
20237
|
}
|
|
20238
|
-
const output2 = [
|
|
20238
|
+
const output2 = [color3.gray(this.hint), this.renderInstructions(), this.renderCurrentInput()];
|
|
20239
20239
|
if (this.filteredOptions.length && this.filteredOptions[this.cursor].disabled) {
|
|
20240
|
-
output2.push(
|
|
20240
|
+
output2.push(color3.yellow(this.warn));
|
|
20241
20241
|
}
|
|
20242
20242
|
return output2.join(" ");
|
|
20243
20243
|
}
|
|
@@ -20247,12 +20247,12 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter so
|
|
|
20247
20247
|
super.render();
|
|
20248
20248
|
let prompt = [
|
|
20249
20249
|
style.symbol(this.done, this.aborted),
|
|
20250
|
-
|
|
20250
|
+
color3.bold(this.msg),
|
|
20251
20251
|
style.delimiter(false),
|
|
20252
20252
|
this.renderDoneOrInstructions()
|
|
20253
20253
|
].join(" ");
|
|
20254
20254
|
if (this.showMinError) {
|
|
20255
|
-
prompt +=
|
|
20255
|
+
prompt += color3.red(`You must select a minimum of ${this.minSelected} choices.`);
|
|
20256
20256
|
this.showMinError = false;
|
|
20257
20257
|
}
|
|
20258
20258
|
prompt += this.renderOptions(this.filteredOptions);
|
|
@@ -20267,7 +20267,7 @@ Filtered results for: ${this.inputValue ? this.inputValue : color.gray("Enter so
|
|
|
20267
20267
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/confirm.js
|
|
20268
20268
|
var require_confirm2 = __commonJS({
|
|
20269
20269
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/confirm.js"(exports2, module2) {
|
|
20270
|
-
var
|
|
20270
|
+
var color3 = require_kleur();
|
|
20271
20271
|
var Prompt = require_prompt2();
|
|
20272
20272
|
var { style, clear } = require_util2();
|
|
20273
20273
|
var { erase, cursor: cursor2 } = require_src();
|
|
@@ -20325,9 +20325,9 @@ var require_confirm2 = __commonJS({
|
|
|
20325
20325
|
super.render();
|
|
20326
20326
|
this.outputText = [
|
|
20327
20327
|
style.symbol(this.done, this.aborted),
|
|
20328
|
-
|
|
20328
|
+
color3.bold(this.msg),
|
|
20329
20329
|
style.delimiter(this.done),
|
|
20330
|
-
this.done ? this.value ? this.yesMsg : this.noMsg :
|
|
20330
|
+
this.done ? this.value ? this.yesMsg : this.noMsg : color3.gray(this.initialValue ? this.yesOption : this.noOption)
|
|
20331
20331
|
].join(" ");
|
|
20332
20332
|
this.out.write(erase.line + cursor2.to(0) + this.outputText);
|
|
20333
20333
|
}
|
|
@@ -20512,7 +20512,7 @@ var require_prompts3 = __commonJS({
|
|
|
20512
20512
|
|
|
20513
20513
|
// dist/utils/version-check.js
|
|
20514
20514
|
function isBundled() {
|
|
20515
|
-
const v15 = "0.1.195-dev.simplify-google-client-setup.
|
|
20515
|
+
const v15 = "0.1.195-dev.simplify-google-client-setup.3";
|
|
20516
20516
|
return typeof v15 === "string" && v15 !== "undefined";
|
|
20517
20517
|
}
|
|
20518
20518
|
function getPackageRoot() {
|
|
@@ -20529,7 +20529,7 @@ function getInstallationInfo() {
|
|
|
20529
20529
|
};
|
|
20530
20530
|
}
|
|
20531
20531
|
function getCurrentVersion() {
|
|
20532
|
-
const bundledVersion = "0.1.195-dev.simplify-google-client-setup.
|
|
20532
|
+
const bundledVersion = "0.1.195-dev.simplify-google-client-setup.3";
|
|
20533
20533
|
if (bundledVersion && bundledVersion !== "undefined") {
|
|
20534
20534
|
return bundledVersion;
|
|
20535
20535
|
}
|
|
@@ -21090,6 +21090,24 @@ __export(macos_permissions_exports, {
|
|
|
21090
21090
|
repairTccPathsIfChanged: () => repairTccPathsIfChanged,
|
|
21091
21091
|
saveTccPaths: () => saveTccPaths
|
|
21092
21092
|
});
|
|
21093
|
+
function color(text, code) {
|
|
21094
|
+
return `${code}${text}${ANSI_RESET}`;
|
|
21095
|
+
}
|
|
21096
|
+
function okText(text) {
|
|
21097
|
+
return color(text, ANSI_GREEN);
|
|
21098
|
+
}
|
|
21099
|
+
function warnText(text) {
|
|
21100
|
+
return color(text, ANSI_YELLOW);
|
|
21101
|
+
}
|
|
21102
|
+
function errorText(text) {
|
|
21103
|
+
return color(text, ANSI_RED);
|
|
21104
|
+
}
|
|
21105
|
+
function infoText(text) {
|
|
21106
|
+
return color(text, ANSI_CYAN);
|
|
21107
|
+
}
|
|
21108
|
+
function boldText(text) {
|
|
21109
|
+
return color(text, ANSI_BOLD);
|
|
21110
|
+
}
|
|
21093
21111
|
function resolveNodeBinaryPath() {
|
|
21094
21112
|
try {
|
|
21095
21113
|
const whichPath = (0, import_node_child_process.execSync)("which node", { encoding: "utf-8" }).trim();
|
|
@@ -21515,8 +21533,8 @@ async function checkDownloadsFolderPermission() {
|
|
|
21515
21533
|
return false;
|
|
21516
21534
|
}
|
|
21517
21535
|
}
|
|
21518
|
-
async function runSwiftCheck(
|
|
21519
|
-
const base = (0, import_node_path6.join)((0, import_node_os2.tmpdir)(), `visionclaw-perm-check-${
|
|
21536
|
+
async function runSwiftCheck(label2, code) {
|
|
21537
|
+
const base = (0, import_node_path6.join)((0, import_node_os2.tmpdir)(), `visionclaw-perm-check-${label2}`);
|
|
21520
21538
|
const src = `${base}.swift`;
|
|
21521
21539
|
const bin = base;
|
|
21522
21540
|
try {
|
|
@@ -21573,8 +21591,9 @@ async function checkMacOSPermissions() {
|
|
|
21573
21591
|
if (process.platform !== "darwin") {
|
|
21574
21592
|
return true;
|
|
21575
21593
|
}
|
|
21576
|
-
console.log("--- macOS Permissions Check
|
|
21577
|
-
|
|
21594
|
+
console.log(`${boldText("--- macOS Permissions Check ---")}
|
|
21595
|
+
`);
|
|
21596
|
+
console.log(` ${infoText("Terminal:")} ${TERMINAL_NAME} (${TERMINAL_BUNDLE_ID})
|
|
21578
21597
|
`);
|
|
21579
21598
|
let allGranted = true;
|
|
21580
21599
|
const permChecks = [
|
|
@@ -21594,14 +21613,14 @@ async function checkMacOSPermissions() {
|
|
|
21594
21613
|
{ label: "Documents Folder", check: checkDocumentsFolderPermission, permType: "documents-folder" },
|
|
21595
21614
|
{ label: "Downloads Folder", check: checkDownloadsFolderPermission, permType: "downloads-folder" }
|
|
21596
21615
|
];
|
|
21597
|
-
for (const { label, check: check2, permType } of permChecks) {
|
|
21598
|
-
const padded = `${
|
|
21616
|
+
for (const { label: label2, check: check2, permType } of permChecks) {
|
|
21617
|
+
const padded = `${label2}:`.padEnd(22);
|
|
21599
21618
|
process.stdout.write(` ${padded} `);
|
|
21600
21619
|
const granted = await check2();
|
|
21601
21620
|
if (granted) {
|
|
21602
|
-
console.log("Granted");
|
|
21621
|
+
console.log(okText("Granted"));
|
|
21603
21622
|
} else {
|
|
21604
|
-
console.log("NOT GRANTED");
|
|
21623
|
+
console.log(errorText("NOT GRANTED"));
|
|
21605
21624
|
printPermissionInstructions(permType);
|
|
21606
21625
|
allGranted = false;
|
|
21607
21626
|
}
|
|
@@ -21609,27 +21628,27 @@ async function checkMacOSPermissions() {
|
|
|
21609
21628
|
process.stdout.write(" cliclick: ");
|
|
21610
21629
|
const cliclickOk = await checkCliclickInstalled();
|
|
21611
21630
|
if (cliclickOk) {
|
|
21612
|
-
console.log("Installed");
|
|
21631
|
+
console.log(okText("Installed"));
|
|
21613
21632
|
} else {
|
|
21614
|
-
console.log("NOT INSTALLED");
|
|
21633
|
+
console.log(errorText("NOT INSTALLED"));
|
|
21615
21634
|
console.log("\n To install cliclick: brew install cliclick");
|
|
21616
21635
|
allGranted = false;
|
|
21617
21636
|
}
|
|
21618
21637
|
process.stdout.write(" ffmpeg: ");
|
|
21619
21638
|
const ffmpegOk = await checkFfmpegInstalled();
|
|
21620
21639
|
if (ffmpegOk) {
|
|
21621
|
-
console.log("Installed");
|
|
21640
|
+
console.log(okText("Installed"));
|
|
21622
21641
|
} else {
|
|
21623
|
-
console.log("NOT INSTALLED");
|
|
21642
|
+
console.log(errorText("NOT INSTALLED"));
|
|
21624
21643
|
console.log("\n To install ffmpeg: brew install ffmpeg");
|
|
21625
21644
|
allGranted = false;
|
|
21626
21645
|
}
|
|
21627
21646
|
process.stdout.write(" Chrome: ");
|
|
21628
21647
|
const chromeOk = await checkChromeInstalled();
|
|
21629
21648
|
if (chromeOk) {
|
|
21630
|
-
console.log("Found");
|
|
21649
|
+
console.log(okText("Found"));
|
|
21631
21650
|
} else {
|
|
21632
|
-
console.log("NOT FOUND");
|
|
21651
|
+
console.log(errorText("NOT FOUND"));
|
|
21633
21652
|
console.log("\n Install Google Chrome from https://www.google.com/chrome/");
|
|
21634
21653
|
allGranted = false;
|
|
21635
21654
|
}
|
|
@@ -21638,33 +21657,31 @@ async function checkMacOSPermissions() {
|
|
|
21638
21657
|
if (ghOk) {
|
|
21639
21658
|
const ghAuth = await checkGhAuthenticated();
|
|
21640
21659
|
if (ghAuth) {
|
|
21641
|
-
console.log("Installed & Authenticated");
|
|
21660
|
+
console.log(okText("Installed & Authenticated"));
|
|
21642
21661
|
} else {
|
|
21643
|
-
console.log("
|
|
21644
|
-
console.log("
|
|
21645
|
-
allGranted = false;
|
|
21662
|
+
console.log(warnText("Installed; not authenticated yet"));
|
|
21663
|
+
console.log(" Setup can authenticate gh using a server-delivered GitHub PAT when GitHub is enabled.");
|
|
21646
21664
|
}
|
|
21647
21665
|
} else {
|
|
21648
|
-
console.log("NOT INSTALLED");
|
|
21666
|
+
console.log(errorText("NOT INSTALLED"));
|
|
21649
21667
|
console.log("\n To install: brew install gh");
|
|
21650
|
-
console.log(" Then authenticate: gh auth login");
|
|
21651
21668
|
allGranted = false;
|
|
21652
21669
|
}
|
|
21653
21670
|
process.stdout.write(" whisper-cli: ");
|
|
21654
21671
|
const whisperOk = await checkWhisperCppInstalled();
|
|
21655
21672
|
if (whisperOk) {
|
|
21656
|
-
console.log("Installed");
|
|
21673
|
+
console.log(okText("Installed"));
|
|
21657
21674
|
} else {
|
|
21658
|
-
console.log("NOT INSTALLED");
|
|
21675
|
+
console.log(errorText("NOT INSTALLED"));
|
|
21659
21676
|
console.log("\n To install: brew install whisper-cpp (binary is whisper-cli)");
|
|
21660
21677
|
allGranted = false;
|
|
21661
21678
|
}
|
|
21662
21679
|
process.stdout.write(" Whisper model: ");
|
|
21663
21680
|
const modelStatus = checkWhisperModelIntegrity();
|
|
21664
21681
|
if (modelStatus === "valid") {
|
|
21665
|
-
console.log("Found");
|
|
21682
|
+
console.log(okText("Found"));
|
|
21666
21683
|
} else {
|
|
21667
|
-
console.log(modelStatus === "incomplete" ? "INCOMPLETE (bad download)" : "NOT FOUND");
|
|
21684
|
+
console.log(errorText(modelStatus === "incomplete" ? "INCOMPLETE (bad download)" : "NOT FOUND"));
|
|
21668
21685
|
console.log(`
|
|
21669
21686
|
Download the model (1.5GB, one-time):`);
|
|
21670
21687
|
console.log(` mkdir -p ${WHISPER_MODEL_DIR} && curl -L -o ${WHISPER_MODEL_PATH} '${WHISPER_MODEL_URL}'`);
|
|
@@ -21673,19 +21690,21 @@ async function checkMacOSPermissions() {
|
|
|
21673
21690
|
process.stdout.write(" pm2: ");
|
|
21674
21691
|
const pm2Ok = await checkPm2Installed();
|
|
21675
21692
|
if (pm2Ok) {
|
|
21676
|
-
console.log("Installed");
|
|
21693
|
+
console.log(okText("Installed"));
|
|
21677
21694
|
} else {
|
|
21678
|
-
console.log("NOT INSTALLED");
|
|
21695
|
+
console.log(errorText("NOT INSTALLED"));
|
|
21679
21696
|
console.log("\n To install: npm install -g pm2");
|
|
21680
21697
|
allGranted = false;
|
|
21681
21698
|
}
|
|
21682
21699
|
console.log("");
|
|
21683
21700
|
if (!allGranted) {
|
|
21684
|
-
console.log(" Some permissions are missing. VisionClaw needs these to control the desktop.");
|
|
21685
|
-
console.log(" You can continue setup now and grant them later, but the agent will");
|
|
21686
|
-
console.log(" not be fully functional until all
|
|
21701
|
+
console.log(warnText(" Some permissions or prerequisites are missing. VisionClaw needs these to control the desktop."));
|
|
21702
|
+
console.log(warnText(" You can continue setup now and grant them later, but the agent will"));
|
|
21703
|
+
console.log(`${warnText(" not be fully functional until all required items are ready.")}
|
|
21704
|
+
`);
|
|
21687
21705
|
} else {
|
|
21688
|
-
console.log(" All permissions granted
|
|
21706
|
+
console.log(`${okText(" All permissions granted!")}
|
|
21707
|
+
`);
|
|
21689
21708
|
}
|
|
21690
21709
|
return allGranted;
|
|
21691
21710
|
}
|
|
@@ -21760,7 +21779,7 @@ function pinHomebrewBinaries() {
|
|
|
21760
21779
|
}
|
|
21761
21780
|
}
|
|
21762
21781
|
}
|
|
21763
|
-
var import_node_child_process, import_node_fs6, import_node_os2, import_node_path6, import_node_util, execAsync, TERMINAL_BUNDLE_ID, TERMINAL_NAME, cachedNodePath, cachedCliclickPath, TCC_SERVICES, SYSTEM_TCC_SERVICES, WHISPER_MODEL_DIR, WHISPER_MODEL_FILENAME, WHISPER_MODEL_PATH, WHISPER_MODEL_URL, _cachedRemoteSize, TCC_PATHS_FILE;
|
|
21782
|
+
var import_node_child_process, import_node_fs6, import_node_os2, import_node_path6, import_node_util, execAsync, ANSI_RESET, ANSI_BOLD, ANSI_GREEN, ANSI_YELLOW, ANSI_RED, ANSI_CYAN, TERMINAL_BUNDLE_ID, TERMINAL_NAME, cachedNodePath, cachedCliclickPath, TCC_SERVICES, SYSTEM_TCC_SERVICES, WHISPER_MODEL_DIR, WHISPER_MODEL_FILENAME, WHISPER_MODEL_PATH, WHISPER_MODEL_URL, _cachedRemoteSize, TCC_PATHS_FILE;
|
|
21764
21783
|
var init_macos_permissions = __esm({
|
|
21765
21784
|
"dist/onboarding/macos-permissions.js"() {
|
|
21766
21785
|
"use strict";
|
|
@@ -21770,6 +21789,12 @@ var init_macos_permissions = __esm({
|
|
|
21770
21789
|
import_node_path6 = require("node:path");
|
|
21771
21790
|
import_node_util = require("node:util");
|
|
21772
21791
|
execAsync = (0, import_node_util.promisify)(import_node_child_process.exec);
|
|
21792
|
+
ANSI_RESET = "\x1B[0m";
|
|
21793
|
+
ANSI_BOLD = "\x1B[1m";
|
|
21794
|
+
ANSI_GREEN = "\x1B[32m";
|
|
21795
|
+
ANSI_YELLOW = "\x1B[33m";
|
|
21796
|
+
ANSI_RED = "\x1B[31m";
|
|
21797
|
+
ANSI_CYAN = "\x1B[36m";
|
|
21773
21798
|
TERMINAL_BUNDLE_ID = "com.apple.Terminal";
|
|
21774
21799
|
TERMINAL_NAME = "Terminal";
|
|
21775
21800
|
TCC_SERVICES = {
|
|
@@ -30784,7 +30809,7 @@ async function warnIfPermissionsLookWrong() {
|
|
|
30784
30809
|
["Accessibility", await checkAccessibilityPermission()],
|
|
30785
30810
|
["Input Monitoring", await checkInputMonitoringPermission()]
|
|
30786
30811
|
];
|
|
30787
|
-
const missing = checks.filter(([, granted]) => !granted).map(([
|
|
30812
|
+
const missing = checks.filter(([, granted]) => !granted).map(([label2]) => label2);
|
|
30788
30813
|
if (missing.length > 0) {
|
|
30789
30814
|
warn2(`Some macOS permissions appear missing: ${missing.join(", ")}`);
|
|
30790
30815
|
console.log(` Run ${DIM3}visionclaw prepare-mac${RESET3} if desktop automation does not work.`);
|
|
@@ -32480,8 +32505,8 @@ function getXcrunSdkPath() {
|
|
|
32480
32505
|
return null;
|
|
32481
32506
|
}
|
|
32482
32507
|
}
|
|
32483
|
-
function compileAndRunSwift(
|
|
32484
|
-
const base = (0, import_node_path12.join)((0, import_node_os7.tmpdir)(), `visionclaw-perm-${
|
|
32508
|
+
function compileAndRunSwift(label2, code) {
|
|
32509
|
+
const base = (0, import_node_path12.join)((0, import_node_os7.tmpdir)(), `visionclaw-perm-${label2}`);
|
|
32485
32510
|
const src = `${base}.swift`;
|
|
32486
32511
|
const bin = base;
|
|
32487
32512
|
try {
|
|
@@ -33564,25 +33589,25 @@ var require_tr46 = __commonJS({
|
|
|
33564
33589
|
};
|
|
33565
33590
|
}
|
|
33566
33591
|
var combiningMarksRegex = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/;
|
|
33567
|
-
function validateLabel(
|
|
33568
|
-
if (
|
|
33569
|
-
|
|
33592
|
+
function validateLabel(label2, processing_option) {
|
|
33593
|
+
if (label2.substr(0, 4) === "xn--") {
|
|
33594
|
+
label2 = punycode.toUnicode(label2);
|
|
33570
33595
|
processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL;
|
|
33571
33596
|
}
|
|
33572
33597
|
var error49 = false;
|
|
33573
|
-
if (normalize(
|
|
33598
|
+
if (normalize(label2) !== label2 || label2[3] === "-" && label2[4] === "-" || label2[0] === "-" || label2[label2.length - 1] === "-" || label2.indexOf(".") !== -1 || label2.search(combiningMarksRegex) === 0) {
|
|
33574
33599
|
error49 = true;
|
|
33575
33600
|
}
|
|
33576
|
-
var len = countSymbols(
|
|
33601
|
+
var len = countSymbols(label2);
|
|
33577
33602
|
for (var i12 = 0; i12 < len; ++i12) {
|
|
33578
|
-
var status = findStatus(
|
|
33603
|
+
var status = findStatus(label2.codePointAt(i12));
|
|
33579
33604
|
if (processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid" || processing === PROCESSING_OPTIONS.NONTRANSITIONAL && status[1] !== "valid" && status[1] !== "deviation") {
|
|
33580
33605
|
error49 = true;
|
|
33581
33606
|
break;
|
|
33582
33607
|
}
|
|
33583
33608
|
}
|
|
33584
33609
|
return {
|
|
33585
|
-
label,
|
|
33610
|
+
label: label2,
|
|
33586
33611
|
error: error49
|
|
33587
33612
|
};
|
|
33588
33613
|
}
|
|
@@ -688395,6 +688420,21 @@ function findChromePath2() {
|
|
|
688395
688420
|
}
|
|
688396
688421
|
return candidates[0];
|
|
688397
688422
|
}
|
|
688423
|
+
function color2(text, code) {
|
|
688424
|
+
return `${code}${text}${ANSI_RESET2}`;
|
|
688425
|
+
}
|
|
688426
|
+
function success2(text) {
|
|
688427
|
+
return color2(text, ANSI_GREEN2);
|
|
688428
|
+
}
|
|
688429
|
+
function action(text) {
|
|
688430
|
+
return color2(text, ANSI_YELLOW2);
|
|
688431
|
+
}
|
|
688432
|
+
function label(text) {
|
|
688433
|
+
return color2(text, ANSI_CYAN2);
|
|
688434
|
+
}
|
|
688435
|
+
function strong(text) {
|
|
688436
|
+
return color2(text, ANSI_BOLD2);
|
|
688437
|
+
}
|
|
688398
688438
|
function resolveSetupSource(commandArgs) {
|
|
688399
688439
|
for (let i12 = 0; i12 < commandArgs.length; i12++) {
|
|
688400
688440
|
const arg = commandArgs[i12];
|
|
@@ -688450,14 +688490,16 @@ Chrome opened with the VisionClaw Playwright profile for ${gmail}.`);
|
|
|
688450
688490
|
async function ensureGoogleBrowserLogin(context, gmail, password) {
|
|
688451
688491
|
const page = await getPrimaryPage(context);
|
|
688452
688492
|
await page.goto(`https://accounts.google.com/signin/v2/identifier?service=mail&flowName=GlifWebSignIn&flowEntry=ServiceLogin&Email=${encodeURIComponent(gmail)}`, { waitUntil: "domcontentloaded" });
|
|
688453
|
-
console.log("\nGoogle sign-in is manual.");
|
|
688454
|
-
console.log("Use the opened Chrome window in the VisionClaw Playwright profile to complete sign-in.");
|
|
688455
|
-
console.log("Google may request phone number, recovery, or other verification steps.");
|
|
688456
|
-
console.log("\nCredentials for operator use:");
|
|
688457
|
-
console.log(` Email: ${gmail}`);
|
|
688458
|
-
console.log(` Password: ${password}`);
|
|
688459
688493
|
console.log(`
|
|
688460
|
-
|
|
688494
|
+
${action(strong("Google sign-in is manual."))}`);
|
|
688495
|
+
console.log(action("Use the opened Chrome window in the VisionClaw Playwright profile to complete sign-in."));
|
|
688496
|
+
console.log(action("Google may request phone number, recovery, or other verification steps."));
|
|
688497
|
+
console.log(`
|
|
688498
|
+
${strong("Credentials for operator use:")}`);
|
|
688499
|
+
console.log(` ${label("Email:")} ${strong(gmail)}`);
|
|
688500
|
+
console.log(` ${label("Password:")} ${strong(password)}`);
|
|
688501
|
+
console.log(`
|
|
688502
|
+
${action(`Complete any remaining Google sign-in steps for ${gmail} in the opened Chrome window.`)}`);
|
|
688461
688503
|
await waitForOperator("Press Enter after Google sign-in is complete.");
|
|
688462
688504
|
}
|
|
688463
688505
|
async function maybeSetupGithub(context, spec, state2) {
|
|
@@ -688512,7 +688554,8 @@ async function maybeSetupGithub(context, spec, state2) {
|
|
|
688512
688554
|
}
|
|
688513
688555
|
async function runSetup(commandArgs = []) {
|
|
688514
688556
|
ensureConfigDir();
|
|
688515
|
-
console.log("=== VisionClaw Manufacturer Setup
|
|
688557
|
+
console.log(`${strong("=== VisionClaw Manufacturer Setup ===")}
|
|
688558
|
+
`);
|
|
688516
688559
|
const source = resolveSetupSource(commandArgs);
|
|
688517
688560
|
const { spec, setupCode } = await loadProvisioningSpec(source);
|
|
688518
688561
|
if (configExists()) {
|
|
@@ -688547,13 +688590,13 @@ async function runSetup(commandArgs = []) {
|
|
|
688547
688590
|
existed: true
|
|
688548
688591
|
};
|
|
688549
688592
|
console.log(`
|
|
688550
|
-
Workspace account is activated on the server (${workspaceAccount.email}).`);
|
|
688593
|
+
${success2(`Workspace account is activated on the server (${workspaceAccount.email}).`)}`);
|
|
688551
688594
|
state2 = updateSetupState({
|
|
688552
688595
|
gmail: workspaceAccount.email,
|
|
688553
688596
|
gmailPassword: workspaceAccount.password
|
|
688554
688597
|
});
|
|
688555
688598
|
console.log(`
|
|
688556
|
-
Workspace account ready: ${workspaceAccount.email}`);
|
|
688599
|
+
${success2(`Workspace account ready: ${workspaceAccount.email}`)}`);
|
|
688557
688600
|
const context = await launchPersistentChrome();
|
|
688558
688601
|
try {
|
|
688559
688602
|
await ensureGoogleBrowserLogin(context, workspaceAccount.email, workspaceAccount.password);
|
|
@@ -688671,7 +688714,7 @@ Workspace account ready: ${workspaceAccount.email}`);
|
|
|
688671
688714
|
Onboarding link: ${onboardingLink}`);
|
|
688672
688715
|
}
|
|
688673
688716
|
}
|
|
688674
|
-
var import_node_fs17, import_node_path16, import_prompts, import_playwright, CHROME_PATH;
|
|
688717
|
+
var import_node_fs17, import_node_path16, import_prompts, import_playwright, CHROME_PATH, ANSI_RESET2, ANSI_BOLD2, ANSI_GREEN2, ANSI_YELLOW2, ANSI_CYAN2;
|
|
688675
688718
|
var init_onboarding = __esm({
|
|
688676
688719
|
"dist/onboarding/index.js"() {
|
|
688677
688720
|
"use strict";
|
|
@@ -688693,6 +688736,11 @@ var init_onboarding = __esm({
|
|
|
688693
688736
|
init_prepare_mac();
|
|
688694
688737
|
init_setup_shared();
|
|
688695
688738
|
CHROME_PATH = findChromePath2();
|
|
688739
|
+
ANSI_RESET2 = "\x1B[0m";
|
|
688740
|
+
ANSI_BOLD2 = "\x1B[1m";
|
|
688741
|
+
ANSI_GREEN2 = "\x1B[32m";
|
|
688742
|
+
ANSI_YELLOW2 = "\x1B[33m";
|
|
688743
|
+
ANSI_CYAN2 = "\x1B[36m";
|
|
688696
688744
|
}
|
|
688697
688745
|
});
|
|
688698
688746
|
|
|
@@ -702819,8 +702867,8 @@ var require_dist_cjs32 = __commonJS({
|
|
|
702819
702867
|
return VALID_HOST_LABEL_REGEX.test(value);
|
|
702820
702868
|
}
|
|
702821
702869
|
const labels = value.split(".");
|
|
702822
|
-
for (const
|
|
702823
|
-
if (!isValidHostLabel(
|
|
702870
|
+
for (const label2 of labels) {
|
|
702871
|
+
if (!isValidHostLabel(label2)) {
|
|
702824
702872
|
return false;
|
|
702825
702873
|
}
|
|
702826
702874
|
}
|
|
@@ -703212,8 +703260,8 @@ var require_dist_cjs33 = __commonJS({
|
|
|
703212
703260
|
var urlParser = require_dist_cjs30();
|
|
703213
703261
|
var isVirtualHostableS3Bucket = (value, allowSubDomains = false) => {
|
|
703214
703262
|
if (allowSubDomains) {
|
|
703215
|
-
for (const
|
|
703216
|
-
if (!isVirtualHostableS3Bucket(
|
|
703263
|
+
for (const label2 of value.split(".")) {
|
|
703264
|
+
if (!isVirtualHostableS3Bucket(label2)) {
|
|
703217
703265
|
return false;
|
|
703218
703266
|
}
|
|
703219
703267
|
}
|
|
@@ -711415,8 +711463,8 @@ var init_AwsQueryProtocol = __esm({
|
|
|
711415
711463
|
if (deref(operationSchema.input) === "unit" || !request.body) {
|
|
711416
711464
|
request.body = "";
|
|
711417
711465
|
}
|
|
711418
|
-
const
|
|
711419
|
-
request.body = `Action=${
|
|
711466
|
+
const action2 = operationSchema.name.split("#")[1] ?? operationSchema.name;
|
|
711467
|
+
request.body = `Action=${action2}&Version=${this.options.version}` + request.body;
|
|
711420
711468
|
if (request.body.endsWith("&")) {
|
|
711421
711469
|
request.body = request.body.slice(-1);
|
|
711422
711470
|
}
|
|
@@ -718714,8 +718762,8 @@ var require_dist_cjs67 = __commonJS({
|
|
|
718714
718762
|
var urlParser = require_dist_cjs30();
|
|
718715
718763
|
var isVirtualHostableS3Bucket = (value, allowSubDomains = false) => {
|
|
718716
718764
|
if (allowSubDomains) {
|
|
718717
|
-
for (const
|
|
718718
|
-
if (!isVirtualHostableS3Bucket(
|
|
718765
|
+
for (const label2 of value.split(".")) {
|
|
718766
|
+
if (!isVirtualHostableS3Bucket(label2)) {
|
|
718719
718767
|
return false;
|
|
718720
718768
|
}
|
|
718721
718769
|
}
|
|
@@ -720845,13 +720893,13 @@ var require_dist_cjs69 = __commonJS({
|
|
|
720845
720893
|
};
|
|
720846
720894
|
});
|
|
720847
720895
|
}
|
|
720848
|
-
withObjectStore(mode,
|
|
720896
|
+
withObjectStore(mode, action2) {
|
|
720849
720897
|
return this.getDb().then((db3) => {
|
|
720850
720898
|
const tx = db3.transaction(STORE_NAME, mode);
|
|
720851
720899
|
tx.oncomplete = () => db3.close();
|
|
720852
720900
|
return new Promise((resolve, reject) => {
|
|
720853
720901
|
tx.onerror = () => reject(tx.error);
|
|
720854
|
-
resolve(
|
|
720902
|
+
resolve(action2(tx.objectStore(STORE_NAME)));
|
|
720855
720903
|
}).catch((err7) => {
|
|
720856
720904
|
db3.close();
|
|
720857
720905
|
throw err7;
|
|
@@ -721301,8 +721349,8 @@ var require_dist_cjs70 = __commonJS({
|
|
|
721301
721349
|
var urlParser = require_dist_cjs30();
|
|
721302
721350
|
var isVirtualHostableS3Bucket = (value, allowSubDomains = false) => {
|
|
721303
721351
|
if (allowSubDomains) {
|
|
721304
|
-
for (const
|
|
721305
|
-
if (!isVirtualHostableS3Bucket(
|
|
721352
|
+
for (const label2 of value.split(".")) {
|
|
721353
|
+
if (!isVirtualHostableS3Bucket(label2)) {
|
|
721306
721354
|
return false;
|
|
721307
721355
|
}
|
|
721308
721356
|
}
|
|
@@ -735248,10 +735296,10 @@ var init_workload_identity_auth = __esm({
|
|
|
735248
735296
|
})
|
|
735249
735297
|
});
|
|
735250
735298
|
if (!response.ok) {
|
|
735251
|
-
const
|
|
735299
|
+
const errorText2 = await response.text();
|
|
735252
735300
|
let body = void 0;
|
|
735253
735301
|
try {
|
|
735254
|
-
body = JSON.parse(
|
|
735302
|
+
body = JSON.parse(errorText2);
|
|
735255
735303
|
} catch {
|
|
735256
735304
|
}
|
|
735257
735305
|
if (response.status === 400 || response.status === 401 || response.status === 403) {
|
|
@@ -753444,9 +753492,9 @@ var require_codegen = __commonJS({
|
|
|
753444
753492
|
}
|
|
753445
753493
|
};
|
|
753446
753494
|
var Label = class extends Node {
|
|
753447
|
-
constructor(
|
|
753495
|
+
constructor(label2) {
|
|
753448
753496
|
super();
|
|
753449
|
-
this.label =
|
|
753497
|
+
this.label = label2;
|
|
753450
753498
|
this.names = {};
|
|
753451
753499
|
}
|
|
753452
753500
|
render({ _n: _n2 }) {
|
|
@@ -753454,14 +753502,14 @@ var require_codegen = __commonJS({
|
|
|
753454
753502
|
}
|
|
753455
753503
|
};
|
|
753456
753504
|
var Break = class extends Node {
|
|
753457
|
-
constructor(
|
|
753505
|
+
constructor(label2) {
|
|
753458
753506
|
super();
|
|
753459
|
-
this.label =
|
|
753507
|
+
this.label = label2;
|
|
753460
753508
|
this.names = {};
|
|
753461
753509
|
}
|
|
753462
753510
|
render({ _n: _n2 }) {
|
|
753463
|
-
const
|
|
753464
|
-
return `break${
|
|
753511
|
+
const label2 = this.label ? ` ${this.label}` : "";
|
|
753512
|
+
return `break${label2};` + _n2;
|
|
753465
753513
|
}
|
|
753466
753514
|
};
|
|
753467
753515
|
var Throw = class extends Node {
|
|
@@ -753873,12 +753921,12 @@ var require_codegen = __commonJS({
|
|
|
753873
753921
|
return this._endBlockNode(For);
|
|
753874
753922
|
}
|
|
753875
753923
|
// `label` statement
|
|
753876
|
-
label(
|
|
753877
|
-
return this._leafNode(new Label(
|
|
753924
|
+
label(label2) {
|
|
753925
|
+
return this._leafNode(new Label(label2));
|
|
753878
753926
|
}
|
|
753879
753927
|
// `break` statement
|
|
753880
|
-
break(
|
|
753881
|
-
return this._leafNode(new Break(
|
|
753928
|
+
break(label2) {
|
|
753929
|
+
return this._leafNode(new Break(label2));
|
|
753882
753930
|
}
|
|
753883
753931
|
// `return` statement
|
|
753884
753932
|
return(value) {
|
|
@@ -770128,37 +770176,37 @@ async function runApprovedFunctionTool(deps, toolRun) {
|
|
|
770128
770176
|
});
|
|
770129
770177
|
}
|
|
770130
770178
|
async function _runComputerActionAndScreenshot(computer, toolCall, runContext) {
|
|
770131
|
-
for (const
|
|
770132
|
-
switch (
|
|
770179
|
+
for (const action2 of getComputerToolActions(toolCall)) {
|
|
770180
|
+
switch (action2.type) {
|
|
770133
770181
|
case "click":
|
|
770134
|
-
await computer.click(
|
|
770182
|
+
await computer.click(action2.x, action2.y, action2.button, runContext);
|
|
770135
770183
|
break;
|
|
770136
770184
|
case "double_click":
|
|
770137
|
-
await computer.doubleClick(
|
|
770185
|
+
await computer.doubleClick(action2.x, action2.y, runContext);
|
|
770138
770186
|
break;
|
|
770139
770187
|
case "drag":
|
|
770140
|
-
await computer.drag(
|
|
770188
|
+
await computer.drag(action2.path.map((p10) => [p10.x, p10.y]), runContext);
|
|
770141
770189
|
break;
|
|
770142
770190
|
case "keypress":
|
|
770143
|
-
await computer.keypress(
|
|
770191
|
+
await computer.keypress(action2.keys, runContext);
|
|
770144
770192
|
break;
|
|
770145
770193
|
case "move":
|
|
770146
|
-
await computer.move(
|
|
770194
|
+
await computer.move(action2.x, action2.y, runContext);
|
|
770147
770195
|
break;
|
|
770148
770196
|
case "screenshot":
|
|
770149
770197
|
await computer.screenshot(runContext);
|
|
770150
770198
|
break;
|
|
770151
770199
|
case "scroll":
|
|
770152
|
-
await computer.scroll(
|
|
770200
|
+
await computer.scroll(action2.x, action2.y, action2.scroll_x, action2.scroll_y, runContext);
|
|
770153
770201
|
break;
|
|
770154
770202
|
case "type":
|
|
770155
|
-
await computer.type(
|
|
770203
|
+
await computer.type(action2.text, runContext);
|
|
770156
770204
|
break;
|
|
770157
770205
|
case "wait":
|
|
770158
770206
|
await computer.wait(runContext);
|
|
770159
770207
|
break;
|
|
770160
770208
|
default:
|
|
770161
|
-
|
|
770209
|
+
action2;
|
|
770162
770210
|
break;
|
|
770163
770211
|
}
|
|
770164
770212
|
}
|
|
@@ -770251,9 +770299,9 @@ function emitToolEnd(runner, runContext, agent, tool2, output2, toolCall) {
|
|
|
770251
770299
|
async function executeShellActions(agent, actions, runner, runContext, customLogger = void 0, toolErrorFormatter) {
|
|
770252
770300
|
const _logger = customLogger ?? logger_default;
|
|
770253
770301
|
const results = [];
|
|
770254
|
-
for (const
|
|
770255
|
-
const shellTool2 =
|
|
770256
|
-
const toolCall =
|
|
770302
|
+
for (const action2 of actions) {
|
|
770303
|
+
const shellTool2 = action2.shell;
|
|
770304
|
+
const toolCall = action2.toolCall;
|
|
770257
770305
|
if (!shellTool2.shell) {
|
|
770258
770306
|
_logger.warn(`Skipping shell action for tool "${shellTool2.name}" because no local shell implementation is configured.`);
|
|
770259
770307
|
continue;
|
|
@@ -770308,12 +770356,12 @@ async function executeShellActions(agent, actions, runner, runContext, customLog
|
|
|
770308
770356
|
maxOutputLength = shellResult.maxOutputLength;
|
|
770309
770357
|
}
|
|
770310
770358
|
} catch (err7) {
|
|
770311
|
-
const
|
|
770312
|
-
const traceError = getTraceToolError(runner.config.traceIncludeSensitiveData,
|
|
770359
|
+
const errorText2 = toErrorMessage2(err7);
|
|
770360
|
+
const traceError = getTraceToolError(runner.config.traceIncludeSensitiveData, errorText2);
|
|
770313
770361
|
shellOutputs = [
|
|
770314
770362
|
{
|
|
770315
770363
|
stdout: "",
|
|
770316
|
-
stderr:
|
|
770364
|
+
stderr: errorText2,
|
|
770317
770365
|
outcome: { type: "exit", exitCode: null }
|
|
770318
770366
|
}
|
|
770319
770367
|
];
|
|
@@ -770352,9 +770400,9 @@ async function executeShellActions(agent, actions, runner, runContext, customLog
|
|
|
770352
770400
|
async function executeApplyPatchOperations(agent, actions, runner, runContext, customLogger = void 0, toolErrorFormatter) {
|
|
770353
770401
|
const _logger = customLogger ?? logger_default;
|
|
770354
770402
|
const results = [];
|
|
770355
|
-
for (const
|
|
770356
|
-
const applyPatchTool2 =
|
|
770357
|
-
const toolCall =
|
|
770403
|
+
for (const action2 of actions) {
|
|
770404
|
+
const applyPatchTool2 = action2.applyPatch;
|
|
770405
|
+
const toolCall = action2.toolCall;
|
|
770358
770406
|
const editorContext = { runContext };
|
|
770359
770407
|
const approvalItem = new RunToolApprovalItem(toolCall, agent, applyPatchTool2.name);
|
|
770360
770408
|
const approvalDecision = await handleToolApprovalDecision({
|
|
@@ -770446,9 +770494,9 @@ async function executeApplyPatchOperations(agent, actions, runner, runContext, c
|
|
|
770446
770494
|
async function executeComputerActions(agent, actions, runner, runContext, customLogger = void 0, toolErrorFormatter) {
|
|
770447
770495
|
const _logger = customLogger ?? logger_default;
|
|
770448
770496
|
const results = [];
|
|
770449
|
-
for (const
|
|
770450
|
-
const toolCall =
|
|
770451
|
-
const computerTool2 =
|
|
770497
|
+
for (const action2 of actions) {
|
|
770498
|
+
const toolCall = action2.toolCall;
|
|
770499
|
+
const computerTool2 = action2.computer;
|
|
770452
770500
|
const computerActions2 = getComputerToolActions(toolCall);
|
|
770453
770501
|
let cachedRejectionMessage;
|
|
770454
770502
|
const getRejectionMessage = async () => {
|
|
@@ -770524,8 +770572,8 @@ async function executeComputerActions(agent, actions, runner, runContext, custom
|
|
|
770524
770572
|
} catch (err7) {
|
|
770525
770573
|
_logger.error("Failed to execute computer action:", err7);
|
|
770526
770574
|
output2 = "";
|
|
770527
|
-
const
|
|
770528
|
-
const traceError = getTraceToolError(runner.config.traceIncludeSensitiveData,
|
|
770575
|
+
const errorText2 = toErrorMessage2(err7);
|
|
770576
|
+
const traceError = getTraceToolError(runner.config.traceIncludeSensitiveData, errorText2);
|
|
770529
770577
|
span?.setError({
|
|
770530
770578
|
message: "Error running tool",
|
|
770531
770579
|
data: {
|
|
@@ -771255,11 +771303,11 @@ function filterActionsByApproval(preStepItems, actions, type) {
|
|
|
771255
771303
|
if (allowedCallIds.size === 0) {
|
|
771256
771304
|
return [];
|
|
771257
771305
|
}
|
|
771258
|
-
return actions.filter((
|
|
771306
|
+
return actions.filter((action2) => typeof action2.toolCall.callId === "string" && allowedCallIds.has(action2.toolCall.callId));
|
|
771259
771307
|
}
|
|
771260
771308
|
function filterPendingActions(actions, options3) {
|
|
771261
|
-
return actions.filter((
|
|
771262
|
-
const callId =
|
|
771309
|
+
return actions.filter((action2) => {
|
|
771310
|
+
const callId = action2.toolCall.callId;
|
|
771263
771311
|
const hasCallId = typeof callId === "string";
|
|
771264
771312
|
if (options3.allowedCallIds && options3.allowedCallIds.size > 0) {
|
|
771265
771313
|
if (!hasCallId || !options3.allowedCallIds.has(callId)) {
|
|
@@ -773491,11 +773539,11 @@ var init_agent = __esm({
|
|
|
773491
773539
|
});
|
|
773492
773540
|
|
|
773493
773541
|
// node_modules/.pnpm/@openai+agents-core@0.6.0_ws@8.20.0_zod@4.3.6/node_modules/@openai/agents-core/dist/mcpServers.mjs
|
|
773494
|
-
function createTimeoutError(
|
|
773542
|
+
function createTimeoutError(action2, server, timeoutMs) {
|
|
773495
773543
|
if (timeoutMs === null) {
|
|
773496
|
-
return new Error(`MCP server ${
|
|
773544
|
+
return new Error(`MCP server ${action2} timed out.`);
|
|
773497
773545
|
}
|
|
773498
|
-
const error49 = new Error(`MCP server ${
|
|
773546
|
+
const error49 = new Error(`MCP server ${action2} timed out after ${timeoutMs}ms for '${server.name}'.`);
|
|
773499
773547
|
error49.name = "TimeoutError";
|
|
773500
773548
|
return error49;
|
|
773501
773549
|
}
|
|
@@ -773609,12 +773657,12 @@ var init_mcpServers = __esm({
|
|
|
773609
773657
|
close() {
|
|
773610
773658
|
return this.submit("close", this.closeTimeoutMs);
|
|
773611
773659
|
}
|
|
773612
|
-
submit(
|
|
773660
|
+
submit(action2, timeoutMs) {
|
|
773613
773661
|
if (this.done) {
|
|
773614
773662
|
return Promise.reject(createClosedError(this.server));
|
|
773615
773663
|
}
|
|
773616
773664
|
if (this.closeResult || this.closing) {
|
|
773617
|
-
if (
|
|
773665
|
+
if (action2 === "close" && this.closeResult) {
|
|
773618
773666
|
return this.closeResult;
|
|
773619
773667
|
}
|
|
773620
773668
|
return Promise.reject(createClosingError(this.server));
|
|
@@ -773626,12 +773674,12 @@ var init_mcpServers = __esm({
|
|
|
773626
773674
|
rejectCommand = reject;
|
|
773627
773675
|
});
|
|
773628
773676
|
const command = {
|
|
773629
|
-
action,
|
|
773677
|
+
action: action2,
|
|
773630
773678
|
timeoutMs,
|
|
773631
773679
|
resolve: resolveCommand,
|
|
773632
773680
|
reject: rejectCommand
|
|
773633
773681
|
};
|
|
773634
|
-
if (
|
|
773682
|
+
if (action2 === "close") {
|
|
773635
773683
|
this.closeResult = promise3;
|
|
773636
773684
|
}
|
|
773637
773685
|
this.queue.push(command);
|
|
@@ -775859,7 +775907,7 @@ function getInputItems(input) {
|
|
|
775859
775907
|
return entry;
|
|
775860
775908
|
}
|
|
775861
775909
|
if (item.type === "shell_call") {
|
|
775862
|
-
const
|
|
775910
|
+
const action2 = {
|
|
775863
775911
|
commands: item.action.commands,
|
|
775864
775912
|
timeout_ms: typeof item.action.timeoutMs === "number" ? item.action.timeoutMs : null,
|
|
775865
775913
|
max_output_length: typeof item.action.maxOutputLength === "number" ? item.action.maxOutputLength : null
|
|
@@ -775870,7 +775918,7 @@ function getInputItems(input) {
|
|
|
775870
775918
|
id: item.id,
|
|
775871
775919
|
call_id: item.callId,
|
|
775872
775920
|
status: item.status ?? "in_progress",
|
|
775873
|
-
action,
|
|
775921
|
+
action: action2,
|
|
775874
775922
|
...shellProviderData
|
|
775875
775923
|
};
|
|
775876
775924
|
return entry;
|
|
@@ -776153,9 +776201,9 @@ function convertToOutputItem(items) {
|
|
|
776153
776201
|
};
|
|
776154
776202
|
return output2;
|
|
776155
776203
|
} else if (item.type === "computer_call") {
|
|
776156
|
-
const { call_id, status, action, actions, ...providerData } = item;
|
|
776204
|
+
const { call_id, status, action: action2, actions, ...providerData } = item;
|
|
776157
776205
|
const normalizedActions = Array.isArray(actions) && actions.length > 0 ? actions : void 0;
|
|
776158
|
-
if (!normalizedActions && !
|
|
776206
|
+
if (!normalizedActions && !action2) {
|
|
776159
776207
|
throw new UserError(`Unsupported computer call item without an action or actions: ${JSON.stringify(item)}`);
|
|
776160
776208
|
}
|
|
776161
776209
|
const output2 = {
|
|
@@ -776163,21 +776211,21 @@ function convertToOutputItem(items) {
|
|
|
776163
776211
|
id: item.id,
|
|
776164
776212
|
callId: call_id,
|
|
776165
776213
|
status,
|
|
776166
|
-
action:
|
|
776214
|
+
action: action2 ?? normalizedActions?.[0],
|
|
776167
776215
|
...normalizedActions ? { actions: normalizedActions } : {},
|
|
776168
776216
|
providerData
|
|
776169
776217
|
};
|
|
776170
776218
|
return output2;
|
|
776171
776219
|
} else if (item.type === "shell_call") {
|
|
776172
|
-
const { call_id, status, action, ...providerData } = item;
|
|
776220
|
+
const { call_id, status, action: action2, ...providerData } = item;
|
|
776173
776221
|
const shellAction = {
|
|
776174
|
-
commands: Array.isArray(
|
|
776222
|
+
commands: Array.isArray(action2?.commands) ? action2.commands : []
|
|
776175
776223
|
};
|
|
776176
|
-
const timeout =
|
|
776224
|
+
const timeout = action2?.timeout_ms;
|
|
776177
776225
|
if (typeof timeout === "number") {
|
|
776178
776226
|
shellAction.timeoutMs = timeout;
|
|
776179
776227
|
}
|
|
776180
|
-
const maxOutputLength =
|
|
776228
|
+
const maxOutputLength = action2?.max_output_length;
|
|
776181
776229
|
if (typeof maxOutputLength === "number") {
|
|
776182
776230
|
shellAction.maxOutputLength = maxOutputLength;
|
|
776183
776231
|
}
|
|
@@ -804219,14 +804267,14 @@ async function execSudo(args, options3 = {}) {
|
|
|
804219
804267
|
child.stdin.end();
|
|
804220
804268
|
});
|
|
804221
804269
|
}
|
|
804222
|
-
async function withTimeout2(promise3, timeoutMs,
|
|
804270
|
+
async function withTimeout2(promise3, timeoutMs, label2) {
|
|
804223
804271
|
let timer2;
|
|
804224
804272
|
try {
|
|
804225
804273
|
return await Promise.race([
|
|
804226
804274
|
promise3,
|
|
804227
804275
|
new Promise((_resolve, reject) => {
|
|
804228
804276
|
timer2 = setTimeout(() => {
|
|
804229
|
-
reject(new Error(`${
|
|
804277
|
+
reject(new Error(`${label2} timed out after ${timeoutMs}ms`));
|
|
804230
804278
|
}, timeoutMs);
|
|
804231
804279
|
})
|
|
804232
804280
|
]);
|
|
@@ -806091,9 +806139,9 @@ ${lines.join("\n")}`
|
|
|
806091
806139
|
};
|
|
806092
806140
|
}
|
|
806093
806141
|
default: {
|
|
806094
|
-
const
|
|
806142
|
+
const action2 = args.action;
|
|
806095
806143
|
return {
|
|
806096
|
-
content: [{ type: "text", text: `Unknown action: ${
|
|
806144
|
+
content: [{ type: "text", text: `Unknown action: ${action2}` }],
|
|
806097
806145
|
isError: true
|
|
806098
806146
|
};
|
|
806099
806147
|
}
|
|
@@ -806321,7 +806369,7 @@ var init_gmail_email = __esm({
|
|
|
806321
806369
|
this.gmail = createGmailClient(config2);
|
|
806322
806370
|
}
|
|
806323
806371
|
async listEmails(options3 = {}) {
|
|
806324
|
-
const
|
|
806372
|
+
const label2 = options3.label ?? "INBOX";
|
|
806325
806373
|
const maxResults = options3.maxResults ?? 10;
|
|
806326
806374
|
const unreadOnly = options3.unreadOnly ?? false;
|
|
806327
806375
|
const qParts = [];
|
|
@@ -806331,7 +806379,7 @@ var init_gmail_email = __esm({
|
|
|
806331
806379
|
qParts.push("is:unread");
|
|
806332
806380
|
const res = await this.gmail.users.messages.list({
|
|
806333
806381
|
userId: "me",
|
|
806334
|
-
labelIds: [
|
|
806382
|
+
labelIds: [label2],
|
|
806335
806383
|
q: qParts.length ? qParts.join(" ") : void 0,
|
|
806336
806384
|
maxResults
|
|
806337
806385
|
});
|
|
@@ -807406,9 +807454,9 @@ ID: ${folder.id}${link}`
|
|
|
807406
807454
|
};
|
|
807407
807455
|
}
|
|
807408
807456
|
default: {
|
|
807409
|
-
const
|
|
807457
|
+
const action2 = args.action;
|
|
807410
807458
|
return {
|
|
807411
|
-
content: [{ type: "text", text: `Unknown action: ${
|
|
807459
|
+
content: [{ type: "text", text: `Unknown action: ${action2}` }],
|
|
807412
807460
|
isError: true
|
|
807413
807461
|
};
|
|
807414
807462
|
}
|
|
@@ -808332,9 +808380,9 @@ function isArrayOf(isString, arr) {
|
|
|
808332
808380
|
return arr.every((item) => Number.isSafeInteger(item));
|
|
808333
808381
|
}
|
|
808334
808382
|
}
|
|
808335
|
-
function astr(
|
|
808383
|
+
function astr(label2, input) {
|
|
808336
808384
|
if (typeof input !== "string")
|
|
808337
|
-
throw new Error(`${
|
|
808385
|
+
throw new Error(`${label2}: string expected`);
|
|
808338
808386
|
return true;
|
|
808339
808387
|
}
|
|
808340
808388
|
function anumber(n6) {
|
|
@@ -808345,13 +808393,13 @@ function aArr(input) {
|
|
|
808345
808393
|
if (!Array.isArray(input))
|
|
808346
808394
|
throw new Error("array expected");
|
|
808347
808395
|
}
|
|
808348
|
-
function astrArr(
|
|
808396
|
+
function astrArr(label2, input) {
|
|
808349
808397
|
if (!isArrayOf(true, input))
|
|
808350
|
-
throw new Error(`${
|
|
808398
|
+
throw new Error(`${label2}: array of strings expected`);
|
|
808351
808399
|
}
|
|
808352
|
-
function anumArr(
|
|
808400
|
+
function anumArr(label2, input) {
|
|
808353
808401
|
if (!isArrayOf(false, input))
|
|
808354
|
-
throw new Error(`${
|
|
808402
|
+
throw new Error(`${label2}: array of numbers expected`);
|
|
808355
808403
|
}
|
|
808356
808404
|
// @__NO_SIDE_EFFECTS__
|
|
808357
808405
|
function chain(...args) {
|
|
@@ -819411,15 +819459,15 @@ function parseOtpauthURI(uri) {
|
|
|
819411
819459
|
const secret = url2.searchParams.get("secret");
|
|
819412
819460
|
if (!secret)
|
|
819413
819461
|
return null;
|
|
819414
|
-
const
|
|
819462
|
+
const label2 = decodeURIComponent(url2.pathname.replace(/^\/\/totp\//, "").replace(/^\//, ""));
|
|
819415
819463
|
let issuer = url2.searchParams.get("issuer") ?? void 0;
|
|
819416
819464
|
let account;
|
|
819417
|
-
if (
|
|
819418
|
-
const [labelIssuer, labelAccount] =
|
|
819465
|
+
if (label2.includes(":")) {
|
|
819466
|
+
const [labelIssuer, labelAccount] = label2.split(":", 2);
|
|
819419
819467
|
issuer = issuer ?? labelIssuer;
|
|
819420
819468
|
account = labelAccount;
|
|
819421
|
-
} else if (
|
|
819422
|
-
account =
|
|
819469
|
+
} else if (label2) {
|
|
819470
|
+
account = label2;
|
|
819423
819471
|
}
|
|
819424
819472
|
const digits = url2.searchParams.get("digits");
|
|
819425
819473
|
const period = url2.searchParams.get("period");
|
|
@@ -819476,7 +819524,7 @@ function handleStore(args) {
|
|
|
819476
819524
|
secrets.push(fullEntry);
|
|
819477
819525
|
}
|
|
819478
819526
|
saveTOTPSecrets(secrets);
|
|
819479
|
-
const
|
|
819527
|
+
const action2 = isUpdate ? "Updated" : "Stored new";
|
|
819480
819528
|
try {
|
|
819481
819529
|
const token = h13({
|
|
819482
819530
|
secret: entry.secret,
|
|
@@ -819485,9 +819533,9 @@ function handleStore(args) {
|
|
|
819485
819533
|
algorithm: normalizeAlgorithm(entry.algorithm),
|
|
819486
819534
|
guardrails: lenientGuardrails
|
|
819487
819535
|
});
|
|
819488
|
-
return ok7(`${
|
|
819536
|
+
return ok7(`${action2} TOTP secret for "${entry.service}". Current code: ${token} (valid for ~${entry.period ?? 30}s)`);
|
|
819489
819537
|
} catch (e11) {
|
|
819490
|
-
return ok7(`${
|
|
819538
|
+
return ok7(`${action2} TOTP secret for "${entry.service}", but code generation failed: ${e11 instanceof Error ? e11.message : String(e11)}. The secret may be invalid.`);
|
|
819491
819539
|
}
|
|
819492
819540
|
}
|
|
819493
819541
|
function handleGenerate(args) {
|
|
@@ -823173,7 +823221,7 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
823173
823221
|
return promiseResolvedWith(void 0);
|
|
823174
823222
|
});
|
|
823175
823223
|
}
|
|
823176
|
-
shutdownWithAction(() => Promise.all(actions.map((
|
|
823224
|
+
shutdownWithAction(() => Promise.all(actions.map((action2) => action2())), true, error49);
|
|
823177
823225
|
};
|
|
823178
823226
|
if (signal.aborted) {
|
|
823179
823227
|
abortAlgorithm();
|
|
@@ -823247,21 +823295,21 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
823247
823295
|
const oldCurrentWrite = currentWrite;
|
|
823248
823296
|
return PerformPromiseThen(currentWrite, () => oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : void 0);
|
|
823249
823297
|
}
|
|
823250
|
-
function isOrBecomesErrored(stream, promise3,
|
|
823298
|
+
function isOrBecomesErrored(stream, promise3, action2) {
|
|
823251
823299
|
if (stream._state === "errored") {
|
|
823252
|
-
|
|
823300
|
+
action2(stream._storedError);
|
|
823253
823301
|
} else {
|
|
823254
|
-
uponRejection(promise3,
|
|
823302
|
+
uponRejection(promise3, action2);
|
|
823255
823303
|
}
|
|
823256
823304
|
}
|
|
823257
|
-
function isOrBecomesClosed(stream, promise3,
|
|
823305
|
+
function isOrBecomesClosed(stream, promise3, action2) {
|
|
823258
823306
|
if (stream._state === "closed") {
|
|
823259
|
-
|
|
823307
|
+
action2();
|
|
823260
823308
|
} else {
|
|
823261
|
-
uponFulfillment(promise3,
|
|
823309
|
+
uponFulfillment(promise3, action2);
|
|
823262
823310
|
}
|
|
823263
823311
|
}
|
|
823264
|
-
function shutdownWithAction(
|
|
823312
|
+
function shutdownWithAction(action2, originalIsError, originalError) {
|
|
823265
823313
|
if (shuttingDown) {
|
|
823266
823314
|
return;
|
|
823267
823315
|
}
|
|
@@ -823272,7 +823320,7 @@ var require_ponyfill_es2018 = __commonJS({
|
|
|
823272
823320
|
doTheRest();
|
|
823273
823321
|
}
|
|
823274
823322
|
function doTheRest() {
|
|
823275
|
-
uponPromise(
|
|
823323
|
+
uponPromise(action2(), () => finalize2(originalIsError, originalError), (newError) => finalize2(true, newError));
|
|
823276
823324
|
return null;
|
|
823277
823325
|
}
|
|
823278
823326
|
}
|
|
@@ -860396,7 +860444,7 @@ var require_streams2 = __commonJS({
|
|
|
860396
860444
|
readAll() {
|
|
860397
860445
|
return new Promise((resolve, reject) => {
|
|
860398
860446
|
const chunks = [];
|
|
860399
|
-
const
|
|
860447
|
+
const action2 = () => {
|
|
860400
860448
|
if (__classPrivateFieldGet9(this, _BufferStreamReader_error, "f")) {
|
|
860401
860449
|
reject(__classPrivateFieldGet9(this, _BufferStreamReader_error, "f"));
|
|
860402
860450
|
return;
|
|
@@ -860404,20 +860452,20 @@ var require_streams2 = __commonJS({
|
|
|
860404
860452
|
const buffer = __classPrivateFieldGet9(this, _BufferStreamReader_stream, "f").read();
|
|
860405
860453
|
if (buffer != null) {
|
|
860406
860454
|
chunks.push(buffer);
|
|
860407
|
-
__classPrivateFieldGet9(this, _BufferStreamReader_pendingActions, "f").push(
|
|
860455
|
+
__classPrivateFieldGet9(this, _BufferStreamReader_pendingActions, "f").push(action2);
|
|
860408
860456
|
} else if (__classPrivateFieldGet9(this, _BufferStreamReader_ended, "f")) {
|
|
860409
860457
|
const result = Buffer.concat(chunks);
|
|
860410
860458
|
resolve(result);
|
|
860411
860459
|
} else {
|
|
860412
|
-
__classPrivateFieldGet9(this, _BufferStreamReader_pendingActions, "f").push(
|
|
860460
|
+
__classPrivateFieldGet9(this, _BufferStreamReader_pendingActions, "f").push(action2);
|
|
860413
860461
|
}
|
|
860414
860462
|
};
|
|
860415
|
-
|
|
860463
|
+
action2();
|
|
860416
860464
|
});
|
|
860417
860465
|
}
|
|
860418
860466
|
read(p10) {
|
|
860419
860467
|
return new Promise((resolve, reject) => {
|
|
860420
|
-
const
|
|
860468
|
+
const action2 = () => {
|
|
860421
860469
|
if (__classPrivateFieldGet9(this, _BufferStreamReader_error, "f")) {
|
|
860422
860470
|
reject(__classPrivateFieldGet9(this, _BufferStreamReader_error, "f"));
|
|
860423
860471
|
return;
|
|
@@ -860431,19 +860479,19 @@ var require_streams2 = __commonJS({
|
|
|
860431
860479
|
if (__classPrivateFieldGet9(this, _BufferStreamReader_ended, "f")) {
|
|
860432
860480
|
resolve(null);
|
|
860433
860481
|
} else {
|
|
860434
|
-
__classPrivateFieldGet9(this, _BufferStreamReader_pendingActions, "f").push(
|
|
860482
|
+
__classPrivateFieldGet9(this, _BufferStreamReader_pendingActions, "f").push(action2);
|
|
860435
860483
|
}
|
|
860436
860484
|
};
|
|
860437
|
-
|
|
860485
|
+
action2();
|
|
860438
860486
|
});
|
|
860439
860487
|
}
|
|
860440
860488
|
};
|
|
860441
860489
|
exports2.BufferStreamReader = BufferStreamReader;
|
|
860442
860490
|
_BufferStreamReader_stream = /* @__PURE__ */ new WeakMap(), _BufferStreamReader_error = /* @__PURE__ */ new WeakMap(), _BufferStreamReader_ended = /* @__PURE__ */ new WeakMap(), _BufferStreamReader_pendingActions = /* @__PURE__ */ new WeakMap(), _BufferStreamReader_instances = /* @__PURE__ */ new WeakSet(), _BufferStreamReader_runPendingActions = function _BufferStreamReader_runPendingActions2() {
|
|
860443
860491
|
const errors2 = [];
|
|
860444
|
-
for (const
|
|
860492
|
+
for (const action2 of __classPrivateFieldGet9(this, _BufferStreamReader_pendingActions, "f").splice(0)) {
|
|
860445
860493
|
try {
|
|
860446
|
-
|
|
860494
|
+
action2();
|
|
860447
860495
|
} catch (err7) {
|
|
860448
860496
|
errors2.push(err7);
|
|
860449
860497
|
}
|
|
@@ -860648,9 +860696,9 @@ var require_run2 = __commonJS({
|
|
|
860648
860696
|
const [receivedCode, signalName] = await __classPrivateFieldGet9(this, _Process_status, "f");
|
|
860649
860697
|
const signal = signalName ? os_1.default.constants.signals[signalName] : receivedCode > 128 ? receivedCode - 128 : void 0;
|
|
860650
860698
|
const code = receivedCode != null ? receivedCode : signal != null ? 128 + signal : void 0;
|
|
860651
|
-
const
|
|
860699
|
+
const success3 = code === 0;
|
|
860652
860700
|
__classPrivateFieldSet8(this, _Process_receivedStatus, true, "f");
|
|
860653
|
-
return { code, signal, success:
|
|
860701
|
+
return { code, signal, success: success3 };
|
|
860654
860702
|
}
|
|
860655
860703
|
async output() {
|
|
860656
860704
|
if (!__classPrivateFieldGet9(this, _Process_stdout, "f")) {
|
|
@@ -861850,16 +861898,16 @@ function createMergeProxy(baseObj, extObj) {
|
|
|
861850
861898
|
return true;
|
|
861851
861899
|
},
|
|
861852
861900
|
deleteProperty(_target, prop) {
|
|
861853
|
-
let
|
|
861901
|
+
let success3 = false;
|
|
861854
861902
|
if (prop in extObj) {
|
|
861855
861903
|
delete extObj[prop];
|
|
861856
|
-
|
|
861904
|
+
success3 = true;
|
|
861857
861905
|
}
|
|
861858
861906
|
if (prop in baseObj) {
|
|
861859
861907
|
delete baseObj[prop];
|
|
861860
|
-
|
|
861908
|
+
success3 = true;
|
|
861861
861909
|
}
|
|
861862
|
-
return
|
|
861910
|
+
return success3;
|
|
861863
861911
|
},
|
|
861864
861912
|
ownKeys(_target) {
|
|
861865
861913
|
const baseKeys = Reflect.ownKeys(baseObj);
|
|
@@ -895354,8 +895402,8 @@ async function handleSearch(keyword, forcedMarket, limit2) {
|
|
|
895354
895402
|
}
|
|
895355
895403
|
}
|
|
895356
895404
|
async function queryStockData(args) {
|
|
895357
|
-
const { action } = args;
|
|
895358
|
-
switch (
|
|
895405
|
+
const { action: action2 } = args;
|
|
895406
|
+
switch (action2) {
|
|
895359
895407
|
case "quote": {
|
|
895360
895408
|
if (!args.symbols) {
|
|
895361
895409
|
return makeError2("'symbols' is required for quote action");
|
|
@@ -895385,7 +895433,7 @@ async function queryStockData(args) {
|
|
|
895385
895433
|
return handleSearch(args.keyword, marketArg ?? "all", args.limit ?? 20);
|
|
895386
895434
|
}
|
|
895387
895435
|
default:
|
|
895388
|
-
return makeError2(`unknown action '${String(
|
|
895436
|
+
return makeError2(`unknown action '${String(action2)}'`);
|
|
895389
895437
|
}
|
|
895390
895438
|
}
|
|
895391
895439
|
var sdk, yf, stockDataTool;
|
|
@@ -903317,8 +903365,8 @@ var require_debuggability = __commonJS({
|
|
|
903317
903365
|
};
|
|
903318
903366
|
if (util2.isNode && process.stderr.isTTY) {
|
|
903319
903367
|
printWarning = function(message, isSoft) {
|
|
903320
|
-
var
|
|
903321
|
-
console.warn(
|
|
903368
|
+
var color3 = isSoft ? "\x1B[33m" : "\x1B[31m";
|
|
903369
|
+
console.warn(color3 + message + "\x1B[0m\n");
|
|
903322
903370
|
};
|
|
903323
903371
|
} else if (!util2.isNode && typeof new Error().stack === "string") {
|
|
903324
903372
|
printWarning = function(message, isSoft) {
|
|
@@ -903503,10 +903551,10 @@ var require_finally = __commonJS({
|
|
|
903503
903551
|
return reasonOrValue;
|
|
903504
903552
|
}
|
|
903505
903553
|
}
|
|
903506
|
-
Promise2.prototype._passThrough = function(handler, type,
|
|
903554
|
+
Promise2.prototype._passThrough = function(handler, type, success3, fail5) {
|
|
903507
903555
|
if (typeof handler !== "function") return this.then();
|
|
903508
903556
|
return this._then(
|
|
903509
|
-
|
|
903557
|
+
success3,
|
|
903510
903558
|
fail5,
|
|
903511
903559
|
void 0,
|
|
903512
903560
|
new PassThroughHandlerContext(this, type, handler),
|
|
@@ -906799,15 +906847,15 @@ var require_plumbing = __commonJS({
|
|
|
906799
906847
|
var isString = require_isString();
|
|
906800
906848
|
var isUndefined = require_isUndefined();
|
|
906801
906849
|
module2.exports = function(options3) {
|
|
906802
|
-
var
|
|
906850
|
+
var errorText2 = "Please verify options";
|
|
906803
906851
|
if (!isObjectLike(options3)) {
|
|
906804
|
-
throw new TypeError(
|
|
906852
|
+
throw new TypeError(errorText2);
|
|
906805
906853
|
}
|
|
906806
906854
|
if (!isFunction(options3.PromiseImpl)) {
|
|
906807
|
-
throw new TypeError(
|
|
906855
|
+
throw new TypeError(errorText2 + ".PromiseImpl");
|
|
906808
906856
|
}
|
|
906809
906857
|
if (!isUndefined(options3.constructorMixin) && !isFunction(options3.constructorMixin)) {
|
|
906810
|
-
throw new TypeError(
|
|
906858
|
+
throw new TypeError(errorText2 + ".PromiseImpl");
|
|
906811
906859
|
}
|
|
906812
906860
|
var PromiseImpl = options3.PromiseImpl;
|
|
906813
906861
|
var constructorMixin = options3.constructorMixin;
|
|
@@ -906918,15 +906966,15 @@ var require_request2 = __commonJS({
|
|
|
906918
906966
|
var isFunction = require_isFunction();
|
|
906919
906967
|
var isObjectLike = require_isObjectLike();
|
|
906920
906968
|
module2.exports = function(options3) {
|
|
906921
|
-
var
|
|
906969
|
+
var errorText2 = "Please verify options";
|
|
906922
906970
|
if (!isObjectLike(options3)) {
|
|
906923
|
-
throw new TypeError(
|
|
906971
|
+
throw new TypeError(errorText2);
|
|
906924
906972
|
}
|
|
906925
906973
|
if (!isFunction(options3.request)) {
|
|
906926
|
-
throw new TypeError(
|
|
906974
|
+
throw new TypeError(errorText2 + ".request");
|
|
906927
906975
|
}
|
|
906928
906976
|
if (!isArray6(options3.expose) || options3.expose.length === 0) {
|
|
906929
|
-
throw new TypeError(
|
|
906977
|
+
throw new TypeError(errorText2 + ".expose");
|
|
906930
906978
|
}
|
|
906931
906979
|
var plumbing = core({
|
|
906932
906980
|
PromiseImpl: options3.PromiseImpl,
|
|
@@ -939310,10 +939358,10 @@ var require_telegram = __commonJS({
|
|
|
939310
939358
|
*/
|
|
939311
939359
|
}, {
|
|
939312
939360
|
key: "sendChatAction",
|
|
939313
|
-
value: function sendChatAction(chatId,
|
|
939361
|
+
value: function sendChatAction(chatId, action2) {
|
|
939314
939362
|
var form = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
939315
939363
|
form.chat_id = chatId;
|
|
939316
|
-
form.action =
|
|
939364
|
+
form.action = action2;
|
|
939317
939365
|
return this._request("sendChatAction", { form });
|
|
939318
939366
|
}
|
|
939319
939367
|
/**
|
|
@@ -943612,9 +943660,9 @@ var require_telegram2 = __commonJS({
|
|
|
943612
943660
|
* @return {Promise} True on success
|
|
943613
943661
|
* @see https://core.telegram.org/bots/api#sendchataction
|
|
943614
943662
|
*/
|
|
943615
|
-
sendChatAction(chatId,
|
|
943663
|
+
sendChatAction(chatId, action2, form = {}) {
|
|
943616
943664
|
form.chat_id = chatId;
|
|
943617
|
-
form.action =
|
|
943665
|
+
form.action = action2;
|
|
943618
943666
|
return this._request("sendChatAction", { form });
|
|
943619
943667
|
}
|
|
943620
943668
|
/**
|
|
@@ -946637,9 +946685,9 @@ var init_telegram = __esm({
|
|
|
946637
946685
|
await this.answerCallbackQuery(callbackId, "Unknown action.");
|
|
946638
946686
|
return;
|
|
946639
946687
|
}
|
|
946640
|
-
const
|
|
946688
|
+
const action2 = match[1];
|
|
946641
946689
|
const entryId = match[2];
|
|
946642
|
-
if (
|
|
946690
|
+
if (action2 === "approve") {
|
|
946643
946691
|
const result2 = await this.approveEntry(entryId, messageChatId, { suppressReply: true });
|
|
946644
946692
|
await this.answerCallbackQuery(callbackId, result2);
|
|
946645
946693
|
await this.clearCallbackButtons(query);
|
|
@@ -947160,9 +947208,9 @@ ${messageText}` : messageText,
|
|
|
947160
947208
|
if (url2) {
|
|
947161
947209
|
try {
|
|
947162
947210
|
const transcript = await transcribeAudioFile(url2);
|
|
947163
|
-
const
|
|
947164
|
-
commandMessage.text = commandMessage.text ? `${
|
|
947165
|
-
${commandMessage.text}` : `${
|
|
947211
|
+
const label2 = "[Voice message transcription]";
|
|
947212
|
+
commandMessage.text = commandMessage.text ? `${label2}: ${transcript}
|
|
947213
|
+
${commandMessage.text}` : `${label2}: ${transcript}`;
|
|
947166
947214
|
} catch (err7) {
|
|
947167
947215
|
logger.warn(`Telegram: Voice pre-transcription failed: ${err7 instanceof Error ? err7.message : String(err7)}`);
|
|
947168
947216
|
}
|
|
@@ -952789,7 +952837,7 @@ var require_body = __commonJS({
|
|
|
952789
952837
|
});
|
|
952790
952838
|
}
|
|
952791
952839
|
assert4(isReadableStreamLike(stream));
|
|
952792
|
-
let
|
|
952840
|
+
let action2 = null;
|
|
952793
952841
|
let source = null;
|
|
952794
952842
|
let length = null;
|
|
952795
952843
|
let type = null;
|
|
@@ -952842,7 +952890,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
952842
952890
|
length = null;
|
|
952843
952891
|
}
|
|
952844
952892
|
source = object5;
|
|
952845
|
-
|
|
952893
|
+
action2 = async function* () {
|
|
952846
952894
|
for (const part of blobParts) {
|
|
952847
952895
|
if (part.stream) {
|
|
952848
952896
|
yield* part.stream();
|
|
@@ -952872,11 +952920,11 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
952872
952920
|
if (typeof source === "string" || util2.isBuffer(source)) {
|
|
952873
952921
|
length = Buffer.byteLength(source);
|
|
952874
952922
|
}
|
|
952875
|
-
if (
|
|
952923
|
+
if (action2 != null) {
|
|
952876
952924
|
let iterator;
|
|
952877
952925
|
stream = new ReadableStream({
|
|
952878
952926
|
async start() {
|
|
952879
|
-
iterator =
|
|
952927
|
+
iterator = action2(object5)[Symbol.asyncIterator]();
|
|
952880
952928
|
},
|
|
952881
952929
|
async pull(controller) {
|
|
952882
952930
|
const { value, done } = await iterator.next();
|
|
@@ -961767,11 +961815,11 @@ var require_progressevent = __commonJS({
|
|
|
961767
961815
|
var require_encoding = __commonJS({
|
|
961768
961816
|
"node_modules/.pnpm/undici@6.24.1/node_modules/undici/lib/web/fileapi/encoding.js"(exports2, module2) {
|
|
961769
961817
|
"use strict";
|
|
961770
|
-
function getEncoding(
|
|
961771
|
-
if (!
|
|
961818
|
+
function getEncoding(label2) {
|
|
961819
|
+
if (!label2) {
|
|
961772
961820
|
return "failure";
|
|
961773
961821
|
}
|
|
961774
|
-
switch (
|
|
961822
|
+
switch (label2.trim().toLowerCase()) {
|
|
961775
961823
|
case "unicode-1-1-utf-8":
|
|
961776
961824
|
case "unicode11utf8":
|
|
961777
961825
|
case "unicode20utf8":
|
|
@@ -976351,7 +976399,7 @@ var require_Messages = __commonJS({
|
|
|
976351
976399
|
[DjsErrorCodes.ClientInvalidOption]: (prop, must) => `The ${prop} option must be ${must}`,
|
|
976352
976400
|
[DjsErrorCodes.ClientInvalidProvidedShards]: "None of the provided shards were valid.",
|
|
976353
976401
|
[DjsErrorCodes.ClientMissingIntents]: "Valid intents must be provided for the Client.",
|
|
976354
|
-
[DjsErrorCodes.ClientNotReady]: (
|
|
976402
|
+
[DjsErrorCodes.ClientNotReady]: (action2) => `The client needs to be logged in to ${action2}.`,
|
|
976355
976403
|
[DjsErrorCodes.TokenInvalid]: "An invalid token was provided.",
|
|
976356
976404
|
[DjsErrorCodes.TokenMissing]: "Request to use token, but token was unavailable to the client.",
|
|
976357
976405
|
[DjsErrorCodes.ApplicationCommandPermissionsTokenMissing]: "Editing application command permissions requires an OAuth2 bearer token, but none was provided.",
|
|
@@ -976377,7 +976425,7 @@ var require_Messages = __commonJS({
|
|
|
976377
976425
|
[DjsErrorCodes.ShardingNoChildExists]: (id2) => `Shard ${id2} has no active process or worker.`,
|
|
976378
976426
|
[DjsErrorCodes.ShardingShardMiscalculation]: (shard, guild, count) => `Calculated invalid shard ${shard} for guild ${guild} with ${count} shards.`,
|
|
976379
976427
|
[DjsErrorCodes.ColorRange]: "Color must be within the range 0 - 16777215 (0xFFFFFF).",
|
|
976380
|
-
[DjsErrorCodes.ColorConvert]: (
|
|
976428
|
+
[DjsErrorCodes.ColorConvert]: (color3) => `Unable to convert "${color3}" to a number.`,
|
|
976381
976429
|
[DjsErrorCodes.InviteOptionsMissingChannel]: "A valid guild channel must be provided when GuildScheduledEvent is EXTERNAL.",
|
|
976382
976430
|
[DjsErrorCodes.ButtonLabel]: "MessageButton label must be a string",
|
|
976383
976431
|
[DjsErrorCodes.ButtonURL]: "MessageButton URL must be a string",
|
|
@@ -976434,7 +976482,7 @@ var require_Messages = __commonJS({
|
|
|
976434
976482
|
`Client must have Create Guild Expressions or Manage Guild Expressions permission in guild ${guild} to see emoji authors.`
|
|
976435
976483
|
),
|
|
976436
976484
|
[DjsErrorCodes.MissingManageEmojisAndStickersPermission]: (guild) => `Client must have Manage Emojis and Stickers permission in guild ${guild} to see emoji authors.`,
|
|
976437
|
-
[DjsErrorCodes.NotGuildSoundboardSound]: (
|
|
976485
|
+
[DjsErrorCodes.NotGuildSoundboardSound]: (action2) => `Soundboard sound is a default (non-guild) soundboard sound and can't be ${action2}.`,
|
|
976438
976486
|
[DjsErrorCodes.NotGuildSticker]: "Sticker is a standard (non-guild) sticker and has no author.",
|
|
976439
976487
|
[DjsErrorCodes.ReactionResolveUser]: "Couldn't resolve the user id to remove from the reaction.",
|
|
976440
976488
|
[DjsErrorCodes.VanityURL]: "This guild does not have the vanity URL feature enabled.",
|
|
@@ -979033,8 +979081,8 @@ var require_Role = __commonJS({
|
|
|
979033
979081
|
* @returns {Promise<Role>}
|
|
979034
979082
|
* @deprecated Use {@link Role#setColors} instead.
|
|
979035
979083
|
*/
|
|
979036
|
-
async setColor(
|
|
979037
|
-
return this.edit({ color, reason });
|
|
979084
|
+
async setColor(color3, reason) {
|
|
979085
|
+
return this.edit({ color: color3, reason });
|
|
979038
979086
|
}
|
|
979039
979087
|
/**
|
|
979040
979088
|
* Sets new colors for the role.
|
|
@@ -980015,20 +980063,20 @@ var require_Util = __commonJS({
|
|
|
980015
980063
|
if (!allowEmpty && data2.length === 0) throw new error49(errorMessage);
|
|
980016
980064
|
return data2;
|
|
980017
980065
|
}
|
|
980018
|
-
function resolveColor(
|
|
980066
|
+
function resolveColor(color3) {
|
|
980019
980067
|
let resolvedColor;
|
|
980020
|
-
if (typeof
|
|
980021
|
-
if (
|
|
980022
|
-
if (
|
|
980023
|
-
if (/^#?[\da-f]{6}$/i.test(
|
|
980024
|
-
resolvedColor = Colors[
|
|
980025
|
-
} else if (Array.isArray(
|
|
980026
|
-
resolvedColor = (
|
|
980068
|
+
if (typeof color3 === "string") {
|
|
980069
|
+
if (color3 === "Random") return Math.floor(Math.random() * (16777215 + 1));
|
|
980070
|
+
if (color3 === "Default") return 0;
|
|
980071
|
+
if (/^#?[\da-f]{6}$/i.test(color3)) return parseInt(color3.replace("#", ""), 16);
|
|
980072
|
+
resolvedColor = Colors[color3];
|
|
980073
|
+
} else if (Array.isArray(color3)) {
|
|
980074
|
+
resolvedColor = (color3[0] << 16) + (color3[1] << 8) + color3[2];
|
|
980027
980075
|
} else {
|
|
980028
|
-
resolvedColor =
|
|
980076
|
+
resolvedColor = color3;
|
|
980029
980077
|
}
|
|
980030
980078
|
if (!Number.isInteger(resolvedColor)) {
|
|
980031
|
-
throw new DiscordjsTypeError2(ErrorCodes2.ColorConvert,
|
|
980079
|
+
throw new DiscordjsTypeError2(ErrorCodes2.ColorConvert, color3);
|
|
980032
980080
|
}
|
|
980033
980081
|
if (resolvedColor < 0 || resolvedColor > 16777215) {
|
|
980034
980082
|
throw new DiscordjsRangeError2(ErrorCodes2.ColorRange);
|
|
@@ -986676,9 +986724,9 @@ ${givenBlock}`;
|
|
|
986676
986724
|
__name(_ExpectedConstraintError, "ExpectedConstraintError");
|
|
986677
986725
|
var ExpectedConstraintError = _ExpectedConstraintError;
|
|
986678
986726
|
var _Result = class _Result2 {
|
|
986679
|
-
constructor(
|
|
986680
|
-
this.success =
|
|
986681
|
-
if (
|
|
986727
|
+
constructor(success3, value, error49) {
|
|
986728
|
+
this.success = success3;
|
|
986729
|
+
if (success3) {
|
|
986682
986730
|
this.value = value;
|
|
986683
986731
|
} else {
|
|
986684
986732
|
this.error = error49;
|
|
@@ -989669,14 +989717,14 @@ var require_dist14 = __commonJS({
|
|
|
989669
989717
|
*
|
|
989670
989718
|
* @param color - The color to use
|
|
989671
989719
|
*/
|
|
989672
|
-
setColor(
|
|
989673
|
-
colorPredicate.parse(
|
|
989674
|
-
if (Array.isArray(
|
|
989675
|
-
const [red, green, blue] =
|
|
989720
|
+
setColor(color3) {
|
|
989721
|
+
colorPredicate.parse(color3);
|
|
989722
|
+
if (Array.isArray(color3)) {
|
|
989723
|
+
const [red, green, blue] = color3;
|
|
989676
989724
|
this.data.color = (red << 16) + (green << 8) + blue;
|
|
989677
989725
|
return this;
|
|
989678
989726
|
}
|
|
989679
|
-
this.data.color =
|
|
989727
|
+
this.data.color = color3 ?? void 0;
|
|
989680
989728
|
return this;
|
|
989681
989729
|
}
|
|
989682
989730
|
/**
|
|
@@ -989823,8 +989871,8 @@ var require_dist14 = __commonJS({
|
|
|
989823
989871
|
*
|
|
989824
989872
|
* @param label - The label to use
|
|
989825
989873
|
*/
|
|
989826
|
-
setLabel(
|
|
989827
|
-
this.data.label = labelValueDescriptionValidator.parse(
|
|
989874
|
+
setLabel(label2) {
|
|
989875
|
+
this.data.label = labelValueDescriptionValidator.parse(label2);
|
|
989828
989876
|
return this;
|
|
989829
989877
|
}
|
|
989830
989878
|
/**
|
|
@@ -989902,8 +989950,8 @@ var require_dist14 = __commonJS({
|
|
|
989902
989950
|
}
|
|
989903
989951
|
__name(validateRequiredSelectMenuParameters, "validateRequiredSelectMenuParameters");
|
|
989904
989952
|
var defaultValidator = import_shapeshift2.s.boolean();
|
|
989905
|
-
function validateRequiredSelectMenuOptionParameters(
|
|
989906
|
-
labelValueDescriptionValidator.parse(
|
|
989953
|
+
function validateRequiredSelectMenuOptionParameters(label2, value) {
|
|
989954
|
+
labelValueDescriptionValidator.parse(label2);
|
|
989907
989955
|
labelValueDescriptionValidator.parse(value);
|
|
989908
989956
|
}
|
|
989909
989957
|
__name(validateRequiredSelectMenuOptionParameters, "validateRequiredSelectMenuOptionParameters");
|
|
@@ -989911,12 +989959,12 @@ var require_dist14 = __commonJS({
|
|
|
989911
989959
|
var urlValidator = import_shapeshift2.s.string().url({
|
|
989912
989960
|
allowedProtocols: ["http:", "https:", "discord:"]
|
|
989913
989961
|
}).setValidationEnabled(isValidationEnabled);
|
|
989914
|
-
function validateRequiredButtonParameters(style,
|
|
989962
|
+
function validateRequiredButtonParameters(style, label2, emoji3, customId, skuId, url2) {
|
|
989915
989963
|
if (style === import_v10.ButtonStyle.Premium) {
|
|
989916
989964
|
if (!skuId) {
|
|
989917
989965
|
throw new RangeError("Premium buttons must have an SKU id.");
|
|
989918
989966
|
}
|
|
989919
|
-
if (customId ||
|
|
989967
|
+
if (customId || label2 || url2 || emoji3) {
|
|
989920
989968
|
throw new RangeError("Premium buttons cannot have a custom id, label, URL, or emoji.");
|
|
989921
989969
|
}
|
|
989922
989970
|
} else {
|
|
@@ -989926,7 +989974,7 @@ var require_dist14 = __commonJS({
|
|
|
989926
989974
|
if (url2 && customId) {
|
|
989927
989975
|
throw new RangeError("URL and custom id are mutually exclusive.");
|
|
989928
989976
|
}
|
|
989929
|
-
if (!
|
|
989977
|
+
if (!label2 && !emoji3) {
|
|
989930
989978
|
throw new RangeError("Non-premium buttons must have a label and/or an emoji.");
|
|
989931
989979
|
}
|
|
989932
989980
|
if (style === import_v10.ButtonStyle.Link) {
|
|
@@ -990075,8 +990123,8 @@ var require_dist14 = __commonJS({
|
|
|
990075
990123
|
*
|
|
990076
990124
|
* @param label - The label to use
|
|
990077
990125
|
*/
|
|
990078
|
-
setLabel(
|
|
990079
|
-
this.data.label = buttonLabelValidator.parse(
|
|
990126
|
+
setLabel(label2) {
|
|
990127
|
+
this.data.label = buttonLabelValidator.parse(label2);
|
|
990080
990128
|
return this;
|
|
990081
990129
|
}
|
|
990082
990130
|
/**
|
|
@@ -990258,8 +990306,8 @@ var require_dist14 = __commonJS({
|
|
|
990258
990306
|
*
|
|
990259
990307
|
* @param label - The label to use
|
|
990260
990308
|
*/
|
|
990261
|
-
setLabel(
|
|
990262
|
-
this.data.label =
|
|
990309
|
+
setLabel(label2) {
|
|
990310
|
+
this.data.label = label2;
|
|
990263
990311
|
return this;
|
|
990264
990312
|
}
|
|
990265
990313
|
/**
|
|
@@ -990473,8 +990521,8 @@ var require_dist14 = __commonJS({
|
|
|
990473
990521
|
*
|
|
990474
990522
|
* @param label - The label to use
|
|
990475
990523
|
*/
|
|
990476
|
-
setLabel(
|
|
990477
|
-
this.data.label =
|
|
990524
|
+
setLabel(label2) {
|
|
990525
|
+
this.data.label = label2;
|
|
990478
990526
|
return this;
|
|
990479
990527
|
}
|
|
990480
990528
|
/**
|
|
@@ -991379,8 +991427,8 @@ var require_dist14 = __commonJS({
|
|
|
991379
991427
|
* @param label - The label to use
|
|
991380
991428
|
* @deprecated Use a label builder to create a label (and optionally a description) instead.
|
|
991381
991429
|
*/
|
|
991382
|
-
setLabel(
|
|
991383
|
-
this.data.label = labelValidator.parse(
|
|
991430
|
+
setLabel(label2) {
|
|
991431
|
+
this.data.label = labelValidator.parse(label2);
|
|
991384
991432
|
return this;
|
|
991385
991433
|
}
|
|
991386
991434
|
/**
|
|
@@ -991523,8 +991571,8 @@ var require_dist14 = __commonJS({
|
|
|
991523
991571
|
*
|
|
991524
991572
|
* @param label - The label to use
|
|
991525
991573
|
*/
|
|
991526
|
-
setLabel(
|
|
991527
|
-
this.data.label =
|
|
991574
|
+
setLabel(label2) {
|
|
991575
|
+
this.data.label = label2;
|
|
991528
991576
|
return this;
|
|
991529
991577
|
}
|
|
991530
991578
|
/**
|
|
@@ -991986,14 +992034,14 @@ var require_dist14 = __commonJS({
|
|
|
991986
992034
|
*
|
|
991987
992035
|
* @param color - The color to use
|
|
991988
992036
|
*/
|
|
991989
|
-
setAccentColor(
|
|
991990
|
-
containerColorPredicate.parse(
|
|
991991
|
-
if (Array.isArray(
|
|
991992
|
-
const [red, green, blue] =
|
|
992037
|
+
setAccentColor(color3) {
|
|
992038
|
+
containerColorPredicate.parse(color3);
|
|
992039
|
+
if (Array.isArray(color3)) {
|
|
992040
|
+
const [red, green, blue] = color3;
|
|
991993
992041
|
this.data.accent_color = (red << 16) + (green << 8) + blue;
|
|
991994
992042
|
return this;
|
|
991995
992043
|
}
|
|
991996
|
-
this.data.accent_color =
|
|
992044
|
+
this.data.accent_color = color3;
|
|
991997
992045
|
return this;
|
|
991998
992046
|
}
|
|
991999
992047
|
/**
|
|
@@ -992626,7 +992674,7 @@ var require_dist14 = __commonJS({
|
|
|
992626
992674
|
*/
|
|
992627
992675
|
addLabelComponents(...components) {
|
|
992628
992676
|
const normalized = normalizeArray(components);
|
|
992629
|
-
const resolved = normalized.map((
|
|
992677
|
+
const resolved = normalized.map((label2) => resolveBuilder(label2, LabelBuilder));
|
|
992630
992678
|
this.components.push(...resolved);
|
|
992631
992679
|
return this;
|
|
992632
992680
|
}
|
|
@@ -992693,7 +992741,7 @@ var require_dist14 = __commonJS({
|
|
|
992693
992741
|
* @param labels - The replacing label objects
|
|
992694
992742
|
*/
|
|
992695
992743
|
spliceLabelComponents(index, deleteCount, ...labels) {
|
|
992696
|
-
const resolved = labels.map((
|
|
992744
|
+
const resolved = labels.map((label2) => resolveBuilder(label2, LabelBuilder));
|
|
992697
992745
|
this.components.splice(index, deleteCount, ...resolved);
|
|
992698
992746
|
return this;
|
|
992699
992747
|
}
|
|
@@ -1002596,7 +1002644,7 @@ var require_AutoModerationRule = __commonJS({
|
|
|
1002596
1002644
|
};
|
|
1002597
1002645
|
}
|
|
1002598
1002646
|
if ("actions" in data2) {
|
|
1002599
|
-
this.actions = data2.actions.map((
|
|
1002647
|
+
this.actions = data2.actions.map((action2) => _transformAPIAutoModerationAction(action2));
|
|
1002600
1002648
|
}
|
|
1002601
1002649
|
if ("enabled" in data2) {
|
|
1002602
1002650
|
this.enabled = data2.enabled;
|
|
@@ -1003301,7 +1003349,7 @@ var require_GuildAuditLogsEntry = __commonJS({
|
|
|
1003301
1003349
|
* @param {AuditLogEvent} action The action target
|
|
1003302
1003350
|
* @returns {AuditLogActionType}
|
|
1003303
1003351
|
*/
|
|
1003304
|
-
static actionType(
|
|
1003352
|
+
static actionType(action2) {
|
|
1003305
1003353
|
if ([
|
|
1003306
1003354
|
AuditLogEvent.ChannelCreate,
|
|
1003307
1003355
|
AuditLogEvent.ChannelOverwriteCreate,
|
|
@@ -1003322,7 +1003370,7 @@ var require_GuildAuditLogsEntry = __commonJS({
|
|
|
1003322
1003370
|
AuditLogEvent.AutoModerationBlockMessage,
|
|
1003323
1003371
|
AuditLogEvent.OnboardingPromptCreate,
|
|
1003324
1003372
|
AuditLogEvent.OnboardingCreate
|
|
1003325
|
-
].includes(
|
|
1003373
|
+
].includes(action2)) {
|
|
1003326
1003374
|
return "Create";
|
|
1003327
1003375
|
}
|
|
1003328
1003376
|
if ([
|
|
@@ -1003347,7 +1003395,7 @@ var require_GuildAuditLogsEntry = __commonJS({
|
|
|
1003347
1003395
|
AuditLogEvent.SoundboardSoundDelete,
|
|
1003348
1003396
|
AuditLogEvent.AutoModerationRuleDelete,
|
|
1003349
1003397
|
AuditLogEvent.OnboardingPromptDelete
|
|
1003350
|
-
].includes(
|
|
1003398
|
+
].includes(action2)) {
|
|
1003351
1003399
|
return "Delete";
|
|
1003352
1003400
|
}
|
|
1003353
1003401
|
if ([
|
|
@@ -1003374,7 +1003422,7 @@ var require_GuildAuditLogsEntry = __commonJS({
|
|
|
1003374
1003422
|
AuditLogEvent.AutoModerationUserCommunicationDisabled,
|
|
1003375
1003423
|
AuditLogEvent.OnboardingPromptUpdate,
|
|
1003376
1003424
|
AuditLogEvent.OnboardingUpdate
|
|
1003377
|
-
].includes(
|
|
1003425
|
+
].includes(action2)) {
|
|
1003378
1003426
|
return "Update";
|
|
1003379
1003427
|
}
|
|
1003380
1003428
|
return "All";
|
|
@@ -1010722,12 +1010770,12 @@ var require_AutoModerationRuleManager = __commonJS({
|
|
|
1010722
1010770
|
mention_total_limit: triggerMetadata.mentionTotalLimit,
|
|
1010723
1010771
|
mention_raid_protection_enabled: triggerMetadata.mentionRaidProtectionEnabled
|
|
1010724
1010772
|
},
|
|
1010725
|
-
actions: actions.map((
|
|
1010726
|
-
type:
|
|
1010773
|
+
actions: actions.map((action2) => ({
|
|
1010774
|
+
type: action2.type,
|
|
1010727
1010775
|
metadata: {
|
|
1010728
|
-
duration_seconds:
|
|
1010729
|
-
channel_id:
|
|
1010730
|
-
custom_message:
|
|
1010776
|
+
duration_seconds: action2.metadata?.durationSeconds,
|
|
1010777
|
+
channel_id: action2.metadata?.channel && this.guild.channels.resolveId(action2.metadata.channel),
|
|
1010778
|
+
custom_message: action2.metadata?.customMessage
|
|
1010731
1010779
|
}
|
|
1010732
1010780
|
})),
|
|
1010733
1010781
|
enabled,
|
|
@@ -1010773,12 +1010821,12 @@ var require_AutoModerationRuleManager = __commonJS({
|
|
|
1010773
1010821
|
mention_total_limit: triggerMetadata.mentionTotalLimit,
|
|
1010774
1010822
|
mention_raid_protection_enabled: triggerMetadata.mentionRaidProtectionEnabled
|
|
1010775
1010823
|
},
|
|
1010776
|
-
actions: actions?.map((
|
|
1010777
|
-
type:
|
|
1010824
|
+
actions: actions?.map((action2) => ({
|
|
1010825
|
+
type: action2.type,
|
|
1010778
1010826
|
metadata: {
|
|
1010779
|
-
duration_seconds:
|
|
1010780
|
-
channel_id:
|
|
1010781
|
-
custom_message:
|
|
1010827
|
+
duration_seconds: action2.metadata?.durationSeconds,
|
|
1010828
|
+
channel_id: action2.metadata?.channel && this.guild.channels.resolveId(action2.metadata.channel),
|
|
1010829
|
+
custom_message: action2.metadata?.customMessage
|
|
1010782
1010830
|
}
|
|
1010783
1010831
|
})),
|
|
1010784
1010832
|
enabled,
|
|
@@ -1013605,7 +1013653,7 @@ var require_RoleManager = __commonJS({
|
|
|
1013605
1013653
|
*/
|
|
1013606
1013654
|
async create(options3 = {}) {
|
|
1013607
1013655
|
let { permissions, icon } = options3;
|
|
1013608
|
-
const { name, color, hoist, position, mentionable, reason, unicodeEmoji } = options3;
|
|
1013656
|
+
const { name, color: color3, hoist, position, mentionable, reason, unicodeEmoji } = options3;
|
|
1013609
1013657
|
if (permissions !== void 0) permissions = new PermissionsBitField2(permissions);
|
|
1013610
1013658
|
if (icon) {
|
|
1013611
1013659
|
const guildEmojiURL = this.guild.emojis.resolve(icon)?.imageURL();
|
|
@@ -1013617,13 +1013665,13 @@ var require_RoleManager = __commonJS({
|
|
|
1013617
1013665
|
secondary_color: options3.colors.secondaryColor && resolveColor(options3.colors.secondaryColor),
|
|
1013618
1013666
|
tertiary_color: options3.colors.tertiaryColor && resolveColor(options3.colors.tertiaryColor)
|
|
1013619
1013667
|
};
|
|
1013620
|
-
if (
|
|
1013668
|
+
if (color3 !== void 0) {
|
|
1013621
1013669
|
if (!deprecationEmittedForCreate) {
|
|
1013622
1013670
|
process11.emitWarning(`Passing "color" to RoleManager#create() is deprecated. Use "colors" instead.`);
|
|
1013623
1013671
|
}
|
|
1013624
1013672
|
deprecationEmittedForCreate = true;
|
|
1013625
1013673
|
colors = {
|
|
1013626
|
-
primary_color: resolveColor(
|
|
1013674
|
+
primary_color: resolveColor(color3),
|
|
1013627
1013675
|
secondary_color: null,
|
|
1013628
1013676
|
tertiary_color: null
|
|
1013629
1013677
|
};
|
|
@@ -1015365,9 +1015413,9 @@ var require_GuildManager = __commonJS({
|
|
|
1015365
1015413
|
verification_level: verificationLevel,
|
|
1015366
1015414
|
default_message_notifications: defaultMessageNotifications,
|
|
1015367
1015415
|
explicit_content_filter: explicitContentFilter,
|
|
1015368
|
-
roles: roles.map(({ color, permissions, ...options3 }) => ({
|
|
1015416
|
+
roles: roles.map(({ color: color3, permissions, ...options3 }) => ({
|
|
1015369
1015417
|
...options3,
|
|
1015370
|
-
color:
|
|
1015418
|
+
color: color3 && resolveColor(color3),
|
|
1015371
1015419
|
permissions: permissions === void 0 ? void 0 : PermissionsBitField2.resolve(permissions).toString()
|
|
1015372
1015420
|
})),
|
|
1015373
1015421
|
channels: channels.map(
|
|
@@ -1017658,8 +1017706,8 @@ var require_EmbedBuilder = __commonJS({
|
|
|
1017658
1017706
|
* @param {?ColorResolvable} color The color of the embed
|
|
1017659
1017707
|
* @returns {EmbedBuilder}
|
|
1017660
1017708
|
*/
|
|
1017661
|
-
setColor(
|
|
1017662
|
-
return super.setColor(
|
|
1017709
|
+
setColor(color3) {
|
|
1017710
|
+
return super.setColor(color3 && resolveColor(color3));
|
|
1017663
1017711
|
}
|
|
1017664
1017712
|
/**
|
|
1017665
1017713
|
* Creates a new embed builder from JSON data
|
|
@@ -1019162,7 +1019210,7 @@ var init_cdn_url = __esm({
|
|
|
1019162
1019210
|
|
|
1019163
1019211
|
// node_modules/.pnpm/@tencent-weixin+openclaw-weixin@2.4.3/node_modules/@tencent-weixin/openclaw-weixin/src/cdn/cdn-upload.ts
|
|
1019164
1019212
|
async function uploadBufferToCdn(params) {
|
|
1019165
|
-
const { buf, uploadFullUrl, uploadParam, filekey, cdnBaseUrl, label, aeskey } = params;
|
|
1019213
|
+
const { buf, uploadFullUrl, uploadParam, filekey, cdnBaseUrl, label: label2, aeskey } = params;
|
|
1019166
1019214
|
const ciphertext = encryptAesEcb(buf, aeskey);
|
|
1019167
1019215
|
const trimmedFull = uploadFullUrl?.trim();
|
|
1019168
1019216
|
let cdnUrl;
|
|
@@ -1019171,9 +1019219,9 @@ async function uploadBufferToCdn(params) {
|
|
|
1019171
1019219
|
} else if (uploadParam) {
|
|
1019172
1019220
|
cdnUrl = buildCdnUploadUrl({ cdnBaseUrl, uploadParam, filekey });
|
|
1019173
1019221
|
} else {
|
|
1019174
|
-
throw new Error(`${
|
|
1019222
|
+
throw new Error(`${label2}: CDN upload URL missing (need upload_full_url or upload_param)`);
|
|
1019175
1019223
|
}
|
|
1019176
|
-
logger8.debug(`${
|
|
1019224
|
+
logger8.debug(`${label2}: CDN POST url=${redactUrl(cdnUrl)} ciphertextSize=${ciphertext.length}`);
|
|
1019177
1019225
|
let downloadParam;
|
|
1019178
1019226
|
let lastError;
|
|
1019179
1019227
|
for (let attempt = 1; attempt <= UPLOAD_MAX_RETRIES; attempt++) {
|
|
@@ -1019186,33 +1019234,33 @@ async function uploadBufferToCdn(params) {
|
|
|
1019186
1019234
|
if (res.status >= 400 && res.status < 500) {
|
|
1019187
1019235
|
const errMsg = res.headers.get("x-error-message") ?? await res.text();
|
|
1019188
1019236
|
logger8.error(
|
|
1019189
|
-
`${
|
|
1019237
|
+
`${label2}: CDN client error attempt=${attempt} status=${res.status} errMsg=${errMsg}`
|
|
1019190
1019238
|
);
|
|
1019191
1019239
|
throw new Error(`CDN upload client error ${res.status}: ${errMsg}`);
|
|
1019192
1019240
|
}
|
|
1019193
1019241
|
if (res.status !== 200) {
|
|
1019194
1019242
|
const errMsg = res.headers.get("x-error-message") ?? `status ${res.status}`;
|
|
1019195
1019243
|
logger8.error(
|
|
1019196
|
-
`${
|
|
1019244
|
+
`${label2}: CDN server error attempt=${attempt} status=${res.status} errMsg=${errMsg}`
|
|
1019197
1019245
|
);
|
|
1019198
1019246
|
throw new Error(`CDN upload server error: ${errMsg}`);
|
|
1019199
1019247
|
}
|
|
1019200
1019248
|
downloadParam = res.headers.get("x-encrypted-param") ?? void 0;
|
|
1019201
1019249
|
if (!downloadParam) {
|
|
1019202
1019250
|
logger8.error(
|
|
1019203
|
-
`${
|
|
1019251
|
+
`${label2}: CDN response missing x-encrypted-param header attempt=${attempt}`
|
|
1019204
1019252
|
);
|
|
1019205
1019253
|
throw new Error("CDN upload response missing x-encrypted-param header");
|
|
1019206
1019254
|
}
|
|
1019207
|
-
logger8.debug(`${
|
|
1019255
|
+
logger8.debug(`${label2}: CDN upload success attempt=${attempt}`);
|
|
1019208
1019256
|
break;
|
|
1019209
1019257
|
} catch (err7) {
|
|
1019210
1019258
|
lastError = err7;
|
|
1019211
1019259
|
if (err7 instanceof Error && err7.message.includes("client error")) throw err7;
|
|
1019212
1019260
|
if (attempt < UPLOAD_MAX_RETRIES) {
|
|
1019213
|
-
logger8.error(`${
|
|
1019261
|
+
logger8.error(`${label2}: attempt ${attempt} failed, retrying... err=${String(err7)}`);
|
|
1019214
1019262
|
} else {
|
|
1019215
|
-
logger8.error(`${
|
|
1019263
|
+
logger8.error(`${label2}: all ${UPLOAD_MAX_RETRIES} attempts failed err=${String(err7)}`);
|
|
1019216
1019264
|
}
|
|
1019217
1019265
|
}
|
|
1019218
1019266
|
}
|
|
@@ -1019341,7 +1019389,7 @@ async function downloadRemoteImageToTemp(url2, destDir) {
|
|
|
1019341
1019389
|
return filePath;
|
|
1019342
1019390
|
}
|
|
1019343
1019391
|
async function uploadMediaToCdn(params) {
|
|
1019344
|
-
const { filePath, toUserId, opts, cdnBaseUrl, mediaType, label } = params;
|
|
1019392
|
+
const { filePath, toUserId, opts, cdnBaseUrl, mediaType, label: label2 } = params;
|
|
1019345
1019393
|
const plaintext = await import_promises21.default.readFile(filePath);
|
|
1019346
1019394
|
const rawsize = plaintext.length;
|
|
1019347
1019395
|
const rawfilemd5 = import_node_crypto12.default.createHash("md5").update(plaintext).digest("hex");
|
|
@@ -1019349,7 +1019397,7 @@ async function uploadMediaToCdn(params) {
|
|
|
1019349
1019397
|
const filekey = import_node_crypto12.default.randomBytes(16).toString("hex");
|
|
1019350
1019398
|
const aeskey = import_node_crypto12.default.randomBytes(16);
|
|
1019351
1019399
|
logger8.debug(
|
|
1019352
|
-
`${
|
|
1019400
|
+
`${label2}: file=${filePath} rawsize=${rawsize} filesize=${filesize} md5=${rawfilemd5} filekey=${filekey}`
|
|
1019353
1019401
|
);
|
|
1019354
1019402
|
const uploadUrlResp = await getUploadUrl({
|
|
1019355
1019403
|
...opts,
|
|
@@ -1019366,9 +1019414,9 @@ async function uploadMediaToCdn(params) {
|
|
|
1019366
1019414
|
const uploadParam = uploadUrlResp.upload_param;
|
|
1019367
1019415
|
if (!uploadFullUrl && !uploadParam) {
|
|
1019368
1019416
|
logger8.error(
|
|
1019369
|
-
`${
|
|
1019417
|
+
`${label2}: getUploadUrl returned no upload URL (need upload_full_url or upload_param), resp=${JSON.stringify(uploadUrlResp)}`
|
|
1019370
1019418
|
);
|
|
1019371
|
-
throw new Error(`${
|
|
1019419
|
+
throw new Error(`${label2}: getUploadUrl returned no upload URL`);
|
|
1019372
1019420
|
}
|
|
1019373
1019421
|
const { downloadParam: downloadEncryptedQueryParam } = await uploadBufferToCdn({
|
|
1019374
1019422
|
buf: plaintext,
|
|
@@ -1019377,7 +1019425,7 @@ async function uploadMediaToCdn(params) {
|
|
|
1019377
1019425
|
filekey,
|
|
1019378
1019426
|
cdnBaseUrl,
|
|
1019379
1019427
|
aeskey,
|
|
1019380
|
-
label: `${
|
|
1019428
|
+
label: `${label2}[orig filekey=${filekey}]`
|
|
1019381
1019429
|
});
|
|
1019382
1019430
|
return {
|
|
1019383
1019431
|
filekey,
|
|
@@ -1019425,27 +1019473,27 @@ var init_upload = __esm({
|
|
|
1019425
1019473
|
});
|
|
1019426
1019474
|
|
|
1019427
1019475
|
// node_modules/.pnpm/@tencent-weixin+openclaw-weixin@2.4.3/node_modules/@tencent-weixin/openclaw-weixin/src/cdn/pic-decrypt.ts
|
|
1019428
|
-
async function fetchCdnBytes(url2,
|
|
1019476
|
+
async function fetchCdnBytes(url2, label2) {
|
|
1019429
1019477
|
let res;
|
|
1019430
1019478
|
try {
|
|
1019431
1019479
|
res = await fetch(url2);
|
|
1019432
1019480
|
} catch (err7) {
|
|
1019433
1019481
|
const cause = err7.cause ?? err7.code ?? "(no cause)";
|
|
1019434
1019482
|
logger8.error(
|
|
1019435
|
-
`${
|
|
1019483
|
+
`${label2}: fetch network error url=${url2} err=${String(err7)} cause=${String(cause)}`
|
|
1019436
1019484
|
);
|
|
1019437
1019485
|
throw err7;
|
|
1019438
1019486
|
}
|
|
1019439
|
-
logger8.debug(`${
|
|
1019487
|
+
logger8.debug(`${label2}: response status=${res.status} ok=${res.ok}`);
|
|
1019440
1019488
|
if (!res.ok) {
|
|
1019441
1019489
|
const body = await res.text().catch(() => "(unreadable)");
|
|
1019442
|
-
const msg = `${
|
|
1019490
|
+
const msg = `${label2}: CDN download ${res.status} ${res.statusText} body=${body}`;
|
|
1019443
1019491
|
logger8.error(msg);
|
|
1019444
1019492
|
throw new Error(msg);
|
|
1019445
1019493
|
}
|
|
1019446
1019494
|
return Buffer.from(await res.arrayBuffer());
|
|
1019447
1019495
|
}
|
|
1019448
|
-
function parseAesKey(aesKeyBase64,
|
|
1019496
|
+
function parseAesKey(aesKeyBase64, label2) {
|
|
1019449
1019497
|
const decoded = Buffer.from(aesKeyBase64, "base64");
|
|
1019450
1019498
|
if (decoded.length === 16) {
|
|
1019451
1019499
|
return decoded;
|
|
@@ -1019453,38 +1019501,38 @@ function parseAesKey(aesKeyBase64, label) {
|
|
|
1019453
1019501
|
if (decoded.length === 32 && /^[0-9a-fA-F]{32}$/.test(decoded.toString("ascii"))) {
|
|
1019454
1019502
|
return Buffer.from(decoded.toString("ascii"), "hex");
|
|
1019455
1019503
|
}
|
|
1019456
|
-
const msg = `${
|
|
1019504
|
+
const msg = `${label2}: aes_key must decode to 16 raw bytes or 32-char hex string, got ${decoded.length} bytes (base64="${aesKeyBase64}")`;
|
|
1019457
1019505
|
logger8.error(msg);
|
|
1019458
1019506
|
throw new Error(msg);
|
|
1019459
1019507
|
}
|
|
1019460
|
-
async function downloadAndDecryptBuffer(encryptedQueryParam, aesKeyBase64, cdnBaseUrl,
|
|
1019461
|
-
const key = parseAesKey(aesKeyBase64,
|
|
1019508
|
+
async function downloadAndDecryptBuffer(encryptedQueryParam, aesKeyBase64, cdnBaseUrl, label2, fullUrl) {
|
|
1019509
|
+
const key = parseAesKey(aesKeyBase64, label2);
|
|
1019462
1019510
|
let url2;
|
|
1019463
1019511
|
if (fullUrl) {
|
|
1019464
1019512
|
url2 = fullUrl;
|
|
1019465
1019513
|
} else if (ENABLE_CDN_URL_FALLBACK) {
|
|
1019466
1019514
|
url2 = buildCdnDownloadUrl(encryptedQueryParam, cdnBaseUrl);
|
|
1019467
1019515
|
} else {
|
|
1019468
|
-
throw new Error(`${
|
|
1019516
|
+
throw new Error(`${label2}: fullUrl is required (CDN URL fallback is disabled)`);
|
|
1019469
1019517
|
}
|
|
1019470
|
-
logger8.debug(`${
|
|
1019471
|
-
const encrypted = await fetchCdnBytes(url2,
|
|
1019472
|
-
logger8.debug(`${
|
|
1019518
|
+
logger8.debug(`${label2}: fetching url=${url2}`);
|
|
1019519
|
+
const encrypted = await fetchCdnBytes(url2, label2);
|
|
1019520
|
+
logger8.debug(`${label2}: downloaded ${encrypted.byteLength} bytes, decrypting`);
|
|
1019473
1019521
|
const decrypted = decryptAesEcb(encrypted, key);
|
|
1019474
|
-
logger8.debug(`${
|
|
1019522
|
+
logger8.debug(`${label2}: decrypted ${decrypted.length} bytes`);
|
|
1019475
1019523
|
return decrypted;
|
|
1019476
1019524
|
}
|
|
1019477
|
-
async function downloadPlainCdnBuffer(encryptedQueryParam, cdnBaseUrl,
|
|
1019525
|
+
async function downloadPlainCdnBuffer(encryptedQueryParam, cdnBaseUrl, label2, fullUrl) {
|
|
1019478
1019526
|
let url2;
|
|
1019479
1019527
|
if (fullUrl) {
|
|
1019480
1019528
|
url2 = fullUrl;
|
|
1019481
1019529
|
} else if (ENABLE_CDN_URL_FALLBACK) {
|
|
1019482
1019530
|
url2 = buildCdnDownloadUrl(encryptedQueryParam, cdnBaseUrl);
|
|
1019483
1019531
|
} else {
|
|
1019484
|
-
throw new Error(`${
|
|
1019532
|
+
throw new Error(`${label2}: fullUrl is required (CDN URL fallback is disabled)`);
|
|
1019485
1019533
|
}
|
|
1019486
|
-
logger8.debug(`${
|
|
1019487
|
-
return fetchCdnBytes(url2,
|
|
1019534
|
+
logger8.debug(`${label2}: fetching url=${url2}`);
|
|
1019535
|
+
return fetchCdnBytes(url2, label2);
|
|
1019488
1019536
|
}
|
|
1019489
1019537
|
var init_pic_decrypt = __esm({
|
|
1019490
1019538
|
"node_modules/.pnpm/@tencent-weixin+openclaw-weixin@2.4.3/node_modules/@tencent-weixin/openclaw-weixin/src/cdn/pic-decrypt.ts"() {
|
|
@@ -1019555,34 +1019603,34 @@ var init_silk_transcode = __esm({
|
|
|
1019555
1019603
|
|
|
1019556
1019604
|
// node_modules/.pnpm/@tencent-weixin+openclaw-weixin@2.4.3/node_modules/@tencent-weixin/openclaw-weixin/src/media/media-download.ts
|
|
1019557
1019605
|
async function downloadMediaFromItem(item, deps) {
|
|
1019558
|
-
const { cdnBaseUrl, saveMedia, log, errLog, label } = deps;
|
|
1019606
|
+
const { cdnBaseUrl, saveMedia, log, errLog, label: label2 } = deps;
|
|
1019559
1019607
|
const result = {};
|
|
1019560
1019608
|
if (item.type === MessageItemType.IMAGE) {
|
|
1019561
1019609
|
const img = item.image_item;
|
|
1019562
1019610
|
if (!img?.media?.encrypt_query_param && !img?.media?.full_url) return result;
|
|
1019563
1019611
|
const aesKeyBase64 = img.aeskey ? Buffer.from(img.aeskey, "hex").toString("base64") : img.media.aes_key;
|
|
1019564
1019612
|
logger8.debug(
|
|
1019565
|
-
`${
|
|
1019613
|
+
`${label2} image: encrypt_query_param=${(img.media.encrypt_query_param ?? "").slice(0, 40)}... hasAesKey=${Boolean(aesKeyBase64)} aeskeySource=${img.aeskey ? "image_item.aeskey" : "media.aes_key"} full_url=${Boolean(img.media.full_url)}`
|
|
1019566
1019614
|
);
|
|
1019567
1019615
|
try {
|
|
1019568
1019616
|
const buf = aesKeyBase64 ? await downloadAndDecryptBuffer(
|
|
1019569
1019617
|
img.media.encrypt_query_param ?? "",
|
|
1019570
1019618
|
aesKeyBase64,
|
|
1019571
1019619
|
cdnBaseUrl,
|
|
1019572
|
-
`${
|
|
1019620
|
+
`${label2} image`,
|
|
1019573
1019621
|
img.media.full_url
|
|
1019574
1019622
|
) : await downloadPlainCdnBuffer(
|
|
1019575
1019623
|
img.media.encrypt_query_param ?? "",
|
|
1019576
1019624
|
cdnBaseUrl,
|
|
1019577
|
-
`${
|
|
1019625
|
+
`${label2} image-plain`,
|
|
1019578
1019626
|
img.media.full_url
|
|
1019579
1019627
|
);
|
|
1019580
1019628
|
const saved = await saveMedia(buf, void 0, "inbound", WEIXIN_MEDIA_MAX_BYTES);
|
|
1019581
1019629
|
result.decryptedPicPath = saved.path;
|
|
1019582
|
-
logger8.debug(`${
|
|
1019630
|
+
logger8.debug(`${label2} image saved: ${saved.path}`);
|
|
1019583
1019631
|
} catch (err7) {
|
|
1019584
|
-
logger8.error(`${
|
|
1019585
|
-
errLog(`weixin ${
|
|
1019632
|
+
logger8.error(`${label2} image download/decrypt failed: ${String(err7)}`);
|
|
1019633
|
+
errLog(`weixin ${label2} image download/decrypt failed: ${String(err7)}`);
|
|
1019586
1019634
|
}
|
|
1019587
1019635
|
} else if (item.type === MessageItemType.VOICE) {
|
|
1019588
1019636
|
const voice = item.voice_item;
|
|
@@ -1019593,25 +1019641,25 @@ async function downloadMediaFromItem(item, deps) {
|
|
|
1019593
1019641
|
voice.media.encrypt_query_param ?? "",
|
|
1019594
1019642
|
voice.media.aes_key,
|
|
1019595
1019643
|
cdnBaseUrl,
|
|
1019596
|
-
`${
|
|
1019644
|
+
`${label2} voice`,
|
|
1019597
1019645
|
voice.media.full_url
|
|
1019598
1019646
|
);
|
|
1019599
|
-
logger8.debug(`${
|
|
1019647
|
+
logger8.debug(`${label2} voice: decrypted ${silkBuf.length} bytes, attempting silk transcode`);
|
|
1019600
1019648
|
const wavBuf = await silkToWav(silkBuf);
|
|
1019601
1019649
|
if (wavBuf) {
|
|
1019602
1019650
|
const saved = await saveMedia(wavBuf, "audio/wav", "inbound", WEIXIN_MEDIA_MAX_BYTES);
|
|
1019603
1019651
|
result.decryptedVoicePath = saved.path;
|
|
1019604
1019652
|
result.voiceMediaType = "audio/wav";
|
|
1019605
|
-
logger8.debug(`${
|
|
1019653
|
+
logger8.debug(`${label2} voice: saved WAV to ${saved.path}`);
|
|
1019606
1019654
|
} else {
|
|
1019607
1019655
|
const saved = await saveMedia(silkBuf, "audio/silk", "inbound", WEIXIN_MEDIA_MAX_BYTES);
|
|
1019608
1019656
|
result.decryptedVoicePath = saved.path;
|
|
1019609
1019657
|
result.voiceMediaType = "audio/silk";
|
|
1019610
|
-
logger8.debug(`${
|
|
1019658
|
+
logger8.debug(`${label2} voice: silk transcode unavailable, saved raw SILK to ${saved.path}`);
|
|
1019611
1019659
|
}
|
|
1019612
1019660
|
} catch (err7) {
|
|
1019613
|
-
logger8.error(`${
|
|
1019614
|
-
errLog(`weixin ${
|
|
1019661
|
+
logger8.error(`${label2} voice download/transcode failed: ${String(err7)}`);
|
|
1019662
|
+
errLog(`weixin ${label2} voice download/transcode failed: ${String(err7)}`);
|
|
1019615
1019663
|
}
|
|
1019616
1019664
|
} else if (item.type === MessageItemType.FILE) {
|
|
1019617
1019665
|
const fileItem = item.file_item;
|
|
@@ -1019622,7 +1019670,7 @@ async function downloadMediaFromItem(item, deps) {
|
|
|
1019622
1019670
|
fileItem.media.encrypt_query_param ?? "",
|
|
1019623
1019671
|
fileItem.media.aes_key,
|
|
1019624
1019672
|
cdnBaseUrl,
|
|
1019625
|
-
`${
|
|
1019673
|
+
`${label2} file`,
|
|
1019626
1019674
|
fileItem.media.full_url
|
|
1019627
1019675
|
);
|
|
1019628
1019676
|
const mime = getMimeFromFilename(fileItem.file_name ?? "file.bin");
|
|
@@ -1019635,10 +1019683,10 @@ async function downloadMediaFromItem(item, deps) {
|
|
|
1019635
1019683
|
);
|
|
1019636
1019684
|
result.decryptedFilePath = saved.path;
|
|
1019637
1019685
|
result.fileMediaType = mime;
|
|
1019638
|
-
logger8.debug(`${
|
|
1019686
|
+
logger8.debug(`${label2} file: saved to ${saved.path} mime=${mime}`);
|
|
1019639
1019687
|
} catch (err7) {
|
|
1019640
|
-
logger8.error(`${
|
|
1019641
|
-
errLog(`weixin ${
|
|
1019688
|
+
logger8.error(`${label2} file download failed: ${String(err7)}`);
|
|
1019689
|
+
errLog(`weixin ${label2} file download failed: ${String(err7)}`);
|
|
1019642
1019690
|
}
|
|
1019643
1019691
|
} else if (item.type === MessageItemType.VIDEO) {
|
|
1019644
1019692
|
const videoItem = item.video_item;
|
|
@@ -1019649,15 +1019697,15 @@ async function downloadMediaFromItem(item, deps) {
|
|
|
1019649
1019697
|
videoItem.media.encrypt_query_param ?? "",
|
|
1019650
1019698
|
videoItem.media.aes_key,
|
|
1019651
1019699
|
cdnBaseUrl,
|
|
1019652
|
-
`${
|
|
1019700
|
+
`${label2} video`,
|
|
1019653
1019701
|
videoItem.media.full_url
|
|
1019654
1019702
|
);
|
|
1019655
1019703
|
const saved = await saveMedia(buf, "video/mp4", "inbound", WEIXIN_MEDIA_MAX_BYTES);
|
|
1019656
1019704
|
result.decryptedVideoPath = saved.path;
|
|
1019657
|
-
logger8.debug(`${
|
|
1019705
|
+
logger8.debug(`${label2} video: saved to ${saved.path}`);
|
|
1019658
1019706
|
} catch (err7) {
|
|
1019659
|
-
logger8.error(`${
|
|
1019660
|
-
errLog(`weixin ${
|
|
1019707
|
+
logger8.error(`${label2} video download failed: ${String(err7)}`);
|
|
1019708
|
+
errLog(`weixin ${label2} video download failed: ${String(err7)}`);
|
|
1019661
1019709
|
}
|
|
1019662
1019710
|
}
|
|
1019663
1019711
|
return result;
|
|
@@ -1020122,7 +1020170,7 @@ async function sendMessageWeixin(params) {
|
|
|
1020122
1020170
|
return { messageId: clientId };
|
|
1020123
1020171
|
}
|
|
1020124
1020172
|
async function sendMediaItems(params) {
|
|
1020125
|
-
const { to, text, mediaItem, opts, label } = params;
|
|
1020173
|
+
const { to, text, mediaItem, opts, label: label2 } = params;
|
|
1020126
1020174
|
const items = [];
|
|
1020127
1020175
|
if (text) {
|
|
1020128
1020176
|
items.push({ type: MessageItemType.TEXT, text_item: { text } });
|
|
@@ -1020151,12 +1020199,12 @@ async function sendMediaItems(params) {
|
|
|
1020151
1020199
|
});
|
|
1020152
1020200
|
} catch (err7) {
|
|
1020153
1020201
|
logger8.error(
|
|
1020154
|
-
`${
|
|
1020202
|
+
`${label2}: failed to=${to} clientId=${lastClientId} err=${String(err7)}`
|
|
1020155
1020203
|
);
|
|
1020156
1020204
|
throw err7;
|
|
1020157
1020205
|
}
|
|
1020158
1020206
|
}
|
|
1020159
|
-
logger8.info(`${
|
|
1020207
|
+
logger8.info(`${label2}: success to=${to} clientId=${lastClientId}`);
|
|
1020160
1020208
|
return { messageId: lastClientId };
|
|
1020161
1020209
|
}
|
|
1020162
1020210
|
async function sendImageMessageWeixin(params) {
|
|
@@ -1022017,10 +1022065,10 @@ var require_main4 = __commonJS({
|
|
|
1022017
1022065
|
var toCell = function(isBlack) {
|
|
1022018
1022066
|
return isBlack ? black : white;
|
|
1022019
1022067
|
};
|
|
1022020
|
-
var repeat = function(
|
|
1022068
|
+
var repeat = function(color3) {
|
|
1022021
1022069
|
return {
|
|
1022022
1022070
|
times: function(count) {
|
|
1022023
|
-
return new Array(count).join(
|
|
1022071
|
+
return new Array(count).join(color3);
|
|
1022024
1022072
|
}
|
|
1022025
1022073
|
};
|
|
1022026
1022074
|
};
|
|
@@ -1026699,12 +1026747,12 @@ var require_format_normaliser = __commonJS({
|
|
|
1026699
1026747
|
let pxPos = 0;
|
|
1026700
1026748
|
for (let y12 = 0; y12 < height; y12++) {
|
|
1026701
1026749
|
for (let x14 = 0; x14 < width; x14++) {
|
|
1026702
|
-
let
|
|
1026703
|
-
if (!
|
|
1026750
|
+
let color3 = palette[indata[pxPos]];
|
|
1026751
|
+
if (!color3) {
|
|
1026704
1026752
|
throw new Error("index " + indata[pxPos] + " not in palette");
|
|
1026705
1026753
|
}
|
|
1026706
1026754
|
for (let i12 = 0; i12 < 4; i12++) {
|
|
1026707
|
-
outdata[pxPos + i12] =
|
|
1026755
|
+
outdata[pxPos + i12] = color3[i12];
|
|
1026708
1026756
|
}
|
|
1026709
1026757
|
pxPos += 4;
|
|
1026710
1026758
|
}
|
|
@@ -1028133,9 +1028181,9 @@ var require_terminal2 = __commonJS({
|
|
|
1028133
1028181
|
var require_svg_tag = __commonJS({
|
|
1028134
1028182
|
"node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js"(exports2) {
|
|
1028135
1028183
|
var Utils = require_utils12();
|
|
1028136
|
-
function getColorAttrib(
|
|
1028137
|
-
const alpha =
|
|
1028138
|
-
const str3 = attrib + '="' +
|
|
1028184
|
+
function getColorAttrib(color3, attrib) {
|
|
1028185
|
+
const alpha = color3.a / 255;
|
|
1028186
|
+
const str3 = attrib + '="' + color3.hex + '"';
|
|
1028139
1028187
|
return alpha < 1 ? str3 + " " + attrib + '-opacity="' + alpha.toFixed(2).slice(1) + '"' : str3;
|
|
1028140
1028188
|
}
|
|
1028141
1028189
|
function svgCmd(cmd, x14, y12) {
|
|
@@ -1028588,7 +1028636,7 @@ function formatReport(grand, dateLabel, prevCounts, prevTotal, prevTime) {
|
|
|
1028588
1028636
|
L9.push("");
|
|
1028589
1028637
|
for (const cat of catOrder) {
|
|
1028590
1028638
|
const items = byCat.get(cat) ?? [];
|
|
1028591
|
-
const [emoji3,
|
|
1028639
|
+
const [emoji3, label2] = CAT_INFO[cat] ?? ["\u{1F4E6}", cat.charAt(0).toUpperCase() + cat.slice(1)];
|
|
1028592
1028640
|
const catTotal = items.reduce((s11, [, v15]) => s11 + v15, 0);
|
|
1028593
1028641
|
const pct2 = (catTotal / total * 100).toFixed(0);
|
|
1028594
1028642
|
const prevCatTotal = items.reduce((s11, [n6]) => s11 + (prevCounts[n6] ?? 0), 0);
|
|
@@ -1028597,7 +1028645,7 @@ function formatReport(grand, dateLabel, prevCounts, prevTotal, prevTime) {
|
|
|
1028597
1028645
|
if (hasPrev && catDiff !== 0) {
|
|
1028598
1028646
|
catDelta = catDiff > 0 ? ` +${catDiff}` : ` ${catDiff}`;
|
|
1028599
1028647
|
}
|
|
1028600
|
-
L9.push(`${emoji3} ${
|
|
1028648
|
+
L9.push(`${emoji3} ${label2} \u2014 ${catTotal} (${pct2}%)${catDelta}`);
|
|
1028601
1028649
|
const sorted = [...items].sort((a11, b12) => b12[1] - a11[1]);
|
|
1028602
1028650
|
for (const [name, cnt] of sorted) {
|
|
1028603
1028651
|
const b12 = bar(cnt, mx);
|
|
@@ -1033996,14 +1034044,14 @@ async function processCycles(cycles, sdkTurnIndex, hasTranscript, sidecarIndex,
|
|
|
1033996
1034044
|
}
|
|
1033997
1034045
|
return { records, matched, unmatched, recoveryStats };
|
|
1033998
1034046
|
}
|
|
1033999
|
-
function printRecordStats(
|
|
1034047
|
+
function printRecordStats(label2, records, matched, unmatched, hasTranscript, filterStats) {
|
|
1034000
1034048
|
if (records.length === 0 && filterStats.input === 0)
|
|
1034001
1034049
|
return;
|
|
1034002
1034050
|
const totalTraj = records.reduce((sum, r12) => sum + r12.trajectory.length, 0);
|
|
1034003
1034051
|
const withPrompts = records.filter((r12) => r12.prompt !== "heartbeat").length;
|
|
1034004
1034052
|
const withInterrupts = records.filter((r12) => r12.has_interrupts).length;
|
|
1034005
1034053
|
console.log(`
|
|
1034006
|
-
${
|
|
1034054
|
+
${label2}:`);
|
|
1034007
1034055
|
console.log(` Records: ${records.length}`);
|
|
1034008
1034056
|
if (filterStats.compactionOnly > 0) {
|
|
1034009
1034057
|
console.log(` Compaction-only (filtered): ${filterStats.compactionOnly}`);
|
|
@@ -1034971,15 +1035019,15 @@ async function gunzipFile(gzPath) {
|
|
|
1034971
1035019
|
await (0, import_promises27.pipeline)(input, (0, import_node_zlib7.createGunzip)(), output2);
|
|
1034972
1035020
|
import_node_fs83.default.unlinkSync(gzPath);
|
|
1034973
1035021
|
}
|
|
1034974
|
-
async function gunzipDir(dir,
|
|
1035022
|
+
async function gunzipDir(dir, label2) {
|
|
1034975
1035023
|
for (const entry of import_node_fs83.default.readdirSync(dir, { withFileTypes: true })) {
|
|
1034976
1035024
|
if (entry.isFile() && entry.name.endsWith(".jsonl.gz")) {
|
|
1034977
|
-
console.log(` GUNZIP ${entry.name}${
|
|
1035025
|
+
console.log(` GUNZIP ${entry.name}${label2 ? ` in ${label2}` : ""}`);
|
|
1034978
1035026
|
await gunzipFile(import_node_path82.default.join(dir, entry.name));
|
|
1034979
1035027
|
}
|
|
1034980
1035028
|
if (entry.isDirectory()) {
|
|
1034981
1035029
|
const subDir = import_node_path82.default.join(dir, entry.name);
|
|
1034982
|
-
await gunzipDir(subDir, `${
|
|
1035030
|
+
await gunzipDir(subDir, `${label2 ? label2 + "/" : ""}${entry.name}`);
|
|
1034983
1035031
|
}
|
|
1034984
1035032
|
}
|
|
1034985
1035033
|
}
|
|
@@ -1035009,8 +1035057,8 @@ async function extractAgent(baseDir, agent, force) {
|
|
|
1035009
1035057
|
console.log(` SKIP ${folder}/ (already extracted)`);
|
|
1035010
1035058
|
stats.skipped++;
|
|
1035011
1035059
|
} else {
|
|
1035012
|
-
const
|
|
1035013
|
-
console.log(` ${
|
|
1035060
|
+
const label2 = hasExtractedFiles(folderPath) ? "RE-EXTRACT" : "EXTRACT";
|
|
1035061
|
+
console.log(` ${label2} ${file2} -> ${folder}/`);
|
|
1035014
1035062
|
(0, import_node_child_process35.execSync)(`tar xzf "${archivePath}" -C "${folderPath}/"`, {
|
|
1035015
1035063
|
stdio: "pipe"
|
|
1035016
1035064
|
});
|
|
@@ -1035144,23 +1035192,23 @@ function resolveCliEntry() {
|
|
|
1035144
1035192
|
function resolveProjectRoot() {
|
|
1035145
1035193
|
return import_node_path83.default.resolve(import_node_path83.default.dirname(new URL(__importMetaUrl).pathname), "../..");
|
|
1035146
1035194
|
}
|
|
1035147
|
-
function processDir(dataDir,
|
|
1035195
|
+
function processDir(dataDir, label2, options3) {
|
|
1035148
1035196
|
const logsDir = import_node_path83.default.join(dataDir, "logs");
|
|
1035149
1035197
|
if (!hasExtractedLogs(logsDir)) {
|
|
1035150
|
-
console.log(`SKIP: ${
|
|
1035151
|
-
return { label, status: "skipped", reason: "no logs" };
|
|
1035198
|
+
console.log(`SKIP: ${label2} (no extracted logs \u2014 run extract-data first)`);
|
|
1035199
|
+
return { label: label2, status: "skipped", reason: "no logs" };
|
|
1035152
1035200
|
}
|
|
1035153
1035201
|
const outputDir = import_node_path83.default.join(dataDir, "output");
|
|
1035154
1035202
|
if (import_node_fs84.default.existsSync(outputDir) && !options3.force) {
|
|
1035155
|
-
console.log(`SKIP: ${
|
|
1035156
|
-
return { label, status: "skipped", reason: "output exists" };
|
|
1035203
|
+
console.log(`SKIP: ${label2} (output/ exists, use --force to re-process)`);
|
|
1035204
|
+
return { label: label2, status: "skipped", reason: "output exists" };
|
|
1035157
1035205
|
}
|
|
1035158
1035206
|
if (import_node_fs84.default.existsSync(outputDir) && options3.force) {
|
|
1035159
1035207
|
import_node_fs84.default.rmSync(outputDir, { recursive: true, force: true });
|
|
1035160
1035208
|
}
|
|
1035161
1035209
|
console.log("");
|
|
1035162
1035210
|
console.log("==========================================");
|
|
1035163
|
-
console.log(`Processing: ${
|
|
1035211
|
+
console.log(`Processing: ${label2}`);
|
|
1035164
1035212
|
console.log("==========================================");
|
|
1035165
1035213
|
try {
|
|
1035166
1035214
|
const sinceArg = options3.since ? ` --since ${options3.since}` : "";
|
|
@@ -1035200,10 +1035248,10 @@ function processDir(dataDir, label, options3) {
|
|
|
1035200
1035248
|
} else {
|
|
1035201
1035249
|
console.log(" SKIP convert-openai-chat (no system-prompt.md)");
|
|
1035202
1035250
|
}
|
|
1035203
|
-
return { label, status: "succeeded" };
|
|
1035251
|
+
return { label: label2, status: "succeeded" };
|
|
1035204
1035252
|
} catch (err7) {
|
|
1035205
|
-
console.error(`FAILED: ${
|
|
1035206
|
-
return { label, status: "failed" };
|
|
1035253
|
+
console.error(`FAILED: ${label2} \u2014 ${err7 instanceof Error ? err7.message : String(err7)}`);
|
|
1035254
|
+
return { label: label2, status: "failed" };
|
|
1035207
1035255
|
}
|
|
1035208
1035256
|
}
|
|
1035209
1035257
|
function parseBatchProcessArgs(args) {
|
|
@@ -1035646,14 +1035694,14 @@ function convertSubAgentTranscript(transcriptPath, parentUid, subagentIndex, des
|
|
|
1035646
1035694
|
}
|
|
1035647
1035695
|
}
|
|
1035648
1035696
|
const lastMsg = chatMessages[chatMessages.length - 1];
|
|
1035649
|
-
const
|
|
1035697
|
+
const success3 = lastMsg.role === "assistant" && !!lastMsg.content;
|
|
1035650
1035698
|
return {
|
|
1035651
1035699
|
uid: (0, import_node_crypto21.randomUUID)(),
|
|
1035652
1035700
|
agent_type: "subagent",
|
|
1035653
1035701
|
subagent_index: subagentIndex,
|
|
1035654
1035702
|
parent_uid: parentUid,
|
|
1035655
1035703
|
prompt: description,
|
|
1035656
|
-
success:
|
|
1035704
|
+
success: success3,
|
|
1035657
1035705
|
messages: chatMessages
|
|
1035658
1035706
|
};
|
|
1035659
1035707
|
}
|
|
@@ -1038475,8 +1038523,8 @@ function redactRealtimeToolPayload(toolName, value) {
|
|
|
1038475
1038523
|
}
|
|
1038476
1038524
|
async function manageCalendar(config2, args) {
|
|
1038477
1038525
|
const cal = getCalendarClient(config2);
|
|
1038478
|
-
const
|
|
1038479
|
-
switch (
|
|
1038526
|
+
const action2 = args.action ?? "list_events";
|
|
1038527
|
+
switch (action2) {
|
|
1038480
1038528
|
case "list_events": {
|
|
1038481
1038529
|
const timeMin = args.start ? requireIsoDateTime(args.start, "start") : /* @__PURE__ */ new Date();
|
|
1038482
1038530
|
const timeMax = args.end ? requireIsoDateTime(args.end, "end") : new Date(timeMin.getTime() + 7 * 864e5);
|
|
@@ -1038536,13 +1038584,13 @@ async function manageCalendar(config2, args) {
|
|
|
1038536
1038584
|
return (await cal.findFreeTime(timeMin, timeMax)).slice(0, clampInt(args.max_results, 1, 10, 5));
|
|
1038537
1038585
|
}
|
|
1038538
1038586
|
default:
|
|
1038539
|
-
return { error: `Unknown calendar action: ${
|
|
1038587
|
+
return { error: `Unknown calendar action: ${action2}` };
|
|
1038540
1038588
|
}
|
|
1038541
1038589
|
}
|
|
1038542
1038590
|
async function manageEmail(config2, args) {
|
|
1038543
1038591
|
const email3 = getEmailClient(config2);
|
|
1038544
|
-
const
|
|
1038545
|
-
switch (
|
|
1038592
|
+
const action2 = args.action ?? "list";
|
|
1038593
|
+
switch (action2) {
|
|
1038546
1038594
|
case "list": {
|
|
1038547
1038595
|
const maxResults = clampInt(args.num, 1, 10, 5);
|
|
1038548
1038596
|
const messages2 = await email3.listEmails({ label: "INBOX", unreadOnly: args.unread_only ?? false, maxResults });
|
|
@@ -1038555,7 +1038603,7 @@ async function manageEmail(config2, args) {
|
|
|
1038555
1038603
|
return { sent: true, messageId: result.id, to: args.to, subject: args.subject };
|
|
1038556
1038604
|
}
|
|
1038557
1038605
|
default:
|
|
1038558
|
-
return { error: `Unknown email action: ${
|
|
1038606
|
+
return { error: `Unknown email action: ${action2}` };
|
|
1038559
1038607
|
}
|
|
1038560
1038608
|
}
|
|
1038561
1038609
|
function memory(args) {
|
|
@@ -1044581,18 +1044629,18 @@ function extractUsageFromStream(stream) {
|
|
|
1044581
1044629
|
}
|
|
1044582
1044630
|
function buildResultMessage(stream, config2) {
|
|
1044583
1044631
|
const usage = stream.rawResponses?.at(-1)?.usage;
|
|
1044584
|
-
const
|
|
1044632
|
+
const errorText2 = stream.error instanceof Error ? stream.error.message : stream.error ? JSON.stringify(stream.error) : "";
|
|
1044585
1044633
|
return {
|
|
1044586
1044634
|
type: "result",
|
|
1044587
|
-
subtype:
|
|
1044635
|
+
subtype: errorText2 ? "error" : "success",
|
|
1044588
1044636
|
num_turns: 1,
|
|
1044589
1044637
|
usage: {
|
|
1044590
1044638
|
input_tokens: usage?.inputTokens ?? 0,
|
|
1044591
1044639
|
output_tokens: usage?.outputTokens ?? 0
|
|
1044592
1044640
|
},
|
|
1044593
1044641
|
total_cost_usd: 0,
|
|
1044594
|
-
is_error: Boolean(
|
|
1044595
|
-
errors:
|
|
1044642
|
+
is_error: Boolean(errorText2),
|
|
1044643
|
+
errors: errorText2 ? [errorText2] : [],
|
|
1044596
1044644
|
model: getModelId(config2)
|
|
1044597
1044645
|
};
|
|
1044598
1044646
|
}
|
|
@@ -1045457,11 +1045505,11 @@ var ActivityTracker = class {
|
|
|
1045457
1045505
|
* see the parent Task block; callers should always `recordSubagentStarted`
|
|
1045458
1045506
|
* first when possible.
|
|
1045459
1045507
|
*/
|
|
1045460
|
-
recordSubagentActivity(toolUseId,
|
|
1045508
|
+
recordSubagentActivity(toolUseId, label2) {
|
|
1045461
1045509
|
const entry = this.subagents.get(toolUseId);
|
|
1045462
1045510
|
if (entry?.status !== "running")
|
|
1045463
1045511
|
return;
|
|
1045464
|
-
const truncated =
|
|
1045512
|
+
const truncated = label2.length > SUBAGENT_ACTIVITY_LIMIT ? label2.substring(0, SUBAGENT_ACTIVITY_LIMIT) + "\u2026" : label2;
|
|
1045465
1045513
|
entry.lastActivity = truncated;
|
|
1045466
1045514
|
entry.actionCount += 1;
|
|
1045467
1045515
|
}
|
|
@@ -1045481,9 +1045529,9 @@ var ActivityTracker = class {
|
|
|
1045481
1045529
|
if (typeof info.toolUses === "number" && Number.isFinite(info.toolUses)) {
|
|
1045482
1045530
|
entry.actionCount = Math.max(entry.actionCount, info.toolUses);
|
|
1045483
1045531
|
}
|
|
1045484
|
-
const
|
|
1045485
|
-
if (
|
|
1045486
|
-
const truncated =
|
|
1045532
|
+
const label2 = info.lastToolName ?? info.description;
|
|
1045533
|
+
if (label2 && label2.length > 0) {
|
|
1045534
|
+
const truncated = label2.length > SUBAGENT_ACTIVITY_LIMIT ? label2.substring(0, SUBAGENT_ACTIVITY_LIMIT) + "\u2026" : label2;
|
|
1045487
1045535
|
entry.lastActivity = truncated;
|
|
1045488
1045536
|
}
|
|
1045489
1045537
|
}
|
|
@@ -1045587,8 +1045635,8 @@ var ActivityTracker = class {
|
|
|
1045587
1045635
|
lines.push("", "Recent conversation:");
|
|
1045588
1045636
|
for (const e11 of this.recentExchanges) {
|
|
1045589
1045637
|
const preview = e11.text.length > EXCHANGE_TEXT_LIMIT ? e11.text.substring(0, EXCHANGE_TEXT_LIMIT) + "\u2026" : e11.text;
|
|
1045590
|
-
const
|
|
1045591
|
-
lines.push(` ${
|
|
1045638
|
+
const label2 = e11.role === "user" ? "User" : "Agent";
|
|
1045639
|
+
lines.push(` ${label2}: ${preview}`);
|
|
1045592
1045640
|
}
|
|
1045593
1045641
|
}
|
|
1045594
1045642
|
if (this.streamingActivity) {
|
|
@@ -1045656,9 +1045704,9 @@ var ActivityTracker = class {
|
|
|
1045656
1045704
|
};
|
|
1045657
1045705
|
function formatSubagentLine(progress) {
|
|
1045658
1045706
|
const elapsedSec = Math.round(((progress.completedAt ?? Date.now()) - progress.startedAt) / 1e3);
|
|
1045659
|
-
const
|
|
1045707
|
+
const label2 = progress.subagentType ?? "subagent";
|
|
1045660
1045708
|
const statusIcon = progress.status === "running" ? "\u{1F504}" : progress.status === "completed" ? "\u2705" : "\u274C";
|
|
1045661
|
-
const parts = [`${statusIcon} ${
|
|
1045709
|
+
const parts = [`${statusIcon} ${label2}`];
|
|
1045662
1045710
|
parts.push(`(${elapsedSec}s, ${progress.actionCount} step${progress.actionCount === 1 ? "" : "s"})`);
|
|
1045663
1045711
|
if (progress.description) {
|
|
1045664
1045712
|
const desc = progress.description.length > 80 ? progress.description.substring(0, 80) + "\u2026" : progress.description;
|
|
@@ -1046736,10 +1046784,10 @@ async function transcribeVoiceMessages(messages2) {
|
|
|
1046736
1046784
|
for (const att of audioAttachments) {
|
|
1046737
1046785
|
tasks.push(transcribeAudioAttachment(att).then((transcript) => {
|
|
1046738
1046786
|
if (transcript) {
|
|
1046739
|
-
const
|
|
1046787
|
+
const label2 = msg.text ? `${msg.text}
|
|
1046740
1046788
|
|
|
1046741
1046789
|
[Voice message transcription]: ${transcript}` : `[Voice message transcription]: ${transcript}`;
|
|
1046742
|
-
msg.text =
|
|
1046790
|
+
msg.text = label2;
|
|
1046743
1046791
|
logger.log("info", "transcribe", `Transcribed voice message from ${msg.sender}`, {
|
|
1046744
1046792
|
channel: msg.channel,
|
|
1046745
1046793
|
sender: msg.sender,
|
|
@@ -1047723,8 +1047771,8 @@ function registerCommandHandlers(deps) {
|
|
|
1047723
1047771
|
channelManager.on("silent_mode_request", (req) => {
|
|
1047724
1047772
|
ownerConfig.silentCompaction = req.enabled;
|
|
1047725
1047773
|
saveOwnerConfig(ownerConfig);
|
|
1047726
|
-
const
|
|
1047727
|
-
logger.system(`Silent compaction mode set to ${
|
|
1047774
|
+
const label2 = req.enabled ? "on" : "off";
|
|
1047775
|
+
logger.system(`Silent compaction mode set to ${label2} by ${req.sender} via ${req.channel}`);
|
|
1047728
1047776
|
channelManager.sendMessage(req.channel, req.sender, req.enabled ? t11("cmd.silent.on", getLocale()) : t11("cmd.silent.off", getLocale())).catch((err7) => {
|
|
1047729
1047777
|
logger.warn(`Failed to send silent mode confirmation: ${err7 instanceof Error ? err7.message : String(err7)}`);
|
|
1047730
1047778
|
});
|
|
@@ -1047996,8 +1048044,8 @@ ${portal.portalUrl}`);
|
|
|
1047996
1048044
|
lines.push("");
|
|
1047997
1048045
|
lines.push(t11("cmd.tasks.recent_steps", getLocale()));
|
|
1047998
1048046
|
const last5 = recentActions.slice(-5);
|
|
1047999
|
-
for (const
|
|
1048000
|
-
lines.push(` ${
|
|
1048047
|
+
for (const action2 of last5) {
|
|
1048048
|
+
lines.push(` ${action2}`);
|
|
1048001
1048049
|
}
|
|
1048002
1048050
|
}
|
|
1048003
1048051
|
if (subagents.length > 0) {
|
|
@@ -1048786,9 +1048834,9 @@ function createUpgradeBetaHandler() {
|
|
|
1048786
1048834
|
}
|
|
1048787
1048835
|
function createUpgradeHandlerWithOptions(defaults2) {
|
|
1048788
1048836
|
return async (commandId, _payload) => {
|
|
1048789
|
-
const
|
|
1048837
|
+
const label2 = defaults2?.beta ? "upgrade-beta" : defaults2?.tag ? `upgrade-${defaults2.tag}` : "upgrade";
|
|
1048790
1048838
|
try {
|
|
1048791
|
-
logger.system(`[upgrade-handler] Received remote ${
|
|
1048839
|
+
logger.system(`[upgrade-handler] Received remote ${label2} command`);
|
|
1048792
1048840
|
const result = await performUpgrade(defaults2);
|
|
1048793
1048841
|
logger.system(`[upgrade-handler] ${result.message}`);
|
|
1048794
1048842
|
if (result.ok) {
|
|
@@ -1048800,7 +1048848,7 @@ function createUpgradeHandlerWithOptions(defaults2) {
|
|
|
1048800
1048848
|
};
|
|
1048801
1048849
|
} catch (err7) {
|
|
1048802
1048850
|
const errMsg = err7 instanceof Error ? err7.message : String(err7);
|
|
1048803
|
-
logger.err(`[upgrade-handler] ${
|
|
1048851
|
+
logger.err(`[upgrade-handler] ${label2} failed: ${errMsg}`);
|
|
1048804
1048852
|
return {
|
|
1048805
1048853
|
status: "failed",
|
|
1048806
1048854
|
result: JSON.stringify({ error: errMsg })
|
|
@@ -1050625,8 +1050673,8 @@ async function processAgentStream(queryStream, session, activityTracker, session
|
|
|
1050625
1050673
|
const evtType = evt.type;
|
|
1050626
1050674
|
if (evtType === "content_block_start") {
|
|
1050627
1050675
|
const cb2 = evt.content_block;
|
|
1050628
|
-
const
|
|
1050629
|
-
activityTracker.startStreamingBlock(
|
|
1050676
|
+
const label2 = cb2?.type === "tool_use" ? cb2.name ?? "tool_use" : cb2?.type ?? "content";
|
|
1050677
|
+
activityTracker.startStreamingBlock(label2);
|
|
1050630
1050678
|
} else if (evtType === "content_block_delta") {
|
|
1050631
1050679
|
const delta = evt.delta;
|
|
1050632
1050680
|
const chars = (delta?.text ?? delta?.partial_json ?? "").length;
|
|
@@ -1050939,16 +1050987,16 @@ var WakeCycleRunner = class {
|
|
|
1050939
1050987
|
lines.push("");
|
|
1050940
1050988
|
lines.push(`Completed (${completed.length}):`);
|
|
1050941
1050989
|
for (const s11 of completed) {
|
|
1050942
|
-
const
|
|
1050990
|
+
const label2 = s11.description ?? s11.subagentType ?? s11.toolUseId;
|
|
1050943
1050991
|
const icon = s11.status === "completed" ? "\u2705" : "\u274C";
|
|
1050944
|
-
lines.push(` ${icon} ${
|
|
1050992
|
+
lines.push(` ${icon} ${label2}`);
|
|
1050945
1050993
|
}
|
|
1050946
1050994
|
}
|
|
1050947
1050995
|
lines.push("");
|
|
1050948
1050996
|
lines.push(`Still running (${stillRunning.length}):`);
|
|
1050949
1050997
|
for (const s11 of stillRunning) {
|
|
1050950
|
-
const
|
|
1050951
|
-
lines.push(` \u23F3 ${
|
|
1050998
|
+
const label2 = s11.description ?? s11.subagentType ?? s11.toolUseId;
|
|
1050999
|
+
lines.push(` \u23F3 ${label2}`);
|
|
1050952
1051000
|
}
|
|
1050953
1051001
|
lines.push("");
|
|
1050954
1051002
|
lines.push("The results may still arrive. You can ask me to check and compile them later.");
|
|
@@ -1053691,10 +1053739,10 @@ function startInjectorProcess(binPath, onExit) {
|
|
|
1053691
1053739
|
});
|
|
1053692
1053740
|
return proc;
|
|
1053693
1053741
|
}
|
|
1053694
|
-
function killProcess(proc,
|
|
1053742
|
+
function killProcess(proc, label2) {
|
|
1053695
1053743
|
if (!proc)
|
|
1053696
1053744
|
return;
|
|
1053697
|
-
logger.debug(`Stopping ${
|
|
1053745
|
+
logger.debug(`Stopping ${label2}...`);
|
|
1053698
1053746
|
proc.stdin?.end();
|
|
1053699
1053747
|
proc.kill("SIGTERM");
|
|
1053700
1053748
|
}
|
|
@@ -1054084,18 +1054132,18 @@ var StreamManager = class _StreamManager {
|
|
|
1054084
1054132
|
handleAction(data2) {
|
|
1054085
1054133
|
if (data2.length < 2)
|
|
1054086
1054134
|
return;
|
|
1054087
|
-
const
|
|
1054088
|
-
if (!_StreamManager.VALID_ACTIONS.has(
|
|
1054089
|
-
logger.debug(`[rdp] Unknown action: ${
|
|
1054135
|
+
const action2 = data2.subarray(1).toString("utf-8");
|
|
1054136
|
+
if (!_StreamManager.VALID_ACTIONS.has(action2)) {
|
|
1054137
|
+
logger.debug(`[rdp] Unknown action: ${action2}`);
|
|
1054090
1054138
|
return;
|
|
1054091
1054139
|
}
|
|
1054092
|
-
logger.system(`[rdp] Action: ${
|
|
1054140
|
+
logger.system(`[rdp] Action: ${action2}`);
|
|
1054093
1054141
|
const stdin = this.injectorProc?.stdin;
|
|
1054094
1054142
|
if (!stdin?.writable) {
|
|
1054095
1054143
|
logger.err("[rdp] Cannot execute action: input-injector not running");
|
|
1054096
1054144
|
return;
|
|
1054097
1054145
|
}
|
|
1054098
|
-
stdin.write(`action ${
|
|
1054146
|
+
stdin.write(`action ${action2}
|
|
1054099
1054147
|
`);
|
|
1054100
1054148
|
}
|
|
1054101
1054149
|
// -------------------------------------------------------------------------
|