open-agents-ai 0.20.1 → 0.21.1

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 +123 -56
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
4
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
@@ -15075,16 +15074,15 @@ async function handleUpdate(subcommand, ctx) {
15075
15074
  process.stdout.write(` ${c2.green("\u2714")} Installed v${info.latestVersion}. Reloading...
15076
15075
 
15077
15076
  `);
15078
- if (ctx.savePendingTaskState) {
15079
- ctx.savePendingTaskState();
15080
- }
15077
+ const hadActiveTask = ctx.savePendingTaskState?.() ?? false;
15078
+ const resumeFlag = hadActiveTask ? "1" : "update-only";
15081
15079
  const { execPath, argv } = process;
15082
15080
  try {
15083
15081
  const { execFileSync } = await import("node:child_process");
15084
- process.env.__OA_RESUMED = "1";
15082
+ process.env.__OA_RESUMED = resumeFlag;
15085
15083
  execFileSync(execPath, argv.slice(1), {
15086
15084
  stdio: "inherit",
15087
- env: { ...process.env, __OA_RESUMED: "1" }
15085
+ env: { ...process.env, __OA_RESUMED: resumeFlag }
15088
15086
  });
15089
15087
  } catch {
15090
15088
  renderWarning("Reload failed. Restart oa manually to use the new version.");
@@ -18007,68 +18005,107 @@ ${files.map((f) => `- [\`${f}\`](./${f})`).join("\n")}
18007
18005
  });
18008
18006
 
18009
18007
  // packages/cli/dist/tui/braille-spinner.js
