open-agents-ai 0.157.0 → 0.158.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.
Files changed (2) hide show
  1. package/dist/index.js +55 -5
  2. 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 {
@@ -59141,8 +59153,11 @@ function buildTools(repoRoot, config, contextWindowSize) {
59141
59153
  new SemanticMapTool(repoRoot),
59142
59154
  new RepoMapTool(repoRoot),
59143
59155
  new ProcessHealthTool(),
59144
- // Full OA sub-process spawning (wired to tab bar later via setStatusBar)
59145
- new FullSubAgentTool(repoRoot, config.model, config.backendUrl),
59156
+ // Full OA sub-process callbacks wired after runner + statusBar created
59157
+ (() => {
59158
+ _fullSubAgentToolRef = new FullSubAgentTool(repoRoot, config.model, config.backendUrl);
59159
+ return _fullSubAgentToolRef;
59160
+ })(),
59146
59161
  // Nexus P2P networking + x402 micropayments
59147
59162
  new NexusTool(repoRoot)
59148
59163
  ];
@@ -59369,7 +59384,22 @@ function startTask(task, config, repoRoot, voice, stream, taskStores, bruteForce
59369
59384
  let dynamicContext = formatContextForPrompt(projectCtx, modelTier);
59370
59385
  const environmentProvider = () => {
59371
59386
  try {
59372
- return formatSnapshotForContext(collectSnapshot(repoRoot));
59387
+ let env = formatSnapshotForContext(collectSnapshot(repoRoot));
59388
+ const fullSubs = getAllFullSubAgents();
59389
+ if (fullSubs.length > 0) {
59390
+ const lines = ["\n<sub-agents>"];
59391
+ for (const sub of fullSubs) {
59392
+ const runtime = ((Date.now() - sub.startedAt) / 1e3).toFixed(0);
59393
+ const lastLine = sub.outputBuffer.length > 0 ? sub.outputBuffer[sub.outputBuffer.length - 1].slice(0, 80) : "";
59394
+ lines.push(` ${sub.id} [${sub.status}] PID:${sub.pid} ${runtime}s \u2014 ${sub.task.slice(0, 60)}`);
59395
+ if (lastLine)
59396
+ lines.push(` latest: ${lastLine}`);
59397
+ }
59398
+ lines.push(" Actions: full_sub_agent(action='status'|'output'|'stop', id='...')");
59399
+ lines.push("</sub-agents>");
59400
+ env += lines.join("\n");
59401
+ }
59402
+ return env;
59373
59403
  } catch {
59374
59404
  return "";
59375
59405
  }
@@ -59572,6 +59602,7 @@ ${lines.join("\n")}
59572
59602
  environmentProvider
59573
59603
  });
59574
59604
  runner.setWorkingDirectory(repoRoot);
59605
+ _activeRunnerRef = runner;
59575
59606
  const tools = buildTools(repoRoot, config, contextWindowSize);
59576
59607
  if (contextWindowSize && contextWindowSize > 0) {
59577
59608
  for (const tool of tools) {
@@ -60399,6 +60430,23 @@ async function startInteractive(config, repoPath) {
60399
60430
  statusBar.activate(scrollTop);
60400
60431
  setTerminalTitle(void 0, version);
60401
60432
  banner.onAfterRender = () => statusBar.renderHeaderButtons();
60433
+ if (_fullSubAgentToolRef) {
60434
+ _fullSubAgentToolRef.setCallbacks({
60435
+ onViewRegister: (id, label, type) => statusBar.registerAgentView(id, label, type),
60436
+ onViewWrite: (id, text) => statusBar.writeToAgentView(id, text),
60437
+ onViewStatus: (id, status) => statusBar.updateAgentViewStatus(id, status),
60438
+ onComplete: (id, task, exitCode, output) => {
60439
+ const summary = output.split("\n").filter((l) => l.trim()).slice(-5).join("\n");
60440
+ const status = exitCode === 0 ? "COMPLETED" : "FAILED";
60441
+ _activeRunnerRef?.injectUserMessage(`[Full sub-agent ${id} ${status}]
60442
+ Task: ${task.slice(0, 100)}
60443
+ Exit code: ${exitCode}
60444
+ Last output:
60445
+ ${summary}
60446
+ Review its full output in the [${id}] tab or via full_sub_agent(action='output', id='${id}')`);
60447
+ }
60448
+ });
60449
+ }
60402
60450
  statusBar.setBannerRefresh(() => {
60403
60451
  banner.renderCurrentFrame();
60404
60452
  });
@@ -63458,7 +63506,7 @@ Rules:
63458
63506
  process.exit(1);
63459
63507
  }
63460
63508
  }
63461
- var taskManager, _shellToolRef, SELF_IMPROVE_INTERVAL, _tasksSinceImprove;
63509
+ var taskManager, _shellToolRef, _fullSubAgentToolRef, _activeRunnerRef, SELF_IMPROVE_INTERVAL, _tasksSinceImprove;
63462
63510
  var init_interactive = __esm({
63463
63511
  "packages/cli/dist/tui/interactive.js"() {
63464
63512
  "use strict";
@@ -63499,6 +63547,8 @@ var init_interactive = __esm({
63499
63547
  init_neovim_mode();
63500
63548
  taskManager = new BackgroundTaskManager();
63501
63549
  _shellToolRef = null;
63550
+ _fullSubAgentToolRef = null;
63551
+ _activeRunnerRef = null;
63502
63552
  SELF_IMPROVE_INTERVAL = 5;
63503
63553
  _tasksSinceImprove = 0;
63504
63554
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.157.0",
3
+ "version": "0.158.0",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",