open-agents-ai 0.34.0 → 0.34.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 +134 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -21970,12 +21970,113 @@ var init_braille_spinner = __esm({
21970
21970
  });
21971
21971
 
21972
21972
  // packages/cli/dist/tui/status-bar.js
21973
- var StatusBar;
21973
+ var EXPERT_TOOL_BASELINES, CONTEXT_SWITCH_OVERHEAD, TURN_PLANNING_OVERHEAD, DEFAULT_TOOL_BASELINE, HumanSpeedTracker, StatusBar;
21974
21974
  var init_status_bar = __esm({
21975
21975
  "packages/cli/dist/tui/status-bar.js"() {
21976
21976
  "use strict";
21977
21977
  init_render();
21978
21978
  init_braille_spinner();
21979
+ EXPERT_TOOL_BASELINES = {
21980
+ file_read: 12,
21981
+ structured_read: 15,
21982
+ file_write: 90,
21983
+ structured_file: 90,
21984
+ file_edit: 25,
21985
+ file_patch: 90,
21986
+ batch_edit: 90,
21987
+ grep_search: 15,
21988
+ glob_find: 8,
21989
+ shell: 20,
21990
+ web_fetch: 45,
21991
+ web_search: 60,
21992
+ web_crawl: 90,
21993
+ memory_read: 5,
21994
+ memory_write: 15,
21995
+ memory_search: 10,
21996
+ list_directory: 5,
21997
+ codebase_map: 180,
21998
+ git_info: 8,
21999
+ diagnostic: 10,
22000
+ explore_tools: 10,
22001
+ image_read: 8,
22002
+ screenshot: 15,
22003
+ ocr: 20,
22004
+ ocr_pdf: 30,
22005
+ pdf_to_text: 20,
22006
+ ocr_image_advanced: 30,
22007
+ transcribe_file: 60,
22008
+ transcribe_url: 60,
22009
+ vision: 15,
22010
+ desktop_click: 5,
22011
+ desktop_describe: 10,
22012
+ code_sandbox: 45,
22013
+ skill_list: 5,
22014
+ skill_execute: 30,
22015
+ create_tool: 120,
22016
+ manage_tools: 15,
22017
+ aiwg_setup: 30,
22018
+ aiwg_health: 10,
22019
+ aiwg_workflow: 30,
22020
+ background_run: 30,
22021
+ task_status: 5,
22022
+ task_output: 5,
22023
+ task_stop: 3,
22024
+ task_complete: 0
22025
+ };
22026
+ CONTEXT_SWITCH_OVERHEAD = 5;
22027
+ TURN_PLANNING_OVERHEAD = 15;
22028
+ DEFAULT_TOOL_BASELINE = 20;
22029
+ HumanSpeedTracker = class {
22030
+ /** Accumulated estimated human-expert time in seconds */
22031
+ humanTimeS = 0;
22032
+ /** Accumulated agent wall-clock time in milliseconds */
22033
+ agentTimeMs = 0;
22034
+ /** Timestamp when current task started (0 = no active task) */
22035
+ taskStartMs = 0;
22036
+ /** Number of tool calls in current session */
22037
+ toolCalls = 0;
22038
+ /** Number of turns in current session */
22039
+ turns = 0;
22040
+ /** Record a tool call — adds the expert baseline time */
22041
+ recordToolCall(toolName) {
22042
+ const baseline = EXPERT_TOOL_BASELINES[toolName] ?? DEFAULT_TOOL_BASELINE;
22043
+ this.humanTimeS += baseline + CONTEXT_SWITCH_OVERHEAD;
22044
+ this.toolCalls++;
22045
+ }
22046
+ /** Record a turn (assistant reasoning cycle) */
22047
+ recordTurn() {
22048
+ this.humanTimeS += TURN_PLANNING_OVERHEAD;
22049
+ this.turns++;
22050
+ }
22051
+ /** Mark the start of a task (for wall-clock tracking) */
22052
+ taskStart() {
22053
+ this.taskStartMs = Date.now();
22054
+ }
22055
+ /** Mark the end of a task — accumulates elapsed wall-clock time */
22056
+ taskEnd() {
22057
+ if (this.taskStartMs > 0) {
22058
+ this.agentTimeMs += Date.now() - this.taskStartMs;
22059
+ this.taskStartMs = 0;
22060
+ }
22061
+ }
22062
+ /**
22063
+ * Get the current speed ratio (human expert time / agent time).
22064
+ * Returns 0 if no work has been done yet.
22065
+ * During an active task, includes in-flight elapsed time.
22066
+ */
22067
+ getSpeedRatio() {
22068
+ if (this.humanTimeS === 0)
22069
+ return 0;
22070
+ const totalAgentMs = this.agentTimeMs + (this.taskStartMs > 0 ? Date.now() - this.taskStartMs : 0);
22071
+ if (totalAgentMs <= 0)
22072
+ return 0;
22073
+ return this.humanTimeS * 1e3 / totalAgentMs;
22074
+ }
22075
+ /** Whether any work has been recorded */
22076
+ get hasData() {
22077
+ return this.toolCalls > 0;
22078
+ }
22079
+ };
21979
22080
  StatusBar = class {
21980
22081
  metrics = {
21981
22082
  promptTokens: 0,
@@ -22114,6 +22215,24 @@ var init_status_bar = __esm({
22114
22215
  setContextWindowSize(size) {
22115
22216
  this.metrics.contextWindowSize = size;
22116
22217
  }
22218
+ /** Human expert speed ratio tracker */
22219
+ _speedTracker = new HumanSpeedTracker();
22220
+ /** Record a tool call for speed ratio tracking */
22221
+ recordSpeedToolCall(toolName) {
22222
+ this._speedTracker.recordToolCall(toolName);
22223
+ }
22224
+ /** Record a turn for speed ratio tracking */
22225
+ recordSpeedTurn() {
22226
+ this._speedTracker.recordTurn();
22227
+ }
22228
+ /** Mark task start for speed ratio wall-clock tracking */
22229
+ recordSpeedTaskStart() {
22230
+ this._speedTracker.taskStart();
22231
+ }
22232
+ /** Mark task end for speed ratio wall-clock tracking */
22233
+ recordSpeedTaskEnd() {
22234
+ this._speedTracker.taskEnd();
22235
+ }
22117
22236
  /** Model capabilities — shown as emoji indicators on the status bar */
22118
22237
  _caps = {
22119
22238
  vision: false,
@@ -22320,6 +22439,15 @@ var init_status_bar = __esm({
22320
22439
  const costStr = m.estimatedCost < 0.01 ? `$${m.estimatedCost.toFixed(4)}` : m.estimatedCost < 1 ? `$${m.estimatedCost.toFixed(3)}` : `$${m.estimatedCost.toFixed(2)}`;
22321
22440
  costLabel = pipe + pastel2(222, "Cost: ") + c2.bold(costStr);
22322
22441
  }
22442
+ let speedLabel = "";
22443
+ if (this._speedTracker.hasData) {
22444
+ const ratio = this._speedTracker.getSpeedRatio();
22445
+ if (ratio > 0) {
22446
+ const ratioStr = ratio >= 10 ? `${Math.round(ratio)}x` : `${ratio.toFixed(1)}x`;
22447
+ const ratioColor = ratio >= 2 ? c2.green : ratio >= 1 ? c2.yellow : c2.red;
22448
+ speedLabel = pipe + pastel2(218, "Exp: ") + ratioColor(c2.bold(ratioStr));
22449
+ }
22450
+ }
22323
22451
  let recordingLabel = "";
22324
22452
  if (this._recording) {
22325
22453
  const dot = this._recBlink ? pastel2(210, "\u25CF") : " ";
@@ -22334,7 +22462,7 @@ var init_status_bar = __esm({
22334
22462
  if (this._caps.thinking)
22335
22463
  capParts.push("\u{1F9E0}");
22336
22464
  const capsLabel = capParts.length > 0 ? pipe + pastel2(183, capParts.join(" ")) : "";
22337
- return ` ${tokInLabel}${pipe}${tokOutLabel}${pipe}${ctxLabel}${costLabel}${capsLabel}${recordingLabel}`;
22465
+ return ` ${tokInLabel}${pipe}${tokOutLabel}${pipe}${ctxLabel}${speedLabel}${costLabel}${capsLabel}${recordingLabel}`;
22338
22466
  }
22339
22467
  // -------------------------------------------------------------------------
22340
22468
  // Private
@@ -22939,6 +23067,7 @@ ${entry.fullContent}`
22939
23067
  }
22940
23068
  }
22941
23069
  lastToolCall = { name: event.toolName ?? "unknown", args: event.toolArgs ?? {} };
23070
+ statusBar?.recordSpeedToolCall(event.toolName ?? "unknown");
22942
23071
  statusBar?.setActiveTool(event.toolName ?? null);
22943
23072
  contentWrite(() => {
22944
23073
  if (voice?.enabled) {
@@ -22967,6 +23096,7 @@ ${entry.fullContent}`
22967
23096
  });
22968
23097
  break;
22969
23098
  case "model_response":
23099
+ statusBar?.recordSpeedTurn();
22970
23100
  if (config.verbose && !stream?.enabled && event.content) {
22971
23101
  contentWrite(() => renderAssistantText(event.content));
22972
23102
  }
@@ -24002,6 +24132,7 @@ NEW TASK: ${fullInput}`;
24002
24132
  }
24003
24133
  try {
24004
24134
  statusBar.setProcessing(true);
24135
+ statusBar.recordSpeedTaskStart();
24005
24136
  const task = startTask(taskInput, currentConfig, repoRoot, voiceEngine, {
24006
24137
  enabled: streamEnabled,
24007
24138
  renderer: streamRenderer
@@ -24040,6 +24171,7 @@ NEW TASK: ${fullInput}`;
24040
24171
  }
24041
24172
  } finally {
24042
24173
  statusBar.setProcessing(false);
24174
+ statusBar.recordSpeedTaskEnd();
24043
24175
  if (activeTask) {
24044
24176
  sessionFilesTouched = Array.from(activeTask.filesTouched);
24045
24177
  sessionToolCallCount = activeTask.toolCallCount;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.34.0",
3
+ "version": "0.34.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",