18010
- var DENSITY, WAVE, COLOR_RAMP, BrailleSpinner;
18008
+ function buildColorRamp(ramp) {
18009
+ return [...ramp, ...ramp.slice(1, -1).reverse()];
18010
+ }
18011
+ function themeForTool(toolName) {
18012
+ if (!toolName)
18013
+ return THEME_DEFAULT;
18014
+ switch (toolName) {
18015
+ case "file_read":
18016
+ case "file_write":
18017
+ case "file_edit":
18018
+ case "file_patch":
18019
+ case "batch_edit":
18020
+ return THEME_FILE;
18021
+ case "shell":
18022
+ case "background_run":
18023
+ return THEME_SHELL;
18024
+ case "web_search":
18025
+ case "web_fetch":
18026
+ return THEME_WEB;
18027
+ case "grep_search":
18028
+ case "find_files":
18029
+ case "list_directory":
18030
+ case "codebase_map":
18031
+ case "diagnostic":
18032
+ case "git_info":
18033
+ return THEME_SEARCH;
18034
+ case "memory_read":
18035
+ case "memory_write":
18036
+ return THEME_MEMORY;
18037
+ case "create_tool":
18038
+ case "manage_tools":
18039
+ return THEME_TOOL_CREATE;
18040
+ default:
18041
+ if (toolName.startsWith("aiwg_") || toolName.startsWith("skill_")) {
18042
+ return THEME_SKILL;
18043
+ }
18044
+ return THEME_DEFAULT;
18045
+ }
18046
+ }
18047
+ var DENSITY, WAVE, THEME_DEFAULT, THEME_FILE, THEME_SHELL, THEME_WEB, THEME_SEARCH, THEME_MEMORY, THEME_SKILL, THEME_TOOL_CREATE, BrailleSpinner;
18011
18048
  var init_braille_spinner = __esm({
18012
18049
  "packages/cli/dist/tui/braille-spinner.js"() {
18013
18050
  "use strict";
18014
18051
  DENSITY = [
18015
18052
  "\u2800",
18016
- // ⠀ empty
18053
+ // empty
18017
18054
  "\u2840",
18018
- // ⡀ dot 7
18055
+ // dot 7
18019
18056
  "\u28C0",
18020
- // ⣀ dots 7,8
18057
+ // dots 7,8
18021
18058
  "\u28C4",
18022
- // ⣄ dots 3,7,8
18059
+ // dots 3,7,8
18023
18060
  "\u28E4",
18024
- // ⣤ dots 3,6,7,8
18061
+ // dots 3,6,7,8
18025
18062
  "\u28E6",
18026
- // ⣦ dots 2,3,6,7,8
18063
+ // dots 2,3,6,7,8
18027
18064
  "\u28F6",
18028
- // ⣶ dots 2,3,5,6,7,8
18065
+ // dots 2,3,5,6,7,8
18029
18066
  "\u28F7",
18030
- // ⣷ dots 1,2,3,5,6,7,8
18067
+ // dots 1,2,3,5,6,7,8
18031
18068
  "\u28FF"
18032
- // ⣿ all dots
18069
+ // all dots
18033
18070
  ];
18034
18071
  WAVE = [...DENSITY, ...DENSITY.slice(1, -1).reverse()];
18035
- COLOR_RAMP = [
18036
- 237,
18037
- // ⠀ very dim gray
18038
- 60,
18039
- // ⡀ muted lavender
18040
- 97,
18041
- // ⣀ dim purple
18042
- 97,
18043
- // ⣄ dim purple
18044
- 141,
18045
- // ⣤ medium purple
18046
- 141,
18047
- // ⣦ medium purple
18048
- 183,
18049
- // ⣶ light lavender
18050
- 183,
18051
- // ⣷ light lavender
18052
- 189,
18053
- // ⣿ bright lavender
18054
- 183,
18055
- // ⣷ (descending)
18056
- 183,
18057
- // ⣶
18058
- 141,
18059
- // ⣦
18060
- 141,
18061
- // ⣤
18062
- 97,
18063
- // ⣄
18064
- 97,
18065
- // ⣀
18066
- 60
18067
- // ⡀
18068
- ];
18072
+ THEME_DEFAULT = {
18073
+ ramp: [237, 60, 97, 97, 141, 141, 183, 183, 189],
18074
+ speed: 2
18075
+ };
18076
+ THEME_FILE = {
18077
+ ramp: [237, 34, 70, 71, 77, 78, 114, 150, 157],
18078
+ speed: 2
18079
+ };
18080
+ THEME_SHELL = {
18081
+ ramp: [237, 37, 73, 79, 80, 116, 117, 152, 158],
18082
+ speed: 3
18083
+ };
18084
+ THEME_WEB = {
18085
+ ramp: [237, 25, 26, 32, 33, 68, 69, 110, 153],
18086
+ speed: 1
18087
+ };
18088
+ THEME_SEARCH = {
18089
+ ramp: [237, 60, 97, 98, 134, 135, 141, 177, 189],
18090
+ speed: 4
18091
+ };
18092
+ THEME_MEMORY = {
18093
+ ramp: [237, 136, 172, 178, 179, 214, 215, 220, 222],
18094
+ speed: 1
18095
+ };
18096
+ THEME_SKILL = {
18097
+ ramp: [237, 168, 169, 175, 176, 211, 212, 217, 219],
18098
+ speed: 2
18099
+ };
18100
+ THEME_TOOL_CREATE = {
18101
+ ramp: [237, 173, 174, 179, 180, 215, 216, 222, 229],
18102
+ speed: 2
18103
+ };
18069
18104
  BrailleSpinner = class {
18070
18105
  frame = 0;
18071
18106
  timer = null;
18107
+ theme = THEME_DEFAULT;
18108
+ colorRamp = buildColorRamp(THEME_DEFAULT.ramp);
18072
18109
  /** Start the animation, calling `onFrame` every tick (~80 ms). */
18073
18110
  start(onFrame) {
18074
18111
  this.frame = 0;
@@ -18084,24 +18121,38 @@ var init_braille_spinner = __esm({
18084
18121
  this.timer = null;
18085
18122
  }
18086
18123
  this.frame = 0;
18124
+ this.setTool(null);
18087
18125
  }
18088
18126
  /** Whether the animation timer is active. */
18089
18127
  get isRunning() {
18090
18128
  return this.timer !== null;
18091
18129
  }
18130
+ /**
18131
+ * Set the active tool, changing the animation color theme and speed.
18132
+ * Pass null to return to the default idle theme.
18133
+ */
18134
+ setTool(toolName) {
18135
+ const next = themeForTool(toolName);
18136
+ if (next !== this.theme) {
18137
+ this.theme = next;
18138
+ this.colorRamp = buildColorRamp(next.ramp);
18139
+ }
18140
+ }
18092
18141
  /**
18093
18142
  * Render the current animation frame as an ANSI-colored string.
18094
18143
  * Each column gets a braille character whose density and color vary
18095
18144
  * sinusoidally, shifted by `this.frame` to create movement.
18145
+ * The column multiplier (speed) and colors come from the active tool theme.
18096
18146
  */
18097
18147
  render(width) {
18098
18148
  const cycleLen = WAVE.length;
18149
+ const speed = this.theme.speed;
18099
18150
  let buf = "";
18100
18151
  let lastColor = -1;
18101
18152
  for (let col = 0; col < width; col++) {
18102
- const idx = (col * 2 + this.frame) % cycleLen;
18153
+ const idx = (col * speed + this.frame) % cycleLen;
18103
18154
  const ch = WAVE[idx];
18104
- const color = COLOR_RAMP[idx];
18155
+ const color = this.colorRamp[idx];
18105
18156
  if (color !== lastColor) {
18106
18157
  buf += `\x1B[38;5;${color}m`;
18107
18158
  lastColor = color;
@@ -18214,6 +18265,14 @@ var init_status_bar = __esm({
18214
18265
  this.renderBufferLine();
18215
18266
  }
18216
18267
  }
18268
+ /**
18269
+ * Set the active tool for the braille spinner animation.
18270
+ * Changes the spinner's color theme and wave speed to reflect the tool category.
18271
+ * Pass null to return to the default idle theme (e.g. on tool_result).
18272
+ */
18273
+ setActiveTool(toolName) {
18274
+ this._brailleSpinner.setTool(toolName);
18275
+ }
18217
18276
  /** Context window size to display. Can be updated if model changes. */
18218
18277
  setContextWindowSize(size) {
18219
18278
  this.metrics.contextWindowSize = size;
@@ -18759,6 +18818,7 @@ function startTask(task, config, repoRoot, voice, stream, taskStores, bruteForce
18759
18818
  }
18760
18819
  }
18761
18820
  lastToolCall = { name: event.toolName ?? "unknown", args: event.toolArgs ?? {} };
18821
+ statusBar?.setActiveTool(event.toolName ?? null);
18762
18822
  contentWrite(() => {
18763
18823
  if (voice?.enabled) {
18764
18824
  const desc = describeToolCall(event.toolName ?? "unknown", event.toolArgs ?? {});
@@ -18773,6 +18833,7 @@ function startTask(task, config, repoRoot, voice, stream, taskStores, bruteForce
18773
18833
  editHistory.logToolCall(lastToolCall.name, lastToolCall.args, event.success ?? false);
18774
18834
  lastToolCall = null;
18775
18835
  }
18836
+ statusBar?.setActiveTool(null);
18776
18837
  contentWrite(() => {
18777
18838
  renderToolResult(event.toolName ?? "unknown", event.success ?? false, event.content ?? "");
18778
18839
  if (voice?.enabled && !(event.success ?? true)) {
@@ -18904,7 +18965,9 @@ function startTask(task, config, repoRoot, voice, stream, taskStores, bruteForce
18904
18965
  }
18905
18966
  async function startInteractive(config, repoPath) {
18906
18967
  const repoRoot = resolve16(repoPath ?? cwd());
18907
- const isResumed = !!process.env.__OA_RESUMED;
18968
+ const resumeFlag = process.env.__OA_RESUMED ?? "";
18969
+ const isResumed = resumeFlag !== "";
18970
+ const hasTaskToResume = resumeFlag === "1";
18908
18971
  if (isResumed) {
18909
18972
  delete process.env.__OA_RESUMED;
18910
18973
  }
@@ -18994,8 +19057,10 @@ async function startInteractive(config, repoPath) {
18994
19057
  let carouselLines = 0;
18995
19058
  const version = getVersion();
18996
19059
  if (isResumed) {
18997
- renderInfo(`Updated to v${version} \u2014 picking up where you left off.
18998
- `);
19060
+ const resumeMsg = hasTaskToResume ? `Updated to v${version} \u2014 picking up where you left off.
19061
+ ` : `Updated to v${version}.
19062
+ `;
19063
+ renderInfo(resumeMsg);
18999
19064
  } else {
19000
19065
  process.stdout.write("\x1B[2J\x1B[H");
19001
19066
  carouselLines = carousel.start();
@@ -19214,7 +19279,9 @@ async function startInteractive(config, repoPath) {
19214
19279
  savedAt: (/* @__PURE__ */ new Date()).toISOString(),
19215
19280
  toolCallCount: sessionToolCallCount
19216
19281
  });
19282
+ return true;
19217
19283
  }
19284
+ return false;
19218
19285
  },
19219
19286
  dreamStart(mode) {
19220
19287
  if (activeTask) {
@@ -19307,7 +19374,7 @@ async function startInteractive(config, repoPath) {
19307
19374
  setColors: (enabled) => setColorsEnabled(enabled)
19308
19375
  };
19309
19376
  showPrompt();
19310
- if (isResumed) {
19377
+ if (hasTaskToResume) {
19311
19378
  const pendingTask = loadPendingTask(repoRoot);
19312
19379
  if (pendingTask) {
19313
19380
  setTimeout(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.20.1",
3
+ "version": "0.21.1",
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",