agent-yes 1.58.0 → 1.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{SUPPORTED_CLIS-Kash6b_w.js → SUPPORTED_CLIS-CJViBrBx.js} +14 -429
- package/dist/agent-yes.config-72EQj3_2.js +4 -0
- package/dist/{agent-yes.config-Dr2p5kBW.js → agent-yes.config-CQlMMPB9.js} +2 -2
- package/dist/cli.js +718 -17
- package/dist/index.js +2 -2
- package/dist/{logger-DH1Rx9HI.js → logger-Cff_cjTg.js} +3 -1
- package/package.json +6 -3
- package/ts/index.ts +9 -8
- package/dist/agent-yes.config-mJP0MKqV.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as __esmMin, c as __toESM, i as __commonJSMin, n as require_winston, o as __exportAll, s as __require, t as logger } from "./logger-
|
|
1
|
+
import { a as __esmMin, c as __toESM, i as __commonJSMin, n as require_winston, o as __exportAll, s as __require, t as logger } from "./logger-Cff_cjTg.js";
|
|
2
2
|
import { arch, platform } from "process";
|
|
3
3
|
import { execSync } from "child_process";
|
|
4
4
|
import { closeSync, existsSync, fsyncSync, mkdirSync, openSync } from "fs";
|
|
@@ -23,6 +23,7 @@ import { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWater
|
|
|
23
23
|
import { Buffer as Buffer$1 } from "node:buffer";
|
|
24
24
|
import { fromWritable } from "from-node-stream";
|
|
25
25
|
import { appendFile, mkdir as mkdir$1, readFile as readFile$1, readdir, rename, writeFile as writeFile$2 } from "fs/promises";
|
|
26
|
+
import { TerminalRenderStream } from "terminal-render";
|
|
26
27
|
import { lock } from "proper-lockfile";
|
|
27
28
|
|
|
28
29
|
//#region node_modules/is-plain-obj/index.js
|
|
@@ -622,8 +623,9 @@ const format = (open, close) => {
|
|
|
622
623
|
if (index === -1) return openCode + string + closeCode;
|
|
623
624
|
let result = openCode;
|
|
624
625
|
let lastIndex = 0;
|
|
626
|
+
const replaceCode = (close === 22 ? closeCode : "") + openCode;
|
|
625
627
|
while (index !== -1) {
|
|
626
|
-
result += string.slice(lastIndex, index) +
|
|
628
|
+
result += string.slice(lastIndex, index) + replaceCode;
|
|
627
629
|
lastIndex = index + closeCode.length;
|
|
628
630
|
index = string.indexOf(closeCode, lastIndex);
|
|
629
631
|
}
|
|
@@ -3156,7 +3158,7 @@ function prettyMilliseconds(milliseconds, options) {
|
|
|
3156
3158
|
add(Number(parsed.hours), "hour", "h");
|
|
3157
3159
|
}
|
|
3158
3160
|
add(Number(parsed.minutes), "minute", "m");
|
|
3159
|
-
if (!options.hideSeconds) if (options.separateMilliseconds || options.formatSubMilliseconds || !options.colonNotation && milliseconds < 1e3) {
|
|
3161
|
+
if (!options.hideSeconds) if (options.separateMilliseconds || options.formatSubMilliseconds || !options.colonNotation && milliseconds < 1e3 && !options.subSecondsAsDecimals) {
|
|
3160
3162
|
const seconds = Number(parsed.seconds);
|
|
3161
3163
|
const milliseconds = Number(parsed.milliseconds);
|
|
3162
3164
|
const microseconds = Number(parsed.microseconds);
|
|
@@ -8512,423 +8514,6 @@ function composers(stream) {
|
|
|
8512
8514
|
}
|
|
8513
8515
|
var src_default = sflow;
|
|
8514
8516
|
|
|
8515
|
-
//#endregion
|
|
8516
|
-
//#region node_modules/terminal-render/dist/index.js
|
|
8517
|
-
var TerminalTextRender = class {
|
|
8518
|
-
lines = [""];
|
|
8519
|
-
scrollback = [];
|
|
8520
|
-
cursorRow = 0;
|
|
8521
|
-
cursorCol = 0;
|
|
8522
|
-
savedCursorRow = 0;
|
|
8523
|
-
savedCursorCol = 0;
|
|
8524
|
-
isAtRestoredPosition = false;
|
|
8525
|
-
scrollTop = 0;
|
|
8526
|
-
scrollBottom = null;
|
|
8527
|
-
endedWithNewline = false;
|
|
8528
|
-
getCursorPosition() {
|
|
8529
|
-
return {
|
|
8530
|
-
row: this.cursorRow,
|
|
8531
|
-
col: this.cursorCol
|
|
8532
|
-
};
|
|
8533
|
-
}
|
|
8534
|
-
getScrollRegion() {
|
|
8535
|
-
return {
|
|
8536
|
-
top: this.scrollTop,
|
|
8537
|
-
bottom: this.scrollBottom
|
|
8538
|
-
};
|
|
8539
|
-
}
|
|
8540
|
-
write(data) {
|
|
8541
|
-
for (let i = 0; i < data.length; i++) {
|
|
8542
|
-
const char = data[i];
|
|
8543
|
-
switch (char) {
|
|
8544
|
-
case "\r":
|
|
8545
|
-
this.cursorCol = 0;
|
|
8546
|
-
break;
|
|
8547
|
-
case `
|
|
8548
|
-
`:
|
|
8549
|
-
this.endedWithNewline = true;
|
|
8550
|
-
if (this.scrollBottom !== null && this.cursorRow === this.getScrollBottomIndex()) {
|
|
8551
|
-
this.scrollUp(1);
|
|
8552
|
-
this.cursorCol = 0;
|
|
8553
|
-
this.ensureLine(this.cursorRow);
|
|
8554
|
-
} else {
|
|
8555
|
-
this.cursorRow++;
|
|
8556
|
-
this.cursorCol = 0;
|
|
8557
|
-
this.ensureLine(this.cursorRow);
|
|
8558
|
-
}
|
|
8559
|
-
break;
|
|
8560
|
-
case "\b":
|
|
8561
|
-
if (this.cursorCol > 0) this.cursorCol--;
|
|
8562
|
-
break;
|
|
8563
|
-
case " ":
|
|
8564
|
-
this.cursorCol = Math.floor((this.cursorCol + 8) / 8) * 8;
|
|
8565
|
-
break;
|
|
8566
|
-
default:
|
|
8567
|
-
if (char === "\x1B") {
|
|
8568
|
-
if (this.isEraseSequence(data, i)) i = this.handleEraseSequence(data, i) - 1;
|
|
8569
|
-
else if (i + 1 < data.length && data[i + 1] === "M") {
|
|
8570
|
-
if (this.cursorRow > this.scrollTop) this.cursorRow = Math.max(this.scrollTop, this.cursorRow - 1);
|
|
8571
|
-
else {
|
|
8572
|
-
this.scrollDown(1);
|
|
8573
|
-
this.cursorRow = this.scrollTop;
|
|
8574
|
-
}
|
|
8575
|
-
i++;
|
|
8576
|
-
} else if (i + 1 < data.length && data[i + 1] === "]") i = this.handleOscSequence(data, i) - 1;
|
|
8577
|
-
else if (i + 1 < data.length && data[i + 1] === "[") {
|
|
8578
|
-
const escapeStart = i;
|
|
8579
|
-
i += 2;
|
|
8580
|
-
let escapeEnd = i;
|
|
8581
|
-
while (escapeEnd < data.length && !/[a-zA-Z]/.test(data[escapeEnd])) escapeEnd++;
|
|
8582
|
-
if (escapeEnd < data.length) {
|
|
8583
|
-
const escapeCode = data.slice(escapeStart + 2, escapeEnd);
|
|
8584
|
-
const command = data[escapeEnd];
|
|
8585
|
-
this.handleAnsiEscape(escapeCode, command);
|
|
8586
|
-
i = escapeEnd;
|
|
8587
|
-
} else {
|
|
8588
|
-
const escapeCode = data.slice(escapeStart + 2);
|
|
8589
|
-
this.handleAnsiEscape(escapeCode, "");
|
|
8590
|
-
i = data.length - 1;
|
|
8591
|
-
}
|
|
8592
|
-
} else if (i + 1 < data.length && data[i + 1] === "c" && i + 2 >= data.length) {
|
|
8593
|
-
this.lines = [""];
|
|
8594
|
-
this.scrollback = [];
|
|
8595
|
-
this.cursorRow = 0;
|
|
8596
|
-
this.cursorCol = 0;
|
|
8597
|
-
this.savedCursorRow = 0;
|
|
8598
|
-
this.savedCursorCol = 0;
|
|
8599
|
-
this.scrollTop = 0;
|
|
8600
|
-
this.scrollBottom = null;
|
|
8601
|
-
i++;
|
|
8602
|
-
} else if (i + 1 < data.length && data[i + 1] === "?") {
|
|
8603
|
-
const escapeStart = i;
|
|
8604
|
-
i += 2;
|
|
8605
|
-
let escapeEnd = i;
|
|
8606
|
-
while (escapeEnd < data.length && !/[a-zA-Z]/.test(data[escapeEnd])) escapeEnd++;
|
|
8607
|
-
if (escapeEnd < data.length) {
|
|
8608
|
-
const escapeCode = data.slice(escapeStart + 2, escapeEnd);
|
|
8609
|
-
const command = data[escapeEnd];
|
|
8610
|
-
this.handleCsiQuestionSequence(escapeCode, command);
|
|
8611
|
-
i = escapeEnd;
|
|
8612
|
-
}
|
|
8613
|
-
} else if (i + 1 < data.length && data[i + 1] === ">") {
|
|
8614
|
-
const escapeStart = i;
|
|
8615
|
-
i += 2;
|
|
8616
|
-
let escapeEnd = i;
|
|
8617
|
-
while (escapeEnd < data.length && !/[a-zA-Z]/.test(data[escapeEnd])) escapeEnd++;
|
|
8618
|
-
if (escapeEnd < data.length) {
|
|
8619
|
-
const escapeCode = data.slice(escapeStart + 2, escapeEnd);
|
|
8620
|
-
const command = data[escapeEnd];
|
|
8621
|
-
this.handleCsiGreaterSequence(escapeCode, command);
|
|
8622
|
-
i = escapeEnd;
|
|
8623
|
-
}
|
|
8624
|
-
}
|
|
8625
|
-
} else {
|
|
8626
|
-
this.endedWithNewline = false;
|
|
8627
|
-
this.ensureLine(this.cursorRow);
|
|
8628
|
-
const line = this.lines[this.cursorRow];
|
|
8629
|
-
if (this.isAtRestoredPosition && this.cursorCol < line.length) {
|
|
8630
|
-
this.lines[this.cursorRow] = line.substring(0, this.cursorCol) + char + line.substring(this.cursorCol);
|
|
8631
|
-
this.isAtRestoredPosition = false;
|
|
8632
|
-
} else if (this.cursorCol >= line.length) this.lines[this.cursorRow] = line + " ".repeat(this.cursorCol - line.length) + char;
|
|
8633
|
-
else this.lines[this.cursorRow] = line.substring(0, this.cursorCol) + char + line.substring(this.cursorCol + 1);
|
|
8634
|
-
this.cursorCol++;
|
|
8635
|
-
}
|
|
8636
|
-
break;
|
|
8637
|
-
}
|
|
8638
|
-
}
|
|
8639
|
-
return this;
|
|
8640
|
-
}
|
|
8641
|
-
ensureLine(row) {
|
|
8642
|
-
while (this.lines.length <= row) this.lines.push("");
|
|
8643
|
-
}
|
|
8644
|
-
handleAnsiEscape(escapeCode, command) {
|
|
8645
|
-
switch (command) {
|
|
8646
|
-
case "":
|
|
8647
|
-
if (escapeCode === "6n") {} else if (escapeCode === "c") {}
|
|
8648
|
-
break;
|
|
8649
|
-
case "A": {
|
|
8650
|
-
const upLines = parseInt(escapeCode) || 1;
|
|
8651
|
-
this.cursorRow = Math.max(0, this.cursorRow - upLines);
|
|
8652
|
-
break;
|
|
8653
|
-
}
|
|
8654
|
-
case "B": {
|
|
8655
|
-
const downLines = parseInt(escapeCode) || 1;
|
|
8656
|
-
const originalRow = this.cursorRow;
|
|
8657
|
-
this.cursorRow += downLines;
|
|
8658
|
-
if (this.cursorRow > originalRow + 1) this.cursorCol = 0;
|
|
8659
|
-
this.ensureLine(this.cursorRow);
|
|
8660
|
-
break;
|
|
8661
|
-
}
|
|
8662
|
-
case "C":
|
|
8663
|
-
this.cursorCol += parseInt(escapeCode) || 1;
|
|
8664
|
-
break;
|
|
8665
|
-
case "D": {
|
|
8666
|
-
const backwardCols = parseInt(escapeCode) || 1;
|
|
8667
|
-
this.cursorCol = Math.max(0, this.cursorCol - backwardCols);
|
|
8668
|
-
break;
|
|
8669
|
-
}
|
|
8670
|
-
case "E":
|
|
8671
|
-
this.cursorRow += parseInt(escapeCode) || 1;
|
|
8672
|
-
this.cursorCol = 0;
|
|
8673
|
-
this.ensureLine(this.cursorRow);
|
|
8674
|
-
break;
|
|
8675
|
-
case "F": {
|
|
8676
|
-
const prevLines = parseInt(escapeCode) || 1;
|
|
8677
|
-
this.cursorRow = Math.max(0, this.cursorRow - prevLines);
|
|
8678
|
-
this.cursorCol = 0;
|
|
8679
|
-
break;
|
|
8680
|
-
}
|
|
8681
|
-
case "G":
|
|
8682
|
-
if (escapeCode === "") {
|
|
8683
|
-
const currentLine = this.lines[this.cursorRow] || "";
|
|
8684
|
-
if (this.cursorRow === 0 && this.lines.length === 1 && this.cursorCol === currentLine.length && currentLine.length > 0) this.cursorCol = Math.max(0, this.cursorCol - 1);
|
|
8685
|
-
else this.cursorCol = 0;
|
|
8686
|
-
} else {
|
|
8687
|
-
const col = parseInt(escapeCode) || 1;
|
|
8688
|
-
this.cursorCol = Math.max(0, col - 1);
|
|
8689
|
-
}
|
|
8690
|
-
break;
|
|
8691
|
-
case "H":
|
|
8692
|
-
case "f": {
|
|
8693
|
-
const parts = escapeCode.split(";");
|
|
8694
|
-
this.cursorRow = Math.max(0, (parseInt(parts[0]) || 1) - 1);
|
|
8695
|
-
this.cursorCol = Math.max(0, (parseInt(parts[1]) || 1) - 1);
|
|
8696
|
-
this.isAtRestoredPosition = false;
|
|
8697
|
-
this.ensureLine(this.cursorRow);
|
|
8698
|
-
break;
|
|
8699
|
-
}
|
|
8700
|
-
case "J":
|
|
8701
|
-
this.ensureLine(this.cursorRow);
|
|
8702
|
-
if (escapeCode === "2") {
|
|
8703
|
-
this.lines = [""];
|
|
8704
|
-
this.scrollback = [];
|
|
8705
|
-
this.cursorRow = 0;
|
|
8706
|
-
this.cursorCol = 0;
|
|
8707
|
-
this.scrollTop = 0;
|
|
8708
|
-
this.scrollBottom = null;
|
|
8709
|
-
} else if (escapeCode === "" || escapeCode === "0") {
|
|
8710
|
-
this.lines[this.cursorRow] = this.lines[this.cursorRow].substring(0, this.cursorCol);
|
|
8711
|
-
for (let row = this.cursorRow + 1; row < this.lines.length; row++) this.lines[row] = "";
|
|
8712
|
-
} else if (escapeCode === "1") {
|
|
8713
|
-
for (let row = 0; row < this.cursorRow; row++) this.lines[row] = "";
|
|
8714
|
-
this.lines[this.cursorRow] = this.lines[this.cursorRow].substring(this.cursorCol);
|
|
8715
|
-
}
|
|
8716
|
-
break;
|
|
8717
|
-
case "K":
|
|
8718
|
-
if (escapeCode === "" || escapeCode === "0") {
|
|
8719
|
-
this.ensureLine(this.cursorRow);
|
|
8720
|
-
this.lines[this.cursorRow] = this.lines[this.cursorRow].substring(0, this.cursorCol);
|
|
8721
|
-
} else if (escapeCode === "1") {
|
|
8722
|
-
this.ensureLine(this.cursorRow);
|
|
8723
|
-
this.lines[this.cursorRow] = " ".repeat(this.cursorCol) + this.lines[this.cursorRow].substring(this.cursorCol);
|
|
8724
|
-
} else if (escapeCode === "2") {
|
|
8725
|
-
this.ensureLine(this.cursorRow);
|
|
8726
|
-
this.lines[this.cursorRow] = "";
|
|
8727
|
-
}
|
|
8728
|
-
break;
|
|
8729
|
-
case "S": {
|
|
8730
|
-
const scrollCount = parseInt(escapeCode) || 1;
|
|
8731
|
-
this.scrollUp(scrollCount);
|
|
8732
|
-
break;
|
|
8733
|
-
}
|
|
8734
|
-
case "s":
|
|
8735
|
-
if (escapeCode === "") {
|
|
8736
|
-
this.savedCursorRow = this.cursorRow;
|
|
8737
|
-
this.savedCursorCol = this.cursorCol;
|
|
8738
|
-
}
|
|
8739
|
-
break;
|
|
8740
|
-
case "u":
|
|
8741
|
-
if (escapeCode === "") {
|
|
8742
|
-
this.cursorRow = this.savedCursorRow;
|
|
8743
|
-
this.cursorCol = this.savedCursorCol;
|
|
8744
|
-
this.isAtRestoredPosition = true;
|
|
8745
|
-
this.ensureLine(this.cursorRow);
|
|
8746
|
-
}
|
|
8747
|
-
break;
|
|
8748
|
-
case "r":
|
|
8749
|
-
if (escapeCode === "") {
|
|
8750
|
-
this.scrollTop = 0;
|
|
8751
|
-
this.scrollBottom = null;
|
|
8752
|
-
} else {
|
|
8753
|
-
const parts = escapeCode.split(";");
|
|
8754
|
-
const topParam = parseInt(parts[0] || "1", 10) || 1;
|
|
8755
|
-
const bottomParam = parts[1] ? parseInt(parts[1], 10) || topParam : null;
|
|
8756
|
-
const top = Math.max(0, topParam - 1);
|
|
8757
|
-
this.scrollTop = top;
|
|
8758
|
-
if (bottomParam === null) this.scrollBottom = null;
|
|
8759
|
-
else {
|
|
8760
|
-
const bottomInclusive = Math.max(top, bottomParam - 1);
|
|
8761
|
-
this.scrollBottom = bottomInclusive + 1;
|
|
8762
|
-
this.ensureLine(bottomInclusive);
|
|
8763
|
-
}
|
|
8764
|
-
}
|
|
8765
|
-
if (this.scrollBottom !== null) {
|
|
8766
|
-
const bottomIndex = this.getScrollBottomIndex();
|
|
8767
|
-
this.cursorRow = Math.min(Math.max(this.cursorRow, this.scrollTop), bottomIndex);
|
|
8768
|
-
}
|
|
8769
|
-
break;
|
|
8770
|
-
}
|
|
8771
|
-
}
|
|
8772
|
-
handleCsiQuestionSequence(escapeCode, command) {
|
|
8773
|
-
switch (command) {
|
|
8774
|
-
case "h": break;
|
|
8775
|
-
case "l": break;
|
|
8776
|
-
case "u": break;
|
|
8777
|
-
default: break;
|
|
8778
|
-
}
|
|
8779
|
-
}
|
|
8780
|
-
handleCsiGreaterSequence(escapeCode, command) {
|
|
8781
|
-
switch (command) {
|
|
8782
|
-
case "u": break;
|
|
8783
|
-
default: break;
|
|
8784
|
-
}
|
|
8785
|
-
}
|
|
8786
|
-
render() {
|
|
8787
|
-
const trimmedLines = [...[...this.scrollback, ...this.lines]];
|
|
8788
|
-
while (trimmedLines.length > 1 && trimmedLines[trimmedLines.length - 1] === "") {
|
|
8789
|
-
if (this.shouldPreserveTrailingNewline(trimmedLines)) {
|
|
8790
|
-
if (trimmedLines.length > 2 && trimmedLines[trimmedLines.length - 2] === "") {
|
|
8791
|
-
trimmedLines.pop();
|
|
8792
|
-
continue;
|
|
8793
|
-
}
|
|
8794
|
-
break;
|
|
8795
|
-
}
|
|
8796
|
-
trimmedLines.pop();
|
|
8797
|
-
}
|
|
8798
|
-
return trimmedLines.join(`
|
|
8799
|
-
`);
|
|
8800
|
-
}
|
|
8801
|
-
tail(n) {
|
|
8802
|
-
const trimmedLines = [...[...this.scrollback, ...this.lines]];
|
|
8803
|
-
while (trimmedLines.length > 1 && trimmedLines[trimmedLines.length - 1] === "") {
|
|
8804
|
-
if (this.shouldPreserveTrailingNewline(trimmedLines)) {
|
|
8805
|
-
if (trimmedLines.length > 2 && trimmedLines[trimmedLines.length - 2] === "") {
|
|
8806
|
-
trimmedLines.pop();
|
|
8807
|
-
continue;
|
|
8808
|
-
}
|
|
8809
|
-
break;
|
|
8810
|
-
}
|
|
8811
|
-
trimmedLines.pop();
|
|
8812
|
-
}
|
|
8813
|
-
return trimmedLines.slice(-n).join(`
|
|
8814
|
-
`);
|
|
8815
|
-
}
|
|
8816
|
-
shouldPreserveTrailingNewline(lines) {
|
|
8817
|
-
if (!this.endedWithNewline) return false;
|
|
8818
|
-
for (let i = lines.length - 2; i >= 0; i--) {
|
|
8819
|
-
const line = lines[i];
|
|
8820
|
-
if (line === "") continue;
|
|
8821
|
-
return line.startsWith("╰") && line.endsWith("╯");
|
|
8822
|
-
}
|
|
8823
|
-
return false;
|
|
8824
|
-
}
|
|
8825
|
-
clear() {
|
|
8826
|
-
this.lines = [""];
|
|
8827
|
-
this.scrollback = [];
|
|
8828
|
-
this.cursorRow = 0;
|
|
8829
|
-
this.cursorCol = 0;
|
|
8830
|
-
this.savedCursorRow = 0;
|
|
8831
|
-
this.savedCursorCol = 0;
|
|
8832
|
-
this.scrollTop = 0;
|
|
8833
|
-
this.scrollBottom = null;
|
|
8834
|
-
this.endedWithNewline = false;
|
|
8835
|
-
}
|
|
8836
|
-
isEraseSequence(data, i) {
|
|
8837
|
-
const remaining = data.slice(i);
|
|
8838
|
-
if (!remaining.startsWith("\x1B[2K")) return false;
|
|
8839
|
-
let pos = 4;
|
|
8840
|
-
while (pos < remaining.length && remaining.slice(pos, pos + 8) === "\x1B[1A\x1B[2K") pos += 8;
|
|
8841
|
-
return pos < remaining.length && remaining.slice(pos, pos + 3) === "\x1B[G";
|
|
8842
|
-
}
|
|
8843
|
-
handleEraseSequence(data, i) {
|
|
8844
|
-
const remaining = data.slice(i);
|
|
8845
|
-
if (!remaining.startsWith("\x1B[2K")) return i;
|
|
8846
|
-
let pos = 4;
|
|
8847
|
-
let linesToClear = 1;
|
|
8848
|
-
while (pos < remaining.length && remaining.slice(pos, pos + 8) === "\x1B[1A\x1B[2K") {
|
|
8849
|
-
pos += 8;
|
|
8850
|
-
linesToClear++;
|
|
8851
|
-
}
|
|
8852
|
-
if (pos >= remaining.length || remaining.slice(pos, pos + 3) !== "\x1B[G") return i;
|
|
8853
|
-
pos += 3;
|
|
8854
|
-
const currentRow = this.cursorRow;
|
|
8855
|
-
if (linesToClear === 2 && remaining === "\x1B[2K\x1B[1A\x1B[2K\x1B[G") {
|
|
8856
|
-
for (let i2 = 0; i2 < 2 && currentRow + i2 < this.lines.length; i2++) this.lines[currentRow + i2] = "";
|
|
8857
|
-
this.cursorCol = 0;
|
|
8858
|
-
} else {
|
|
8859
|
-
const startRow = Math.max(0, currentRow - linesToClear + 1);
|
|
8860
|
-
for (let row = startRow; row <= currentRow && row < this.lines.length; row++) this.lines[row] = "";
|
|
8861
|
-
this.cursorRow = startRow;
|
|
8862
|
-
this.cursorCol = 0;
|
|
8863
|
-
}
|
|
8864
|
-
return i + pos;
|
|
8865
|
-
}
|
|
8866
|
-
handleOscSequence(data, i) {
|
|
8867
|
-
if (i + 1 >= data.length || data[i] !== "\x1B" || data[i + 1] !== "]") return i;
|
|
8868
|
-
let pos = i + 2;
|
|
8869
|
-
let terminatorStart = data.length;
|
|
8870
|
-
while (pos < data.length) {
|
|
8871
|
-
const ch = data[pos];
|
|
8872
|
-
if (ch === "\x07") {
|
|
8873
|
-
terminatorStart = pos;
|
|
8874
|
-
pos += 1;
|
|
8875
|
-
break;
|
|
8876
|
-
}
|
|
8877
|
-
if (ch === "\x1B" && pos + 1 < data.length && data[pos + 1] === "\\") {
|
|
8878
|
-
terminatorStart = pos;
|
|
8879
|
-
pos += 2;
|
|
8880
|
-
break;
|
|
8881
|
-
}
|
|
8882
|
-
pos++;
|
|
8883
|
-
}
|
|
8884
|
-
const oscPayload = data.slice(i + 2, terminatorStart);
|
|
8885
|
-
if (oscPayload.startsWith("8;")) {
|
|
8886
|
-
const secondSemicolon = oscPayload.indexOf(";", 2);
|
|
8887
|
-
if (secondSemicolon !== -1) {
|
|
8888
|
-
const uri = oscPayload.slice(secondSemicolon + 1);
|
|
8889
|
-
if (uri) this.write(uri);
|
|
8890
|
-
}
|
|
8891
|
-
}
|
|
8892
|
-
return Math.min(pos, data.length);
|
|
8893
|
-
}
|
|
8894
|
-
getScrollBottomIndex() {
|
|
8895
|
-
if (this.scrollBottom === null) return Math.max(this.lines.length - 1, this.scrollTop);
|
|
8896
|
-
const bottomIndex = Math.max(this.scrollTop, this.scrollBottom - 1);
|
|
8897
|
-
this.ensureLine(bottomIndex);
|
|
8898
|
-
return bottomIndex;
|
|
8899
|
-
}
|
|
8900
|
-
scrollUp(count) {
|
|
8901
|
-
if (count <= 0) return;
|
|
8902
|
-
const top = this.scrollTop;
|
|
8903
|
-
const bottomIndex = this.getScrollBottomIndex();
|
|
8904
|
-
if (bottomIndex < top) return;
|
|
8905
|
-
const regionHeight = bottomIndex - top + 1;
|
|
8906
|
-
const actualCount = Math.min(count, regionHeight);
|
|
8907
|
-
if (top === 0) for (let i = 0; i < actualCount; i++) {
|
|
8908
|
-
const scrolledLine = this.lines[0];
|
|
8909
|
-
if (scrolledLine !== "" || this.scrollback.length > 0) this.scrollback.push(scrolledLine);
|
|
8910
|
-
for (let row = 0; row < bottomIndex; row++) this.lines[row] = this.lines[row + 1] || "";
|
|
8911
|
-
this.lines[bottomIndex] = "";
|
|
8912
|
-
}
|
|
8913
|
-
else for (let i = 0; i < actualCount; i++) {
|
|
8914
|
-
for (let row = top; row < bottomIndex; row++) this.lines[row] = this.lines[row + 1] || "";
|
|
8915
|
-
this.lines[bottomIndex] = "";
|
|
8916
|
-
}
|
|
8917
|
-
}
|
|
8918
|
-
scrollDown(count) {
|
|
8919
|
-
if (count <= 0) return;
|
|
8920
|
-
const top = this.scrollTop;
|
|
8921
|
-
const bottomIndex = this.getScrollBottomIndex();
|
|
8922
|
-
if (bottomIndex < top) return;
|
|
8923
|
-
const regionHeight = bottomIndex - top + 1;
|
|
8924
|
-
const actualCount = Math.min(count, regionHeight);
|
|
8925
|
-
for (let i = 0; i < actualCount; i++) {
|
|
8926
|
-
for (let row = bottomIndex; row > top; row--) this.lines[row] = this.lines[row - 1] || "";
|
|
8927
|
-
this.lines[top] = "";
|
|
8928
|
-
}
|
|
8929
|
-
}
|
|
8930
|
-
};
|
|
8931
|
-
|
|
8932
8517
|
//#endregion
|
|
8933
8518
|
//#region ts/resume/codexSessionManager.ts
|
|
8934
8519
|
const getSessionsFile = () => process.env.CLI_YES_TEST_HOME ? path.join(process.env.CLI_YES_TEST_HOME, ".config", "agent-yes", "codex-sessions.json") : path.join(homedir(), ".config", "agent-yes", "codex-sessions.json");
|
|
@@ -9797,7 +9382,7 @@ function tryCatch(catchFn, fn) {
|
|
|
9797
9382
|
//#endregion
|
|
9798
9383
|
//#region package.json
|
|
9799
9384
|
var name = "agent-yes";
|
|
9800
|
-
var version = "1.
|
|
9385
|
+
var version = "1.59.0";
|
|
9801
9386
|
|
|
9802
9387
|
//#endregion
|
|
9803
9388
|
//#region ts/pty-fix.ts
|
|
@@ -10223,7 +9808,7 @@ async function notifyWebhook(status, details, cwd = process.cwd()) {
|
|
|
10223
9808
|
|
|
10224
9809
|
//#endregion
|
|
10225
9810
|
//#region ts/index.ts
|
|
10226
|
-
const config = await import("./agent-yes.config-
|
|
9811
|
+
const config = await import("./agent-yes.config-72EQj3_2.js").then((mod) => mod.default || mod);
|
|
10227
9812
|
const CLIS_CONFIG = config.clis;
|
|
10228
9813
|
/**
|
|
10229
9814
|
* Main function to run agent-cli with automatic yes/no responses
|
|
@@ -10280,8 +9865,9 @@ async function agentYes({ cli, cliArgs = [], prompt, robust = true, cwd, env, ex
|
|
|
10280
9865
|
if (verbose) logger.debug(`[stdin] isTTY: ${process.stdin.isTTY}, setRawMode available: ${!!process.stdin.setRawMode}`);
|
|
10281
9866
|
process.stdin.setRawMode?.(true);
|
|
10282
9867
|
if (verbose) logger.debug(`[stdin] Raw mode set, isRaw: ${process.stdin.isRaw}`);
|
|
10283
|
-
const
|
|
10284
|
-
const
|
|
9868
|
+
const terminalStream = new TerminalRenderStream({ mode: "raw" });
|
|
9869
|
+
const terminalRender = terminalStream.getRenderer();
|
|
9870
|
+
const outputWriter = terminalStream.writable.getWriter();
|
|
10285
9871
|
logger.debug(`Using ${ptyPackage} for pseudo terminal management.`);
|
|
10286
9872
|
if (!!process.env.CLAUDE_PPID) logger.info(`[${cli}-yes] Running as sub-agent (CLAUDE_PPID=${process.env.CLAUDE_PPID})`);
|
|
10287
9873
|
const cliConf = CLIS_CONFIG[cli] || {};
|
|
@@ -10420,9 +10006,9 @@ async function agentYes({ cli, cliArgs = [], prompt, robust = true, cwd, env, ex
|
|
|
10420
10006
|
if (!ctx.stdinFirstReady.isReady) ctx.stdinFirstReady.ready();
|
|
10421
10007
|
});
|
|
10422
10008
|
const pendingExitCode = Promise.withResolvers();
|
|
10423
|
-
|
|
10009
|
+
function onData(data) {
|
|
10424
10010
|
const currentPid = shell.pid;
|
|
10425
|
-
|
|
10011
|
+
outputWriter.write(data);
|
|
10426
10012
|
globalAgentRegistry.appendStdout(currentPid, data);
|
|
10427
10013
|
}
|
|
10428
10014
|
shell.onData(onData);
|
|
@@ -10574,7 +10160,6 @@ async function agentYes({ cli, cliArgs = [], prompt, robust = true, cwd, env, ex
|
|
|
10574
10160
|
const { cols, rows } = getTerminalDimensions();
|
|
10575
10161
|
shell.resize(cols, rows);
|
|
10576
10162
|
});
|
|
10577
|
-
const terminalRender = new TerminalTextRender();
|
|
10578
10163
|
const isStillWorkingQ = () => {
|
|
10579
10164
|
const rendered = terminalRender.tail(24).replace(/\s+/g, " ");
|
|
10580
10165
|
return conf.working?.some((rgx) => rgx.test(rendered));
|
|
@@ -10740,7 +10325,7 @@ async function agentYes({ cli, cliArgs = [], prompt, robust = true, cwd, env, ex
|
|
|
10740
10325
|
await ctx.stdinReady.wait();
|
|
10741
10326
|
shell.write(data);
|
|
10742
10327
|
} }),
|
|
10743
|
-
readable:
|
|
10328
|
+
readable: terminalStream.readable
|
|
10744
10329
|
}).forEach(() => {
|
|
10745
10330
|
ctx.idleWaiter.ping();
|
|
10746
10331
|
pidStore.updateStatus(shell.pid, "active").catch(() => null);
|
|
@@ -10844,4 +10429,4 @@ const SUPPORTED_CLIS = Object.keys(CLIS_CONFIG);
|
|
|
10844
10429
|
|
|
10845
10430
|
//#endregion
|
|
10846
10431
|
export { AgentContext as a, PidStore as c, config as i, removeControlCharacters as l, CLIS_CONFIG as n, name as o, agentYes as r, version as s, SUPPORTED_CLIS as t };
|
|
10847
|
-
//# sourceMappingURL=SUPPORTED_CLIS-
|
|
10432
|
+
//# sourceMappingURL=SUPPORTED_CLIS-CJViBrBx.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as logger } from "./logger-
|
|
1
|
+
import { t as logger } from "./logger-Cff_cjTg.js";
|
|
2
2
|
import { access, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
3
|
import os from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
@@ -332,4 +332,4 @@ function getDefaultConfig() {
|
|
|
332
332
|
|
|
333
333
|
//#endregion
|
|
334
334
|
export { agent_yes_config_default as t };
|
|
335
|
-
//# sourceMappingURL=agent-yes.config-
|
|
335
|
+
//# sourceMappingURL=agent-yes.config-CQlMMPB9.js.map
|