open-agents-ai 0.187.291 → 0.187.293

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 +66 -17
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -285044,6 +285044,42 @@ function truncate2(s2, max) {
285044
285044
  if (s2.length <= max) return s2.padEnd(max, " ");
285045
285045
  return s2.slice(0, Math.max(0, max - 1)) + "…";
285046
285046
  }
285047
+ function stripAnsi2(s2) {
285048
+ return s2.replace(/\x1B\[[0-9;]*[A-Za-z]/g, "").replace(/\x1B\][^\x07]*\x07/g, "").replace(/\x1B[()][A-Z0-9]/g, "").replace(/\x1B\[?\??[0-9;]*[a-zA-Z]/g, "").replace(/\x1B/g, "");
285049
+ }
285050
+ function visualLen(s2) {
285051
+ return stripAnsi2(s2).length;
285052
+ }
285053
+ function buildTodoProgressBar(todos, maxWidth) {
285054
+ if (maxWidth <= 0 || todos.length === 0) return "";
285055
+ let cells = Math.min(todos.length, maxWidth);
285056
+ const truncated = cells < todos.length;
285057
+ const inIdx = todos.findIndex((t2) => t2.status === "in_progress");
285058
+ let nextIdx = -1;
285059
+ if (inIdx >= 0) {
285060
+ nextIdx = todos.findIndex((t2, i2) => i2 > inIdx && t2.status !== "completed");
285061
+ }
285062
+ if (nextIdx < 0) nextIdx = todos.findIndex((t2) => t2.status === "pending");
285063
+ const PEND = DIM_LABEL;
285064
+ const INPROG = ACCENT;
285065
+ const NEXT = ACCENT;
285066
+ const DONE_Y = ACCENT;
285067
+ let out = "";
285068
+ for (let i2 = 0; i2 < cells; i2++) {
285069
+ const t2 = todos[i2];
285070
+ if (t2.status === "completed") {
285071
+ out += `\x1B[1m${DONE_Y}█${RESET}`;
285072
+ } else if (i2 === inIdx) {
285073
+ out += `${INPROG}▒${RESET}`;
285074
+ } else if (i2 === nextIdx && inIdx >= 0) {
285075
+ out += `${NEXT}▒${RESET}`;
285076
+ } else {
285077
+ out += `${PEND}░${RESET}`;
285078
+ }
285079
+ }
285080
+ if (truncated && maxWidth > 0) out += `${DIM_LABEL}…${RESET}`;
285081
+ return out;
285082
+ }
285047
285083
  function render() {
285048
285084
  if (!_enabled) return;
285049
285085
  if (!panelEffectivelyVisible()) {
@@ -285063,7 +285099,11 @@ function render() {
285063
285099
  const total = _lastTodos.length;
285064
285100
  const headerColor = ACCENT;
285065
285101
  const lines = [];
285066
- const headerText = `tasks ${headerColor}${completed}/${total}${RESET}${DIM_LABEL} (todo_write)${RESET}`;
285102
+ const headerPrefix = `tasks ${headerColor}${completed}/${total}${RESET} `;
285103
+ const headerPrefixWidth = visualLen(headerPrefix);
285104
+ const maxBarWidth = Math.max(0, cols - 2 - headerPrefixWidth);
285105
+ const progressBar = buildTodoProgressBar(_lastTodos, maxBarWidth);
285106
+ const headerText = `${headerPrefix}${progressBar}`;
285067
285107
  lines.push(headerText);
285068
285108
  const visible = _lastTodos.slice(0, MAX_VISIBLE_ROWS - 1);
285069
285109
  for (const t2 of visible) {
@@ -288092,7 +288132,7 @@ function ansi2(code8, text) {
288092
288132
  function fg2562(code8, text) {
288093
288133
  return isTTY2 ? `\x1B[38;5;${code8}m${text}\x1B[0m` : text;
288094
288134
  }
288095
- function stripAnsi2(s2) {
288135
+ function stripAnsi3(s2) {
288096
288136
  return s2.replace(/\x1B\[[0-9;]*m/g, "");
288097
288137
  }
288098
288138
  function defaultRenderRow(item, focused, isActive) {
@@ -288106,8 +288146,8 @@ function matchRow(item, focused, isActive) {
288106
288146
  return defaultRenderRow(item, focused, isActive);
288107
288147
  }
288108
288148
  const marker = selectColors.matchLight("○");
288109
- const label = selectColors.matchLight(stripAnsi2(item.label));
288110
- const detail = item.detail ? ` ${selectColors.dim(stripAnsi2(item.detail))}` : "";
288149
+ const label = selectColors.matchLight(stripAnsi3(item.label));
288150
+ const detail = item.detail ? ` ${selectColors.dim(stripAnsi3(item.detail))}` : "";
288111
288151
  return ` ${marker} ${label}${detail}`;
288112
288152
  }
288113
288153
  function tuiSelect(opts) {
@@ -288131,8 +288171,8 @@ function tuiSelect(opts) {
288131
288171
  matchSet = /* @__PURE__ */ new Set();
288132
288172
  for (let i2 = 0; i2 < items.length; i2++) {
288133
288173
  if (isSkippable(i2)) continue;
288134
- const plain = stripAnsi2(items[i2].label).toLowerCase();
288135
- const detailPlain = items[i2].detail ? stripAnsi2(items[i2].detail).toLowerCase() : "";
288174
+ const plain = stripAnsi3(items[i2].label).toLowerCase();
288175
+ const detailPlain = items[i2].detail ? stripAnsi3(items[i2].detail).toLowerCase() : "";
288136
288176
  if (plain.includes(lower) || detailPlain.includes(lower)) {
288137
288177
  matchSet.add(i2);
288138
288178
  }
@@ -288257,7 +288297,7 @@ function tuiSelect(opts) {
288257
288297
  if (deleteConfirmIdx === idx) {
288258
288298
  const yesLabel = deleteConfirmSel ? selectColors.bold(selectColors.green("[Yes]")) : selectColors.dim("[Yes]");
288259
288299
  const noLabel = !deleteConfirmSel ? selectColors.bold(selectColors.orange("[No]")) : selectColors.dim("[No]");
288260
- lines.push(` ${ansi2("31", "✕")} ${ansi2("31", stripAnsi2(item.label))} Delete? ${yesLabel} ${noLabel}`);
288300
+ lines.push(` ${ansi2("31", "✕")} ${ansi2("31", stripAnsi3(item.label))} Delete? ${yesLabel} ${noLabel}`);
288261
288301
  } else if (filter2) {
288262
288302
  lines.push(matchRow(item, focused, isActive));
288263
288303
  } else {
@@ -291867,11 +291907,11 @@ import { extname as extname10, resolve as resolve32 } from "node:path";
291867
291907
  function ansi3(code8, text) {
291868
291908
  return isTTY3 ? `\x1B[${code8}m${text}\x1B[0m` : text;
291869
291909
  }
291870
- function stripAnsi3(s2) {
291910
+ function stripAnsi4(s2) {
291871
291911
  return s2.replace(/\x1B\[[0-9;]*m/g, "");
291872
291912
  }
291873
291913
  function fitToWidth(text, width) {
291874
- const visible = stripAnsi3(text);
291914
+ const visible = stripAnsi4(text);
291875
291915
  if (visible.length >= width) {
291876
291916
  let visCount = 0;
291877
291917
  let i2 = 0;
@@ -329104,19 +329144,27 @@ function createTaskCompleteTool(modelTier) {
329104
329144
  (t2) => t2.status === "pending" || t2.status === "in_progress" || t2.status === "blocked"
329105
329145
  );
329106
329146
  if (incomplete.length > 0) {
329107
- const incompleteList = incomplete.slice(0, 10).map((t2) => ` - [${t2.status}] ${t2.content}${t2.blocker ? ` (blocked: ${t2.blocker})` : ""}`).join("\n");
329108
- const more = incomplete.length > 10 ? `
329109
- ... +${incomplete.length - 10} more` : "";
329147
+ const incompleteList = incomplete.slice(0, 20).map((t2) => ` - [${t2.status}] ${t2.content}${t2.blocker ? ` (blocked: ${t2.blocker})` : ""}`).join("\n");
329148
+ const more = incomplete.length > 20 ? `
329149
+ ... +${incomplete.length - 20} more` : "";
329150
+ const guidance = `You attempted to call task_complete, but ${incomplete.length} todo item(s) remain. Before finishing, do ALL of the following:
329151
+ 1) For each item BY NAME, state if it is completed and provide OBJECTIVE EVIDENCE (file diffs, test output, logs, or concrete code references).
329152
+ 2) If any item is not completed, proceed to complete them IN ORDER.
329153
+ 3) After all items are truly implemented, call todo_write to mark every item as "completed".
329154
+ 4) ONLY AFTER updating the todo list, call task_complete with a concise final summary.
329155
+
329156
+ Respond concisely in this shape:
329157
+ - verify: [{ name: "<exact item text>", completed: true|false, evidence: "<objective proof>" }, ...]
329158
+ - next: "what you will do next OR the exact todo_write(...) call to update statuses"`;
329110
329159
  return {
329111
329160
  success: false,
329112
329161
  output: "",
329113
- error: `task_complete BLOCKED — ${incomplete.length} todo item(s) still incomplete. You must either:
329114
- 1. Continue working on the remaining items, OR
329115
- 2. If they're actually done, call todo_write with status='completed' for each one, THEN call task_complete again.
329116
- 3. If you are in an interactive session (call, chat, monitoring), RESUME THE LOOP — call your next interaction tool NOW.
329162
+ error: `task_complete BLOCKED — ${incomplete.length} todo item(s) still incomplete.
329117
329163
 
329118
329164
  Incomplete items:
329119
- ${incompleteList}${more}`
329165
+ ${incompleteList}${more}
329166
+
329167
+ ` + guidance
329120
329168
  };
329121
329169
  }
329122
329170
  try {
@@ -330785,6 +330833,7 @@ ${entry.fullContent}`
330785
330833
  });
330786
330834
  const sessionId = `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
330787
330835
  try {
330836
+ process.env["OA_SESSION_ID"] = sessionId;
330788
330837
  setTodoSessionId(sessionId);
330789
330838
  setTuiTasksSession(sessionId);
330790
330839
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.291",
3
+ "version": "0.187.293",
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",