@jun133/kitty 0.0.14 → 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,17 +1,23 @@
1
1
  import {
2
2
  SessionStore,
3
3
  parseRuntimeMemoryAssetMetadata
4
- } from "./chunk-4BN45TQG.mjs";
4
+ } from "./chunk-FKBVCYPW.mjs";
5
5
  import {
6
6
  BackgroundExecutionStore,
7
7
  ControlPlaneLedger,
8
8
  EXTENSION_ENV_KEYS,
9
9
  ExecutionStore,
10
+ PRESERVED_PROJECT_STATE_ENTRY_NAMES,
11
+ PROJECT_STATE_DIR_NAME,
12
+ PROJECT_STATE_ENV_EXAMPLE_FILE_NAME,
13
+ PROJECT_STATE_ENV_FILE_NAME,
14
+ PROJECT_STATE_IGNORE_FILE_NAME,
10
15
  SessionEventStore,
11
16
  buildProjectMap,
12
17
  createRuntimeUiEvent,
13
18
  formatRuntimeUiEventLine,
14
19
  getErrorMessage,
20
+ getProjectStatePaths,
15
21
  isProcessAlive,
16
22
  loadProjectContext,
17
23
  reconcileBackgroundExecutions,
@@ -23,15 +29,10 @@ import {
23
29
  terminatePid,
24
30
  writeStderrLine,
25
31
  writeStdoutLine
26
- } from "./chunk-KROQCOWD.mjs";
32
+ } from "./chunk-7FOTCUIH.mjs";
27
33
  import {
28
- PRESERVED_PROJECT_STATE_ENTRY_NAMES,
29
- PROJECT_STATE_DIR_NAME,
30
- PROJECT_STATE_ENV_EXAMPLE_FILE_NAME,
31
- PROJECT_STATE_ENV_FILE_NAME,
32
- PROJECT_STATE_IGNORE_FILE_NAME,
33
- getProjectStatePaths
34
- } from "./chunk-3KMC6H5K.mjs";
34
+ resolveModelProfile
35
+ } from "./chunk-C3MFBHV3.mjs";
35
36
 
36
37
  // src/observability/terminalLog.ts
37
38
  import fs from "fs";
@@ -374,18 +375,18 @@ function buildExecutionScene(execution) {
374
375
  }
375
376
  function buildHeadline(status, blockedExecutions, watchExecutions) {
376
377
  if (blockedExecutions.length > 0) {
377
- return `${blockedExecutions.length} execution(s) need attention.`;
378
+ return blockedExecutions.length === 1 ? "One delegated task needs attention." : `${blockedExecutions.length} delegated tasks need attention.`;
378
379
  }
379
380
  if (watchExecutions.length > 0) {
380
- 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.`;
381
382
  }
382
383
  if (status.executions.active.length > 0) {
383
- 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.`;
384
385
  }
385
386
  if (!status.sessions.latest) {
386
- return "No active session yet.";
387
+ return "No session has started yet.";
387
388
  }
388
- return "Ready to continue the latest session.";
389
+ return "Latest session is ready.";
389
390
  }
