@jun133/kitty 0.0.13 → 0.0.14

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.
@@ -2,7 +2,7 @@ import {
2
2
  TRANSCRIPT_OUTER_PADDING_X,
3
3
  TUI_COLORS,
4
4
  renderTranscriptLineViews
5
- } from "./chunk-4HIVDFN5.mjs";
5
+ } from "./chunk-NBKU7KA4.mjs";
6
6
 
7
7
  // src/shell/tui/layout.ts
8
8
  var TUI_MIN_WIDTH = 48;
@@ -338,32 +338,44 @@ function createComposerComponent(kit) {
338
338
  function createRuntimeDockComponent(kit) {
339
339
  const { React, Box, Text } = kit;
340
340
  return function RuntimeDock(props) {
341
+ const facts = [];
342
+ if (props.dock.background) {
343
+ facts.push({ label: "\u540E\u53F0", value: props.dock.background });
344
+ }
345
+ if (props.dock.subagent) {
346
+ facts.push({ label: "\u5B50\u4EE3\u7406", value: props.dock.subagent });
347
+ }
348
+ if (props.dock.context) {
349
+ facts.push({ label: "\u4E0A\u4E0B\u6587", value: props.dock.context });
350
+ }
341
351
  return React.createElement(
342
352
  Box,
343
353
  {
344
354
  flexDirection: "column",
345
- width: "100%"
355
+ width: "100%",
356
+ height: TUI_DOCK_ROWS
346
357
  },
347
- React.createElement(
358
+ props.dock.current ? React.createElement(
348
359
  Box,
349
360
  { flexDirection: "row" },
350
- props.dock.work.active ? React.createElement(Text, { color: TUI_COLORS.user }, "\u25A3 ") : null,
351
- React.createElement(Text, { color: props.dock.work.active ? TUI_COLORS.user : TUI_COLORS.muted }, props.dock.work.label),
352
- React.createElement(Text, { color: TUI_COLORS.muted }, " \xB7 "),
353
- React.createElement(Text, { color: props.dock.work.active ? TUI_COLORS.text : TUI_COLORS.muted }, props.dock.work.detail)
361
+ React.createElement(Text, { color: TUI_COLORS.user }, "\u25A3 "),
362
+ React.createElement(Text, { color: TUI_COLORS.text }, props.dock.current)
363
+ ) : React.createElement(
364
+ Box,
365
+ { flexDirection: "row", height: 1 },
366
+ React.createElement(Text, { color: TUI_COLORS.muted }, "\u7A7A\u95F2\u4E2D")
354
367
  ),
355
- React.createElement(
368
+ facts.length > 0 ? React.createElement(
369
+ Box,
370
+ { height: 1, marginTop: 0 },
371
+ ...facts.flatMap(({ label, value }, index) => [
372
+ index > 0 ? React.createElement(Text, { color: TUI_COLORS.muted, key: `${label}-gap` }, " ") : null,
373
+ React.createElement(Text, { color: TUI_COLORS.muted, key: `${label}-label` }, `${label} `),
374
+ React.createElement(Text, { color: readFactColor(value), key: `${label}-value` }, value)
375
+ ])
376
+ ) : React.createElement(
356
377
  Box,
357
- { marginTop: 0 },
358
- null,
359
- React.createElement(Text, { color: TUI_COLORS.muted }, "\u540E\u53F0\u4EFB\u52A1 "),
360
- React.createElement(Text, { color: readFactColor(props.dock.background) }, props.dock.background),
361
- React.createElement(Text, { color: TUI_COLORS.muted }, " "),
362
- React.createElement(Text, { color: TUI_COLORS.muted }, "\u5B50\u4EE3\u7406 "),
363
- React.createElement(Text, { color: readFactColor(props.dock.subagent) }, props.dock.subagent),
364
- React.createElement(Text, { color: TUI_COLORS.muted }, " "),
365
- React.createElement(Text, { color: TUI_COLORS.muted }, "\u4E0A\u4E0B\u6587 "),
366
- React.createElement(Text, { color: TUI_COLORS.text }, props.dock.context)
378
+ { marginTop: 0 }
367
379
  )
368
380
  );
369
381
  };
@@ -23,7 +23,7 @@ import {
23
23
  terminatePid,
24
24
  writeStderrLine,
25
25
  writeStdoutLine
26
- } from "./chunk-MMIH75OY.mjs";
26
+ } from "./chunk-KROQCOWD.mjs";
27
27
  import {
28
28
  PRESERVED_PROJECT_STATE_ENTRY_NAMES,
29
29
  PROJECT_STATE_DIR_NAME,
@@ -1482,6 +1482,9 @@ function formatSessionEventsForCli(result) {
1482
1482
  return result.events.map(formatSessionEventForCli).join("\n");
1483
1483
  }
1484
1484
  function formatSessionEventForCli(event) {
1485
+ if (isToolEvent(event)) {
1486
+ return formatToolEventForCli(event);
1487
+ }
1485
1488
  const parts = [
1486
1489
  event.createdAt,
1487
1490
  event.type,
@@ -1491,10 +1494,39 @@ function formatSessionEventForCli(event) {
1491
1494
  ];
1492
1495
  return parts.filter(Boolean).join(" ");
1493
1496
  }
1497
+ function formatToolEventForCli(event) {
1498
+ const details = event.details ?? {};
1499
+ const toolName = readString2(details.toolName);
1500
+ const toolCallId = readString2(details.toolCallId);
1501
+ const durationMs = readNumber2(details.durationMs);
1502
+ const changedPathCount = readNumber2(details.changedPathCount);
1503
+ const error = readString2(details.error);
1504
+ const parts = [
1505
+ event.createdAt,
1506
+ event.type,
1507
+ toolName ? `tool=${toolName}` : void 0,
1508
+ toolCallId ? `call=${toolCallId}` : void 0,
1509
+ durationMs === void 0 ? void 0 : `duration=${durationMs}ms`,
1510
+ changedPathCount === void 0 ? void 0 : `changed=${changedPathCount}`,
1511
+ error ? `error=${formatInline(error)}` : void 0,
1512
+ event.host ? `host=${event.host}` : void 0,
1513
+ event.message ? `message=${formatInline(event.message)}` : void 0
1514
+ ];
1515
+ return parts.filter(Boolean).join(" ");
1516
+ }
1517
+ function isToolEvent(event) {
1518
+ return event.type === "tool.started" || event.type === "tool.completed" || event.type === "tool.failed";
1519
+ }
1494
1520
  function formatInline(value) {
1495
1521
  const normalized = value.replace(/\s+/g, " ").trim();
1496
1522
  return normalized.length > 120 ? `${normalized.slice(0, 117)}...` : normalized;
1497
1523
  }
1524
+ function readString2(value) {
1525
+ return typeof value === "string" && value.length > 0 ? value : void 0;
1526
+ }
1527
+ function readNumber2(value) {
1528
+ return typeof value === "number" && Number.isFinite(value) ? value : void 0;
1529
+ }
1498
1530
 
1499
1531
  // src/config/paths.ts
1500
1532
  function getAppPaths(rootDir = process.cwd()) {