open-agents-ai 0.157.0 → 0.159.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 +62 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20861,6 +20861,17 @@ var init_full_sub_agent = __esm({
|
|
|
20861
20861
|
onViewRegister;
|
|
20862
20862
|
onViewWrite;
|
|
20863
20863
|
onViewStatus;
|
|
20864
|
+
onComplete;
|
|
20865
|
+
/**
|
|
20866
|
+
* Wire callbacks after construction (needed because StatusBar and Runner
|
|
20867
|
+
* are created after the tool array). Call this once from interactive.ts.
|
|
20868
|
+
*/
|
|
20869
|
+
setCallbacks(callbacks) {
|
|
20870
|
+
this.onViewRegister = callbacks.onViewRegister;
|
|
20871
|
+
this.onViewWrite = callbacks.onViewWrite;
|
|
20872
|
+
this.onViewStatus = callbacks.onViewStatus;
|
|
20873
|
+
this.onComplete = callbacks.onComplete;
|
|
20874
|
+
}
|
|
20864
20875
|
constructor(workingDir, model, backendUrl, callbacks) {
|
|
20865
20876
|
this.workingDir = workingDir;
|
|
20866
20877
|
this.model = model ?? "";
|
|
@@ -20878,8 +20889,9 @@ var init_full_sub_agent = __esm({
|
|
|
20878
20889
|
if (!task)
|
|
20879
20890
|
return { success: false, output: "", error: "task is required", durationMs: performance.now() - start };
|
|
20880
20891
|
const model = String(args["model"] ?? this.model);
|
|
20881
|
-
const entry = spawnFullSubAgent(task, { model, backendUrl: this.backendUrl, workingDir: this.workingDir }, (text) => this.onViewWrite?.(entry.id, text), (id, exitCode) => {
|
|
20892
|
+
const entry = spawnFullSubAgent(task, { model, backendUrl: this.backendUrl, workingDir: this.workingDir }, (text) => this.onViewWrite?.(entry.id, text), (id, exitCode, output) => {
|
|
20882
20893
|
this.onViewStatus?.(id, exitCode === 0 ? "completed" : "failed");
|
|
20894
|
+
this.onComplete?.(id, task, exitCode, output);
|
|
20883
20895
|
});
|
|
20884
20896
|
this.onViewRegister?.(entry.id, entry.id, "full");
|
|
20885
20897
|
return {
|
|
@@ -57928,7 +57940,8 @@ var init_status_bar = __esm({
|
|
|
57928
57940
|
this.cancelMouseIdle();
|
|
57929
57941
|
this.enableMouseTracking();
|
|
57930
57942
|
const rows = process.stdout.rows ?? 24;
|
|
57931
|
-
const
|
|
57943
|
+
const pos = this.rowPositions(rows);
|
|
57944
|
+
const scrollEnd = pos.scrollEnd;
|
|
57932
57945
|
if (this.writeDepth === 1 && !this._origWrite) {
|
|
57933
57946
|
this._origWrite = this._trueStdoutWrite;
|
|
57934
57947
|
const origBound = this._trueStdoutWrite;
|
|
@@ -58747,7 +58760,11 @@ ${CONTENT_BG_SEQ}`);
|
|
|
58747
58760
|
self.copySelection();
|
|
58748
58761
|
return;
|
|
58749
58762
|
}
|
|
58750
|
-
if (s === "\x1B[67;6u") {
|
|
58763
|
+
if (s === "\x1B[67;6u" || s === "\x1B[27;6;67~") {
|
|
58764
|
+
self.copySelection();
|
|
58765
|
+
return;
|
|
58766
|
+
}
|
|
58767
|
+
if (s === "" && key?.shift) {
|
|
58751
58768
|
self.copySelection();
|
|
58752
58769
|
return;
|
|
58753
58770
|
}
|
|
@@ -59141,8 +59158,11 @@ function buildTools(repoRoot, config, contextWindowSize) {
|
|
|
59141
59158
|
new SemanticMapTool(repoRoot),
|
|
59142
59159
|
new RepoMapTool(repoRoot),
|
|
59143
59160
|
new ProcessHealthTool(),
|
|
59144
|
-
// Full OA sub-process
|
|
59145
|
-
|
|
59161
|
+
// Full OA sub-process — callbacks wired after runner + statusBar created
|
|
59162
|
+
(() => {
|
|
59163
|
+
_fullSubAgentToolRef = new FullSubAgentTool(repoRoot, config.model, config.backendUrl);
|
|
59164
|
+
return _fullSubAgentToolRef;
|
|
59165
|
+
})(),
|
|
59146
59166
|
// Nexus P2P networking + x402 micropayments
|
|
59147
59167
|
new NexusTool(repoRoot)
|
|
59148
59168
|
];
|
|
@@ -59369,7 +59389,22 @@ function startTask(task, config, repoRoot, voice, stream, taskStores, bruteForce
|
|
|
59369
59389
|
let dynamicContext = formatContextForPrompt(projectCtx, modelTier);
|
|
59370
59390
|
const environmentProvider = () => {
|
|
59371
59391
|
try {
|
|
59372
|
-
|
|
59392
|
+
let env = formatSnapshotForContext(collectSnapshot(repoRoot));
|
|
59393
|
+
const fullSubs = getAllFullSubAgents();
|
|
59394
|
+
if (fullSubs.length > 0) {
|
|
59395
|
+
const lines = ["\n<sub-agents>"];
|
|
59396
|
+
for (const sub of fullSubs) {
|
|
59397
|
+
const runtime = ((Date.now() - sub.startedAt) / 1e3).toFixed(0);
|
|
59398
|
+
const lastLine = sub.outputBuffer.length > 0 ? sub.outputBuffer[sub.outputBuffer.length - 1].slice(0, 80) : "";
|
|
59399
|
+
lines.push(` ${sub.id} [${sub.status}] PID:${sub.pid} ${runtime}s \u2014 ${sub.task.slice(0, 60)}`);
|
|
59400
|
+
if (lastLine)
|
|
59401
|
+
lines.push(` latest: ${lastLine}`);
|
|
59402
|
+
}
|
|
59403
|
+
lines.push(" Actions: full_sub_agent(action='status'|'output'|'stop', id='...')");
|
|
59404
|
+
lines.push("</sub-agents>");
|
|
59405
|
+
env += lines.join("\n");
|
|
59406
|
+
}
|
|
59407
|
+
return env;
|
|
59373
59408
|
} catch {
|
|
59374
59409
|
return "";
|
|
59375
59410
|
}
|
|
@@ -59572,6 +59607,7 @@ ${lines.join("\n")}
|
|
|
59572
59607
|
environmentProvider
|
|
59573
59608
|
});
|
|
59574
59609
|
runner.setWorkingDirectory(repoRoot);
|
|
59610
|
+
_activeRunnerRef = runner;
|
|
59575
59611
|
const tools = buildTools(repoRoot, config, contextWindowSize);
|
|
59576
59612
|
if (contextWindowSize && contextWindowSize > 0) {
|
|
59577
59613
|
for (const tool of tools) {
|
|
@@ -60399,6 +60435,23 @@ async function startInteractive(config, repoPath) {
|
|
|
60399
60435
|
statusBar.activate(scrollTop);
|
|
60400
60436
|
setTerminalTitle(void 0, version);
|
|
60401
60437
|
banner.onAfterRender = () => statusBar.renderHeaderButtons();
|
|
60438
|
+
if (_fullSubAgentToolRef) {
|
|
60439
|
+
_fullSubAgentToolRef.setCallbacks({
|
|
60440
|
+
onViewRegister: (id, label, type) => statusBar.registerAgentView(id, label, type),
|
|
60441
|
+
onViewWrite: (id, text) => statusBar.writeToAgentView(id, text),
|
|
60442
|
+
onViewStatus: (id, status) => statusBar.updateAgentViewStatus(id, status),
|
|
60443
|
+
onComplete: (id, task, exitCode, output) => {
|
|
60444
|
+
const summary = output.split("\n").filter((l) => l.trim()).slice(-5).join("\n");
|
|
60445
|
+
const status = exitCode === 0 ? "COMPLETED" : "FAILED";
|
|
60446
|
+
_activeRunnerRef?.injectUserMessage(`[Full sub-agent ${id} ${status}]
|
|
60447
|
+
Task: ${task.slice(0, 100)}
|
|
60448
|
+
Exit code: ${exitCode}
|
|
60449
|
+
Last output:
|
|
60450
|
+
${summary}
|
|
60451
|
+
Review its full output in the [${id}] tab or via full_sub_agent(action='output', id='${id}')`);
|
|
60452
|
+
}
|
|
60453
|
+
});
|
|
60454
|
+
}
|
|
60402
60455
|
statusBar.setBannerRefresh(() => {
|
|
60403
60456
|
banner.renderCurrentFrame();
|
|
60404
60457
|
});
|
|
@@ -63458,7 +63511,7 @@ Rules:
|
|
|
63458
63511
|
process.exit(1);
|
|
63459
63512
|
}
|
|
63460
63513
|
}
|
|
63461
|
-
var taskManager, _shellToolRef, SELF_IMPROVE_INTERVAL, _tasksSinceImprove;
|
|
63514
|
+
var taskManager, _shellToolRef, _fullSubAgentToolRef, _activeRunnerRef, SELF_IMPROVE_INTERVAL, _tasksSinceImprove;
|
|
63462
63515
|
var init_interactive = __esm({
|
|
63463
63516
|
"packages/cli/dist/tui/interactive.js"() {
|
|
63464
63517
|
"use strict";
|
|
@@ -63499,6 +63552,8 @@ var init_interactive = __esm({
|
|
|
63499
63552
|
init_neovim_mode();
|
|
63500
63553
|
taskManager = new BackgroundTaskManager();
|
|
63501
63554
|
_shellToolRef = null;
|
|
63555
|
+
_fullSubAgentToolRef = null;
|
|
63556
|
+
_activeRunnerRef = null;
|
|
63502
63557
|
SELF_IMPROVE_INTERVAL = 5;
|
|
63503
63558
|
_tasksSinceImprove = 0;
|
|
63504
63559
|
}
|
package/package.json
CHANGED