open-agents-ai 0.138.97 → 0.138.99

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 +119 -25
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -38606,15 +38606,35 @@ async function startNeovimMode(opts) {
38606
38606
  cleanedUp: false
38607
38607
  };
38608
38608
  _state = state;
38609
- const backLabel = " \u2190 back ";
38610
- const backStartCol = 2;
38611
- const backEndCol = backStartCol + backLabel.length - 1;
38612
- function renderBackButton() {
38609
+ const toolbarBtns = [];
38610
+ {
38611
+ const btns = [
38612
+ { label: " \u2190 back ", action: "back" },
38613
+ { label: " undo ", action: "undo" },
38614
+ { label: " redo ", action: "redo" },
38615
+ { label: " save ", action: "save" }
38616
+ ];
38617
+ let col = 2;
38618
+ for (const b of btns) {
38619
+ toolbarBtns.push({ label: b.label, startCol: col, endCol: col + b.label.length - 1, action: b.action });
38620
+ col += b.label.length + 1;
38621
+ }
38622
+ }
38623
+ function renderToolbar() {
38613
38624
  if (!isTTY5)
38614
38625
  return;
38615
- process.stdout.write(`\x1B7\x1B[1;${backStartCol}H\x1B]8;;oa-cmd:back\x07\x1B[38;5;245m\x1B[48;5;236m${backLabel}\x1B]8;;\x07\x1B[0m\x1B8`);
38626
+ let buf = "\x1B7";
38627
+ buf += `\x1B[2;1H\x1B[48;5;234m\x1B[2K`;
38628
+ for (const btn of toolbarBtns) {
38629
+ buf += `\x1B[2;${btn.startCol}H`;
38630
+ buf += `\x1B]8;;oa-cmd:${btn.action}\x07`;
38631
+ buf += `\x1B[38;5;245m\x1B[48;5;236m${btn.label}`;
38632
+ buf += `\x1B]8;;\x07`;
38633
+ }
38634
+ buf += "\x1B[0m\x1B8";
38635
+ process.stdout.write(buf);
38616
38636
  }
38617
- renderBackButton();
38637
+ renderToolbar();
38618
38638
  nvimPty.onData((data) => {
38619
38639
  if (state.cleanedUp)
38620
38640
  return;
@@ -38629,7 +38649,7 @@ async function startNeovimMode(opts) {
38629
38649
  } else {
38630
38650
  process.stdout.write(filtered);
38631
38651
  }
38632
- renderBackButton();
38652
+ renderToolbar();
38633
38653
  });
38634
38654
  nvimPty.onExit(() => {
38635
38655
  if (!state.cleanedUp) {
@@ -38662,14 +38682,26 @@ async function startNeovimMode(opts) {
38662
38682
  toggleFocus(state);
38663
38683
  return;
38664
38684
  }
38665
- const backClick = seq.match(/\x1B\[<0;(\d+);1M/);
38666
- if (backClick) {
38667
- const clickCol = parseInt(backClick[1]);
38668
- if (clickCol >= backStartCol && clickCol <= backEndCol) {
38669
- doCleanup(state);
38670
- return;
38685
+ const toolbarClick = seq.match(/\x1B\[<0;(\d+);2M/);
38686
+ if (toolbarClick) {
38687
+ const clickCol = parseInt(toolbarClick[1]);
38688
+ for (const btn of toolbarBtns) {
38689
+ if (clickCol >= btn.startCol && clickCol <= btn.endCol) {
38690
+ if (btn.action === "back") {
38691
+ doCleanup(state);
38692
+ } else if (btn.action === "undo") {
38693
+ nvimPty.write("\x1B:undo\r");
38694
+ } else if (btn.action === "redo") {
38695
+ nvimPty.write("\x1B:redo\r");
38696
+ } else if (btn.action === "save") {
38697
+ nvimPty.write("\x1B:wa\r");
38698
+ }
38699
+ return;
38700
+ }
38671
38701
  }
38672
38702
  }
38703
+ if (seq.match(/\x1B\[<0;(\d+);1M/))
38704
+ return;
38673
38705
  if (state.focused) {
38674
38706
  let normalized = seq.replace(/\x1BO([ABCD])/g, "\x1B[$1");
38675
38707
  if (topOffset > 0) {
@@ -51925,7 +51957,7 @@ function themeForTool(toolName) {
51925
51957
  return THEME_DEFAULT;
51926
51958
  }
51927
51959
  }
51928
- var DENSITY, WAVE, THEME_DEFAULT, THEME_FILE, THEME_SHELL, THEME_WEB, THEME_SEARCH, THEME_MEMORY, THEME_SKILL, THEME_TOOL_CREATE, THEME_DREAM, DEFAULT_METRICS, BrailleSpinner;
51960
+ var DENSITY, WAVE, EXTENDED_DENSITY, WAVE_EXT, particleHash, MOOD_RAMPS, THEME_DEFAULT, THEME_FILE, THEME_SHELL, THEME_WEB, THEME_SEARCH, THEME_MEMORY, THEME_SKILL, THEME_TOOL_CREATE, THEME_DREAM, DEFAULT_METRICS, BrailleSpinner;
51929
51961
  var init_braille_spinner = __esm({
51930
51962
  "packages/cli/dist/tui/braille-spinner.js"() {
51931
51963
  "use strict";
@@ -51950,6 +51982,47 @@ var init_braille_spinner = __esm({
51950
51982
  // all dots
51951
51983
  ];
51952
51984
  WAVE = [...DENSITY, ...DENSITY.slice(1, -1).reverse()];
51985
+ EXTENDED_DENSITY = [
51986
+ "\u2800",
51987
+ // empty
51988
+ "\xB7",
51989
+ // middle dot (matches header sparse particle)
51990
+ "\u2840",
51991
+ // dot 7
51992
+ "\u28C0",
51993
+ // dots 7,8
51994
+ "\u2591",
51995
+ // ░ light shade (header particle)
51996
+ "\u28E4",
51997
+ // dots 3,6,7,8
51998
+ "\u2592",
51999
+ // ▒ medium shade
52000
+ "\u28F7",
52001
+ // dots 1,2,3,5,6,7,8
52002
+ "\u2593",
52003
+ // ▓ dark shade
52004
+ "\u28FF",
52005
+ // all dots
52006
+ "\u2588"
52007
+ // █ full block (header solid)
52008
+ ];
52009
+ WAVE_EXT = [...EXTENDED_DENSITY, ...EXTENDED_DENSITY.slice(1, -1).reverse()];
52010
+ particleHash = (col, frame) => {
52011
+ const x = col * 13 + frame * 3 + 37;
52012
+ return (x * x * 31 + x * 17 + 59) % 97 / 97;
52013
+ };
52014
+ MOOD_RAMPS = {
52015
+ neutral: [237, 94, 130, 136, 172, 172, 178, 178, 214],
52016
+ // default amber→yellow
52017
+ success: [237, 22, 28, 34, 40, 46, 47, 48, 49],
52018
+ // green pulse
52019
+ error: [237, 52, 88, 124, 160, 196, 197, 203, 209],
52020
+ // red alert
52021
+ waiting: [237, 24, 25, 31, 32, 38, 39, 45, 51],
52022
+ // cool blue
52023
+ thinking: [237, 55, 91, 127, 163, 164, 170, 176, 213]
52024
+ // purple contemplation
52025
+ };
51953
52026
  THEME_DEFAULT = {
51954
52027
  ramp: [237, 94, 130, 136, 172, 172, 178, 178, 214],
51955
52028
  // grey → amber → yellow (matches header)
@@ -51992,7 +52065,8 @@ var init_braille_spinner = __esm({
51992
52065
  tokenRate: 0,
51993
52066
  isStreaming: false,
51994
52067
  snr: 0.5,
51995
- isDreaming: false
52068
+ isDreaming: false,
52069
+ mood: "neutral"
51996
52070
  };
51997
52071
  BrailleSpinner = class {
51998
52072
  frame = 0;
@@ -52064,10 +52138,15 @@ var init_braille_spinner = __esm({
52064
52138
  * - Dream mode: slower, deeper breathing with warm amber color override.
52065
52139
  */
52066
52140
  render(width) {
52067
- const cycleLen = WAVE.length;
52068
52141
  const m = this._metrics;
52142
+ const useExtended = m.isStreaming || m.isDreaming || m.mood !== "neutral";
52143
+ const wave = useExtended ? WAVE_EXT : WAVE;
52144
+ const cycleLen = wave.length;
52069
52145
  const activeTheme = m.isDreaming ? THEME_DREAM : this.theme;
52070
- const activeColorRamp = m.isDreaming ? buildColorRamp(THEME_DREAM.ramp) : this.colorRamp;
52146
+ const moodRamp = m.mood !== "neutral" ? MOOD_RAMPS[m.mood] : null;
52147
+ const baseRamp = moodRamp ?? (m.isDreaming ? THEME_DREAM.ramp : activeTheme.ramp);
52148
+ const extRamp = useExtended ? [...baseRamp, baseRamp[baseRamp.length - 1], baseRamp[baseRamp.length - 1]] : baseRamp;
52149
+ const activeColorRamp = buildColorRamp(extRamp);
52071
52150
  const baseSpeed = activeTheme.speed;
52072
52151
  const breathRate = m.isDreaming ? 0.04 : 0.08;
52073
52152
  const breathPhase = Math.sin(this.frame * breathRate);
@@ -52077,6 +52156,10 @@ var init_braille_spinner = __esm({
52077
52156
  speed = baseSpeed + rateBoost + breathPhase * 0.3;
52078
52157
  } else if (m.isDreaming) {
52079
52158
  speed = baseSpeed * 0.6 + breathPhase * 1.2;
52159
+ } else if (m.mood === "waiting") {
52160
+ speed = baseSpeed * 0.5 + breathPhase * 0.5;
52161
+ } else if (m.mood === "thinking") {
52162
+ speed = baseSpeed * 0.8 + breathPhase * 1.5;
52080
52163
  } else {
52081
52164
  speed = baseSpeed + breathPhase * 0.8;
52082
52165
  }
@@ -52087,31 +52170,42 @@ var init_braille_spinner = __esm({
52087
52170
  const slinkyFreq = 0.02 + (m.isStreaming ? 0.01 : 0);
52088
52171
  const slinkyAmp = 1.5 + pressure * 2;
52089
52172
  const jitterSeed = this.frame * 7919;
52173
+ const moodWaveShift = m.mood === "error" ? Math.sin(this.frame * 0.3) * 2 : 0;
52174
+ const moodDensityBoost = m.mood === "success" ? 0.2 : m.mood === "error" ? 0.3 : 0;
52090
52175
  let buf = "";
52091
52176
  let lastColor = -1;
52177
+ const halfCycle = Math.ceil(cycleLen / 2);
52092
52178
  for (let col = 0; col < width; col++) {
52093
52179
  const slinkyOffset = Math.sin(col * 0.1 + this.frame * slinkyFreq) * slinkyAmp;
52094
52180
  const jitterHash = Math.sin((col * 127 + jitterSeed) * 1e-3) * 2 + Math.cos((col * 311 + jitterSeed) * 7e-4) * 1.5;
52095
52181
  const snrJitter = jitterHash * entropy * 3;
52096
- const rawPhase = col * speed + this.frame + slinkyOffset + snrJitter;
52182
+ const rawPhase = col * speed + this.frame + slinkyOffset + snrJitter + moodWaveShift;
52097
52183
  const normalizedPhase = (rawPhase % cycleLen + cycleLen) % cycleLen;
52098
52184
  const waveIdx = Math.round(normalizedPhase) % cycleLen;
52099
52185
  let amplitude;
52100
- if (waveIdx <= 8) {
52186
+ if (waveIdx <= halfCycle) {
52101
52187
  amplitude = waveIdx;
52102
52188
  } else {
52103
- amplitude = 16 - waveIdx;
52189
+ amplitude = cycleLen - waveIdx;
52104
52190
  }
52105
- const scaledAmplitude = Math.round(amplitude * densityScale);
52191
+ const effectiveDensity = Math.min(1, densityScale + moodDensityBoost);
52192
+ const scaledAmplitude = Math.round(amplitude * effectiveDensity);
52106
52193
  let scaledIdx;
52107
- if (waveIdx <= 8) {
52194
+ if (waveIdx <= halfCycle) {
52108
52195
  scaledIdx = scaledAmplitude;
52109
52196
  } else {
52110
- scaledIdx = 16 - scaledAmplitude;
52197
+ scaledIdx = cycleLen - scaledAmplitude;
52111
52198
  }
52112
52199
  scaledIdx = Math.max(0, Math.min(cycleLen - 1, scaledIdx));
52113
- const ch = WAVE[scaledIdx];
52114
- const color = activeColorRamp[scaledIdx];
52200
+ let ch = wave[scaledIdx];
52201
+ if (useExtended && scaledIdx <= 2 && scaledIdx > 0) {
52202
+ const scatter = particleHash(col, this.frame);
52203
+ if (scatter < 0.3) {
52204
+ const sparseChars = ["\xB7", "\u2801", "\u2802", "\u2840", "\u2804"];
52205
+ ch = sparseChars[Math.floor(scatter * sparseChars.length * 3.33) % sparseChars.length];
52206
+ }
52207
+ }
52208
+ const color = activeColorRamp[Math.min(scaledIdx, activeColorRamp.length - 1)];
52115
52209
  if (color !== lastColor) {
52116
52210
  buf += `\x1B[38;5;${color}m`;
52117
52211
  lastColor = color;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.138.97",
3
+ "version": "0.138.99",
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",