@jun133/kitty 0.0.12 → 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-MV5BYUNW.mjs";
26
+ } from "./chunk-KROQCOWD.mjs";
27
27
  import {
28
28
  PRESERVED_PROJECT_STATE_ENTRY_NAMES,
29
29
  PROJECT_STATE_DIR_NAME,
@@ -315,7 +315,7 @@ async function terminateProcesses(processes, cwd) {
315
315
 
316
316
  // src/runtime/scene.ts
317
317
  function buildRuntimeScene(status) {
318
- const executions = status.executions.active.map(buildExecutionScene);
318
+ const executions = readSceneExecutions(status);
319
319
  const blockedExecutions = executions.filter((execution) => execution.risk === "blocked");
320
320
  const watchExecutions = executions.filter((execution) => execution.risk === "watch");
321
321
  const activeBackground = executions.filter((execution) => execution.kind === "background");
@@ -346,6 +346,19 @@ function buildRuntimeScene(status) {
346
346
  executions
347
347
  };
348
348
  }
349
+ function readSceneExecutions(status) {
350
+ const byId = /* @__PURE__ */ new Map();
351
+ for (const execution of status.executions.active) {
352
+ byId.set(execution.id, buildExecutionScene(execution));
353
+ }
354
+ for (const execution of status.executions.recent) {
355
+ const scene = buildExecutionScene(execution);
356
+ if (scene.risk !== "none" && !byId.has(scene.id)) {
357
+ byId.set(scene.id, scene);
358
+ }
359
+ }
360
+ return [...byId.values()];
361
+ }
349
362
  function buildExecutionScene(execution) {
350
363
  const risk = readExecutionRisk(execution);
351
364
  return {
@@ -360,9 +373,6 @@ function buildExecutionScene(execution) {
360
373
  };
361
374
  }
362
375
  function buildHeadline(status, blockedExecutions, watchExecutions) {
363
- if (!status.sessions.latest) {
364
- return "No active session yet.";
365
- }
366
376
  if (blockedExecutions.length > 0) {
367
377
  return `${blockedExecutions.length} execution(s) need attention.`;
368
378
  }
@@ -372,6 +382,9 @@ function buildHeadline(status, blockedExecutions, watchExecutions) {
372
382
  if (status.executions.active.length > 0) {
373
383
  return `${status.executions.active.length} execution(s) are running.`;
374
384
  }
385
+ if (!status.sessions.latest) {
386
+ return "No active session yet.";
387
+ }
375
388
  return "Ready to continue the latest session.";
376
389
  }
377
390
  function readFocus(status) {
@@ -1131,6 +1144,9 @@ function formatRuntimeStatusText(status) {
1131
1144
  lines.push("Current workspace:");
1132
1145
  lines.push(`- Focus: ${status.scene.focus}`);
1133
1146
  lines.push(`- Session: ${readSessionLine(status)}`);
1147
+ if (status.sessions.skipped > 0) {
1148
+ lines.push(`- Sessions: ${status.sessions.total} total, ${status.sessions.skipped} skipped`);
1149
+ }
1134
1150
  lines.push(`- Next: ${status.scene.nextAction}`);
1135
1151
  lines.push(`- Blocked: ${status.scene.blocked}`);
1136
1152
  lines.push(`- Context budget: ${readContextBudgetLine(status)}`);
@@ -1255,9 +1271,9 @@ function formatRuntimeStatusText(status) {
1255
1271
  ].filter(Boolean).join(" "));
1256
1272
  }
1257
1273
  }
1258
- if (status.executions.active.length > 0) {
1274
+ if (status.scene.executions.length > 0) {
1259
1275
  lines.push("");
1260
- lines.push("Active executions:");
1276
+ lines.push("Scene executions:");
1261
1277
  for (const execution of status.scene.executions) {
1262
1278
  lines.push([
1263
1279
  execution.id,
@@ -1466,6 +1482,9 @@ function formatSessionEventsForCli(result) {
1466
1482
  return result.events.map(formatSessionEventForCli).join("\n");
1467
1483
  }
1468
1484
  function formatSessionEventForCli(event) {
1485
+ if (isToolEvent(event)) {
1486
+ return formatToolEventForCli(event);
1487
+ }
1469
1488
  const parts = [
1470
1489
  event.createdAt,
1471
1490
  event.type,
@@ -1475,10 +1494,39 @@ function formatSessionEventForCli(event) {
1475
1494
  ];
1476
1495
  return parts.filter(Boolean).join(" ");
1477
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
+ }
1478
1520
  function formatInline(value) {
1479
1521
  const normalized = value.replace(/\s+/g, " ").trim();
1480
1522
  return normalized.length > 120 ? `${normalized.slice(0, 117)}...` : normalized;
1481
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
+ }
1482
1530
 
1483
1531
  // src/config/paths.ts
1484
1532
  function getAppPaths(rootDir = process.cwd()) {