@epoch-agent/tui 0.22.0 → 0.25.0

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 +22 -17
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -2030,7 +2030,7 @@ function formatToolCall(toolName, input) {
2030
2030
  import { Box as Box11, Text as Text12 } from "ink";
2031
2031
  import { useMemo as useMemo2 } from "react";
2032
2032
  import { collapseContext, diffLines } from "@epoch-agent/view";
2033
- import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
2033
+ import { Fragment as Fragment3, jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
2034
2034
  var MAX_RENDERED_LINES = 24;
2035
2035
  var COLORS = {
2036
2036
  add: "#22C55E",
@@ -2045,7 +2045,10 @@ function DiffMessage({
2045
2045
  newContent
2046
2046
  }) {
2047
2047
  const result = useMemo2(() => diffLines(oldContent, newContent), [oldContent, newContent]);
2048
- const collapsed = useMemo2(() => collapseContext(result.lines), [result.lines]);
2048
+ const collapsed = useMemo2(
2049
+ () => result.truncated ? [] : collapseContext(result.lines),
2050
+ [result]
2051
+ );
2049
2052
  const shown = collapsed.slice(0, MAX_RENDERED_LINES);
2050
2053
  const overflow = collapsed.length - shown.length;
2051
2054
  return /* @__PURE__ */ jsxs11(Box11, { flexDirection: "column", paddingX: 1, marginTop: 1, children: [
@@ -2054,18 +2057,20 @@ function DiffMessage({
2054
2057
  "\u270E ",
2055
2058
  filePath
2056
2059
  ] }),
2057
- /* @__PURE__ */ jsxs11(Text12, { color: COLORS.add, children: [
2058
- " +",
2059
- result.added
2060
- ] }),
2061
- /* @__PURE__ */ jsxs11(Text12, { color: COLORS.remove, children: [
2062
- " -",
2063
- result.removed
2060
+ result.truncated ? null : /* @__PURE__ */ jsxs11(Fragment3, { children: [
2061
+ /* @__PURE__ */ jsxs11(Text12, { color: COLORS.add, children: [
2062
+ " +",
2063
+ result.added
2064
+ ] }),
2065
+ /* @__PURE__ */ jsxs11(Text12, { color: COLORS.remove, children: [
2066
+ " -",
2067
+ result.removed
2068
+ ] })
2064
2069
  ] })
2065
2070
  ] }),
2066
2071
  result.truncated ? /* @__PURE__ */ jsxs11(Text12, { color: dim8, dimColor: true, children: [
2067
2072
  " ",
2068
- t("tui.diff.too_large")
2073
+ t("tui.diff.too_large", { old: result.oldLines, new: result.newLines })
2069
2074
  ] }) : shown.map(
2070
2075
  (line, i) => line === null ? /* @__PURE__ */ jsx13(Text12, { color: dim8, dimColor: true, children: " \u22EF" }, `gap-${i}`) : /* @__PURE__ */ jsxs11(Text12, { color: COLORS[line.kind], dimColor: line.kind === "context", children: [
2071
2076
  " ",
@@ -3549,7 +3554,7 @@ function FilePalette({
3549
3554
  ] });
3550
3555
  }
3551
3556
  // src/components/input-box.tsx
3552
- import { Fragment as Fragment3, jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
3557
+ import { Fragment as Fragment4, jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
3553
3558
  var PREFIX2 = "\u276F ";
3554
3559
  var CONTINUATION = " ";
3555
3560
  var PREFIX_WIDTH = 2;
@@ -3836,12 +3841,12 @@ var InputBox = React11.forwardRef(function InputBox2({
3836
3841
  if (!showCursor || rowIdx !== buf.row) return line;
3837
3842
  const cps = toCodePoints(line);
3838
3843
  if (buf.col >= cps.length) {
3839
- return /* @__PURE__ */ jsxs21(Fragment3, { children: [
3844
+ return /* @__PURE__ */ jsxs21(Fragment4, { children: [
3840
3845
  line,
3841
3846
  /* @__PURE__ */ jsx23(Text22, { inverse: true, children: " " })
3842
3847
  ] });
3843
3848
  }
3844
- return /* @__PURE__ */ jsxs21(Fragment3, { children: [
3849
+ return /* @__PURE__ */ jsxs21(Fragment4, { children: [
3845
3850
  cpSlice(line, 0, buf.col),
3846
3851
  /* @__PURE__ */ jsx23(Text22, { inverse: true, children: cps[buf.col] }),
3847
3852
  cpSlice(line, buf.col + 1)
@@ -4006,7 +4011,7 @@ function money(usd2, digits) {
4006
4011
  return formatMoney(usd2, { currency, digits });
4007
4012
  }
4008
4013
  // src/components/status-bar.tsx
4009
- import { Fragment as Fragment4, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
4014
+ import { Fragment as Fragment5, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
4010
4015
  var dim10 = "#6B7280";
4011
4016
  var BAR_WIDTH = 10;
4012
4017
  function permStyle(level) {
@@ -4062,18 +4067,18 @@ function StatusBar({
4062
4067
  ctxPercent,
4063
4068
  "%"
4064
4069
  ] }),
4065
- cost2 !== void 0 && /* @__PURE__ */ jsxs22(Fragment4, { children: [
4070
+ cost2 !== void 0 && /* @__PURE__ */ jsxs22(Fragment5, { children: [
4066
4071
  /* @__PURE__ */ jsx26(Dot, {}),
4067
4072
  /* @__PURE__ */ jsx26(Text24, { color: dim10, children: money(cost2, 4) })
4068
4073
  ] }),
4069
4074
  budgetLeft !== void 0 && /* @__PURE__ */ jsx26(Text24, { color: budgetLeft > 0 ? dim10 : "#EF4444", children: t("tui.status.budget_left", { n: money(budgetLeft, 2) }) })
4070
4075
  ] }),
4071
4076
  /* @__PURE__ */ jsxs22(Box23, { flexDirection: "row", children: [
4072
- statusLine ? /* @__PURE__ */ jsxs22(Fragment4, { children: [
4077
+ statusLine ? /* @__PURE__ */ jsxs22(Fragment5, { children: [
4073
4078
  /* @__PURE__ */ jsx26(Text24, { color: dim10, children: statusLine }),
4074
4079
  /* @__PURE__ */ jsx26(Dot, {})
4075
4080
  ] }) : null,
4076
- runningTasks > 0 && /* @__PURE__ */ jsxs22(Fragment4, { children: [
4081
+ runningTasks > 0 && /* @__PURE__ */ jsxs22(Fragment5, { children: [
4077
4082
  /* @__PURE__ */ jsxs22(Text24, { color: "#8BE9FD", children: [
4078
4083
  "\u2699 ",
4079
4084
  runningTasks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epoch-agent/tui",
3
- "version": "0.22.0",
3
+ "version": "0.25.0",
4
4
  "private": false,
5
5
  "description": "epoch-agent Ink TUI 界面",
6
6
  "repository": {
@@ -29,8 +29,8 @@
29
29
  "mnemonist": "0",
30
30
  "string-width": "8",
31
31
  "strip-ansi": "7",
32
- "@epoch-agent/protocol": "0.22.0",
33
- "@epoch-agent/view": "0.22.0"
32
+ "@epoch-agent/protocol": "0.25.0",
33
+ "@epoch-agent/view": "0.25.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^26.1.2",