open-agents-ai 0.91.0 → 0.92.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +49 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17186,10 +17186,10 @@ ${marker}` : marker);
|
|
|
17186
17186
|
if (!this._workingDirectory)
|
|
17187
17187
|
return;
|
|
17188
17188
|
try {
|
|
17189
|
-
const { mkdirSync:
|
|
17189
|
+
const { mkdirSync: mkdirSync18, writeFileSync: writeFileSync16 } = __require("node:fs");
|
|
17190
17190
|
const { join: join52 } = __require("node:path");
|
|
17191
17191
|
const sessionDir = join52(this._workingDirectory, ".oa", "session", this._sessionId);
|
|
17192
|
-
|
|
17192
|
+
mkdirSync18(sessionDir, { recursive: true });
|
|
17193
17193
|
const checkpoint = {
|
|
17194
17194
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
17195
17195
|
sessionId: this._sessionId,
|
|
@@ -17201,7 +17201,7 @@ ${marker}` : marker);
|
|
|
17201
17201
|
memexEntryCount: this._memexArchive.size,
|
|
17202
17202
|
fileRegistrySize: this._fileRegistry.size
|
|
17203
17203
|
};
|
|
17204
|
-
|
|
17204
|
+
writeFileSync16(join52(sessionDir, "checkpoint.json"), JSON.stringify(checkpoint, null, 2));
|
|
17205
17205
|
} catch {
|
|
17206
17206
|
}
|
|
17207
17207
|
}
|
|
@@ -38991,7 +38991,7 @@ var init_status_bar = __esm({
|
|
|
38991
38991
|
return;
|
|
38992
38992
|
const rows = process.stdout.rows ?? 24;
|
|
38993
38993
|
const pos = this.rowPositions(rows);
|
|
38994
|
-
process.stdout.write(`\x1B[${pos.inputStartRow};1H\x1B[2K`);
|
|
38994
|
+
process.stdout.write(`\x1B[${pos.inputStartRow};1H\x1B[2K\x1B[?25h`);
|
|
38995
38995
|
}
|
|
38996
38996
|
/** Strip ANSI escape codes to measure visible character width */
|
|
38997
38997
|
static visWidth(s) {
|
|
@@ -39358,7 +39358,7 @@ var init_status_bar = __esm({
|
|
|
39358
39358
|
buf += `\x1B[${row};1H\x1B[2K${prefix}${inputWrap.lines[i]}`;
|
|
39359
39359
|
}
|
|
39360
39360
|
const cursorTermRow = pos.inputStartRow + inputWrap.cursorRow;
|
|
39361
|
-
buf += `\x1B[${pos.bottomSepRow};1H\x1B[2K${sep}\x1B[${pos.metricsRow};1H\x1B[2K${this.buildMetricsLine()}\x1B[?7h\x1B[
|
|
39361
|
+
buf += `\x1B[${pos.bottomSepRow};1H\x1B[2K${sep}\x1B[${pos.metricsRow};1H\x1B[2K${this.buildMetricsLine()}\x1B[?7h\x1B[${cursorTermRow};${inputWrap.cursorCol}H\x1B[?25h`;
|
|
39362
39362
|
process.stdout.write(buf);
|
|
39363
39363
|
}
|
|
39364
39364
|
/**
|
|
@@ -39386,7 +39386,8 @@ var init_status_bar = __esm({
|
|
|
39386
39386
|
const w = getTermWidth();
|
|
39387
39387
|
const pos = this.rowPositions(rows);
|
|
39388
39388
|
const sep = c2.dim("\u2500".repeat(w));
|
|
39389
|
-
const buf = `\x1B7\x1B[?7l\x1B[${pos.bufferRow};1H\x1B[2K${this.buildBufferContent(w)}\x1B[${pos.topSepRow};1H\x1B[2K${sep}\x1B[${pos.bottomSepRow};1H\x1B[2K${sep}\x1B[${pos.metricsRow};1H\x1B[2K${this.buildMetricsLine()}\x1B[?7h\x1B8
|
|
39389
|
+
const buf = `\x1B7\x1B[?7l\x1B[${pos.bufferRow};1H\x1B[2K${this.buildBufferContent(w)}\x1B[${pos.topSepRow};1H\x1B[2K${sep}\x1B[${pos.bottomSepRow};1H\x1B[2K${sep}\x1B[${pos.metricsRow};1H\x1B[2K${this.buildMetricsLine()}\x1B[?7h\x1B8` + // DEC restore cursor
|
|
39390
|
+
(this.writeDepth === 0 ? "\x1B[?25h" : "");
|
|
39390
39391
|
process.stdout.write(buf);
|
|
39391
39392
|
}
|
|
39392
39393
|
/**
|
|
@@ -39507,8 +39508,9 @@ import { cwd } from "node:process";
|
|
|
39507
39508
|
import { resolve as resolve28, join as join47, dirname as dirname16, extname as extname9 } from "node:path";
|
|
39508
39509
|
import { createRequire as createRequire2 } from "node:module";
|
|
39509
39510
|
import { fileURLToPath as fileURLToPath12 } from "node:url";
|
|
39510
|
-
import { readFileSync as readFileSync27, rmSync as rmSync2, readdirSync as readdirSync14 } from "node:fs";
|
|
39511
|
+
import { readFileSync as readFileSync27, writeFileSync as writeFileSync14, appendFileSync as appendFileSync3, rmSync as rmSync2, readdirSync as readdirSync14, mkdirSync as mkdirSync16 } from "node:fs";
|
|
39511
39512
|
import { existsSync as existsSync36 } from "node:fs";
|
|
39513
|
+
import { homedir as homedir13 } from "node:os";
|
|
39512
39514
|
function formatTimeAgo(date) {
|
|
39513
39515
|
const seconds = Math.floor((Date.now() - date.getTime()) / 1e3);
|
|
39514
39516
|
if (seconds < 60)
|
|
@@ -40600,14 +40602,42 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
40600
40602
|
const hits = allCompletions.filter((c3) => c3.toLowerCase().startsWith(lower));
|
|
40601
40603
|
return [hits, line];
|
|
40602
40604
|
}
|
|
40605
|
+
const HISTORY_DIR = join47(homedir13(), ".open-agents");
|
|
40606
|
+
const HISTORY_FILE = join47(HISTORY_DIR, "repl-history");
|
|
40607
|
+
const MAX_HISTORY_LINES = 500;
|
|
40608
|
+
let savedHistory = [];
|
|
40609
|
+
try {
|
|
40610
|
+
if (existsSync36(HISTORY_FILE)) {
|
|
40611
|
+
const raw = readFileSync27(HISTORY_FILE, "utf8").trim();
|
|
40612
|
+
if (raw)
|
|
40613
|
+
savedHistory = raw.split("\n").reverse();
|
|
40614
|
+
}
|
|
40615
|
+
} catch {
|
|
40616
|
+
}
|
|
40603
40617
|
const rl = readline2.createInterface({
|
|
40604
40618
|
input: process.stdin,
|
|
40605
40619
|
output: process.stdout,
|
|
40606
40620
|
prompt: idlePrompt,
|
|
40607
40621
|
terminal: true,
|
|
40608
|
-
historySize:
|
|
40622
|
+
historySize: MAX_HISTORY_LINES,
|
|
40623
|
+
history: savedHistory,
|
|
40609
40624
|
completer
|
|
40610
40625
|
});
|
|
40626
|
+
function persistHistoryLine(line) {
|
|
40627
|
+
if (!line.trim())
|
|
40628
|
+
return;
|
|
40629
|
+
try {
|
|
40630
|
+
mkdirSync16(HISTORY_DIR, { recursive: true });
|
|
40631
|
+
appendFileSync3(HISTORY_FILE, line + "\n", "utf8");
|
|
40632
|
+
if (Math.random() < 0.02) {
|
|
40633
|
+
const all = readFileSync27(HISTORY_FILE, "utf8").trim().split("\n");
|
|
40634
|
+
if (all.length > MAX_HISTORY_LINES) {
|
|
40635
|
+
writeFileSync14(HISTORY_FILE, all.slice(-MAX_HISTORY_LINES).join("\n") + "\n", "utf8");
|
|
40636
|
+
}
|
|
40637
|
+
}
|
|
40638
|
+
} catch {
|
|
40639
|
+
}
|
|
40640
|
+
}
|
|
40611
40641
|
statusBar.setPromptText(idlePrompt, 2);
|
|
40612
40642
|
statusBar.setCompletions(allCompletions);
|
|
40613
40643
|
if (statusBar.isActive) {
|
|
@@ -40646,8 +40676,11 @@ Rationale: ${proposal.rationale}${provenanceNote}`;
|
|
|
40646
40676
|
function writeContent(fn) {
|
|
40647
40677
|
if (statusBar.isActive) {
|
|
40648
40678
|
statusBar.beginContentWrite();
|
|
40649
|
-
|
|
40650
|
-
|
|
40679
|
+
try {
|
|
40680
|
+
fn();
|
|
40681
|
+
} finally {
|
|
40682
|
+
statusBar.endContentWrite();
|
|
40683
|
+
}
|
|
40651
40684
|
} else {
|
|
40652
40685
|
fn();
|
|
40653
40686
|
}
|
|
@@ -41617,6 +41650,7 @@ ${sessionCtx}` : "",
|
|
|
41617
41650
|
pasteIndicatorShown = true;
|
|
41618
41651
|
}
|
|
41619
41652
|
rl.on("line", (line) => {
|
|
41653
|
+
persistHistoryLine(line);
|
|
41620
41654
|
const input = line.trim();
|
|
41621
41655
|
if (pendingSessionRestore) {
|
|
41622
41656
|
pendingSessionRestore = false;
|
|
@@ -42721,7 +42755,7 @@ __export(config_exports, {
|
|
|
42721
42755
|
configCommand: () => configCommand
|
|
42722
42756
|
});
|
|
42723
42757
|
import { join as join49, resolve as resolve30 } from "node:path";
|
|
42724
|
-
import { homedir as
|
|
42758
|
+
import { homedir as homedir14 } from "node:os";
|
|
42725
42759
|
import { cwd as cwd3 } from "node:process";
|
|
42726
42760
|
function redactIfSensitive(key, value) {
|
|
42727
42761
|
if (SENSITIVE_KEYS.has(key) && typeof value === "string" && value.length > 0) {
|
|
@@ -42779,7 +42813,7 @@ function handleShow(opts, config) {
|
|
|
42779
42813
|
}
|
|
42780
42814
|
}
|
|
42781
42815
|
printSection("Config File");
|
|
42782
|
-
printInfo(`~/.open-agents/config.json (${join49(
|
|
42816
|
+
printInfo(`~/.open-agents/config.json (${join49(homedir14(), ".open-agents", "config.json")})`);
|
|
42783
42817
|
printSection("Priority Chain");
|
|
42784
42818
|
printInfo(" 1. CLI flags (--model, --backend-url, etc.)");
|
|
42785
42819
|
printInfo(" 2. Project .oa/settings.json (--local)");
|
|
@@ -43037,7 +43071,7 @@ __export(eval_exports, {
|
|
|
43037
43071
|
evalCommand: () => evalCommand
|
|
43038
43072
|
});
|
|
43039
43073
|
import { tmpdir as tmpdir7 } from "node:os";
|
|
43040
|
-
import { mkdirSync as
|
|
43074
|
+
import { mkdirSync as mkdirSync17, writeFileSync as writeFileSync15 } from "node:fs";
|
|
43041
43075
|
import { join as join50 } from "node:path";
|
|
43042
43076
|
async function evalCommand(opts, config) {
|
|
43043
43077
|
const suiteName = opts.suite ?? "basic";
|
|
@@ -43164,8 +43198,8 @@ async function evalCommand(opts, config) {
|
|
|
43164
43198
|
}
|
|
43165
43199
|
function createTempEvalRepo() {
|
|
43166
43200
|
const dir = join50(tmpdir7(), `open-agents-eval-${Date.now()}`);
|
|
43167
|
-
|
|
43168
|
-
|
|
43201
|
+
mkdirSync17(dir, { recursive: true });
|
|
43202
|
+
writeFileSync15(join50(dir, "package.json"), JSON.stringify({ name: "eval-repo", version: "0.0.0" }, null, 2) + "\n", "utf8");
|
|
43169
43203
|
return dir;
|
|
43170
43204
|
}
|
|
43171
43205
|
var BASIC_SUITE, FULL_SUITE, SUITES;
|
package/package.json
CHANGED