@litfamily/litclaude 1.0.62 → 1.0.64
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.
- package/CHANGELOG.md +24 -0
- package/README.md +14 -11
- package/README_ko-KR.md +11 -10
- package/bin/install-ui.mjs +485 -0
- package/bin/litclaude-ai.js +301 -51
- package/docs/assets/readme/badge-version.svg +1 -1
- package/docs/hooks.md +12 -8
- package/package.json +1 -1
- package/plugins/litclaude/.claude-plugin/plugin.json +1 -1
- package/plugins/litclaude/bin/litclaude-hud.js +76 -12
- package/plugins/litclaude/bin/litclaude-mcp.js +1 -1
- package/plugins/litclaude/hooks/lit-mod.mjs +5 -3
- package/plugins/litclaude/lib/hud-accent-palette.mjs +5 -2
- package/plugins/litclaude/lib/mod/frame.mjs +92 -47
- package/plugins/litclaude/lib/mod/motion.mjs +3 -15
- package/plugins/litclaude/lib/mod/settings.mjs +10 -3
- package/plugins/litclaude/lib/mod/sunset.mjs +118 -0
- package/plugins/litclaude/lib/mod/timeline.mjs +10 -25
- package/plugins/litclaude/lib/start-work-lifecycle.mjs +10 -3
package/bin/litclaude-ai.js
CHANGED
|
@@ -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,6 +73,7 @@ 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";
|
|
77
78
|
import { SIZES, pickSize, synthwaveRows } from "../plugins/litclaude/lib/synthwave-mark.mjs";
|
|
78
79
|
import {
|
|
@@ -249,6 +250,12 @@ const OUTPUT_STYLE_OPTIONS = [
|
|
|
249
250
|
{ id: "eli5", label: "ELI5 (English)" },
|
|
250
251
|
{ id: "eli5-ko", label: "ELI5 (한국어)" },
|
|
251
252
|
];
|
|
253
|
+
const OUTPUT_STYLE_DETAILS = {
|
|
254
|
+
"asd-ste100": "short, active, controlled English",
|
|
255
|
+
"asd-ste100-ko": "the same rules in Korean",
|
|
256
|
+
"eli5": "small words, only what you need",
|
|
257
|
+
"eli5-ko": "the same, in Korean",
|
|
258
|
+
};
|
|
252
259
|
const OUTPUT_STYLE_NAMES = {
|
|
253
260
|
"asd-ste100": "LitClaude — ASD-STE100",
|
|
254
261
|
"asd-ste100-ko": "LitClaude — ASD-STE100 (한국어)",
|
|
@@ -417,16 +424,28 @@ const INSTALL_STAGES = [
|
|
|
417
424
|
// Human-facing Synthwave mark: the size follows the terminal width; no colour gives the glyph-only scene.
|
|
418
425
|
// A pipe (agents, CI logs) gets the one plain line, so tool output never carries rows of art.
|
|
419
426
|
const terminalColumns = () => process.stdout.columns || Number.parseInt(process.env.COLUMNS ?? "", 10) || 80;
|
|
420
|
-
const renderLitClaudeWordmark = ({ color = shouldColorInstall() } = {}) => {
|
|
427
|
+
const renderLitClaudeWordmark = ({ color = shouldColorInstall(), cols = terminalColumns() } = {}) => {
|
|
421
428
|
if (!supportsBlocks() || !process.stdout.isTTY) return synthwaveRows({ mode: "plain" }).concat(`litclaude v${version}`);
|
|
422
|
-
const cols = terminalColumns();
|
|
423
429
|
const rows = synthwaveRows({ cols, mode: color ? colorMode() : "mono" });
|
|
424
430
|
const versionLine = `litclaude v${version}`;
|
|
425
431
|
const markWidth = SIZES.find((size) => size.name === pickSize(cols))?.minCols ?? versionLine.length;
|
|
426
432
|
return rows.concat(`${" ".repeat(Math.max(0, Math.floor((markWidth - versionLine.length) / 2)))}${versionLine}`);
|
|
427
433
|
};
|
|
428
434
|
|
|
429
|
-
|
|
435
|
+
// TERM=dumb or a locale that names a non-UTF-8 charset gets ASCII stand-ins for the frame glyphs.
|
|
436
|
+
// An unset locale keeps the frame: Windows Terminal and minimal containers draw it fine.
|
|
437
|
+
const FRAME_ASCII = Object.freeze({ "━": "=", "─": "-", "│": "|", "╭": "+", "╰": "+", "·": "-", "—": "-", "✓": "ok", "✗": "x" });
|
|
438
|
+
const asciiTerminal = () => {
|
|
439
|
+
const locale = process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG || "";
|
|
440
|
+
return process.env.TERM === "dumb" || (locale !== "" && !/utf-?8/iu.test(locale));
|
|
441
|
+
};
|
|
442
|
+
const asciiFrame = (text) => asciiTerminal()
|
|
443
|
+
? text.replace(/[━─│╭╰·—✓✗]/gu, (glyph) => FRAME_ASCII[glyph]).replace(/[⠀-⣿]/gu, "-")
|
|
444
|
+
: text;
|
|
445
|
+
|
|
446
|
+
const familyBanner = (options) => asciiFrame(familyBannerRows(options));
|
|
447
|
+
|
|
448
|
+
const familyBannerRows = ({ color = shouldColorInstall() } = {}) => [
|
|
430
449
|
brandOrange(FAMILY_RULE, color),
|
|
431
450
|
"",
|
|
432
451
|
...renderLitClaudeWordmark({ color }),
|
|
@@ -443,28 +462,41 @@ const printCommandBanner = (parsed) => {
|
|
|
443
462
|
if (["install", "update", "workflow-stage", "rewind", "sessions", "why"].includes(parsed.command)) return;
|
|
444
463
|
if (parsed.rest.some((arg) => arg === "--json" || arg.startsWith("--json="))) return;
|
|
445
464
|
const color = shouldColorInstall();
|
|
446
|
-
process.stdout.write(`${renderLitClaudeWordmark({ color }).join("\n")}\n`);
|
|
465
|
+
process.stdout.write(asciiFrame(`${renderLitClaudeWordmark({ color }).join("\n")}\n`));
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
// The cards an interactive install draws (bin/install-ui.mjs), or null: pipes, CI, --yes, TERM=dumb and
|
|
469
|
+
// the *_PROMPT hooks keep the plain prompts and lines. `installNotes` holds what the plain run prints as
|
|
470
|
+
// KEY: lines, for the summary card.
|
|
471
|
+
let installUi = null;
|
|
472
|
+
const installNotes = [];
|
|
473
|
+
const say = (line) => {
|
|
474
|
+
if (installUi) installNotes.push(line);
|
|
475
|
+
else process.stdout.write(`${line}\n`);
|
|
447
476
|
};
|
|
448
477
|
|
|
449
478
|
const createInstallProgress = () => {
|
|
479
|
+
if (installUi) return createCardProgress();
|
|
450
480
|
const animated = shouldAnimateInstall();
|
|
451
481
|
let frameIndex = 0;
|
|
452
482
|
// Explicit spinner mode keeps structured progress, but cannot enable terminal escapes.
|
|
453
483
|
const live = animated && shouldColorInstall();
|
|
454
484
|
|
|
485
|
+
const write = (chunk) => process.stdout.write(asciiFrame(chunk));
|
|
486
|
+
|
|
455
487
|
const clearLiveLine = () => {
|
|
456
|
-
if (live)
|
|
488
|
+
if (live) write("\r\x1b[2K");
|
|
457
489
|
};
|
|
458
490
|
|
|
459
491
|
return {
|
|
460
492
|
prepare({ claudeTarget, litTarget }) {
|
|
461
493
|
if (!animated) {
|
|
462
|
-
|
|
463
|
-
|
|
494
|
+
write(`\n${familyBanner({ color: false })}`);
|
|
495
|
+
write(`INSTALL_STEP: Installing LitClaude ${version}\n`);
|
|
464
496
|
return;
|
|
465
497
|
}
|
|
466
|
-
|
|
467
|
-
|
|
498
|
+
write(`\n${familyBanner()}\n`);
|
|
499
|
+
write(
|
|
468
500
|
`\n╭─ PREPARING INSTALL\n` +
|
|
469
501
|
`│ Package LitClaude ${version}\n` +
|
|
470
502
|
`│ Action Installing LitClaude ${version}\n` +
|
|
@@ -476,11 +508,11 @@ const createInstallProgress = () => {
|
|
|
476
508
|
},
|
|
477
509
|
async run({ number, title, label, purpose, target }, work) {
|
|
478
510
|
if (!animated) {
|
|
479
|
-
|
|
511
|
+
write(`INSTALL_STEP: ${label}\n`);
|
|
480
512
|
return work();
|
|
481
513
|
}
|
|
482
514
|
|
|
483
|
-
|
|
515
|
+
write(
|
|
484
516
|
`${String(number).padStart(2, "0")} / 05 ${title}\n` +
|
|
485
517
|
` ${purpose}\n` +
|
|
486
518
|
` target ${target}\n`,
|
|
@@ -490,7 +522,7 @@ const createInstallProgress = () => {
|
|
|
490
522
|
const frame = spinnerFrames[frameIndex % spinnerFrames.length];
|
|
491
523
|
frameIndex += 1;
|
|
492
524
|
const line = ` ${color256(81, frame)} ${formatInstallStep(label)}`;
|
|
493
|
-
|
|
525
|
+
write(live ? `\r\x1b[2K${line}` : `${line}\n`);
|
|
494
526
|
};
|
|
495
527
|
renderSpinner();
|
|
496
528
|
const timer = live ? setInterval(renderSpinner, 80) : undefined;
|
|
@@ -499,12 +531,12 @@ const createInstallProgress = () => {
|
|
|
499
531
|
const result = await work();
|
|
500
532
|
if (timer) clearInterval(timer);
|
|
501
533
|
clearLiveLine();
|
|
502
|
-
|
|
534
|
+
write(` ${color256(119, "✓")} ${bold(label)}\n\n`);
|
|
503
535
|
return result;
|
|
504
536
|
} catch (error) {
|
|
505
537
|
if (timer) clearInterval(timer);
|
|
506
538
|
clearLiveLine();
|
|
507
|
-
|
|
539
|
+
write(
|
|
508
540
|
` ${color256(203, "✗")} ${bold(`${label} failed`)}\n\n` +
|
|
509
541
|
`╭─ INSTALL STOPPED\n` +
|
|
510
542
|
`│ Stage ${String(number).padStart(2, "0")} / 05 · ${title}\n` +
|
|
@@ -517,15 +549,61 @@ const createInstallProgress = () => {
|
|
|
517
549
|
},
|
|
518
550
|
receipt(rows) {
|
|
519
551
|
if (!animated) return;
|
|
520
|
-
|
|
552
|
+
write("\n╭─ INSTALL RECEIPT\n");
|
|
521
553
|
for (const [key, value] of rows) {
|
|
522
|
-
|
|
554
|
+
write(`│ ${key.padEnd(13)} ${value}\n`);
|
|
555
|
+
}
|
|
556
|
+
write("╰─ Installation complete\n\n");
|
|
557
|
+
},
|
|
558
|
+
};
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
const createCardProgress = () => {
|
|
562
|
+
let card;
|
|
563
|
+
return {
|
|
564
|
+
prepare() {
|
|
565
|
+
card = installUi.progress({
|
|
566
|
+
tag: "LIT",
|
|
567
|
+
title: `Installing LitClaude ${version}`,
|
|
568
|
+
steps: INSTALL_STAGES.map(([, name, text]) => ({ name, text })),
|
|
569
|
+
});
|
|
570
|
+
},
|
|
571
|
+
async run({ number, title, label }, work) {
|
|
572
|
+
try {
|
|
573
|
+
return await card.run(number - 1, work);
|
|
574
|
+
} catch (error) {
|
|
575
|
+
installUi.panel({
|
|
576
|
+
tag: "LIT",
|
|
577
|
+
title: "INSTALL STOPPED",
|
|
578
|
+
tone: "bad",
|
|
579
|
+
sections: [{ rows: [
|
|
580
|
+
{ mark: "fail", label: "Stage", value: `${String(number).padStart(2, "0")} / 05 · ${title} (${label} failed)` },
|
|
581
|
+
{ mark: "fail", label: "Reason", value: error instanceof Error ? error.message : String(error) },
|
|
582
|
+
{ mark: "note", label: "Next", value: "Resolve the reason above, then rerun litclaude install" },
|
|
583
|
+
{ mark: "note", value: "Exit without reporting success" },
|
|
584
|
+
] }],
|
|
585
|
+
});
|
|
586
|
+
throw error;
|
|
523
587
|
}
|
|
524
|
-
|
|
588
|
+
},
|
|
589
|
+
receipt() {
|
|
590
|
+
card.finish("Install steps", "5 of 5 checked");
|
|
525
591
|
},
|
|
526
592
|
};
|
|
527
593
|
};
|
|
528
594
|
|
|
595
|
+
const homeRelative = (path) => (path.startsWith(`${homedir()}${sep}`) ? `~${path.slice(homedir().length)}` : path);
|
|
596
|
+
|
|
597
|
+
// The opening of a card install: the mark, then where the files go.
|
|
598
|
+
const writeInstallOpening = () => {
|
|
599
|
+
const where = `Installs into ${homeRelative(claudeHome())} and ${homeRelative(litHome())}. Other Claude settings stay as is.`;
|
|
600
|
+
// A short window gets a smaller mark, so the first card and the mark are on screen together.
|
|
601
|
+
const height = process.stdout.rows || 24;
|
|
602
|
+
const cols = Math.min(terminalColumns(), height >= 48 ? Infinity : height >= 34 ? 75 : 43);
|
|
603
|
+
process.stdout.write(asciiFrame(`\n${renderLitClaudeWordmark({ cols }).join("\n")}\n`));
|
|
604
|
+
process.stdout.write(`\n${wrap(where, Math.min(installUi.cols() - 2, 100)).map((line) => ` ${installUi.paint(line, { dim: true })}\n`).join("")}\n`);
|
|
605
|
+
};
|
|
606
|
+
|
|
529
607
|
const currentExists = (home = claudeHome()) => existsSync(claudePluginRoot(home));
|
|
530
608
|
|
|
531
609
|
const readInstalledPlugins = (home = claudeHome()) => {
|
|
@@ -557,6 +635,19 @@ const writeClaudeSettings = (settings, home = claudeHome()) => {
|
|
|
557
635
|
writeFileSync(settingsPath, `${JSON.stringify(settings, null, 2)}\n`);
|
|
558
636
|
};
|
|
559
637
|
|
|
638
|
+
// The same preview at falling widths, for the colour card's rows.
|
|
639
|
+
const hudAccentViews = (theme) => {
|
|
640
|
+
const { depth, ascii } = installUi;
|
|
641
|
+
const plain = depth === "plain";
|
|
642
|
+
const tint = (text) => plain ? text : depth === "16" ? `\x1b[${ansi16CodeForAccent(theme.name)}m${text}\x1b[0m` : `\x1b[38;5;${theme.code}m${text}\x1b[0m`;
|
|
643
|
+
const brand = ascii ? `[LIT v${version}]` : litBrandPrefix(version, { noColor: plain, depth, appearance: normalizeHudAppearance(process.env.LITCLAUDE_HUD_APPEARANCE) });
|
|
644
|
+
const bar = `[${tint(ascii ? "#" : "▌")}${ascii ? "--" : "░░"}]`;
|
|
645
|
+
const line = ascii ? " | " : " │ ";
|
|
646
|
+
const five = `[${ascii ? "#-" : "▏░"}]`;
|
|
647
|
+
const full = `${brand} | O4.8${line}ctx ${bar} 18%/1m${line}5h ${five}4%`;
|
|
648
|
+
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];
|
|
649
|
+
};
|
|
650
|
+
|
|
560
651
|
const hudAccentPreview = (theme) => {
|
|
561
652
|
const color = shouldColorInstall();
|
|
562
653
|
const depth = color ? hudColorDepth(process.env) : "plain";
|
|
@@ -582,7 +673,7 @@ const shouldPromptHudAccent = () => {
|
|
|
582
673
|
return Boolean(process.stdin.isTTY && process.stdout.isTTY && !Object.hasOwn(process.env, "CI"));
|
|
583
674
|
};
|
|
584
675
|
|
|
585
|
-
const chooseHudAccent = async (existingAccent = "cyan") => {
|
|
676
|
+
const chooseHudAccent = async (existingAccent = "cyan", { tag, stored = false } = {}) => {
|
|
586
677
|
const preservedAccent = normalizeHudAccent(existingAccent);
|
|
587
678
|
const envAccent = process.env.LITCLAUDE_HUD_ACCENT;
|
|
588
679
|
if (envAccent && process.env.LITCLAUDE_HUD_ACCENT_PROMPT !== "1") {
|
|
@@ -590,6 +681,19 @@ const chooseHudAccent = async (existingAccent = "cyan") => {
|
|
|
590
681
|
}
|
|
591
682
|
if (!shouldPromptHudAccent()) return envAccent ? normalizeHudAccent(envAccent) : preservedAccent;
|
|
592
683
|
|
|
684
|
+
if (installUi) {
|
|
685
|
+
installUi.setAccent(preservedAccent);
|
|
686
|
+
return installUi.choose({
|
|
687
|
+
tag,
|
|
688
|
+
title: "Status-line colour",
|
|
689
|
+
note: `Sets the accent colour of the status line; press Enter to keep ${preservedAccent}.`,
|
|
690
|
+
choices: hudAccentThemes.map((theme, index) => ({ id: theme.name, label: theme.name, key: String((index + 1) % 10), color: theme.name, views: hudAccentViews(theme) })),
|
|
691
|
+
initial: preservedAccent,
|
|
692
|
+
initialTag: stored ? "current" : "default",
|
|
693
|
+
onHighlight: installUi.setAccent,
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
|
|
593
697
|
process.stdout.write("Choose LitClaude HUD brand color:\n");
|
|
594
698
|
for (const [index, theme] of hudAccentThemes.entries()) {
|
|
595
699
|
process.stdout.write(` ${index + 1}) ${theme.name.padEnd(8)} ${hudAccentPreview(theme)} ${theme.mood}\n`);
|
|
@@ -624,7 +728,7 @@ const shouldPromptOutputStyle = () => {
|
|
|
624
728
|
return Boolean(process.stdin.isTTY && process.stdout.isTTY && !Object.hasOwn(process.env, "CI"));
|
|
625
729
|
};
|
|
626
730
|
|
|
627
|
-
const chooseOutputStyle = async (existingChoice = "off") => {
|
|
731
|
+
const chooseOutputStyle = async (existingChoice = "off", { tag, stored = false } = {}) => {
|
|
628
732
|
const preserved = normalizeOutputStyle(existingChoice);
|
|
629
733
|
const envStyle = process.env.LITCLAUDE_OUTPUT_STYLE;
|
|
630
734
|
if (envStyle && process.env.LITCLAUDE_OUTPUT_STYLE_PROMPT !== "1") {
|
|
@@ -632,6 +736,17 @@ const chooseOutputStyle = async (existingChoice = "off") => {
|
|
|
632
736
|
}
|
|
633
737
|
if (!shouldPromptOutputStyle()) return envStyle ? normalizeOutputStyle(envStyle) : preserved;
|
|
634
738
|
|
|
739
|
+
if (installUi) {
|
|
740
|
+
return installUi.choose({
|
|
741
|
+
tag,
|
|
742
|
+
title: "Output style",
|
|
743
|
+
note: "Sets how Claude words its replies; None leaves the style you use now alone.",
|
|
744
|
+
choices: OUTPUT_STYLE_OPTIONS.map(({ id, label }, index) => ({ id, label, key: String(index), detail: OUTPUT_STYLE_DETAILS[id] })),
|
|
745
|
+
initial: preserved,
|
|
746
|
+
initialTag: stored ? "current" : "default",
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
|
|
635
750
|
process.stdout.write("Choose LitClaude output style:\n");
|
|
636
751
|
for (const [index, option] of OUTPUT_STYLE_OPTIONS.entries()) {
|
|
637
752
|
process.stdout.write(` ${index}) ${option.label}\n`);
|
|
@@ -663,9 +778,19 @@ const shouldPromptIconFont = () => {
|
|
|
663
778
|
|
|
664
779
|
// The icon font is opt-in: the flag, or a Yes to the one question an interactive install asks.
|
|
665
780
|
// --yes keeps the shipped default, which is No.
|
|
666
|
-
const chooseIconFont = async ({ iconFont, assumeYes }) => {
|
|
781
|
+
const chooseIconFont = async ({ iconFont, assumeYes, tag }) => {
|
|
667
782
|
if (iconFont) return true;
|
|
668
783
|
if (assumeYes || !shouldPromptIconFont()) return false;
|
|
784
|
+
if (installUi) {
|
|
785
|
+
return installUi.confirm({
|
|
786
|
+
tag,
|
|
787
|
+
title: "Icon font",
|
|
788
|
+
note: `${planIconFontInstall(iconFontPaths()).supported
|
|
789
|
+
? "Downloads the symbols-only Nerd Font (MIT) into your user font folder"
|
|
790
|
+
: "Shows how to install the symbols-only Nerd Font (MIT) by hand"} so the status band can draw round pills and icons; No keeps plain shapes.`,
|
|
791
|
+
initial: false,
|
|
792
|
+
});
|
|
793
|
+
}
|
|
669
794
|
const rl = createInterface({ input: process.stdin, output: process.stdout, terminal: shouldColorInstall() });
|
|
670
795
|
try {
|
|
671
796
|
return parseYesNo(await rl.question(ICON_FONT_QUESTION));
|
|
@@ -679,19 +804,20 @@ const iconFontPaths = () => ({ platform: process.platform, env: process.env, hom
|
|
|
679
804
|
const runIconFontInstall = async () => {
|
|
680
805
|
const where = iconFontPaths();
|
|
681
806
|
if (!planIconFontInstall(where).supported) {
|
|
682
|
-
|
|
807
|
+
say(`ICON_FONT_SKIPPED: ${windowsIconFontInstructions()}`);
|
|
683
808
|
return;
|
|
684
809
|
}
|
|
685
810
|
try {
|
|
686
811
|
const archive = await loadIconFontArchive({ env: process.env });
|
|
687
812
|
const result = installIconFont({ ...where, archive });
|
|
688
|
-
for (const path of result.installed)
|
|
689
|
-
for (const path of result.present)
|
|
690
|
-
for (const { path, reason } of result.skipped)
|
|
691
|
-
if (result.fontCache)
|
|
692
|
-
|
|
813
|
+
for (const path of result.installed) say(`ICON_FONT_INSTALLED: ${path}`);
|
|
814
|
+
for (const path of result.present) say(`ICON_FONT_PRESENT: ${path}`);
|
|
815
|
+
for (const { path, reason } of result.skipped) say(`ICON_FONT_LEFT_ALONE: ${path} (${reason})`);
|
|
816
|
+
if (result.fontCache) say(`ICON_FONT_CACHE: ${result.fontCache}`);
|
|
817
|
+
say(`ICON_FONT_HINT: ${terminalFontHint(process.env)}`);
|
|
693
818
|
} catch (error) {
|
|
694
|
-
|
|
819
|
+
if (installUi) say(`ICON_FONT_FAILED: ${error.message}`);
|
|
820
|
+
else process.stderr.write(`ICON_FONT_FAILED: ${error.message}\n`);
|
|
695
821
|
}
|
|
696
822
|
};
|
|
697
823
|
|
|
@@ -873,9 +999,20 @@ const shouldPromptAttribution = () => {
|
|
|
873
999
|
|
|
874
1000
|
// An install changes attribution only when the user chose `off`, now or before; --yes and a
|
|
875
1001
|
// non-interactive install leave Claude Code's default alone.
|
|
876
|
-
const installAttribution = async ({ assumeYes }) => {
|
|
1002
|
+
const installAttribution = async ({ assumeYes, tag }) => {
|
|
877
1003
|
let mode = storedAttributionMode(litHome());
|
|
878
|
-
if (mode === undefined
|
|
1004
|
+
if (installUi && mode === undefined) {
|
|
1005
|
+
const keep = await installUi.confirm({
|
|
1006
|
+
tag,
|
|
1007
|
+
title: "Co-Authored-By line",
|
|
1008
|
+
note: "Yes keeps Claude Code's Co-Authored-By line in commits and pull requests; No hides it.",
|
|
1009
|
+
initial: true,
|
|
1010
|
+
foldYes: "keep",
|
|
1011
|
+
foldNo: "off",
|
|
1012
|
+
});
|
|
1013
|
+
mode = keep ? "keep" : "off";
|
|
1014
|
+
writeAttributionMode(litHome(), mode);
|
|
1015
|
+
} else if (mode === undefined && !assumeYes && shouldPromptAttribution()) {
|
|
879
1016
|
const rl = createInterface({ input: process.stdin, output: process.stdout, terminal: shouldColorInstall() });
|
|
880
1017
|
try {
|
|
881
1018
|
mode = /^\s*n/iu.test(await rl.question(ATTRIBUTION_QUESTION)) ? "off" : "keep";
|
|
@@ -886,7 +1023,7 @@ const installAttribution = async ({ assumeYes }) => {
|
|
|
886
1023
|
}
|
|
887
1024
|
const result = readAttributionMode({ litHome: litHome() }) === "off" ? setAttribution("off") : null;
|
|
888
1025
|
const note = result === "user-changed" ? "; your own attribution setting in settings.json was left as it is" : "";
|
|
889
|
-
|
|
1026
|
+
say(`ATTRIBUTION: ${readAttributionMode({ litHome: litHome() })}${note} (change: litclaude-ai config attribution <keep|off>)`);
|
|
890
1027
|
};
|
|
891
1028
|
const AGENT_FILE_QUESTION = "Add the short LitFamily block to your global CLAUDE.md? Your own text stays as it is. [Y/n] ";
|
|
892
1029
|
|
|
@@ -896,37 +1033,48 @@ const shouldPromptAgentFile = () => {
|
|
|
896
1033
|
return Boolean(process.stdin.isTTY && process.stdout.isTTY && !Object.hasOwn(process.env, "CI"));
|
|
897
1034
|
};
|
|
898
1035
|
|
|
899
|
-
const installAgentFile = async ({ assumeYes, agentFile }) => {
|
|
1036
|
+
const installAgentFile = async ({ assumeYes, agentFile, tag }) => {
|
|
900
1037
|
const path = agentFilePath();
|
|
901
1038
|
if (!agentFile || readAgentFileMode({ litHome: litHome() }) === "off") {
|
|
902
|
-
|
|
1039
|
+
say(`AGENT_FILE: off (${path} left as it is; turn on: litclaude-ai config agentFile on)`);
|
|
903
1040
|
return;
|
|
904
1041
|
}
|
|
905
1042
|
const state = agentFileState({ path, version });
|
|
906
1043
|
// A linked, non-file or non-UTF-8 CLAUDE.md is never written, so asking about it would only mislead.
|
|
907
1044
|
if (["symlink", "not-file", "not-utf8"].includes(state)) {
|
|
908
|
-
|
|
1045
|
+
say(`AGENT_FILE: ${state} ${path}; left as it is`);
|
|
909
1046
|
return;
|
|
910
1047
|
}
|
|
911
1048
|
if (state === "absent" && !assumeYes) {
|
|
912
1049
|
if (!shouldPromptAgentFile()) {
|
|
913
|
-
|
|
1050
|
+
say(`AGENT_FILE: skipped (add the LitFamily block to ${path}: litclaude-ai config agentFile on)`);
|
|
914
1051
|
return;
|
|
915
1052
|
}
|
|
916
|
-
const rl = createInterface({ input: process.stdin, output: process.stdout, terminal: shouldColorInstall() });
|
|
917
1053
|
let yes;
|
|
918
|
-
|
|
919
|
-
yes =
|
|
920
|
-
|
|
921
|
-
|
|
1054
|
+
if (installUi) {
|
|
1055
|
+
yes = await installUi.confirm({
|
|
1056
|
+
tag,
|
|
1057
|
+
title: "LitFamily block",
|
|
1058
|
+
note: `Adds a short LitFamily block to ${homeRelative(path)}; your own text there stays as it is, and No leaves the file alone.`,
|
|
1059
|
+
initial: true,
|
|
1060
|
+
foldYes: "add",
|
|
1061
|
+
foldNo: "off",
|
|
1062
|
+
});
|
|
1063
|
+
} else {
|
|
1064
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout, terminal: shouldColorInstall() });
|
|
1065
|
+
try {
|
|
1066
|
+
yes = !/^\s*n/iu.test(await rl.question(AGENT_FILE_QUESTION));
|
|
1067
|
+
} finally {
|
|
1068
|
+
rl.close();
|
|
1069
|
+
}
|
|
922
1070
|
}
|
|
923
1071
|
if (!yes) {
|
|
924
1072
|
writeAgentFileMode(litHome(), "off");
|
|
925
|
-
|
|
1073
|
+
say("AGENT_FILE: off (turn on later: litclaude-ai config agentFile on)");
|
|
926
1074
|
return;
|
|
927
1075
|
}
|
|
928
1076
|
}
|
|
929
|
-
|
|
1077
|
+
say(`${agentFileLine(writeAgentFile("install"))}`);
|
|
930
1078
|
};
|
|
931
1079
|
|
|
932
1080
|
// `config` prints the options; `config <option> <value>` sets one. A value the user sets is theirs,
|
|
@@ -1036,7 +1184,7 @@ const installHudStatusLine = (pluginPath, home = claudeHome(), accent = "cyan")
|
|
|
1036
1184
|
const existingLitClaude = settings[litClaudeSettingsKey] ?? {};
|
|
1037
1185
|
const now = new Date().toISOString();
|
|
1038
1186
|
if (existingLitClaude.statusLineManaged === true && !ownsHudStatusLine(settings, existingLitClaude)) {
|
|
1039
|
-
|
|
1187
|
+
say("HUD_WARNING: statusLine changed by user; leaving it untouched");
|
|
1040
1188
|
return;
|
|
1041
1189
|
}
|
|
1042
1190
|
const previousStatusLine =
|
|
@@ -1074,7 +1222,7 @@ const installOutputStyle = (choice, home = claudeHome()) => {
|
|
|
1074
1222
|
if (currentOutputStyle === undefined || currentOutputStyle === previousWrittenName) {
|
|
1075
1223
|
settings.outputStyle = writtenName;
|
|
1076
1224
|
} else {
|
|
1077
|
-
|
|
1225
|
+
say(`Note: outputStyle was changed outside LitClaude (currently "${currentOutputStyle}"). Switch it via /config if you want LitClaude's style.`);
|
|
1078
1226
|
}
|
|
1079
1227
|
|
|
1080
1228
|
settings[litClaudeSettingsKey] = {
|
|
@@ -1549,6 +1697,75 @@ const preflightInstallOwnership = ({ preserveModifiedSkill = false } = {}) => {
|
|
|
1549
1697
|
return preservation;
|
|
1550
1698
|
};
|
|
1551
1699
|
|
|
1700
|
+
const SUMMARY_NOTES = [
|
|
1701
|
+
[/^HUD_WARNING: /u, "Status line", "warn"],
|
|
1702
|
+
[/^Note: (?=outputStyle)/u, "Output style", "warn"],
|
|
1703
|
+
[/^ICON_FONT_(?:FAILED|LEFT_ALONE|SKIPPED): /u, "Icon font", "warn"],
|
|
1704
|
+
[/^ICON_FONT_(?:INSTALLED|PRESENT): /u, "Icon font", "done"],
|
|
1705
|
+
[/^ICON_FONT_(?:CACHE|HINT): /u, "Icon font", "note"],
|
|
1706
|
+
[/^ATTRIBUTION: /u, "Co-Authored-By", "done"],
|
|
1707
|
+
[/^AGENT_FILE: (?=symlink|not-file|not-utf8)/u, "CLAUDE.md", "warn"],
|
|
1708
|
+
[/^AGENT_FILE: /u, "CLAUDE.md", "done"],
|
|
1709
|
+
];
|
|
1710
|
+
|
|
1711
|
+
// The closing card: what is installed, the settings it runs with, what to do next. Every fact the plain
|
|
1712
|
+
// run prints is here, and a warning is never left out or shortened.
|
|
1713
|
+
const writeInstallSummary = ({ home, hudAccent, hudManaged, permissionMode, localMarketplace, outputStyleChoice, preservedPath }) => {
|
|
1714
|
+
const notes = installNotes.map((line) => {
|
|
1715
|
+
const [pattern, label, mark] = SUMMARY_NOTES.find(([candidate]) => candidate.test(line)) ?? [/^/u, "Note", "warn"];
|
|
1716
|
+
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}`) };
|
|
1717
|
+
});
|
|
1718
|
+
const answered = (label) => notes.some((note) => note.label === label);
|
|
1719
|
+
installUi.setAccent(hudAccent);
|
|
1720
|
+
installUi.panel({
|
|
1721
|
+
tag: "LIT",
|
|
1722
|
+
title: `LitClaude ${version} is installed`,
|
|
1723
|
+
sections: [
|
|
1724
|
+
{ head: "Installed", rows: [
|
|
1725
|
+
{ label: "Plugin", value: pluginKey },
|
|
1726
|
+
{ label: "Plugin path", value: homeRelative(intendedPluginPath(home)) },
|
|
1727
|
+
{ label: "Marketplace", value: homeRelative(localMarketplace) },
|
|
1728
|
+
hudManaged
|
|
1729
|
+
? { label: "Status line", value: `LitClaude status line, ${hudAccent}` }
|
|
1730
|
+
: { mark: "note", label: "Status line", value: "your own status-line setting was kept" },
|
|
1731
|
+
...(outputStyleChoice === "off" || answered("Output style") ? [] : [{ label: "Output style", value: OUTPUT_STYLE_NAMES[outputStyleChoice] }]),
|
|
1732
|
+
...notes,
|
|
1733
|
+
...["Co-Authored-By", "CLAUDE.md"].filter((label) => !answered(label)).map((label) => ({ mark: "warn", label, value: "not answered; left as it was" })),
|
|
1734
|
+
...(preservedPath ? [{ mark: "warn", label: "Kept skill", value: `PRESERVED_MODIFIED_SKILL lit-korean at ${preservedPath}` }] : []),
|
|
1735
|
+
] },
|
|
1736
|
+
{ head: "Settings", rows: [
|
|
1737
|
+
{ mark: "note", label: "Permissions", value: `${permissionMode} — ${permissionProfile(permissionMode).description}` },
|
|
1738
|
+
{ mark: "note", label: "Card options", value: `${modOptionsLine(readClaudeSettings(home))} (change: litclaude-ai config <option> <value>)` },
|
|
1739
|
+
{ mark: "note", label: "Models", value: "host-owned (Claude Code exposes no native route surface)" },
|
|
1740
|
+
] },
|
|
1741
|
+
{ head: "Next", rows: [
|
|
1742
|
+
{ mark: "note", label: "Terminal", value: "quit Claude Code if it is open, then launch with: claude" },
|
|
1743
|
+
{ mark: "note", label: "Desktop app", value: "ready — the Code tab reads these same settings; open a new session there" },
|
|
1744
|
+
] },
|
|
1745
|
+
],
|
|
1746
|
+
});
|
|
1747
|
+
const leftovers = extensionLeftovers({
|
|
1748
|
+
claudeHome: home,
|
|
1749
|
+
litHome: litHome(),
|
|
1750
|
+
cacheHome: process.env.XDG_CACHE_HOME || join(homedir(), ".cache"),
|
|
1751
|
+
currentVersion: version,
|
|
1752
|
+
});
|
|
1753
|
+
const sameName = sameNameSkills({ claudeHome: home, cwd: process.cwd() });
|
|
1754
|
+
// Prose is wrapped to the window; command lines stay whole, without a border, so they can be copied.
|
|
1755
|
+
const width = Math.min(installUi.cols() - 2, 100);
|
|
1756
|
+
const [heading, ...lines] = extensionsNoticeLines({ leftovers, sameName });
|
|
1757
|
+
const blocks = [];
|
|
1758
|
+
for (const line of lines) {
|
|
1759
|
+
const prose = /^ {2}\S/u.test(line);
|
|
1760
|
+
if (prose && blocks.at(-1)?.prose) blocks.at(-1).text += line.slice(1);
|
|
1761
|
+
else blocks.push({ prose, text: line });
|
|
1762
|
+
}
|
|
1763
|
+
process.stdout.write(` ${installUi.heading(heading)}\n`);
|
|
1764
|
+
for (const { prose, text } of blocks) process.stdout.write(`${prose ? wrap(text, width - 2).map((row) => ` ${row}`).join("\n") : ` ${text}`}\n`);
|
|
1765
|
+
process.stdout.write("\n");
|
|
1766
|
+
process.stdout.write(`INSTALL_PASS: LitClaude ${version} installed\n`);
|
|
1767
|
+
};
|
|
1768
|
+
|
|
1552
1769
|
const install = async ({ dryRun, rest }) => {
|
|
1553
1770
|
const home = claudeHome();
|
|
1554
1771
|
const litClaudeHome = litHome();
|
|
@@ -1562,7 +1779,6 @@ const install = async ({ dryRun, rest }) => {
|
|
|
1562
1779
|
const targetPlugin = claudePluginRoot(home);
|
|
1563
1780
|
const sourcePlugin = sourcePluginPath();
|
|
1564
1781
|
const targetMarketplace = marketplaceRoot(litClaudeHome);
|
|
1565
|
-
const progress = createInstallProgress();
|
|
1566
1782
|
|
|
1567
1783
|
if (dryRun) {
|
|
1568
1784
|
process.stdout.write(`${familyBanner({ color: false })}\n`);
|
|
@@ -1598,13 +1814,29 @@ const install = async ({ dryRun, rest }) => {
|
|
|
1598
1814
|
fail(`Packaged LitClaude plugin payload is missing: ${sourcePlugin}`);
|
|
1599
1815
|
}
|
|
1600
1816
|
|
|
1817
|
+
if (!assumeYes && richTerminal({ stdin: process.stdin, stdout: process.stdout, env: process.env })) {
|
|
1818
|
+
installUi = createInstallUi({ stdin: process.stdin, stdout: process.stdout, env: process.env, animate: shouldAnimateInstall() });
|
|
1819
|
+
installUi.setAccent(requestedHudAccent);
|
|
1820
|
+
}
|
|
1821
|
+
const progress = createInstallProgress();
|
|
1822
|
+
// Which questions this run will ask, so each card can say `LIT 2/5`.
|
|
1823
|
+
const asks = [
|
|
1824
|
+
["accent", !process.env.LITCLAUDE_HUD_ACCENT],
|
|
1825
|
+
["style", !process.env.LITCLAUDE_OUTPUT_STYLE],
|
|
1826
|
+
["font", !iconFont],
|
|
1827
|
+
["attribution", storedAttributionMode(litClaudeHome) === undefined],
|
|
1828
|
+
["agentFile", agentFile && readAgentFileMode({ litHome: litClaudeHome }) !== "off" && agentFileState({ path: agentFilePath(home), version }) === "absent"],
|
|
1829
|
+
].filter(([, asked]) => asked).map(([name]) => name);
|
|
1830
|
+
const tag = (name) => `LIT ${asks.indexOf(name) + 1}/${asks.length}`;
|
|
1831
|
+
if (installUi) writeInstallOpening();
|
|
1832
|
+
|
|
1601
1833
|
const hudAccent = assumeYes
|
|
1602
1834
|
? (process.env.LITCLAUDE_HUD_ACCENT ? normalizeHudAccent(process.env.LITCLAUDE_HUD_ACCENT) : existingHudAccent)
|
|
1603
|
-
: await chooseHudAccent(existingHudAccent);
|
|
1835
|
+
: await chooseHudAccent(existingHudAccent, { tag: tag("accent"), stored: existingLitClaude.hudAccent !== undefined });
|
|
1604
1836
|
const outputStyleChoice = assumeYes
|
|
1605
1837
|
? normalizeOutputStyle(process.env.LITCLAUDE_OUTPUT_STYLE ?? existingOutputStyle)
|
|
1606
|
-
: await chooseOutputStyle(existingOutputStyle);
|
|
1607
|
-
const wantsIconFont = await chooseIconFont({ iconFont, assumeYes });
|
|
1838
|
+
: await chooseOutputStyle(existingOutputStyle, { tag: tag("style"), stored: existingLitClaude.outputStyleChoice !== undefined });
|
|
1839
|
+
const wantsIconFont = await chooseIconFont({ iconFont, assumeYes, tag: tag("font") });
|
|
1608
1840
|
const preservation = preflightInstallOwnership({ preserveModifiedSkill: true });
|
|
1609
1841
|
const preservedPath = preserveModifiedLegacySkill(preservation, litClaudeHome);
|
|
1610
1842
|
const targetCompatibility = versionRoot(litClaudeHome);
|
|
@@ -1691,15 +1923,33 @@ const install = async ({ dryRun, rest }) => {
|
|
|
1691
1923
|
["Permissions", `${permissionMode}; global settings allow/deny; ownership-safe removal`],
|
|
1692
1924
|
["Launch", "claude"],
|
|
1693
1925
|
]);
|
|
1926
|
+
if (installUi) {
|
|
1927
|
+
const details = { home, hudAccent, hudManaged, permissionMode, localMarketplace, outputStyleChoice, preservedPath };
|
|
1928
|
+
try {
|
|
1929
|
+
if (wantsIconFont) {
|
|
1930
|
+
const card = installUi.progress({ tag: "LIT", title: "Icon font", steps: [{ name: "Font", text: "download, check and install" }] });
|
|
1931
|
+
await card.run(0, runIconFontInstall);
|
|
1932
|
+
const ok = !installNotes.some((line) => /^ICON_FONT_(?:FAILED|LEFT_ALONE|SKIPPED)/u.test(line));
|
|
1933
|
+
card.finish("Icon font files", ok ? "installed" : "not installed; the summary says why", ok);
|
|
1934
|
+
}
|
|
1935
|
+
await installAttribution({ assumeYes, tag: tag("attribution") });
|
|
1936
|
+
await installAgentFile({ assumeYes, agentFile, tag: tag("agentFile") });
|
|
1937
|
+
} finally {
|
|
1938
|
+
// The install itself is done by now, so it is reported even when a late question was stopped.
|
|
1939
|
+
writeInstallSummary(details);
|
|
1940
|
+
if (preservedPath) process.stderr.write(`INSTALL_WARNING: PRESERVED_MODIFIED_SKILL lit-korean at ${preservedPath}\n`);
|
|
1941
|
+
}
|
|
1942
|
+
return;
|
|
1943
|
+
}
|
|
1694
1944
|
process.stdout.write("Model selection: host-owned (Claude Code exposes no native route surface)\n");
|
|
1695
1945
|
process.stdout.write(`INSTALL_PASS: LitClaude ${version} installed\n`);
|
|
1696
1946
|
process.stdout.write(`Claude plugin: ${pluginKey}\n`);
|
|
1697
1947
|
process.stdout.write(`Marketplace: ${localMarketplace}\n`);
|
|
1698
1948
|
process.stdout.write(`Plugin path: ${intendedPluginPath(home)}\n`);
|
|
1699
1949
|
process.stdout.write(hudManaged ? `HUD: LitClaude statusLine installed (${hudAccent})\n` : "HUD: user statusLine setting preserved\n");
|
|
1700
|
-
process.stdout.write(`Global Claude settings permissions.allow/deny: ${permissionMode} — ${permissionProfile(permissionMode).description}\n`);
|
|
1701
|
-
process.stdout.write(`MOD_OPTIONS: ${modOptionsLine(readClaudeSettings(home))} (change: litclaude-ai config <option> <value>)\n`);
|
|
1702
|
-
process.stdout.write("DESKTOP_APP: ready — the Claude desktop app's Code tab reads these same settings; open a new session there\n");
|
|
1950
|
+
process.stdout.write(asciiFrame(`Global Claude settings permissions.allow/deny: ${permissionMode} — ${permissionProfile(permissionMode).description}\n`));
|
|
1951
|
+
process.stdout.write(asciiFrame(`MOD_OPTIONS: ${modOptionsLine(readClaudeSettings(home))} (change: litclaude-ai config <option> <value>)\n`));
|
|
1952
|
+
process.stdout.write(asciiFrame("DESKTOP_APP: ready — the Claude desktop app's Code tab reads these same settings; open a new session there\n"));
|
|
1703
1953
|
if (wantsIconFont) await runIconFontInstall();
|
|
1704
1954
|
await installAttribution({ assumeYes });
|
|
1705
1955
|
await installAgentFile({ assumeYes, agentFile });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="146" height="20" role="img" aria-label="release: 1.0.
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="146" height="20" role="img" aria-label="release: 1.0.64"><title>release: 1.0.64</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.64</text></g></svg>
|