open-agents-ai 0.187.291 → 0.187.292
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.
- package/dist/index.js +49 -9
- 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
|
|
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
|
|
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(
|
|
288110
|
-
const detail = item.detail ? ` ${selectColors.dim(
|
|
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 =
|
|
288135
|
-
const detailPlain = items[i2].detail ?
|
|
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",
|
|
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
|
|
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 =
|
|
291914
|
+
const visible = stripAnsi4(text);
|
|
291875
291915
|
if (visible.length >= width) {
|
|
291876
291916
|
let visCount = 0;
|
|
291877
291917
|
let i2 = 0;
|
package/package.json
CHANGED