open-agents-ai 0.10.4 → 0.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +36 -28
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7123,17 +7123,22 @@ function renderWarning(message) {
|
|
|
7123
7123
|
function renderRichHeader(opts) {
|
|
7124
7124
|
const w = getTermWidth();
|
|
7125
7125
|
const divider = c2.dim("\u2500".repeat(Math.min(w - 4, 72)));
|
|
7126
|
+
let lines = 0;
|
|
7126
7127
|
process.stdout.write("\n");
|
|
7128
|
+
lines++;
|
|
7127
7129
|
const title = c2.bold(c2.cyan("open-agents"));
|
|
7128
7130
|
const ver = c2.dim(`v${opts.version}`);
|
|
7129
7131
|
const model = c2.dim(`model: ${c2.white(opts.model)}`);
|
|
7130
7132
|
process.stdout.write(` ${title} ${ver} ${c2.dim("\xB7")} ${model}
|
|
7131
7133
|
`);
|
|
7134
|
+
lines++;
|
|
7132
7135
|
const ws = opts.workspace.length > 60 ? "..." + opts.workspace.slice(-57) : opts.workspace;
|
|
7133
7136
|
process.stdout.write(` ${c2.dim("workspace:")} ${c2.white(ws)}
|
|
7134
7137
|
`);
|
|
7138
|
+
lines++;
|
|
7135
7139
|
process.stdout.write(` ${divider}
|
|
7136
7140
|
`);
|
|
7141
|
+
lines++;
|
|
7137
7142
|
process.stdout.write(` ${c2.bold("Tools")} ${c2.dim(`(${TOOL_NAMES.length}):`)} `);
|
|
7138
7143
|
let lineLen = 14;
|
|
7139
7144
|
for (let i = 0; i < TOOL_NAMES.length; i++) {
|
|
@@ -7143,22 +7148,29 @@ function renderRichHeader(opts) {
|
|
|
7143
7148
|
process.stdout.write(`
|
|
7144
7149
|
${" ".repeat(14)}`);
|
|
7145
7150
|
lineLen = 14;
|
|
7151
|
+
lines++;
|
|
7146
7152
|
}
|
|
7147
7153
|
process.stdout.write(`${c2.cyan(name)}${sep}`);
|
|
7148
7154
|
lineLen += name.length + 1;
|
|
7149
7155
|
}
|
|
7150
7156
|
process.stdout.write("\n");
|
|
7157
|
+
lines++;
|
|
7151
7158
|
process.stdout.write(` ${c2.bold("Commands:")} ${COMMAND_NAMES.map((cmd) => c2.yellow(cmd)).join(" ")}
|
|
7152
7159
|
`);
|
|
7160
|
+
lines++;
|
|
7153
7161
|
process.stdout.write(` ${divider}
|
|
7154
7162
|
`);
|
|
7163
|
+
lines++;
|
|
7155
7164
|
const hintIdx = Math.floor(Date.now() / 1e4) % HINTS.length;
|
|
7156
7165
|
const hint = HINTS[hintIdx];
|
|
7157
7166
|
process.stdout.write(` ${c2.dim("\u{1F4A1}")} ${c2.italic(c2.dim(hint))}
|
|
7158
7167
|
`);
|
|
7168
|
+
lines++;
|
|
7159
7169
|
process.stdout.write(` ${c2.dim("Type a task to begin, or /help for all commands.")}
|
|
7160
7170
|
|
|
7161
7171
|
`);
|
|
7172
|
+
lines += 2;
|
|
7173
|
+
return lines;
|
|
7162
7174
|
}
|
|
7163
7175
|
function renderCompactHeader(model) {
|
|
7164
7176
|
process.stdout.write(`
|
|
@@ -8680,6 +8692,8 @@ var init_carousel = __esm({
|
|
|
8680
8692
|
started = false;
|
|
8681
8693
|
rendered = false;
|
|
8682
8694
|
topRow = 1;
|
|
8695
|
+
promptRow = 20;
|
|
8696
|
+
// updated after header renders
|
|
8683
8697
|
constructor() {
|
|
8684
8698
|
this.width = process.stdout.columns ?? 80;
|
|
8685
8699
|
const third = Math.ceil(PHRASES.length / 3);
|
|
@@ -8696,13 +8710,6 @@ var init_carousel = __esm({
|
|
|
8696
8710
|
];
|
|
8697
8711
|
this.rebuildRibbons();
|
|
8698
8712
|
}
|
|
8699
|
-
/**
|
|
8700
|
-
* Best-effort cursor row detection. Since we clear the screen before
|
|
8701
|
-
* starting, the carousel always begins at row 1.
|
|
8702
|
-
*/
|
|
8703
|
-
getCursorRow() {
|
|
8704
|
-
return 1;
|
|
8705
|
-
}
|
|
8706
8713
|
rebuildRibbons() {
|
|
8707
8714
|
for (const row of this.rows) {
|
|
8708
8715
|
const { rendered, plain } = buildRibbon(row.phrases, this.width);
|
|
@@ -8737,24 +8744,20 @@ var init_carousel = __esm({
|
|
|
8737
8744
|
render() {
|
|
8738
8745
|
if (!isTTY3)
|
|
8739
8746
|
return;
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
}
|
|
8748
|
-
process.stdout.write("\x1B8");
|
|
8749
|
-
} else {
|
|
8750
|
-
this.topRow = this.getCursorRow();
|
|
8751
|
-
for (const row of this.rows) {
|
|
8752
|
-
const line = this.extractWindow(row);
|
|
8753
|
-
process.stdout.write(`\x1B[2K${line}
|
|
8754
|
-
`);
|
|
8755
|
-
}
|
|
8747
|
+
let buf = "\x1B[?25l";
|
|
8748
|
+
for (let i = 0; i < this.rows.length; i++) {
|
|
8749
|
+
const line = this.extractWindow(this.rows[i]);
|
|
8750
|
+
const row = this.topRow + i;
|
|
8751
|
+
buf += `\x1B[${row};1H\x1B[2K${line}`;
|
|
8752
|
+
}
|
|
8753
|
+
if (!this.rendered) {
|
|
8754
|
+
buf += `\x1B[${this.topRow + this.lineCount};1H`;
|
|
8756
8755
|
this.rendered = true;
|
|
8756
|
+
} else {
|
|
8757
|
+
buf += `\x1B[${this.promptRow};1H`;
|
|
8757
8758
|
}
|
|
8759
|
+
buf += "\x1B[?25h";
|
|
8760
|
+
process.stdout.write(buf);
|
|
8758
8761
|
}
|
|
8759
8762
|
/**
|
|
8760
8763
|
* Extract a terminal-width window from the scrolling ribbon.
|
|
@@ -8826,14 +8829,18 @@ var init_carousel = __esm({
|
|
|
8826
8829
|
}
|
|
8827
8830
|
if (!isTTY3 || !this.started)
|
|
8828
8831
|
return;
|
|
8829
|
-
|
|
8830
|
-
process.stdout.write(`\x1B[${this.topRow};1H`);
|
|
8832
|
+
let buf = "\x1B[?25l";
|
|
8831
8833
|
for (let i = 0; i < this.lineCount; i++) {
|
|
8832
|
-
|
|
8834
|
+
buf += `\x1B[${this.topRow + i};1H\x1B[2K`;
|
|
8833
8835
|
}
|
|
8834
|
-
|
|
8836
|
+
buf += `\x1B[${this.promptRow};1H\x1B[?25h`;
|
|
8837
|
+
process.stdout.write(buf);
|
|
8835
8838
|
this.started = false;
|
|
8836
8839
|
}
|
|
8840
|
+
/** Tell the carousel where the prompt/content area starts */
|
|
8841
|
+
setPromptRow(row) {
|
|
8842
|
+
this.promptRow = row;
|
|
8843
|
+
}
|
|
8837
8844
|
/** Check if carousel is running */
|
|
8838
8845
|
get isRunning() {
|
|
8839
8846
|
return this.timer !== null;
|
|
@@ -9638,12 +9645,13 @@ async function startInteractive(config, repoPath) {
|
|
|
9638
9645
|
const carousel = new Carousel();
|
|
9639
9646
|
const carouselLines = carousel.start();
|
|
9640
9647
|
const version = getVersion();
|
|
9641
|
-
renderRichHeader({
|
|
9648
|
+
const headerLines = renderRichHeader({
|
|
9642
9649
|
model: config.model,
|
|
9643
9650
|
version,
|
|
9644
9651
|
workspace: repoRoot,
|
|
9645
9652
|
carouselLines
|
|
9646
9653
|
});
|
|
9654
|
+
carousel.setPromptRow(1 + carouselLines + headerLines);
|
|
9647
9655
|
const voiceEngine = new VoiceEngine();
|
|
9648
9656
|
let currentConfig = { ...config };
|
|
9649
9657
|
let activeTask = null;
|
package/package.json
CHANGED