@litfamily/litclaude 1.0.63 → 1.0.65

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.
@@ -12,7 +12,7 @@ import {
12
12
  } from "node:fs";
13
13
  import { cp, mkdir, rm } from "node:fs/promises";
14
14
  import { homedir } from "node:os";
15
- import { dirname, join, resolve } from "node:path";
15
+ import { dirname, join, resolve, sep } from "node:path";
16
16
  import { createInterface } from "node:readline/promises";
17
17
  import { fileURLToPath } from "node:url";
18
18
  import {
@@ -73,7 +73,11 @@ import { DISCUSSIONS_URL, inviteMessage, recordInvite, shareLine } from "../plug
73
73
  import { resolveProjectStateRoot } from "../plugins/litclaude/lib/project-state-root.mjs";
74
74
  import { runUpdateNotifier } from "./update-notifier.mjs";
75
75
  import { assertInstallPath, assertOwnedTree, assertOwnedPluginTree, assertCurrentPointer, assertOwnedRegistrations, migrateLegacyVendorPaths, planModifiedLegacySkill, preserveModifiedLegacySkill, registeredPluginInstallation, writeOwnershipReceipt, removeEmptyDirectory, clearOwnedTree } from "./install-ownership.mjs";
76
+ import { createInstallUi, richTerminal, wrap } from "./install-ui.mjs";
76
77
  import { colorMode, supportsBlocks } from "./litfamily-banner.mjs";
78
+ import { textWidth } from "../plugins/litclaude/lib/mod/layout.mjs";
79
+ import { xterm256Hex } from "../plugins/litclaude/lib/mod/settings.mjs";
80
+ import { roundCapsHere } from "../plugins/litclaude/lib/round-caps.mjs";
77
81
  import { SIZES, pickSize, synthwaveRows } from "../plugins/litclaude/lib/synthwave-mark.mjs";
78
82
  import {
79
83
  ICON_FONT,
@@ -249,6 +253,12 @@ const OUTPUT_STYLE_OPTIONS = [
249
253
  { id: "eli5", label: "ELI5 (English)" },
250
254
  { id: "eli5-ko", label: "ELI5 (한국어)" },
251
255
  ];
256
+ const OUTPUT_STYLE_DETAILS = {
257
+ "asd-ste100": "short, active, controlled English",
258
+ "asd-ste100-ko": "the same rules in Korean",
259
+ "eli5": "small words, only what you need",
260
+ "eli5-ko": "the same, in Korean",
261
+ };
252
262
  const OUTPUT_STYLE_NAMES = {
253
263
  "asd-ste100": "LitClaude — ASD-STE100",
254
264
  "asd-ste100-ko": "LitClaude — ASD-STE100 (한국어)",
@@ -417,9 +427,8 @@ const INSTALL_STAGES = [
417
427
  // Human-facing Synthwave mark: the size follows the terminal width; no colour gives the glyph-only scene.
418
428
  // A pipe (agents, CI logs) gets the one plain line, so tool output never carries rows of art.
419
429
  const terminalColumns = () => process.stdout.columns || Number.parseInt(process.env.COLUMNS ?? "", 10) || 80;
420
- const renderLitClaudeWordmark = ({ color = shouldColorInstall() } = {}) => {
430
+ const renderLitClaudeWordmark = ({ color = shouldColorInstall(), cols = terminalColumns() } = {}) => {
421
431
  if (!supportsBlocks() || !process.stdout.isTTY) return synthwaveRows({ mode: "plain" }).concat(`litclaude v${version}`);
422
- const cols = terminalColumns();
423
432
  const rows = synthwaveRows({ cols, mode: color ? colorMode() : "mono" });
424
433
  const versionLine = `litclaude v${version}`;
425
434
  const markWidth = SIZES.find((size) => size.name === pickSize(cols))?.minCols ?? versionLine.length;
@@ -459,7 +468,18 @@ const printCommandBanner = (parsed) => {
459
468
  process.stdout.write(asciiFrame(`${renderLitClaudeWordmark({ color }).join("\n")}\n`));
460
469
  };
461
470
 
471
+ // The cards an interactive install draws (bin/install-ui.mjs), or null: pipes, CI, --yes, TERM=dumb and
472
+ // the *_PROMPT hooks keep the plain prompts and lines. `installNotes` holds what the plain run prints as
473
+ // KEY: lines, for the summary card.
474
+ let installUi = null;
475
+ const installNotes = [];
476
+ const say = (line) => {
477
+ if (installUi) installNotes.push(line);
478
+ else process.stdout.write(`${line}\n`);
479
+ };
480
+
462
481
  const createInstallProgress = () => {
482
+ if (installUi) return createCardProgress();
463
483
  const animated = shouldAnimateInstall();
464
484
  let frameIndex = 0;
465
485
  // Explicit spinner mode keeps structured progress, but cannot enable terminal escapes.
@@ -541,6 +561,60 @@ const createInstallProgress = () => {
541
561
  };
542
562
  };
543
563
 
564
+ const createCardProgress = () => {
565
+ let card;
566
+ return {
567
+ prepare() {
568
+ card = installUi.progress({
569
+ tag: "LIT",
570
+ title: `Installing LitClaude ${version}`,
571
+ steps: INSTALL_STAGES.map(([, name, text]) => ({ name, text })),
572
+ });
573
+ },
574
+ async run({ number, title, label }, work) {
575
+ try {
576
+ return await card.run(number - 1, work);
577
+ } catch (error) {
578
+ installUi.panel({
579
+ tag: "LIT",
580
+ title: "INSTALL STOPPED",
581
+ tone: "bad",
582
+ sections: [{ rows: [
583
+ { mark: "fail", label: "Stage", value: `${String(number).padStart(2, "0")} / 05 · ${title} (${label} failed)` },
584
+ { mark: "fail", label: "Reason", value: error instanceof Error ? error.message : String(error) },
585
+ { mark: "note", label: "Next", value: "Resolve the reason above, then rerun litclaude install" },
586
+ { mark: "note", value: "Exit without reporting success" },
587
+ ] }],
588
+ });
589
+ throw error;
590
+ }
591
+ },
592
+ receipt() {
593
+ card.finish("Install steps", "5 of 5 checked");
594
+ },
595
+ };
596
+ };
597
+
598
+ // The same answer the status line gets (lib/mod/round.mjs).
599
+ const installerRoundCaps = async () => normalizeHudAppearance(process.env.LITCLAUDE_HUD_APPEARANCE) === "dark"
600
+ && roundCapsHere({ settings: readClaudeSettings() });
601
+
602
+ const homeRelative = (path) => (path.startsWith(`${homedir()}${sep}`) ? `~${path.slice(homedir().length)}` : path);
603
+
604
+ // The opening of a card install: the mark, then where the files go.
605
+ const writeInstallOpening = () => {
606
+ const where = `Installs into ${homeRelative(claudeHome())} and ${homeRelative(litHome())}. Other Claude settings stay as is.`;
607
+ // A short window gets a smaller mark, so the first card and the mark are on screen together.
608
+ const height = process.stdout.rows || 24;
609
+ const cols = Math.min(terminalColumns(), height >= 48 ? Infinity : height >= 34 ? 75 : 43);
610
+ const mark = renderLitClaudeWordmark({ cols });
611
+ // The mark stands over the middle of the cards.
612
+ const width = Math.max(...mark.map((row) => textWidth(row.replace(/\x1b\[[0-9;]*m/gu, ""))));
613
+ const indent = " ".repeat(Math.max(0, 1 + Math.floor((installUi.cardWidth() - width) / 2)));
614
+ process.stdout.write(asciiFrame(`\n${mark.map((row) => indent + row).join("\n")}\n`));
615
+ process.stdout.write(`\n${wrap(where, installUi.cardWidth()).map((line) => ` ${installUi.paint(line, { dim: true })}\n`).join("")}`);
616
+ };
617
+
544
618
  const currentExists = (home = claudeHome()) => existsSync(claudePluginRoot(home));
545
619
 
546
620
  const readInstalledPlugins = (home = claudeHome()) => {
@@ -572,6 +646,40 @@ const writeClaudeSettings = (settings, home = claudeHome()) => {
572
646
  writeFileSync(settingsPath, `${JSON.stringify(settings, null, 2)}\n`);
573
647
  };
574
648
 
649
+ const PREVIEW_TRACK = "#2a2340";
650
+ const hexSgr = (hex, kind = 38) => `\x1b[${kind};2;${[1, 3, 5].map((i) => Number.parseInt(hex.slice(i, i + 2), 16)).join(";")}m`;
651
+ // The status line's round gauge and colours, as bin/litclaude-hud.js draws them.
652
+ const previewGauge = (percent, width, [from, to]) => {
653
+ const eighths = Math.max(percent > 0 ? 1 : 0, Math.round((percent * width * 8) / 100));
654
+ const mix = (t) => `#${[1, 3, 5].map((i) => [from, to].map((hex) => Number.parseInt(hex.slice(i, i + 2), 16))).map(([a, b]) => Math.round(a + (b - a) * t).toString(16).padStart(2, "0")).join("")}`;
655
+ const cellsDrawn = Array.from({ length: width }, (_, i) => `${hexSgr(mix(i / (width - 1)))}${" ▏▎▍▌▋▊▉█"[Math.max(0, Math.min(8, eighths - i * 8))]}`);
656
+ return `${hexSgr(percent > 0 ? from : PREVIEW_TRACK)}\ue0b6${hexSgr(PREVIEW_TRACK, 48)}${cellsDrawn.join("")}\x1b[0m${hexSgr(eighths >= width * 8 ? to : PREVIEW_TRACK)}\ue0b4\x1b[0m`;
657
+ };
658
+ const roundAccentViews = (theme) => {
659
+ const tint = (text) => `\x1b[38;5;${theme.code}m${text}\x1b[0m`;
660
+ const line = (hex) => ` ${hexSgr(hex)}│\x1b[0m `;
661
+ const brand = litBrandPrefix(version, { depth: "truecolor", roundCaps: true });
662
+ const gauge = previewGauge(18, 3, ["#b48cff", xterm256Hex(theme.code)]);
663
+ const context = `${tint("ctx")} ${gauge} ${tint("18%/1m")}`;
664
+ const five = `${tint("5h")} ${previewGauge(4, 2, ["#2fd6a0", "#6bf0c8"])}${hexSgr("#2fd6a0")}4%\x1b[0m`;
665
+ const full = `${brand} ${tint("|")} ${tint("O4.8")}${line("#ff2d95")}${context}${line("#ff66bb")}${five}`;
666
+ return [`${full} ${theme.mood.replace(" default", "'s own")}`, full, `${brand}${line("#ff2d95")}${context}${line("#ff66bb")}${five}`, `${brand}${line("#ff2d95")}${tint("ctx")} ${gauge} ${tint("18%")}`, context, gauge];
667
+ };
668
+
669
+ // The same preview at falling widths, for the colour card's rows.
670
+ const hudAccentViews = (theme) => {
671
+ const { depth, ascii, round } = installUi;
672
+ const plain = depth === "plain";
673
+ if (round) return roundAccentViews(theme);
674
+ const tint = (text) => plain ? text : depth === "16" ? `\x1b[${ansi16CodeForAccent(theme.name)}m${text}\x1b[0m` : `\x1b[38;5;${theme.code}m${text}\x1b[0m`;
675
+ const brand = ascii ? `[LIT v${version}]` : litBrandPrefix(version, { noColor: plain, depth, appearance: normalizeHudAppearance(process.env.LITCLAUDE_HUD_APPEARANCE) });
676
+ const bar = `[${tint(ascii ? "#" : "▌")}${ascii ? "--" : "░░"}]`;
677
+ const line = ascii ? " | " : " │ ";
678
+ const five = `[${ascii ? "#-" : "▏░"}]`;
679
+ const full = `${brand} | O4.8${line}ctx ${bar} 18%/1m${line}5h ${five}4%`;
680
+ return [`${full} ${theme.mood.replace(" default", "'s own")}`, full, `${brand}${line}ctx ${bar} 18%/1m${line}5h ${five}4%`, `${brand}${line}ctx ${bar} 18%`, `ctx ${bar} 18%/1m`, bar];
681
+ };
682
+
575
683
  const hudAccentPreview = (theme) => {
576
684
  const color = shouldColorInstall();
577
685
  const depth = color ? hudColorDepth(process.env) : "plain";
@@ -597,7 +705,7 @@ const shouldPromptHudAccent = () => {
597
705
  return Boolean(process.stdin.isTTY && process.stdout.isTTY && !Object.hasOwn(process.env, "CI"));
598
706
  };
599
707
 
600
- const chooseHudAccent = async (existingAccent = "cyan") => {
708
+ const chooseHudAccent = async (existingAccent = "cyan", { tag, stored = false } = {}) => {
601
709
  const preservedAccent = normalizeHudAccent(existingAccent);
602
710
  const envAccent = process.env.LITCLAUDE_HUD_ACCENT;
603
711
  if (envAccent && process.env.LITCLAUDE_HUD_ACCENT_PROMPT !== "1") {
@@ -605,6 +713,19 @@ const chooseHudAccent = async (existingAccent = "cyan") => {
605
713
  }
606
714
  if (!shouldPromptHudAccent()) return envAccent ? normalizeHudAccent(envAccent) : preservedAccent;
607
715
 
716
+ if (installUi) {
717
+ installUi.setAccent(preservedAccent);
718
+ return installUi.choose({
719
+ tag,
720
+ title: "Status-line colour",
721
+ note: `Sets the accent colour of the status line; press Enter to keep ${preservedAccent}.`,
722
+ choices: hudAccentThemes.map((theme, index) => ({ id: theme.name, label: theme.name, key: String((index + 1) % 10), color: theme.name, views: hudAccentViews(theme) })),
723
+ initial: preservedAccent,
724
+ initialTag: stored ? "current" : "default",
725
+ onHighlight: installUi.setAccent,
726
+ });
727
+ }
728
+
608
729
  process.stdout.write("Choose LitClaude HUD brand color:\n");
609
730
  for (const [index, theme] of hudAccentThemes.entries()) {
610
731
  process.stdout.write(` ${index + 1}) ${theme.name.padEnd(8)} ${hudAccentPreview(theme)} ${theme.mood}\n`);
@@ -639,7 +760,7 @@ const shouldPromptOutputStyle = () => {
639
760
  return Boolean(process.stdin.isTTY && process.stdout.isTTY && !Object.hasOwn(process.env, "CI"));
640
761
  };
641
762
 
642
- const chooseOutputStyle = async (existingChoice = "off") => {
763
+ const chooseOutputStyle = async (existingChoice = "off", { tag, stored = false } = {}) => {
643
764
  const preserved = normalizeOutputStyle(existingChoice);
644
765
  const envStyle = process.env.LITCLAUDE_OUTPUT_STYLE;
645
766
  if (envStyle && process.env.LITCLAUDE_OUTPUT_STYLE_PROMPT !== "1") {
@@ -647,6 +768,17 @@ const chooseOutputStyle = async (existingChoice = "off") => {
647
768
  }
648
769
  if (!shouldPromptOutputStyle()) return envStyle ? normalizeOutputStyle(envStyle) : preserved;
649
770
 
771
+ if (installUi) {
772
+ return installUi.choose({
773
+ tag,
774
+ title: "Output style",
775
+ note: "Sets how Claude words its replies; None leaves the style you use now alone.",
776
+ choices: OUTPUT_STYLE_OPTIONS.map(({ id, label }, index) => ({ id, label, key: String(index), detail: OUTPUT_STYLE_DETAILS[id] })),
777
+ initial: preserved,
778
+ initialTag: stored ? "current" : "default",
779
+ });
780
+ }
781
+
650
782
  process.stdout.write("Choose LitClaude output style:\n");
651
783
  for (const [index, option] of OUTPUT_STYLE_OPTIONS.entries()) {
652
784
  process.stdout.write(` ${index}) ${option.label}\n`);
@@ -678,9 +810,19 @@ const shouldPromptIconFont = () => {
678
810
 
679
811
  // The icon font is opt-in: the flag, or a Yes to the one question an interactive install asks.
680
812
  // --yes keeps the shipped default, which is No.
681
- const chooseIconFont = async ({ iconFont, assumeYes }) => {
813
+ const chooseIconFont = async ({ iconFont, assumeYes, tag }) => {
682
814
  if (iconFont) return true;
683
815
  if (assumeYes || !shouldPromptIconFont()) return false;
816
+ if (installUi) {
817
+ return installUi.confirm({
818
+ tag,
819
+ title: "Icon font",
820
+ note: `${planIconFontInstall(iconFontPaths()).supported
821
+ ? "Downloads the symbols-only Nerd Font (MIT) into your user font folder"
822
+ : "Shows how to install the symbols-only Nerd Font (MIT) by hand"} for the status band's icons and round pills; No leaves your fonts as they are.`,
823
+ initial: false,
824
+ });
825
+ }
684
826
  const rl = createInterface({ input: process.stdin, output: process.stdout, terminal: shouldColorInstall() });
685
827
  try {
686
828
  return parseYesNo(await rl.question(ICON_FONT_QUESTION));
@@ -694,19 +836,20 @@ const iconFontPaths = () => ({ platform: process.platform, env: process.env, hom
694
836
  const runIconFontInstall = async () => {
695
837
  const where = iconFontPaths();
696
838
  if (!planIconFontInstall(where).supported) {
697
- process.stdout.write(`ICON_FONT_SKIPPED: ${windowsIconFontInstructions()}\n`);
839
+ say(`ICON_FONT_SKIPPED: ${windowsIconFontInstructions()}`);
698
840
  return;
699
841
  }
700
842
  try {
701
843
  const archive = await loadIconFontArchive({ env: process.env });
702
844
  const result = installIconFont({ ...where, archive });
703
- for (const path of result.installed) process.stdout.write(`ICON_FONT_INSTALLED: ${path}\n`);
704
- for (const path of result.present) process.stdout.write(`ICON_FONT_PRESENT: ${path}\n`);
705
- for (const { path, reason } of result.skipped) process.stdout.write(`ICON_FONT_LEFT_ALONE: ${path} (${reason})\n`);
706
- if (result.fontCache) process.stdout.write(`ICON_FONT_CACHE: ${result.fontCache}\n`);
707
- process.stdout.write(`ICON_FONT_HINT: ${terminalFontHint(process.env)}\n`);
845
+ for (const path of result.installed) say(`ICON_FONT_INSTALLED: ${path}`);
846
+ for (const path of result.present) say(`ICON_FONT_PRESENT: ${path}`);
847
+ for (const { path, reason } of result.skipped) say(`ICON_FONT_LEFT_ALONE: ${path} (${reason})`);
848
+ if (result.fontCache) say(`ICON_FONT_CACHE: ${result.fontCache}`);
849
+ say(`ICON_FONT_HINT: ${terminalFontHint(process.env)}`);
708
850
  } catch (error) {
709
- process.stderr.write(`ICON_FONT_FAILED: ${error.message}\n`);
851
+ if (installUi) say(`ICON_FONT_FAILED: ${error.message}`);
852
+ else process.stderr.write(`ICON_FONT_FAILED: ${error.message}\n`);
710
853
  }
711
854
  };
712
855
 
@@ -888,9 +1031,20 @@ const shouldPromptAttribution = () => {
888
1031
 
889
1032
  // An install changes attribution only when the user chose `off`, now or before; --yes and a
890
1033
  // non-interactive install leave Claude Code's default alone.
891
- const installAttribution = async ({ assumeYes }) => {
1034
+ const installAttribution = async ({ assumeYes, tag }) => {
892
1035
  let mode = storedAttributionMode(litHome());
893
- if (mode === undefined && !assumeYes && shouldPromptAttribution()) {
1036
+ if (installUi && mode === undefined) {
1037
+ const keep = await installUi.confirm({
1038
+ tag,
1039
+ title: "Co-Authored-By line",
1040
+ note: "Yes keeps Claude Code's Co-Authored-By line in commits and pull requests; No hides it.",
1041
+ initial: true,
1042
+ foldYes: "keep",
1043
+ foldNo: "off",
1044
+ });
1045
+ mode = keep ? "keep" : "off";
1046
+ writeAttributionMode(litHome(), mode);
1047
+ } else if (mode === undefined && !assumeYes && shouldPromptAttribution()) {
894
1048
  const rl = createInterface({ input: process.stdin, output: process.stdout, terminal: shouldColorInstall() });
895
1049
  try {
896
1050
  mode = /^\s*n/iu.test(await rl.question(ATTRIBUTION_QUESTION)) ? "off" : "keep";
@@ -901,7 +1055,7 @@ const installAttribution = async ({ assumeYes }) => {
901
1055
  }
902
1056
  const result = readAttributionMode({ litHome: litHome() }) === "off" ? setAttribution("off") : null;
903
1057
  const note = result === "user-changed" ? "; your own attribution setting in settings.json was left as it is" : "";
904
- process.stdout.write(`ATTRIBUTION: ${readAttributionMode({ litHome: litHome() })}${note} (change: litclaude-ai config attribution <keep|off>)\n`);
1058
+ say(`ATTRIBUTION: ${readAttributionMode({ litHome: litHome() })}${note} (change: litclaude-ai config attribution <keep|off>)`);
905
1059
  };
906
1060
  const AGENT_FILE_QUESTION = "Add the short LitFamily block to your global CLAUDE.md? Your own text stays as it is. [Y/n] ";
907
1061
 
@@ -911,37 +1065,48 @@ const shouldPromptAgentFile = () => {
911
1065
  return Boolean(process.stdin.isTTY && process.stdout.isTTY && !Object.hasOwn(process.env, "CI"));
912
1066
  };
913
1067
 
914
- const installAgentFile = async ({ assumeYes, agentFile }) => {
1068
+ const installAgentFile = async ({ assumeYes, agentFile, tag }) => {
915
1069
  const path = agentFilePath();
916
1070
  if (!agentFile || readAgentFileMode({ litHome: litHome() }) === "off") {
917
- process.stdout.write(`AGENT_FILE: off (${path} left as it is; turn on: litclaude-ai config agentFile on)\n`);
1071
+ say(`AGENT_FILE: off (${path} left as it is; turn on: litclaude-ai config agentFile on)`);
918
1072
  return;
919
1073
  }
920
1074
  const state = agentFileState({ path, version });
921
1075
  // A linked, non-file or non-UTF-8 CLAUDE.md is never written, so asking about it would only mislead.
922
1076
  if (["symlink", "not-file", "not-utf8"].includes(state)) {
923
- process.stdout.write(`AGENT_FILE: ${state} ${path}; left as it is\n`);
1077
+ say(`AGENT_FILE: ${state} ${path}; left as it is`);
924
1078
  return;
925
1079
  }
926
1080
  if (state === "absent" && !assumeYes) {
927
1081
  if (!shouldPromptAgentFile()) {
928
- process.stdout.write(`AGENT_FILE: skipped (add the LitFamily block to ${path}: litclaude-ai config agentFile on)\n`);
1082
+ say(`AGENT_FILE: skipped (add the LitFamily block to ${path}: litclaude-ai config agentFile on)`);
929
1083
  return;
930
1084
  }
931
- const rl = createInterface({ input: process.stdin, output: process.stdout, terminal: shouldColorInstall() });
932
1085
  let yes;
933
- try {
934
- yes = !/^\s*n/iu.test(await rl.question(AGENT_FILE_QUESTION));
935
- } finally {
936
- rl.close();
1086
+ if (installUi) {
1087
+ yes = await installUi.confirm({
1088
+ tag,
1089
+ title: "LitFamily block",
1090
+ note: `Adds a short LitFamily block to ${homeRelative(path)}; your own text there stays as it is, and No leaves the file alone.`,
1091
+ initial: true,
1092
+ foldYes: "add",
1093
+ foldNo: "off",
1094
+ });
1095
+ } else {
1096
+ const rl = createInterface({ input: process.stdin, output: process.stdout, terminal: shouldColorInstall() });
1097
+ try {
1098
+ yes = !/^\s*n/iu.test(await rl.question(AGENT_FILE_QUESTION));
1099
+ } finally {
1100
+ rl.close();
1101
+ }
937
1102
  }
938
1103
  if (!yes) {
939
1104
  writeAgentFileMode(litHome(), "off");
940
- process.stdout.write("AGENT_FILE: off (turn on later: litclaude-ai config agentFile on)\n");
1105
+ say("AGENT_FILE: off (turn on later: litclaude-ai config agentFile on)");
941
1106
  return;
942
1107
  }
943
1108
  }
944
- process.stdout.write(`${agentFileLine(writeAgentFile("install"))}\n`);
1109
+ say(`${agentFileLine(writeAgentFile("install"))}`);
945
1110
  };
946
1111
 
947
1112
  // `config` prints the options; `config <option> <value>` sets one. A value the user sets is theirs,
@@ -1051,7 +1216,7 @@ const installHudStatusLine = (pluginPath, home = claudeHome(), accent = "cyan")
1051
1216
  const existingLitClaude = settings[litClaudeSettingsKey] ?? {};
1052
1217
  const now = new Date().toISOString();
1053
1218
  if (existingLitClaude.statusLineManaged === true && !ownsHudStatusLine(settings, existingLitClaude)) {
1054
- process.stdout.write("HUD_WARNING: statusLine changed by user; leaving it untouched\n");
1219
+ say("HUD_WARNING: statusLine changed by user; leaving it untouched");
1055
1220
  return;
1056
1221
  }
1057
1222
  const previousStatusLine =
@@ -1089,7 +1254,7 @@ const installOutputStyle = (choice, home = claudeHome()) => {
1089
1254
  if (currentOutputStyle === undefined || currentOutputStyle === previousWrittenName) {
1090
1255
  settings.outputStyle = writtenName;
1091
1256
  } else {
1092
- process.stdout.write(`Note: outputStyle was changed outside LitClaude (currently "${currentOutputStyle}"). Switch it via /config if you want LitClaude's style.\n`);
1257
+ say(`Note: outputStyle was changed outside LitClaude (currently "${currentOutputStyle}"). Switch it via /config if you want LitClaude's style.`);
1093
1258
  }
1094
1259
 
1095
1260
  settings[litClaudeSettingsKey] = {
@@ -1564,6 +1729,75 @@ const preflightInstallOwnership = ({ preserveModifiedSkill = false } = {}) => {
1564
1729
  return preservation;
1565
1730
  };
1566
1731
 
1732
+ const SUMMARY_NOTES = [
1733
+ [/^HUD_WARNING: /u, "Status line", "warn"],
1734
+ [/^Note: (?=outputStyle)/u, "Output style", "warn"],
1735
+ [/^ICON_FONT_(?:FAILED|LEFT_ALONE|SKIPPED): /u, "Icon font", "warn"],
1736
+ [/^ICON_FONT_(?:INSTALLED|PRESENT): /u, "Icon font", "done"],
1737
+ [/^ICON_FONT_(?:CACHE|HINT): /u, "Icon font", "note"],
1738
+ [/^ATTRIBUTION: /u, "Co-Authored-By", "done"],
1739
+ [/^AGENT_FILE: (?=symlink|not-file|not-utf8)/u, "CLAUDE.md", "warn"],
1740
+ [/^AGENT_FILE: /u, "CLAUDE.md", "done"],
1741
+ ];
1742
+
1743
+ // The closing card: what is installed, the settings it runs with, what to do next. Every fact the plain
1744
+ // run prints is here, and a warning is never left out or shortened.
1745
+ const writeInstallSummary = ({ home, hudAccent, hudManaged, permissionMode, localMarketplace, outputStyleChoice, preservedPath }) => {
1746
+ const notes = installNotes.map((line) => {
1747
+ const [pattern, label, mark] = SUMMARY_NOTES.find(([candidate]) => candidate.test(line)) ?? [/^/u, "Note", "warn"];
1748
+ return { mark: /left as it is|user-changed|your own attribution/u.test(line) && mark === "done" ? "note" : mark, label, value: line.replace(pattern, "").replaceAll(`${homedir()}${sep}`, `~${sep}`) };
1749
+ });
1750
+ const answered = (label) => notes.some((note) => note.label === label);
1751
+ installUi.setAccent(hudAccent);
1752
+ installUi.panel({
1753
+ tag: "LIT",
1754
+ title: `LitClaude ${version} is installed`,
1755
+ sections: [
1756
+ { head: "Installed", rows: [
1757
+ { label: "Plugin", value: pluginKey },
1758
+ { label: "Plugin path", value: homeRelative(intendedPluginPath(home)) },
1759
+ { label: "Marketplace", value: homeRelative(localMarketplace) },
1760
+ hudManaged
1761
+ ? { label: "Status line", value: `LitClaude status line, ${hudAccent}` }
1762
+ : { mark: "note", label: "Status line", value: "your own status-line setting was kept" },
1763
+ ...(outputStyleChoice === "off" || answered("Output style") ? [] : [{ label: "Output style", value: OUTPUT_STYLE_NAMES[outputStyleChoice] }]),
1764
+ ...notes,
1765
+ ...["Co-Authored-By", "CLAUDE.md"].filter((label) => !answered(label)).map((label) => ({ mark: "warn", label, value: "not answered; left as it was" })),
1766
+ ...(preservedPath ? [{ mark: "warn", label: "Kept skill", value: `PRESERVED_MODIFIED_SKILL lit-korean at ${preservedPath}` }] : []),
1767
+ ] },
1768
+ { head: "Settings", rows: [
1769
+ { mark: "note", label: "Permissions", value: `${permissionMode} — ${permissionProfile(permissionMode).description}` },
1770
+ { mark: "note", label: "Card options", value: `${modOptionsLine(readClaudeSettings(home))} (change: litclaude-ai config <option> <value>)` },
1771
+ { mark: "note", label: "Models", value: "host-owned (Claude Code exposes no native route surface)" },
1772
+ ] },
1773
+ { head: "Next", rows: [
1774
+ { mark: "note", label: "Terminal", value: "quit Claude Code if it is open; launch with: claude" },
1775
+ { mark: "note", label: "Desktop app", value: "ready — the Code tab reads these same settings; open a new session there" },
1776
+ ] },
1777
+ ],
1778
+ });
1779
+ const leftovers = extensionLeftovers({
1780
+ claudeHome: home,
1781
+ litHome: litHome(),
1782
+ cacheHome: process.env.XDG_CACHE_HOME || join(homedir(), ".cache"),
1783
+ currentVersion: version,
1784
+ });
1785
+ const sameName = sameNameSkills({ claudeHome: home, cwd: process.cwd() });
1786
+ // Prose is wrapped to the window; command lines stay whole, without a border, so they can be copied.
1787
+ const width = Math.min(installUi.cols() - 2, 100);
1788
+ const [heading, ...lines] = extensionsNoticeLines({ leftovers, sameName });
1789
+ const blocks = [];
1790
+ for (const line of lines) {
1791
+ const prose = /^ {2}\S/u.test(line);
1792
+ if (prose && blocks.at(-1)?.prose) blocks.at(-1).text += line.slice(1);
1793
+ else blocks.push({ prose, text: line });
1794
+ }
1795
+ process.stdout.write(` ${installUi.heading(heading)}\n`);
1796
+ for (const { prose, text } of blocks) process.stdout.write(`${prose ? wrap(text, width - 2).map((row) => ` ${row}`).join("\n") : ` ${text}`}\n`);
1797
+ process.stdout.write("\n");
1798
+ process.stdout.write(`INSTALL_PASS: LitClaude ${version} installed\n`);
1799
+ };
1800
+
1567
1801
  const install = async ({ dryRun, rest }) => {
1568
1802
  const home = claudeHome();
1569
1803
  const litClaudeHome = litHome();
@@ -1577,7 +1811,6 @@ const install = async ({ dryRun, rest }) => {
1577
1811
  const targetPlugin = claudePluginRoot(home);
1578
1812
  const sourcePlugin = sourcePluginPath();
1579
1813
  const targetMarketplace = marketplaceRoot(litClaudeHome);
1580
- const progress = createInstallProgress();
1581
1814
 
1582
1815
  if (dryRun) {
1583
1816
  process.stdout.write(`${familyBanner({ color: false })}\n`);
@@ -1613,13 +1846,29 @@ const install = async ({ dryRun, rest }) => {
1613
1846
  fail(`Packaged LitClaude plugin payload is missing: ${sourcePlugin}`);
1614
1847
  }
1615
1848
 
1849
+ if (!assumeYes && richTerminal({ stdin: process.stdin, stdout: process.stdout, env: process.env })) {
1850
+ installUi = createInstallUi({ stdin: process.stdin, stdout: process.stdout, env: process.env, round: await installerRoundCaps(), animate: shouldAnimateInstall() });
1851
+ installUi.setAccent(requestedHudAccent);
1852
+ }
1853
+ const progress = createInstallProgress();
1854
+ // Which questions this run will ask, so each card can say `LIT 2/5`.
1855
+ const asks = [
1856
+ ["accent", !process.env.LITCLAUDE_HUD_ACCENT],
1857
+ ["style", !process.env.LITCLAUDE_OUTPUT_STYLE],
1858
+ ["font", !iconFont],
1859
+ ["attribution", storedAttributionMode(litClaudeHome) === undefined],
1860
+ ["agentFile", agentFile && readAgentFileMode({ litHome: litClaudeHome }) !== "off" && agentFileState({ path: agentFilePath(home), version }) === "absent"],
1861
+ ].filter(([, asked]) => asked).map(([name]) => name);
1862
+ const tag = (name) => `LIT ${asks.indexOf(name) + 1}/${asks.length}`;
1863
+ if (installUi) writeInstallOpening();
1864
+
1616
1865
  const hudAccent = assumeYes
1617
1866
  ? (process.env.LITCLAUDE_HUD_ACCENT ? normalizeHudAccent(process.env.LITCLAUDE_HUD_ACCENT) : existingHudAccent)
1618
- : await chooseHudAccent(existingHudAccent);
1867
+ : await chooseHudAccent(existingHudAccent, { tag: tag("accent"), stored: existingLitClaude.hudAccent !== undefined });
1619
1868
  const outputStyleChoice = assumeYes
1620
1869
  ? normalizeOutputStyle(process.env.LITCLAUDE_OUTPUT_STYLE ?? existingOutputStyle)
1621
- : await chooseOutputStyle(existingOutputStyle);
1622
- const wantsIconFont = await chooseIconFont({ iconFont, assumeYes });
1870
+ : await chooseOutputStyle(existingOutputStyle, { tag: tag("style"), stored: existingLitClaude.outputStyleChoice !== undefined });
1871
+ const wantsIconFont = await chooseIconFont({ iconFont, assumeYes, tag: tag("font") });
1623
1872
  const preservation = preflightInstallOwnership({ preserveModifiedSkill: true });
1624
1873
  const preservedPath = preserveModifiedLegacySkill(preservation, litClaudeHome);
1625
1874
  const targetCompatibility = versionRoot(litClaudeHome);
@@ -1706,6 +1955,24 @@ const install = async ({ dryRun, rest }) => {
1706
1955
  ["Permissions", `${permissionMode}; global settings allow/deny; ownership-safe removal`],
1707
1956
  ["Launch", "claude"],
1708
1957
  ]);
1958
+ if (installUi) {
1959
+ const details = { home, hudAccent, hudManaged, permissionMode, localMarketplace, outputStyleChoice, preservedPath };
1960
+ try {
1961
+ if (wantsIconFont) {
1962
+ const card = installUi.progress({ tag: "LIT", title: "Icon font", steps: [{ name: "Font", text: "download, check and install" }] });
1963
+ await card.run(0, runIconFontInstall);
1964
+ const ok = !installNotes.some((line) => /^ICON_FONT_(?:FAILED|LEFT_ALONE|SKIPPED)/u.test(line));
1965
+ card.finish("Icon font files", ok ? "installed" : "not installed; the summary says why", ok);
1966
+ }
1967
+ await installAttribution({ assumeYes, tag: tag("attribution") });
1968
+ await installAgentFile({ assumeYes, agentFile, tag: tag("agentFile") });
1969
+ } finally {
1970
+ // The install itself is done by now, so it is reported even when a late question was stopped.
1971
+ writeInstallSummary(details);
1972
+ if (preservedPath) process.stderr.write(`INSTALL_WARNING: PRESERVED_MODIFIED_SKILL lit-korean at ${preservedPath}\n`);
1973
+ }
1974
+ return;
1975
+ }
1709
1976
  process.stdout.write("Model selection: host-owned (Claude Code exposes no native route surface)\n");
1710
1977
  process.stdout.write(`INSTALL_PASS: LitClaude ${version} installed\n`);
1711
1978
  process.stdout.write(`Claude plugin: ${pluginKey}\n`);
Binary file
Binary file
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="146" height="20" role="img" aria-label="release: 1.0.63"><title>release: 1.0.63</title><g shape-rendering="crispEdges"><rect width="49" height="20" fill="#080d14"/><rect x="49" width="97" height="20" fill="#ff6337"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text x="255" y="140" textLength="390" transform="scale(.1)">release</text><text x="965" y="140" textLength="870" transform="scale(.1)" fill="#080D14">1.0.63</text></g></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="146" height="20" role="img" aria-label="release: 1.0.65"><title>release: 1.0.65</title><g shape-rendering="crispEdges"><rect width="49" height="20" fill="#080d14"/><rect x="49" width="97" height="20" fill="#ff6337"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text x="255" y="140" textLength="390" transform="scale(.1)">release</text><text x="965" y="140" textLength="870" transform="scale(.1)" fill="#080D14">1.0.65</text></g></svg>
package/docs/hooks.md CHANGED
@@ -371,8 +371,8 @@ status line read as one family:
371
371
  ╰─ ctx 42% ▰▰▱▱▱ · 5h 31% · 1w 12% · git main ─────────────────────╯
372
372
  ```
373
373
 
374
- The brackets stand for the ends of filled pills: rounded caps from the icon font with `nerd`
375
- glyphs, one cell of the pill's colour with `basic`. The brand is a pill from orange to pink, the
374
+ The brackets stand for the ends of filled pills: rounded caps where the terminal can draw
375
+ them, with the context gauge rounded in the same five cells, and one cell of the pill's colour with `basic`. The brand is a pill from orange to pink, the
376
376
  current stage runs from violet to the accent, the skills of this request are pills on the accent with dark text, and skills from earlier
377
377
  requests are muted grey pills.
378
378
 
@@ -534,12 +534,18 @@ step's spinner (`- \ | /`) and clock are ASCII, and a glyph swaps only together
534
534
  The desktop app's Code tab, and the other surfaces that are not a terminal, draw a mod's `Text` in
535
535
  a proportional font and cut each span to the cells it was laid out for, so the card above comes
536
536
  apart there. On those surfaces the mod draws the same five rows as one `Svg` element instead
537
- (`lib/mod/svg-card.mjs`): monospace text placed by counted cells, real pills and a rounded border.
538
- It shows the settled state, with no entrances or crossfades. While LitClaude works it moves with
537
+ (`lib/mod/svg-card.mjs`): monospace text placed by counted cells, real pills and a rounded border
538
+ that runs from pink through violet to the accent (amber while it waits on you, red or amber for a
539
+ warning). `lib/mod/svg-sunset.mjs` draws the sunset behind the words: a half-sunk sun with dark
540
+ slits and a soft glow, its reflection on a layered sea, stars, and the border lit under the sun.
541
+ Every word and pill is measured first; a sun, star or wave is drawn only where none of them is, and
542
+ on a crowded card the sun gets smaller, steps aside, sinks to its rim or is left out. Gauges have
543
+ round ends. It shows the settled state, with no entrances or crossfades. While LitClaude works it moves with
539
544
  SMIL animation inside the drawing, which runs in the image the surface draws it as: the
540
545
  pill and the border breathe and the step's spinner turns, and on `full` a light crosses the
541
546
  current stage and the current chips, a head runs the rail leaving it, the count bar's head
542
- shimmers and a comet runs around the border; what breathes, sweeps or shuttles eases in and out,
547
+ shimmers, a comet runs around the border, the sea and the reflection move, the stars twinkle and a
548
+ shooting star passes; `subtle` and an idle card hold the sunset still; what breathes, sweeps or shuttles eases in and out,
543
549
  and the spinner, the comet and the drifting sparks keep an even pace. An idle card is a still
544
550
  image. The app loads each new drawing from scratch and restarts its animation, so this card names
545
551
  the running tool without its clock and shows the loop round without its countdown, and each new
@@ -561,7 +567,7 @@ Uninstall removes only the defaults it wrote that are still unchanged.
561
567
  | Option | Values | Default |
562
568
  | --- | --- | --- |
563
569
  | `motion` | `full`, `subtle` (no overshoot, shimmer, embers, sweep or comet, shorter; the LIT pill still breathes during work and the sunset holds still), `off` (final frames only) | `full` |
564
- | `glyphs` | `auto` (Nerd glyphs when the icon font is installed; otherwise the basic symbols, with round pills in Windows Terminal 1.21 or later and VS Code, which draw the round caps themselves), `nerd`, or `basic` | `auto` |
570
+ | `glyphs` | `auto` (Nerd glyphs when the icon font is installed; otherwise the basic symbols, with round pills where the terminal draws the caps: Windows Terminal 1.21 or later, VS Code, WezTerm, Ghostty, kitty, or any other terminal outside SSH with a Nerd Font installed), `nerd`, or `basic` | `auto` |
565
571
  | `band` | `always` (the whole session, idle included), `auto` (only while work is active or a skill of this request is lit), `off` | `always` |
566
572
  | `notify` | `off`, `finish` (a notification through your own notification channel, `$.ui.notify`, when LIT work completes or a LIT turn longer than three minutes ends), `finish+sound` (the same; a sound is added once LitClaude ships one, and none ships yet) | `off` |
567
573
  | `club` | `on` (the idle card wears the club look once `lit invite` recorded an inviter), `off` (the plain ready card, byte for byte) | `on` |
@@ -596,7 +602,8 @@ between passes the card draws no frames. With `subtle` or `off` motion the ring
596
602
  never makes a band show that `band: auto` would hide. No look flips more than a quarter of the card's brightness more than three
597
603
  times a second; with `motion` off or reduced motion each look is one still frame, and with
598
604
  `NO_COLOR` set the card keeps its labels and draws no colour (basic glyphs, no motion). The desktop
599
- drawing shows the labels of these looks, not the lane segments, the embers or the sunset scene.
605
+ drawing shows the labels of these looks and its own sunset (`svg-sunset.mjs`), not the lane
606
+ segments or the embers.
600
607
 
601
608
  The icons on `nerd` (the rounded pill caps U+E0B6 and U+E0B4, the chip bolt and the branch mark)
602
609
  come from a Nerd Font. `litclaude-ai install
@@ -612,8 +619,15 @@ records the two files, `uninstall` removes only those (and only while unchanged)
612
619
  prints `ICON_FONT:`. With `glyphs` on `auto`, the band checks those font folders by stat at session
613
620
  start and says what it decided on the `/lit-evidence` gates tab.
614
621
 
622
+ Round caps follow one rule (`lib/mod/round.mjs`) on the status line, the card and the installer.
623
+ `LITCLAUDE_HUD_GLYPHS` (`nerd`, `round` or `basic`) wins, then the `glyphs` option, then a terminal that
624
+ draws the caps itself; over SSH the answer is no, and otherwise a Nerd Font's file name in a font folder
625
+ decides. The look through the folders opens no font and stops at 4,000 names, 200 folders or three levels.
626
+ The card asks once a session; the status line keeps its answer in the per-user temp folder for a day, or
627
+ until a font folder changes.
628
+
615
629
  The mod is read-only. It reads LitClaude's own state, the Git `HEAD` of the working directory and
616
- the merged settings (for the status line's accent) and nothing else: the ignition record in the
630
+ the merged settings (for the status line's accent), the names in the font folders, and nothing else: the ignition record in the
617
631
  per-user temp folder, `.litclaude/boulder.json` (found the way the hooks find it, across a
618
632
  linked worktree), and under the outermost Git root's `.litclaude/` the litgoal goal, autoloop
619
633
  counter and ledger, the lit-plan and interface-probe turn records, the auto-handoff
@@ -657,9 +671,18 @@ panel also makes a few machine gestures: a text spinner beside the state block,
657
671
  under the stage counts that moves a row a step, registration marks that turn an eighth a step, and
658
672
  at the power-on a row of slashes that wipes out along the rail from the column. The scene's own width media rules drop the readouts below 1240 px; below 1040 px they drop
659
673
  the frame, the labels and the embers and move the plan and verify cells in behind the glass. It
660
- is drawn like a measuring instrument throughout: graph paper and halftone, a ruler under the fuse,
674
+ is drawn like a measuring instrument throughout: a halftone at both edges, a ruler under the fuse,
661
675
  square cells with a 2 px outline and a hard offset shadow.
662
676
 
677
+ Behind the instruments lies a synthwave sunset: a violet-to-pink sky with twinkling stars and a
678
+ shooting star now and then, a slit sun low behind the column, a ridge of hills and a neon floor
679
+ that runs to the horizon in perspective. A calm column, gutter to gutter, lies over it where the
680
+ conversation is, so the sun reads through the glass as a faint warmth. The sun stands low at rest, up
681
+ in a run and after it, and a little lower while the work waits on you; it rises with the power-on
682
+ (1 s) and sinks with the power-down (1.8 s). The floor rolls only in a run. The frame is a neon
683
+ line from orange through pink and violet to cyan (it starts lime while asking or done). Light mode is
684
+ a pale dawn in the same shapes; a narrow box dims the sun.
685
+
663
686
  Idle and a lit run look clearly different. Idle is a dormant panel: the burnt fuse cold and dim,
664
687
  lit cells banked low, a few dim embers, low heat, a dim frame and `STATE: STANDBY`. A run powers it
665
688
  up: the fuse hot with its heat streak behind the glass, the frame and the share on the right rule
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@litfamily/litclaude",
3
- "version": "1.0.63",
3
+ "version": "1.0.65",
4
4
  "description": "Claude Code plugin: add lit to a prompt and Claude plans, tests, checks and reviews the work, then leaves a handoff for the next session.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "litclaude",
3
3
  "description": "Claude Code-native workflow plugin with a bounded-authority start-work lifecycle.",
4
- "version": "1.0.63",
4
+ "version": "1.0.65",
5
5
  "author": {
6
6
  "name": "LitClaude contributors"
7
7
  },