@jun133/kitty 0.0.15 → 0.0.16

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.
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SessionStore,
3
3
  parseRuntimeMemoryAssetMetadata
4
- } from "./chunk-KUP5OMPB.mjs";
4
+ } from "./chunk-FKBVCYPW.mjs";
5
5
  import {
6
6
  BackgroundExecutionStore,
7
7
  ControlPlaneLedger,
@@ -29,10 +29,10 @@ import {
29
29
  terminatePid,
30
30
  writeStderrLine,
31
31
  writeStdoutLine
32
- } from "./chunk-7FDXKNTM.mjs";
32
+ } from "./chunk-7FOTCUIH.mjs";
33
33
  import {
34
34
  resolveModelProfile
35
- } from "./chunk-S4QTRPZ7.mjs";
35
+ } from "./chunk-C3MFBHV3.mjs";
36
36
 
37
37
  // src/observability/terminalLog.ts
38
38
  import fs from "fs";
@@ -375,18 +375,18 @@ function buildExecutionScene(execution) {
375
375
  }
376
376
  function buildHeadline(status, blockedExecutions, watchExecutions) {
377
377
  if (blockedExecutions.length > 0) {
378
- return `${blockedExecutions.length} execution(s) need attention.`;
378
+ return blockedExecutions.length === 1 ? "One delegated task needs attention." : `${blockedExecutions.length} delegated tasks need attention.`;
379
379
  }
380
380
  if (watchExecutions.length > 0) {
381
- return `${watchExecutions.length} execution(s) should be watched.`;
381
+ return watchExecutions.length === 1 ? "One delegated task is running without output yet." : `${watchExecutions.length} delegated tasks are running without output yet.`;
382
382
  }
383
383
  if (status.executions.active.length > 0) {
384
- return `${status.executions.active.length} execution(s) are running.`;
384
+ return status.executions.active.length === 1 ? "One delegated task is running." : `${status.executions.active.length} delegated tasks are running.`;
385
385
  }
386
386
  if (!status.sessions.latest) {
387
- return "No active session yet.";
387
+ return "No session has started yet.";
388
388
  }
389
- return "Ready to continue the latest session.";
389
+ return "Latest session is ready.";
390
390
  }
