open-agents-ai 0.139.6 → 0.139.8
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 +97 -36
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35512,6 +35512,34 @@ var init_dist6 = __esm({
|
|
|
35512
35512
|
});
|
|
35513
35513
|
|
|
35514
35514
|
// packages/cli/dist/tui/oa-directory.js
|
|
35515
|
+
var oa_directory_exports = {};
|
|
35516
|
+
__export(oa_directory_exports, {
|
|
35517
|
+
OA_DIR: () => OA_DIR,
|
|
35518
|
+
buildContextRestorePrompt: () => buildContextRestorePrompt,
|
|
35519
|
+
deleteUsageRecord: () => deleteUsageRecord,
|
|
35520
|
+
discoverContextFiles: () => discoverContextFiles,
|
|
35521
|
+
generateProjectMap: () => generateProjectMap,
|
|
35522
|
+
getLastTaskSummary: () => getLastTaskSummary,
|
|
35523
|
+
hasOaDirectory: () => hasOaDirectory,
|
|
35524
|
+
initOaDirectory: () => initOaDirectory,
|
|
35525
|
+
loadGlobalSettings: () => loadGlobalSettings,
|
|
35526
|
+
loadPendingTask: () => loadPendingTask,
|
|
35527
|
+
loadProjectSettings: () => loadProjectSettings,
|
|
35528
|
+
loadRecentSessions: () => loadRecentSessions,
|
|
35529
|
+
loadSessionContext: () => loadSessionContext,
|
|
35530
|
+
loadUsageHistory: () => loadUsageHistory,
|
|
35531
|
+
readIndexData: () => readIndexData,
|
|
35532
|
+
readIndexMeta: () => readIndexMeta,
|
|
35533
|
+
recordUsage: () => recordUsage,
|
|
35534
|
+
resolveSettings: () => resolveSettings,
|
|
35535
|
+
saveGlobalSettings: () => saveGlobalSettings,
|
|
35536
|
+
savePendingTask: () => savePendingTask,
|
|
35537
|
+
saveProjectSettings: () => saveProjectSettings,
|
|
35538
|
+
saveSession: () => saveSession,
|
|
35539
|
+
saveSessionContext: () => saveSessionContext,
|
|
35540
|
+
writeIndexData: () => writeIndexData,
|
|
35541
|
+
writeIndexMeta: () => writeIndexMeta
|
|
35542
|
+
});
|
|
35515
35543
|
import { existsSync as existsSync31, mkdirSync as mkdirSync11, readFileSync as readFileSync22, writeFileSync as writeFileSync12, readdirSync as readdirSync8, statSync as statSync11, unlinkSync as unlinkSync6 } from "node:fs";
|
|
35516
35544
|
import { join as join47, relative as relative2, basename as basename9, extname as extname8 } from "node:path";
|
|
35517
35545
|
import { homedir as homedir9 } from "node:os";
|
|
@@ -35643,6 +35671,24 @@ function readIndexMeta(repoRoot) {
|
|
|
35643
35671
|
return null;
|
|
35644
35672
|
}
|
|
35645
35673
|
}
|
|
35674
|
+
function writeIndexMeta(repoRoot, meta) {
|
|
35675
|
+
const metaPath = join47(repoRoot, OA_DIR, "index", "meta.json");
|
|
35676
|
+
mkdirSync11(join47(repoRoot, OA_DIR, "index"), { recursive: true });
|
|
35677
|
+
writeFileSync12(metaPath, JSON.stringify(meta, null, 2), "utf-8");
|
|
35678
|
+
}
|
|
35679
|
+
function readIndexData(repoRoot, filename) {
|
|
35680
|
+
const filePath = join47(repoRoot, OA_DIR, "index", filename);
|
|
35681
|
+
try {
|
|
35682
|
+
return JSON.parse(readFileSync22(filePath, "utf-8"));
|
|
35683
|
+
} catch {
|
|
35684
|
+
return null;
|
|
35685
|
+
}
|
|
35686
|
+
}
|
|
35687
|
+
function writeIndexData(repoRoot, filename, data) {
|
|
35688
|
+
const filePath = join47(repoRoot, OA_DIR, "index", filename);
|
|
35689
|
+
mkdirSync11(join47(repoRoot, OA_DIR, "index"), { recursive: true });
|
|
35690
|
+
writeFileSync12(filePath, JSON.stringify(data, null, 2), "utf-8");
|
|
35691
|
+
}
|
|
35646
35692
|
function generateProjectMap(repoRoot) {
|
|
35647
35693
|
const sections = [];
|
|
35648
35694
|
const repoName2 = basename9(repoRoot);
|
|
@@ -35774,25 +35820,24 @@ function buildContextRestorePrompt(repoRoot) {
|
|
|
35774
35820
|
const ctx = loadSessionContext(repoRoot);
|
|
35775
35821
|
if (!ctx || ctx.entries.length === 0)
|
|
35776
35822
|
return null;
|
|
35777
|
-
const
|
|
35778
|
-
|
|
35779
|
-
""
|
|
35780
|
-
|
|
35781
|
-
|
|
35782
|
-
|
|
35783
|
-
|
|
35784
|
-
|
|
35785
|
-
|
|
35786
|
-
|
|
35787
|
-
|
|
35788
|
-
|
|
35789
|
-
|
|
35790
|
-
|
|
35791
|
-
|
|
35792
|
-
|
|
35793
|
-
|
|
35794
|
-
|
|
35795
|
-
return lines.join("\n");
|
|
35823
|
+
const recent = ctx.entries.slice(-5);
|
|
35824
|
+
const lines = recent.map((e) => {
|
|
35825
|
+
const status = e.completed ? "done" : "partial";
|
|
35826
|
+
const summary = e.summary ? e.summary.slice(0, 100) : e.task.slice(0, 100);
|
|
35827
|
+
return `[${status}] ${summary}`;
|
|
35828
|
+
});
|
|
35829
|
+
return `Previous work in this project:
|
|
35830
|
+
${lines.join("\n")}
|
|
35831
|
+
Do not repeat completed work.`;
|
|
35832
|
+
}
|
|
35833
|
+
function getLastTaskSummary(repoRoot) {
|
|
35834
|
+
const ctx = loadSessionContext(repoRoot);
|
|
35835
|
+
if (!ctx || ctx.entries.length === 0)
|
|
35836
|
+
return null;
|
|
35837
|
+
const last = ctx.entries[ctx.entries.length - 1];
|
|
35838
|
+
const text = last.summary || last.task;
|
|
35839
|
+
const clean = text.replace(/^\[.*?\]\s*/, "").replace(/\s+/g, " ").trim();
|
|
35840
|
+
return clean.length > 40 ? clean.slice(0, 37) + "..." : clean;
|
|
35796
35841
|
}
|
|
35797
35842
|
function detectManifests(repoRoot) {
|
|
35798
35843
|
const manifests = [];
|
|
@@ -52986,6 +53031,13 @@ var init_text_selection = __esm({
|
|
|
52986
53031
|
|
|
52987
53032
|
// packages/cli/dist/tui/status-bar.js
|
|
52988
53033
|
import { readFileSync as readFileSync31 } from "node:fs";
|
|
53034
|
+
function setTerminalTitle(task, version) {
|
|
53035
|
+
if (!process.stdout.isTTY)
|
|
53036
|
+
return;
|
|
53037
|
+
const ver = version ? `OA v${version}` : "OA";
|
|
53038
|
+
const title = task ? `${task.slice(0, 60)} \xB7 ${ver}` : ver;
|
|
53039
|
+
process.stdout.write(`\x1B]2;${title}\x07`);
|
|
53040
|
+
}
|
|
52989
53041
|
var EXPERT_TOOL_BASELINES, CONTEXT_SWITCH_OVERHEAD, TURN_PLANNING_OVERHEAD, DEFAULT_TOOL_BASELINE, CODE_READ_CHARS_PER_SEC, PROSE_READ_CHARS_PER_SEC, MIN_CONTENT_FOR_READING, CODE_CONTENT_TOOLS, PROSE_CONTENT_TOOLS, HumanSpeedTracker, PANEL_BG, CONTENT_BG, TEXT_PRIMARY, PANEL_BG_SEQ, CONTENT_BG_SEQ, RESET, StatusBar;
|
|
52990
53042
|
var init_status_bar = __esm({
|
|
52991
53043
|
"packages/cli/dist/tui/status-bar.js"() {
|
|
@@ -56485,6 +56537,7 @@ async function startInteractive(config, repoPath) {
|
|
|
56485
56537
|
if (process.stdout.isTTY) {
|
|
56486
56538
|
const scrollTop = carouselLines > 0 ? carouselLines : 1;
|
|
56487
56539
|
statusBar.activate(scrollTop);
|
|
56540
|
+
setTerminalTitle(void 0, version);
|
|
56488
56541
|
banner.onAfterRender = () => statusBar.renderHeaderButtons();
|
|
56489
56542
|
statusBar.setBannerRefresh(() => {
|
|
56490
56543
|
banner.renderCurrentFrame();
|
|
@@ -56502,7 +56555,9 @@ async function startInteractive(config, repoPath) {
|
|
|
56502
56555
|
statusBar.renderHeaderButtons();
|
|
56503
56556
|
if (isResumed) {
|
|
56504
56557
|
statusBar.beginContentWrite();
|
|
56505
|
-
const
|
|
56558
|
+
const { getLastTaskSummary: getLastTaskSummary2 } = (init_oa_directory(), __toCommonJS(oa_directory_exports));
|
|
56559
|
+
const taskSummary = hasTaskToResume ? getLastTaskSummary2(repoRoot) : null;
|
|
56560
|
+
const resumeMsg = taskSummary ? `v${version} \u2014 picking up: ${taskSummary}` : `Updated to v${version}.`;
|
|
56506
56561
|
renderInfo(resumeMsg);
|
|
56507
56562
|
statusBar.endContentWrite();
|
|
56508
56563
|
}
|
|
@@ -58283,13 +58338,13 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
58283
58338
|
return false;
|
|
58284
58339
|
setTimeout(() => {
|
|
58285
58340
|
const resumeContext = [
|
|
58286
|
-
`
|
|
58287
|
-
pendingTask.progressSummary ? `Progress
|
|
58288
|
-
pendingTask.filesModified.length > 0 ? `
|
|
58289
|
-
|
|
58290
|
-
|
|
58291
|
-
|
|
58292
|
-
writeContent(() => renderInfo(`
|
|
58341
|
+
`Continuing previous task: ${pendingTask.prompt}`,
|
|
58342
|
+
pendingTask.progressSummary ? `Progress: ${pendingTask.progressSummary}` : "",
|
|
58343
|
+
pendingTask.filesModified.length > 0 ? `Modified: ${pendingTask.filesModified.slice(0, 5).join(", ")}` : "",
|
|
58344
|
+
"Continue where you left off."
|
|
58345
|
+
].filter(Boolean).join("\n");
|
|
58346
|
+
const shortPrompt = pendingTask.prompt.slice(0, 40) + (pendingTask.prompt.length > 40 ? "..." : "");
|
|
58347
|
+
writeContent(() => renderInfo(`Picking up: ${shortPrompt}`));
|
|
58293
58348
|
rl.emit("line", resumeContext);
|
|
58294
58349
|
}, 100);
|
|
58295
58350
|
return true;
|
|
@@ -58526,15 +58581,14 @@ Respond concisely and safely. Remember: you are talking to the general public.`;
|
|
|
58526
58581
|
setTimeout(() => {
|
|
58527
58582
|
const sessionCtx = buildContextRestorePrompt(repoRoot);
|
|
58528
58583
|
const resumeContext = [
|
|
58529
|
-
sessionCtx
|
|
58530
|
-
|
|
58531
|
-
|
|
58532
|
-
pendingTask.
|
|
58533
|
-
|
|
58534
|
-
|
|
58535
|
-
|
|
58536
|
-
|
|
58537
|
-
writeContent(() => renderInfo(`Resuming task: ${pendingTask.prompt.slice(0, 100)}${pendingTask.prompt.length > 100 ? "..." : ""}`));
|
|
58584
|
+
sessionCtx || "",
|
|
58585
|
+
`Continuing task after update: ${pendingTask.prompt}`,
|
|
58586
|
+
pendingTask.progressSummary ? `Progress: ${pendingTask.progressSummary}` : "",
|
|
58587
|
+
pendingTask.filesModified.length > 0 ? `Modified: ${pendingTask.filesModified.slice(0, 5).join(", ")}` : "",
|
|
58588
|
+
"Continue where you left off."
|
|
58589
|
+
].filter(Boolean).join("\n");
|
|
58590
|
+
const shortPrompt = pendingTask.prompt.slice(0, 40) + (pendingTask.prompt.length > 40 ? "..." : "");
|
|
58591
|
+
writeContent(() => renderInfo(`Picking up: ${shortPrompt}`));
|
|
58538
58592
|
rl.emit("line", resumeContext);
|
|
58539
58593
|
}, 100);
|
|
58540
58594
|
}
|
|
@@ -58724,8 +58778,10 @@ Execute this skill now. Follow the behavioral guidance above.`;
|
|
|
58724
58778
|
}, bruteForceEnabled, statusBar, handleSudoRequest, costTracker, (summary, meta) => {
|
|
58725
58779
|
lastCompletedSummary = summary;
|
|
58726
58780
|
lastTaskMeta = meta ?? null;
|
|
58781
|
+
setTerminalTitle(summary?.slice(0, 60), version);
|
|
58727
58782
|
}, currentTaskType, resolvedContextWindowSize, resolvedCaps, currentStyle, deepContextEnabled, compactionSNRCallback(), emotionEngine, flowEnabled, buildSlashCommandHandler(), thinkingEnabled, handleAskUser);
|
|
58728
58783
|
activeTask = task;
|
|
58784
|
+
setTerminalTitle(input.slice(0, 60), version);
|
|
58729
58785
|
showPrompt();
|
|
58730
58786
|
if (isNeovimActive() && !isNeovimFocused()) {
|
|
58731
58787
|
refocusNeovim();
|
|
@@ -58737,6 +58793,7 @@ Execute this skill now. Follow the behavioral guidance above.`;
|
|
|
58737
58793
|
}
|
|
58738
58794
|
statusBar.setProcessing(false);
|
|
58739
58795
|
activeTask = null;
|
|
58796
|
+
setTerminalTitle(void 0, version);
|
|
58740
58797
|
showPrompt();
|
|
58741
58798
|
return;
|
|
58742
58799
|
}
|
|
@@ -58975,8 +59032,10 @@ NEW TASK: ${fullInput}`;
|
|
|
58975
59032
|
}, bruteForceEnabled, statusBar, handleSudoRequest, costTracker, (summary, meta) => {
|
|
58976
59033
|
lastCompletedSummary = summary;
|
|
58977
59034
|
lastTaskMeta = meta ?? null;
|
|
59035
|
+
setTerminalTitle(summary?.slice(0, 60), version);
|
|
58978
59036
|
}, currentTaskType, resolvedContextWindowSize, resolvedCaps, currentStyle, deepContextEnabled, compactionSNRCallback(), emotionEngine, flowEnabled, buildSlashCommandHandler(), thinkingEnabled, handleAskUser);
|
|
58979
59037
|
activeTask = task;
|
|
59038
|
+
setTerminalTitle(input.slice(0, 60), version);
|
|
58980
59039
|
showPrompt();
|
|
58981
59040
|
if (isNeovimActive() && !isNeovimFocused()) {
|
|
58982
59041
|
refocusNeovim();
|
|
@@ -59023,6 +59082,7 @@ NEW TASK: ${fullInput}`;
|
|
|
59023
59082
|
sessionToolCallCount = activeTask.toolCallCount;
|
|
59024
59083
|
}
|
|
59025
59084
|
activeTask = null;
|
|
59085
|
+
setTerminalTitle(void 0, version);
|
|
59026
59086
|
}
|
|
59027
59087
|
const updateMode = savedSettings.updateMode ?? "auto";
|
|
59028
59088
|
if (updateMode !== "manual") {
|
|
@@ -59242,6 +59302,7 @@ async function runWithTUI(task, config, repoPath) {
|
|
|
59242
59302
|
}
|
|
59243
59303
|
renderCompactHeader(config.model);
|
|
59244
59304
|
renderUserMessage(task);
|
|
59305
|
+
setTerminalTitle(task.slice(0, 60), getVersion3());
|
|
59245
59306
|
try {
|
|
59246
59307
|
const handle = startTask(task, config, repoRoot);
|
|
59247
59308
|
await handle.promise;
|
package/package.json
CHANGED