@epoch-agent/tui 4.1.1 → 5.0.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 +29 -7
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ import { useCallback as useCallback13, useEffect as useEffect8, useMemo as useMe
4
4
  import {
5
5
  extractAllMentions
6
6
  } from "@epoch-agent/protocol";
7
+ import { currentActivity } from "@epoch-agent/view";
7
8
  // src/commands/parse.ts
8
9
  function parseSlashInput(text) {
9
10
  if (!text.startsWith("/")) return null;
@@ -1227,6 +1228,7 @@ function ToolConfirmation({
1227
1228
  }
1228
1229
  // src/components/history-item.tsx
1229
1230
  import { Box as Box19, Text as Text20 } from "ink";
1231
+ import { ACTIVITY_KEYS, activityOf } from "@epoch-agent/view";
1230
1232
  // src/markdown/display.tsx
1231
1233
  import { Box as Box10, Text as Text11 } from "ink";
1232
1234
  import React9 from "react";
@@ -2260,13 +2262,19 @@ var STATUS_ICON = {
2260
2262
  };
2261
2263
  function ToolRow({ tool, width }) {
2262
2264
  const inner = Math.max(1, width - 4);
2265
+ const kind = activityOf(tool.toolName);
2266
+ const label = kind === "other" ? formatToolCall(tool.toolName, tool.request) : (() => {
2267
+ const phrase = t(ACTIVITY_KEYS[kind][tool.status === "pending" ? "live" : "done"]);
2268
+ const arg = primaryArg(tool.request);
2269
+ return arg ? `${phrase} \xB7 ${arg}` : phrase;
2270
+ })();
2263
2271
  const result = tool.result === void 0 || tool.result === "" ? void 0 : clampTailLines(String(tool.result), inner, TOOL_RESULT_MAX_LINES);
2264
2272
  const live = tool.status === "pending" && tool.liveOutput ? clampTailLines(tool.liveOutput, inner, TOOL_LIVE_MAX_LINES) : void 0;
2265
2273
  return /* @__PURE__ */ jsxs19(Box19, { flexDirection: "column", children: [
2266
2274
  /* @__PURE__ */ jsx21(Box19, { children: /* @__PURE__ */ jsxs19(Text20, { color: STATUS_COLOR[tool.status], wrap: "truncate-end", children: [
2267
2275
  STATUS_ICON[tool.status],
2268
2276
  " ",
2269
- formatToolCall(tool.toolName, tool.request)
2277
+ label
2270
2278
  ] }) }),
2271
2279
  tool.artifacts?.map((artifact, i) => /* @__PURE__ */ jsx21(Box19, { marginLeft: 2, children: /* @__PURE__ */ jsx21(Text20, { color: artifact.data ? "#8BE9FD" : "#FBBF24", wrap: "truncate-end", children: formatArtifact(artifact) }) }, `art-${i}`)),
2272
2280
  live && /* @__PURE__ */ jsx21(Box19, { marginLeft: 2, flexDirection: "column", children: /* @__PURE__ */ jsx21(Text20, { color: "#6B7280", dimColor: true, wrap: "wrap", children: live.text }) }),
@@ -4123,6 +4131,7 @@ function Suggestions({ visible }) {
4123
4131
  // src/components/thinking-indicator.tsx
4124
4132
  import { Box as Box25, Text as Text26 } from "ink";
4125
4133
  import { useEffect as useEffect5, useState as useState11 } from "react";
4134
+ import { ACTIVITY_KEYS as ACTIVITY_KEYS2 } from "@epoch-agent/view";
4126
4135
  import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
4127
4136
  var SPINNER_FRAMES = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
4128
4137
  var SPINNER_INTERVAL_MS = 100;
@@ -4145,12 +4154,14 @@ function formatTokens(n) {
4145
4154
  function ThinkingIndicator({
4146
4155
  startedAt,
4147
4156
  outputTokens,
4148
- queuedCount = 0
4157
+ queuedCount = 0,
4158
+ activity,
4159
+ width
4149
4160
  }) {
4150
4161
  const [tick, setTick] = useState11(0);
4151
4162
  useEffect5(() => {
4152
- const t2 = setInterval(() => setTick((v) => v + 1), SPINNER_INTERVAL_MS);
4153
- return () => clearInterval(t2);
4163
+ const timer = setInterval(() => setTick((v) => v + 1), SPINNER_INTERVAL_MS);
4164
+ return () => clearInterval(timer);
4154
4165
  }, []);
4155
4166
  const elapsedSec = Math.max(0, Math.floor((Date.now() - startedAt) / 1e3));
4156
4167
  const frame = SPINNER_FRAMES[tick % SPINNER_FRAMES.length];
@@ -4161,13 +4172,15 @@ function ThinkingIndicator({
4161
4172
  }
4162
4173
  if (queuedCount > 0) meta.push(t("tui.thinking.queued", { n: queuedCount }));
4163
4174
  meta.push(t("tui.thinking.esc"));
4175
+ const label = activity ? t(ACTIVITY_KEYS2[activity.kind].live) : `${verb}\u2026`;
4176
+ const detail = activity?.detail ? truncateDetail(activity.detail, width, label, meta.join(" \xB7 ")) : void 0;
4164
4177
  return /* @__PURE__ */ jsxs24(Box25, { paddingX: 1, flexDirection: "row", children: [
4165
4178
  /* @__PURE__ */ jsx28(Text26, { color: accent7, children: frame }),
4166
4179
  /* @__PURE__ */ jsxs24(Text26, { color: accent7, bold: true, children: [
4167
4180
  " ",
4168
- verb,
4169
- "\u2026"
4181
+ label
4170
4182
  ] }),
4183
+ detail ? /* @__PURE__ */ jsx28(Text26, { color: accent7, children: ` ${detail}` }) : null,
4171
4184
  /* @__PURE__ */ jsxs24(Text26, { color: dim11, dimColor: true, children: [
4172
4185
  " ",
4173
4186
  "(",
@@ -4176,6 +4189,12 @@ function ThinkingIndicator({
4176
4189
  ] })
4177
4190
  ] });
4178
4191
  }
4192
+ function truncateDetail(detail, width, label, meta) {
4193
+ if (width === void 0 || width <= 0) return detail;
4194
+ const room = width - 2 - 2 - label.length - 1 - meta.length - 3;
4195
+ if (room <= 0) return "";
4196
+ return truncateByWidth(detail, room);
4197
+ }
4179
4198
  // src/components/toast.tsx
4180
4199
  import { Box as Box26, Text as Text27 } from "ink";
4181
4200
  import { useEffect as useEffect6, useRef as useRef10 } from "react";
@@ -6288,6 +6307,7 @@ function App({
6288
6307
  setPendingImages([]);
6289
6308
  }, [run]);
6290
6309
  const pendingBudget = modalOpen ? MIN_PENDING_HEIGHT : availableHeight;
6310
+ const activity = currentActivity(ui.pendingHistoryItems);
6291
6311
  const sequences = useKeySequences({
6292
6312
  table: keybindings2,
6293
6313
  enabled: (action) => action === "rewind" ? Boolean(host.checkpoints) : true
@@ -6453,7 +6473,9 @@ function App({
6453
6473
  {
6454
6474
  startedAt: run.startedAt,
6455
6475
  queuedCount: run.queuedCount,
6456
- outputTokens: stats.runOutputTokens
6476
+ outputTokens: stats.runOutputTokens,
6477
+ ...activity ? { activity } : {},
6478
+ width: columns
6457
6479
  }
6458
6480
  ),
6459
6481
  /* @__PURE__ */ jsx30(ToastDisplay, { toasts, onDismiss: dismissToast }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epoch-agent/tui",
3
- "version": "4.1.1",
3
+ "version": "5.0.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/view": "4.1.1",
33
- "@epoch-agent/protocol": "4.1.1"
32
+ "@epoch-agent/protocol": "5.0.0",
33
+ "@epoch-agent/view": "5.0.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^26.1.2",