391
391
  function readFocus(status) {
392
392
  const focus = status.sessions.latest?.focus;
@@ -397,7 +397,7 @@ function readFocus(status) {
397
397
  if (title) {
398
398
  return truncateText(title, 120);
399
399
  }
400
- return "none";
400
+ return "No current focus yet.";
401
401
  }
402
402
  function readNextAction(status, blockedExecutions, watchExecutions) {
403
403
  const urgent = blockedExecutions[0] ?? watchExecutions[0];
@@ -405,32 +405,32 @@ function readNextAction(status, blockedExecutions, watchExecutions) {
405
405
  return urgent.nextAction;
406
406
  }
407
407
  if (status.executions.active.length > 0) {
408
- return "Let active work finish, or inspect it with `kitty status` / `kitty background`.";
408
+ return "Wait for the active task, or inspect it with `kitty status` / `kitty background`.";
409
409
  }
410
410
  if (!status.sessions.latest) {
411
411
  return "Start a session with `kitty`.";
412
412
  }
413
- return "Continue from the current session focus.";
413
+ return "Continue from the latest session.";
414
414
  }
415
415
  function readBlocked(blockedExecutions) {
416
416
  if (blockedExecutions.length === 0) {
417
- return "no";
417
+ return "No blockers visible.";
418
418
  }
419
- return blockedExecutions.slice(0, 3).map((execution) => `${execution.kind} ${execution.id}: ${execution.health}`).join(" | ");
419
+ return blockedExecutions.slice(0, 3).map((execution) => `${readExecutionKindLabel(execution.kind)} ${execution.id}: ${execution.health}`).join(" | ");
420
420
  }
421
421
  function readCost(status) {
422
422
  const budget = status.sessions.latest?.contextBudget;
423
423
  const latest = status.modelRequests.recent[0];
424
- const budgetText = budget ? `${Math.round(budget.usageRatio * 100)}% context${budget.compressed ? ", compressed" : ""}` : "context unknown";
424
+ const budgetText = budget ? `${Math.round(budget.usageRatio * 100)}% context${budget.compressed ? ", compressed" : ""}` : "Context has not been measured yet";
425
425
  const layout = budget?.cacheLayout;
426
- const layoutText = layout ? `stable ${readStableRatio(layout.stablePrefixChars, layout.volatileTailChars)}` : "cache layout unknown";
427
- const usageText = latest?.usage ? readUsageCost(latest.usage) : latest ? "provider usage unavailable" : "no model request yet";
428
- return `${budgetText}; ${layoutText}; ${usageText}`;
426
+ const layoutText = layout ? `stable ${readStableRatio(layout.stablePrefixChars, layout.volatileTailChars)}` : void 0;
427
+ const usageText = latest?.usage ? readUsageCost(latest.usage) : latest ? "provider usage unavailable" : "No model request recorded yet";
428
+ return [budgetText, layoutText, usageText].filter(Boolean).join("; ");
429
429
  }
430
430
  function readToolOutputs(status) {
431
431
  const recent = status.toolOutputs.recent;
432
432
  if (recent.length === 0) {
433
- return "no tool output governance yet";
433
+ return "Tool output has not needed projection yet";
434
434
  }
435
435
  const saved = recent.reduce((total, item) => total + (item.savedTokens ?? 0), 0);
436
436
  const truncated = recent.filter((item) => item.truncated).length;
@@ -446,7 +446,7 @@ function readToolOutputs(status) {
446
446
  }
447
447
  function readStableRatio(stableChars, volatileChars) {
448
448
  const total = stableChars + volatileChars;
449
- return total > 0 ? `${Math.round(stableChars / total * 100)}%` : "unknown";
449
+ return total > 0 ? `${Math.round(stableChars / total * 100)}%` : "not measured";
450
450
  }
451
451
  function readUsageCost(usage) {
452
452
  const cached = usage.cacheHitTokens ?? usage.cacheReadTokens;
@@ -460,16 +460,16 @@ function readUsageCost(usage) {
460
460
  function readRecovery(status, executions) {
461
461
  const risky = executions.filter((execution) => execution.risk !== "none").length;
462
462
  if (risky > 0) {
463
- return `${risky} execution(s) need recovery attention.`;
463
+ return risky === 1 ? "One delegated task needs recovery attention." : `${risky} delegated tasks need recovery attention.`;
464
464
  }
465
465
  if (status.wakeSignals.recent.length > 0) {
466
- return `${status.wakeSignals.recent.length} wake signal(s) recorded.`;
466
+ return status.wakeSignals.recent.length === 1 ? "One wake signal is recorded." : `${status.wakeSignals.recent.length} wake signals are recorded.`;
467
467
  }
468
- return "no recovery action needed";
468
+ return "Recovery is clear.";
469
469
  }
470
470
  function readSkillsNextAction(status) {
471
471
  if (status.skills.total === 0) {
472
- return "No runtime skills discovered.";
472
+ return "No runtime skills are discovered in this project.";
473
473
  }
474
474
  if (status.skills.needsAttention.length > 0) {
475
475
  return "Inspect skill issues before relying on those skills.";
@@ -478,7 +478,7 @@ function readSkillsNextAction(status) {
478
478
  }
479
479
  function readMemoryNextAction(status) {
480
480
  if (!status.sessions.latest) {
481
- return "No session memory yet.";
481
+ return "Memory will appear after a session produces useful continuity.";
482
482
  }
483
483
  if (!status.sessions.latest.hasMemory && status.memory.assets.length === 0) {
484
484
  return "Continue the session until useful memory is saved.";
@@ -490,7 +490,7 @@ function readMemoryNextAction(status) {
490
490
  }
491
491
  function readBackgroundNextAction(backgrounds) {
492
492
  if (backgrounds.length === 0) {
493
- return "No active background work.";
493
+ return "No background work is running.";
494
494
  }
495
495
  const blocked = backgrounds.find((execution) => execution.risk === "blocked");
496
496
  if (blocked) {
@@ -525,7 +525,7 @@ function readExecutionSummary(execution) {
525
525
  if (execution.command) {
526
526
  return truncateText(execution.command, 120);
527
527
  }
528
- return `${execution.kind} execution`;
528
+ return `${readExecutionKindLabel(execution.kind)} task`;
529
529
  }
530
530
  function readExecutionNextAction(execution, risk) {
531
531
  if (execution.kind === "background") {
@@ -538,15 +538,25 @@ function readExecutionNextAction(execution, risk) {
538
538
  return `Inspect with \`kitty background wait ${execution.id}\` if you need the result now.`;
539
539
  }
540
540
  if (risk === "blocked") {
541
- return `Inspect execution ${execution.id} in status before continuing.`;
541
+ return `Inspect ${readExecutionKindLabel(execution.kind)} ${execution.id} before continuing.`;
542
542
  }
543
543
  if (risk === "watch") {
544
- return `Watch execution ${execution.id} for output or deadline.`;
544
+ return `Watch ${readExecutionKindLabel(execution.kind)} ${execution.id} for output or deadline.`;
545
545
  }
546
546
  if (execution.waitPolicy === "block_lead_until_complete") {
547
- return "Lead should wait for this execution to finish.";
547
+ return "Lead should wait for this task to finish.";
548
+ }
549
+ return "Task is active.";
550
+ }
551
+ function readExecutionKindLabel(kind) {
552
+ switch (kind) {
553
+ case "background":
554
+ return "background";
555
+ case "subagent":
556
+ return "subagent";
557
+ default:
558
+ return "delegated";
548
559
  }
549
- return "Execution is active.";
550
560
  }
551
561
  function truncateText(value, maxChars) {
552
562
  const normalized = value.replace(/\s+/g, " ").trim();
@@ -1164,38 +1174,34 @@ function formatRuntimeStatusText(status) {
1164
1174
  lines.push(`Project: ${status.rootDir}`);
1165
1175
  lines.push(`State: ${status.stateDir}`);
1166
1176
  lines.push("");
1167
- lines.push("Scene:");
1177
+ lines.push("Current scene:");
1168
1178
  lines.push(`- Now: ${status.scene.headline}`);
1169
1179
  lines.push(`- Focus: ${status.scene.focus}`);
1170
1180
  lines.push(`- Next: ${status.scene.nextAction}`);
1171
1181
  lines.push(`- Blocked: ${status.scene.blocked}`);
1172
- lines.push(`- Background: ${status.scene.background.active} active / ${status.scene.background.blocked} need attention`);
1173
- lines.push(`- Background next: ${status.scene.background.nextAction}`);
1174
- lines.push(`- Skills: ${status.scene.skills.ready}/${status.scene.skills.total} ready; ${status.scene.skills.nextAction}`);
1175
- lines.push(`- Memory: ${status.scene.memory.assets} asset(s), session=${status.scene.memory.latestSessionMemory ? "yes" : "no"}; ${status.scene.memory.nextAction}`);
1182
+ lines.push(`- Background: ${readBackgroundSceneLine(status)}`);
1183
+ lines.push(`- Memory: ${readMemorySceneLine(status)}`);
1184
+ lines.push(`- Skills: ${readSkillsSceneLine(status)}`);
1176
1185
  lines.push(`- Cost: ${status.scene.cost}`);
1177
1186
  lines.push(`- Tool output: ${status.scene.toolOutputs}`);
1178
1187
  lines.push(`- Recovery: ${status.scene.recovery}`);
1179
1188
  lines.push("");
1180
- lines.push("Current workspace:");
1181
- lines.push(`- Focus: ${status.scene.focus}`);
1189
+ lines.push("Runtime facts:");
1182
1190
  lines.push(`- Session: ${readSessionLine(status)}`);
1183
1191
  if (status.sessions.skipped > 0) {
1184
1192
  lines.push(`- Sessions: ${status.sessions.total} total, ${status.sessions.skipped} skipped`);
1185
1193
  }
1186
- lines.push(`- Next: ${status.scene.nextAction}`);
1187
- lines.push(`- Blocked: ${status.scene.blocked}`);
1188
1194
  lines.push(`- Context budget: ${readContextBudgetLine(status)}`);
1189
1195
  lines.push(`- Workset: ${status.sessions.latest?.workset ? `${status.sessions.latest.workset.total} file(s)` : "none"}`);
1190
- lines.push(`- Memory: ${status.memory.assets.length > 0 ? `${status.memory.assets.length} asset(s)` : "none"}`);
1196
+ lines.push(`- Memory files: ${status.memory.assets.length > 0 ? `${status.memory.assets.length}` : "none"}`);
1191
1197
  lines.push(`- Skills: ${status.skills.ready}/${status.skills.total} ready`);
1192
1198
  lines.push(`- Model cache: ${readModelCacheLine(status)}`);
1193
- lines.push(`- Project map: ${status.projectMap ? "ready" : "missing"}`);
1199
+ lines.push(`- Project orientation: ${status.projectMap ? "ready" : "missing"}`);
1194
1200
  lines.push(`- Executions: ${status.executions.active.length} active / ${status.executions.total} total`);
1195
1201
  lines.push(`- Wake signals: ${status.wakeSignals.recent.length}`);
1196
1202
  if (status.taskLifecycle) {
1197
1203
  lines.push("");
1198
- lines.push("Task lifecycle:");
1204
+ lines.push("Task facts:");
1199
1205
  lines.push([
1200
1206
  status.taskLifecycle.stage,
1201
1207
  status.taskLifecycle.reason ? `reason=${status.taskLifecycle.reason}` : void 0,
@@ -1214,7 +1220,7 @@ function formatRuntimeStatusText(status) {
1214
1220
  }
1215
1221
  if (status.projectMap) {
1216
1222
  lines.push("");
1217
- lines.push("Project map:");
1223
+ lines.push("Project facts:");
1218
1224
  lines.push([
1219
1225
  `dirs=${status.projectMap.topLevelDirectories.slice(0, 6).join(", ") || "none"}`,
1220
1226
  `scripts=${status.projectMap.packageScripts.slice(0, 6).join(", ") || "none"}`,
@@ -1309,7 +1315,7 @@ function formatRuntimeStatusText(status) {
1309
1315
  }
1310
1316
  if (status.scene.executions.length > 0) {
1311
1317
  lines.push("");
1312
- lines.push("Scene executions:");
1318
+ lines.push("Delegated task scene:");
1313
1319
  for (const execution of status.scene.executions) {
1314
1320
  lines.push([
1315
1321
  execution.id,
@@ -1373,6 +1379,21 @@ function readSessionLine(status) {
1373
1379
  }
1374
1380
  return `${status.sessions.latest.id} (${status.sessions.latest.messageCount} message(s))`;
1375
1381
  }
1382
+ function readBackgroundSceneLine(status) {
1383
+ const { active, blocked, nextAction } = status.scene.background;
1384
+ if (active === 0) {
1385
+ return nextAction;
1386
+ }
1387
+ return `${active} active${blocked > 0 ? `, ${blocked} need attention` : ""}; ${nextAction}`;
1388
+ }
1389
+ function readMemorySceneLine(status) {
1390
+ const session = status.scene.memory.latestSessionMemory ? "session memory ready" : "session memory not saved yet";
1391
+ const assets = status.scene.memory.assets === 0 ? "no reviewable memory files" : `${status.scene.memory.assets} reviewable memory file(s)`;
1392
+ return `${session}; ${assets}; ${status.scene.memory.nextAction}`;
1393
+ }
1394
+ function readSkillsSceneLine(status) {
1395
+ return `${status.scene.skills.ready}/${status.scene.skills.total} ready; ${status.scene.skills.nextAction}`;
1396
+ }
1376
1397
  function readContextBudgetLine(status) {
1377
1398
  const budget = status.sessions.latest?.contextBudget;
1378
1399
  if (!budget) {
@@ -1489,7 +1510,7 @@ function truncateDisplayTitle(title) {
1489
1510
 
1490
1511
  // src/cli/commands/sessionHelpers.ts
1491
1512
  async function createSessionStore(sessionsDir) {
1492
- const { SessionStore: SessionStore2 } = await import("./session-V7AYOK2Q.mjs");
1513
+ const { SessionStore: SessionStore2 } = await import("./session-WJWPSYBD.mjs");
1493
1514
  return new SessionStore2(sessionsDir);
1494
1515
  }
1495
1516
 
@@ -2014,7 +2035,7 @@ async function resolveLocalStateRootDir(context) {
2014
2035
  }
2015
2036
  function formatSkillsForLocalCommand(status) {
2016
2037
  if (status.skills.total === 0) {
2017
- return "No runtime skills discovered.";
2038
+ return status.scene.skills.nextAction;
2018
2039
  }
2019
2040
  return [
2020
2041
  `skills: ${status.skills.ready}/${status.skills.total} ready`,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createRuntimeUiEvent,
3
3
  createRuntimeUiTerminalRenderer
4
- } from "./chunk-7FDXKNTM.mjs";
4
+ } from "./chunk-7FOTCUIH.mjs";
5
5
 
6
6
  // src/runtime-ui/agentCallbacks.ts
7
7
  function createRuntimeUiAgentCallbacks(input) {