390
391
  function readFocus(status) {
391
392
  const focus = status.sessions.latest?.focus;
@@ -396,7 +397,7 @@ function readFocus(status) {
396
397
  if (title) {
397
398
  return truncateText(title, 120);
398
399
  }
399
- return "none";
400
+ return "No current focus yet.";
400
401
  }
401
402
  function readNextAction(status, blockedExecutions, watchExecutions) {
402
403
  const urgent = blockedExecutions[0] ?? watchExecutions[0];
@@ -404,32 +405,32 @@ function readNextAction(status, blockedExecutions, watchExecutions) {
404
405
  return urgent.nextAction;
405
406
  }
406
407
  if (status.executions.active.length > 0) {
407
- 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`.";
408
409
  }
409
410
  if (!status.sessions.latest) {
410
411
  return "Start a session with `kitty`.";
411
412
  }
412
- return "Continue from the current session focus.";
413
+ return "Continue from the latest session.";
413
414
  }
414
415
  function readBlocked(blockedExecutions) {
415
416
  if (blockedExecutions.length === 0) {
416
- return "no";
417
+ return "No blockers visible.";
417
418
  }
418
- 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(" | ");
419
420
  }
420
421
  function readCost(status) {
421
422
  const budget = status.sessions.latest?.contextBudget;
422
423
  const latest = status.modelRequests.recent[0];
423
- 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";
424
425
  const layout = budget?.cacheLayout;
425
- const layoutText = layout ? `stable ${readStableRatio(layout.stablePrefixChars, layout.volatileTailChars)}` : "cache layout unknown";
426
- const usageText = latest?.usage ? readUsageCost(latest.usage) : latest ? "provider usage unavailable" : "no model request yet";
427
- 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("; ");
428
429
  }
429
430
  function readToolOutputs(status) {
430
431
  const recent = status.toolOutputs.recent;
431
432
  if (recent.length === 0) {
432
- return "no tool output governance yet";
433
+ return "Tool output has not needed projection yet";
433
434
  }
434
435
  const saved = recent.reduce((total, item) => total + (item.savedTokens ?? 0), 0);
435
436
  const truncated = recent.filter((item) => item.truncated).length;
@@ -445,7 +446,7 @@ function readToolOutputs(status) {
445
446
  }
446
447
  function readStableRatio(stableChars, volatileChars) {
447
448
  const total = stableChars + volatileChars;
448
- return total > 0 ? `${Math.round(stableChars / total * 100)}%` : "unknown";
449
+ return total > 0 ? `${Math.round(stableChars / total * 100)}%` : "not measured";
449
450
  }
450
451
  function readUsageCost(usage) {
451
452
  const cached = usage.cacheHitTokens ?? usage.cacheReadTokens;
@@ -459,16 +460,16 @@ function readUsageCost(usage) {
459
460
  function readRecovery(status, executions) {
460
461
  const risky = executions.filter((execution) => execution.risk !== "none").length;
461
462
  if (risky > 0) {
462
- return `${risky} execution(s) need recovery attention.`;
463
+ return risky === 1 ? "One delegated task needs recovery attention." : `${risky} delegated tasks need recovery attention.`;
463
464
  }
464
465
  if (status.wakeSignals.recent.length > 0) {
465
- 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.`;
466
467
  }
467
- return "no recovery action needed";
468
+ return "Recovery is clear.";
468
469
  }
469
470
  function readSkillsNextAction(status) {
470
471
  if (status.skills.total === 0) {
471
- return "No runtime skills discovered.";
472
+ return "No runtime skills are discovered in this project.";
472
473
  }
473
474
  if (status.skills.needsAttention.length > 0) {
474
475
  return "Inspect skill issues before relying on those skills.";
@@ -477,7 +478,7 @@ function readSkillsNextAction(status) {
477
478
  }
478
479
  function readMemoryNextAction(status) {
479
480
  if (!status.sessions.latest) {
480
- return "No session memory yet.";
481
+ return "Memory will appear after a session produces useful continuity.";
481
482
  }
482
483
  if (!status.sessions.latest.hasMemory && status.memory.assets.length === 0) {
483
484
  return "Continue the session until useful memory is saved.";
@@ -489,7 +490,7 @@ function readMemoryNextAction(status) {
489
490
  }
490
491
  function readBackgroundNextAction(backgrounds) {
491
492
  if (backgrounds.length === 0) {
492
- return "No active background work.";
493
+ return "No background work is running.";
493
494
  }
494
495
  const blocked = backgrounds.find((execution) => execution.risk === "blocked");
495
496
  if (blocked) {
@@ -524,7 +525,7 @@ function readExecutionSummary(execution) {
524
525
  if (execution.command) {
525
526
  return truncateText(execution.command, 120);
526
527
  }
527
- return `${execution.kind} execution`;
528
+ return `${readExecutionKindLabel(execution.kind)} task`;
528
529
  }
529
530
  function readExecutionNextAction(execution, risk) {
530
531
  if (execution.kind === "background") {
@@ -537,15 +538,25 @@ function readExecutionNextAction(execution, risk) {
537
538
  return `Inspect with \`kitty background wait ${execution.id}\` if you need the result now.`;
538
539
  }
539
540
  if (risk === "blocked") {
540
- return `Inspect execution ${execution.id} in status before continuing.`;
541
+ return `Inspect ${readExecutionKindLabel(execution.kind)} ${execution.id} before continuing.`;
541
542
  }
542
543
  if (risk === "watch") {
543
- return `Watch execution ${execution.id} for output or deadline.`;
544
+ return `Watch ${readExecutionKindLabel(execution.kind)} ${execution.id} for output or deadline.`;
544
545
  }
545
546
  if (execution.waitPolicy === "block_lead_until_complete") {
546
- 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";
547
559
  }
548
- return "Execution is active.";
549
560
  }
550
561
  function truncateText(value, maxChars) {
551
562
  const normalized = value.replace(/\s+/g, " ").trim();
@@ -648,18 +659,27 @@ var KITTY_ENV = {
648
659
 
649
660
  // src/config/providerPresets.ts
650
661
  var PROVIDER_PRESETS = [
662
+ {
663
+ label: "YLS Codex + GPT-5.5",
664
+ provider: "yls",
665
+ baseUrl: "https://code.ylsagi.com/codex",
666
+ model: "gpt-5.5",
667
+ thinking: "enabled",
668
+ reasoningEffort: "high",
669
+ activeByDefault: false
670
+ },
651
671
  {
652
672
  label: "YLS Codex + GPT-5.4",
653
- provider: "openai",
673
+ provider: "yls",
654
674
  baseUrl: "https://code.ylsagi.com/codex",
655
675
  model: "gpt-5.4",
656
- thinking: "disabled",
676
+ thinking: "enabled",
657
677
  reasoningEffort: "xhigh",
658
678
  activeByDefault: false
659
679
  },
660
680
  {
661
681
  label: "TTAPI + GPT-5.4",
662
- provider: "openai",
682
+ provider: "ttapi",
663
683
  baseUrl: "https://w.ciykj.cn",
664
684
  model: "gpt-5.4",
665
685
  thinking: "disabled",
@@ -696,7 +716,8 @@ async function inspectConfigPreflight(rootDir) {
696
716
  const model = parsedEnv[KITTY_ENV.model] ?? "";
697
717
  const baseUrl = parsedEnv[KITTY_ENV.baseUrl] ?? "";
698
718
  const providerPreset = readProviderPresetLabel({ provider, model, baseUrl });
699
- const ready = files.every((file) => file.exists) && missingKeys.length === 0;
719
+ const catalog = readCatalogProfile({ provider, model });
720
+ const ready = files.every((file) => file.exists) && missingKeys.length === 0 && !catalog.error;
700
721
  return {
701
722
  rootDir: normalizedRoot,
702
723
  kittyDir,
@@ -705,6 +726,10 @@ async function inspectConfigPreflight(rootDir) {
705
726
  activeKeys,
706
727
  missingKeys,
707
728
  providerPreset,
729
+ providerProfile: catalog.providerProfile,
730
+ modelProfile: catalog.modelProfile,
731
+ wireApi: catalog.wireApi,
732
+ catalogError: catalog.error,
708
733
  provider,
709
734
  model,
710
735
  baseUrl,
@@ -730,6 +755,10 @@ function formatConfigPreflightReport(report) {
730
755
  `model: ${report.env.model || "(missing)"}`,
731
756
  `baseUrl: ${report.env.baseUrl || "(missing)"}`,
732
757
  `provider preset: ${formatProviderPresetFact(report)}`,
758
+ `provider profile: ${report.env.providerProfile ?? "(unresolved)"}`,
759
+ `model profile: ${report.env.modelProfile ?? "(unresolved)"}`,
760
+ `wire API: ${report.env.wireApi ?? "(unresolved)"}`,
761
+ report.env.catalogError ? `catalog: ${report.env.catalogError}` : "catalog: ok",
733
762
  `api key: ${report.env.apiKeyPresent ? "present" : "missing"}`,
734
763
  `preflight: ${report.ready ? "ready" : "not_ready"}`,
735
764
  "next:",
@@ -778,6 +807,23 @@ function readProviderPresetLabel(input) {
778
807
  (preset) => preset.provider === input.provider && preset.model === input.model && preset.baseUrl === input.baseUrl
779
808
  )?.label;
780
809
  }
810
+ function readCatalogProfile(input) {
811
+ if (!input.provider || !input.model) {
812
+ return {};
813
+ }
814
+ try {
815
+ const profile = resolveModelProfile(input);
816
+ return {
817
+ providerProfile: profile.provider.label,
818
+ modelProfile: profile.model.label,
819
+ wireApi: profile.model.wireApi
820
+ };
821
+ } catch (error) {
822
+ return {
823
+ error: error instanceof Error ? error.message : String(error)
824
+ };
825
+ }
826
+ }
781
827
  function formatProviderPresetFact(report) {
782
828
  if (report.env.providerPreset) {
783
829
  return report.env.providerPreset;
@@ -1128,38 +1174,34 @@ function formatRuntimeStatusText(status) {
1128
1174
  lines.push(`Project: ${status.rootDir}`);
1129
1175
  lines.push(`State: ${status.stateDir}`);
1130
1176
  lines.push("");
1131
- lines.push("Scene:");
1177
+ lines.push("Current scene:");
1132
1178
  lines.push(`- Now: ${status.scene.headline}`);
1133
1179
  lines.push(`- Focus: ${status.scene.focus}`);
1134
1180
  lines.push(`- Next: ${status.scene.nextAction}`);
1135
1181
  lines.push(`- Blocked: ${status.scene.blocked}`);
1136
- lines.push(`- Background: ${status.scene.background.active} active / ${status.scene.background.blocked} need attention`);
1137
- lines.push(`- Background next: ${status.scene.background.nextAction}`);
1138
- lines.push(`- Skills: ${status.scene.skills.ready}/${status.scene.skills.total} ready; ${status.scene.skills.nextAction}`);
1139
- 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)}`);
1140
1185
  lines.push(`- Cost: ${status.scene.cost}`);
1141
1186
  lines.push(`- Tool output: ${status.scene.toolOutputs}`);
1142
1187
  lines.push(`- Recovery: ${status.scene.recovery}`);
1143
1188
  lines.push("");
1144
- lines.push("Current workspace:");
1145
- lines.push(`- Focus: ${status.scene.focus}`);
1189
+ lines.push("Runtime facts:");
1146
1190
  lines.push(`- Session: ${readSessionLine(status)}`);
1147
1191
  if (status.sessions.skipped > 0) {
1148
1192
  lines.push(`- Sessions: ${status.sessions.total} total, ${status.sessions.skipped} skipped`);
1149
1193
  }
1150
- lines.push(`- Next: ${status.scene.nextAction}`);
1151
- lines.push(`- Blocked: ${status.scene.blocked}`);
1152
1194
  lines.push(`- Context budget: ${readContextBudgetLine(status)}`);
1153
1195
  lines.push(`- Workset: ${status.sessions.latest?.workset ? `${status.sessions.latest.workset.total} file(s)` : "none"}`);
1154
- 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"}`);
1155
1197
  lines.push(`- Skills: ${status.skills.ready}/${status.skills.total} ready`);
1156
1198
  lines.push(`- Model cache: ${readModelCacheLine(status)}`);
1157
- lines.push(`- Project map: ${status.projectMap ? "ready" : "missing"}`);
1199
+ lines.push(`- Project orientation: ${status.projectMap ? "ready" : "missing"}`);
1158
1200
  lines.push(`- Executions: ${status.executions.active.length} active / ${status.executions.total} total`);
1159
1201
  lines.push(`- Wake signals: ${status.wakeSignals.recent.length}`);
1160
1202
  if (status.taskLifecycle) {
1161
1203
  lines.push("");
1162
- lines.push("Task lifecycle:");
1204
+ lines.push("Task facts:");
1163
1205
  lines.push([
1164
1206
  status.taskLifecycle.stage,
1165
1207
  status.taskLifecycle.reason ? `reason=${status.taskLifecycle.reason}` : void 0,
@@ -1178,7 +1220,7 @@ function formatRuntimeStatusText(status) {
1178
1220
  }
1179
1221
  if (status.projectMap) {
1180
1222
  lines.push("");
1181
- lines.push("Project map:");
1223
+ lines.push("Project facts:");
1182
1224
  lines.push([
1183
1225
  `dirs=${status.projectMap.topLevelDirectories.slice(0, 6).join(", ") || "none"}`,
1184
1226
  `scripts=${status.projectMap.packageScripts.slice(0, 6).join(", ") || "none"}`,
@@ -1273,7 +1315,7 @@ function formatRuntimeStatusText(status) {
1273
1315
  }
1274
1316
  if (status.scene.executions.length > 0) {
1275
1317
  lines.push("");
1276
- lines.push("Scene executions:");
1318
+ lines.push("Delegated task scene:");
1277
1319
  for (const execution of status.scene.executions) {
1278
1320
  lines.push([
1279
1321
  execution.id,
@@ -1337,6 +1379,21 @@ function readSessionLine(status) {
1337
1379
  }
1338
1380
  return `${status.sessions.latest.id} (${status.sessions.latest.messageCount} message(s))`;
1339
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
+ }
1340
1397
  function readContextBudgetLine(status) {
1341
1398
  const budget = status.sessions.latest?.contextBudget;
1342
1399
  if (!budget) {
@@ -1453,7 +1510,7 @@ function truncateDisplayTitle(title) {
1453
1510
 
1454
1511
  // src/cli/commands/sessionHelpers.ts
1455
1512
  async function createSessionStore(sessionsDir) {
1456
- const { SessionStore: SessionStore2 } = await import("./session-XKWJHRVY.mjs");
1513
+ const { SessionStore: SessionStore2 } = await import("./session-WJWPSYBD.mjs");
1457
1514
  return new SessionStore2(sessionsDir);
1458
1515
  }
1459
1516
 
@@ -1978,7 +2035,7 @@ async function resolveLocalStateRootDir(context) {
1978
2035
  }
1979
2036
  function formatSkillsForLocalCommand(status) {
1980
2037
  if (status.skills.total === 0) {
1981
- return "No runtime skills discovered.";
2038
+ return status.scene.skills.nextAction;
1982
2039
  }
1983
2040
  return [
1984
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-KROQCOWD.mjs";
4
+ } from "./chunk-7FOTCUIH.mjs";
5
5
 
6
6
  // src/runtime-ui/agentCallbacks.ts
7
7
  function createRuntimeUiAgentCallbacks(input) {