open-agents-ai 0.20.2 → 0.21.2

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 +109 -47
  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, {
@@ -18006,68 +18005,107 @@ ${files.map((f) => `- [\`${f}\`](./${f})`).join("\n")}
18006
18005
  });
18007
18006
 
18008
18007
  // packages/cli/dist/tui/braille-spinner.js
18009
- 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;
18010
18048
  var init_braille_spinner = __esm({
18011
18049
  "packages/cli/dist/tui/braille-spinner.js"() {
18012
18050
  "use strict";
18013
18051
  DENSITY = [
18014
18052
  "\u2800",
18015
- // empty
18053
+ // empty
18016
18054
  "\u2840",
18017
- // dot 7
18055
+ // dot 7
18018
18056
  "\u28C0",
18019
- // dots 7,8
18057
+ // dots 7,8
18020
18058
  "\u28C4",
18021
- // dots 3,7,8
18059
+ // dots 3,7,8
18022
18060
  "\u28E4",
18023
- // dots 3,6,7,8
18061
+ // dots 3,6,7,8
18024
18062
  "\u28E6",
18025
- // dots 2,3,6,7,8
18063
+ // dots 2,3,6,7,8
18026
18064
  "\u28F6",
18027
- // dots 2,3,5,6,7,8
18065
+ // dots 2,3,5,6,7,8
18028
18066
  "\u28F7",
18029
- // dots 1,2,3,5,6,7,8
18067
+ // dots 1,2,3,5,6,7,8
18030
18068
  "\u28FF"
18031
- // all dots
18069
+ // all dots
18032
18070
  ];
18033
18071
  WAVE = [...DENSITY, ...DENSITY.slice(1, -1).reverse()];
18034
- COLOR_RAMP = [
18035
- 237,
18036
- // ⠀ very dim gray
18037
- 60,
18038
- // muted lavender
18039
- 97,
18040
- // ⣀ dim purple
18041
- 97,
18042
- // dim purple
18043
- 141,
18044
- // ⣤ medium purple
18045
- 141,
18046
- // medium purple
18047
- 183,
18048
- // ⣶ light lavender
18049
- 183,
18050
- // light lavender
18051
- 189,
18052
- // ⣿ bright lavender
18053
- 183,
18054
- // (descending)
18055
- 183,
18056
- //
18057
- 141,
18058
- //
18059
- 141,
18060
- //
18061
- 97,
18062
- //
18063
- 97,
18064
- //
18065
- 60
18066
- // ⡀
18067
- ];
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
+ };
18068
18104
  BrailleSpinner = class {
18069
18105
  frame = 0;
18070
18106
  timer = null;
18107
+ theme = THEME_DEFAULT;
18108
+ colorRamp = buildColorRamp(THEME_DEFAULT.ramp);
18071
18109
  /** Start the animation, calling `onFrame` every tick (~80 ms). */
18072
18110
  start(onFrame) {
18073
18111
  this.frame = 0;
@@ -18083,24 +18121,38 @@ var init_braille_spinner = __esm({
18083
18121
  this.timer = null;
18084
18122
  }
18085
18123
  this.frame = 0;
18124
+ this.setTool(null);
18086
18125
  }
18087
18126
  /** Whether the animation timer is active. */
18088
18127
  get isRunning() {
18089
18128
  return this.timer !== null;
18090
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
+ }
18091
18141
  /**
18092
18142
  * Render the current animation frame as an ANSI-colored string.
18093
18143
  * Each column gets a braille character whose density and color vary
18094
18144
  * sinusoidally, shifted by `this.frame` to create movement.
18145
+ * The column multiplier (speed) and colors come from the active tool theme.
18095
18146
  */
18096
18147
  render(width) {
18097
18148
  const cycleLen = WAVE.length;
18149
+ const speed = this.theme.speed;
18098
18150
  let buf = "";
18099
18151
  let lastColor = -1;
18100
18152
  for (let col = 0; col < width; col++) {
18101
- const idx = (col * 2 + this.frame) % cycleLen;
18153
+ const idx = (col * speed + this.frame) % cycleLen;
18102
18154
  const ch = WAVE[idx];
18103
- const color = COLOR_RAMP[idx];
18155
+ const color = this.colorRamp[idx];
18104
18156
  if (color !== lastColor) {
18105
18157
  buf += `\x1B[38;5;${color}m`;
18106
18158
  lastColor = color;
@@ -18213,6 +18265,14 @@ var init_status_bar = __esm({
18213
18265
  this.renderBufferLine();
18214
18266
  }
18215
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
+ }
18216
18276
  /** Context window size to display. Can be updated if model changes. */
18217
18277
  setContextWindowSize(size) {
18218
18278
  this.metrics.contextWindowSize = size;
@@ -18758,6 +18818,7 @@ function startTask(task, config, repoRoot, voice, stream, taskStores, bruteForce
18758
18818
  }
18759
18819
  }
18760
18820
  lastToolCall = { name: event.toolName ?? "unknown", args: event.toolArgs ?? {} };
18821
+ statusBar?.setActiveTool(event.toolName ?? null);
18761
18822
  contentWrite(() => {
18762
18823
  if (voice?.enabled) {
18763
18824
  const desc = describeToolCall(event.toolName ?? "unknown", event.toolArgs ?? {});
@@ -18772,6 +18833,7 @@ function startTask(task, config, repoRoot, voice, stream, taskStores, bruteForce
18772
18833
  editHistory.logToolCall(lastToolCall.name, lastToolCall.args, event.success ?? false);
18773
18834
  lastToolCall = null;
18774
18835
  }
18836
+ statusBar?.setActiveTool(null);
18775
18837
  contentWrite(() => {
18776
18838
  renderToolResult(event.toolName ?? "unknown", event.success ?? false, event.content ?? "");
18777
18839
  if (voice?.enabled && !(event.success ?? true)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.20.2",
3
+ "version": "0.21.2",
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",