agenthud 0.5.2 → 0.5.3

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 +34 -22
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -520,13 +520,13 @@ function formatActivityParts(activity, maxWidth) {
520
520
  }
521
521
  detailDisplayWidth = currentWidth;
522
522
  }
523
- const content2 = `${icon} ${label}: ${truncatedDetail}`;
523
+ const labelContent2 = `${label}: ${truncatedDetail}`;
524
524
  const displayWidth2 = totalPrefixWidth + detailDisplayWidth;
525
- return { timestamp, content: content2, displayWidth: displayWidth2 };
525
+ return { timestamp, icon, labelContent: labelContent2, displayWidth: displayWidth2 };
526
526
  }
527
- const content = `${icon} ${label}`;
527
+ const labelContent = label;
528
528
  const displayWidth = totalPrefixWidth;
529
- return { timestamp, content, displayWidth };
529
+ return { timestamp, icon, labelContent, displayWidth };
530
530
  }
531
531
  function ClaudePanel({
532
532
  data,
@@ -588,7 +588,7 @@ function ClaudePanel({
588
588
  const lines = [];
589
589
  for (let i = 0; i < state.activities.length; i++) {
590
590
  const activity = state.activities[i];
591
- const { timestamp, content, displayWidth } = formatActivityParts(activity, contentWidth);
591
+ const { timestamp, icon, labelContent, displayWidth } = formatActivityParts(activity, contentWidth);
592
592
  const padding = Math.max(0, contentWidth - displayWidth);
593
593
  const style = getActivityStyle(activity);
594
594
  lines.push(
@@ -596,7 +596,9 @@ function ClaudePanel({
596
596
  BOX.v,
597
597
  " ",
598
598
  /* @__PURE__ */ jsx4(Text4, { dimColor: true, children: timestamp }),
599
- /* @__PURE__ */ jsx4(Text4, { color: style.color, dimColor: style.dimColor, children: content }),
599
+ /* @__PURE__ */ jsx4(Text4, { color: "cyan", children: icon }),
600
+ " ",
601
+ /* @__PURE__ */ jsx4(Text4, { color: style.color, dimColor: style.dimColor, children: labelContent }),
600
602
  " ".repeat(padding),
601
603
  BOX.v
602
604
  ] }, `activity-${i}`)
@@ -1331,6 +1333,29 @@ import {
1331
1333
  } from "fs";
1332
1334
  import { homedir } from "os";
1333
1335
  import { join as join2, basename as basename2 } from "path";
1336
+
1337
+ // src/types/index.ts
1338
+ var ICONS = {
1339
+ // Activity types
1340
+ User: ">",
1341
+ Response: "<",
1342
+ // Tools
1343
+ Edit: "~",
1344
+ Write: "~",
1345
+ Read: "\u25CB",
1346
+ Bash: "$",
1347
+ Glob: "*",
1348
+ Grep: "*",
1349
+ WebFetch: "@",
1350
+ WebSearch: "@",
1351
+ Task: "\u25B6",
1352
+ TodoWrite: "~",
1353
+ AskUserQuestion: "?",
1354
+ // Fallback
1355
+ Default: "$"
1356
+ };
1357
+
1358
+ // src/data/claude.ts
1334
1359
  var fs = {
1335
1360
  existsSync: nodeExistsSync2,
1336
1361
  readFileSync: (path) => nodeReadFileSync3(path, "utf-8"),
@@ -1342,19 +1367,6 @@ var THIRTY_SECONDS_MS = 30 * 1e3;
1342
1367
  var MAX_LINES_TO_SCAN = 200;
1343
1368
  var DEFAULT_MAX_ACTIVITIES = 10;
1344
1369
  var MAX_DETAIL_LENGTH = 45;
1345
- var TOOL_ICONS = {
1346
- Edit: "\u{1F4DD}",
1347
- Write: "\u{1F4DD}",
1348
- Read: "\u{1F4D6}",
1349
- Bash: "\u{1F527}",
1350
- Glob: "\u{1F50D}",
1351
- Grep: "\u{1F50D}",
1352
- WebFetch: "\u{1F310}",
1353
- WebSearch: "\u{1F310}",
1354
- Task: "\u{1F4CB}",
1355
- TodoWrite: "\u{1F4DD}",
1356
- AskUserQuestion: "\u2753"
1357
- };
1358
1370
  function getClaudeSessionPath(projectPath) {
1359
1371
  const encoded = projectPath.replace(/\//g, "-");
1360
1372
  return join2(homedir(), ".claude", "projects", encoded);
@@ -1475,7 +1487,7 @@ function parseSessionState(sessionFile, maxActivities = DEFAULT_MAX_ACTIVITIES)
1475
1487
  activities.push({
1476
1488
  timestamp: lastTimestamp || /* @__PURE__ */ new Date(),
1477
1489
  type: "user",
1478
- icon: "\u{1F464}",
1490
+ icon: ICONS.User,
1479
1491
  label: "User",
1480
1492
  detail: truncate2(userText.replace(/\n/g, " "), MAX_DETAIL_LENGTH)
1481
1493
  });
@@ -1492,7 +1504,7 @@ function parseSessionState(sessionFile, maxActivities = DEFAULT_MAX_ACTIVITIES)
1492
1504
  for (const block of messageContent) {
1493
1505
  if (block.type === "tool_use") {
1494
1506
  const toolName = block.name || "Tool";
1495
- const icon = TOOL_ICONS[toolName] || "\u{1F527}";
1507
+ const icon = ICONS[toolName] || ICONS.Default;
1496
1508
  const detail = getToolDetail(toolName, block.input);
1497
1509
  activities.push({
1498
1510
  timestamp: lastTimestamp || /* @__PURE__ */ new Date(),
@@ -1507,7 +1519,7 @@ function parseSessionState(sessionFile, maxActivities = DEFAULT_MAX_ACTIVITIES)
1507
1519
  activities.push({
1508
1520
  timestamp: lastTimestamp || /* @__PURE__ */ new Date(),
1509
1521
  type: "response",
1510
- icon: "\u{1F916}",
1522
+ icon: ICONS.Response,
1511
1523
  label: "Response",
1512
1524
  detail: truncate2(block.text.replace(/\n/g, " "), MAX_DETAIL_LENGTH)
1513
1525
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agenthud",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "CLI tool to monitor agent status in real-time. Works with Claude Code, multi-agent workflows, and any AI agent system.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",