@litfamily/litmuse 0.1.21 → 0.1.23
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 +26 -0
- package/README.md +61 -15
- package/README_ko-KR.md +61 -15
- package/bin/litmuse.mjs +17 -33
- package/lib/agent-file.mjs +2 -11
- package/lib/agent-guide.mjs +71 -0
- package/lib/config.mjs +18 -0
- package/lib/doctor.mjs +3 -1
- package/lib/flags.mjs +35 -0
- package/lib/glyphs.mjs +55 -7
- package/lib/guard.mjs +38 -1
- package/lib/icon-font.mjs +198 -0
- package/lib/install-cards.mjs +8 -3
- package/lib/install.mjs +39 -8
- package/lib/paths.mjs +4 -1
- package/lib/safe-write.mjs +1 -1
- package/lib/uninstall.mjs +13 -1
- package/package.json +3 -2
- package/plugin/.muse-plugin/plugin.json +13 -13
- package/plugin/hooks/lib/autopilot.mjs +638 -0
- package/plugin/hooks/lib/common.mjs +80 -5
- package/plugin/hooks/lib/continuation.mjs +13 -52
- package/plugin/hooks/lib/goal.mjs +5 -2
- package/plugin/hooks/lib/run-group.mjs +33 -0
- package/plugin/hooks/lib/shell-verdict.mjs +1004 -0
- package/plugin/hooks/lib/suggest.mjs +110 -0
- package/plugin/hooks/pre-tool-use.mjs +111 -5
- package/plugin/hooks/subagent-start.mjs +12 -1
- package/plugin/hooks/user-prompt-submit.mjs +69 -13
- package/plugin/skills/lit-plan/SKILL.md +12 -2
- package/plugin/skills/lit-plan/scripts/goal-propose.mjs +9 -2
- package/plugin/skills/start-work/SKILL.md +94 -20
package/lib/flags.mjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// The command line: every flag LitMuse takes. Anything else that starts with a dash is refused, except for `rewind`,
|
|
2
|
+
// which reads its own flags.
|
|
3
|
+
export const NPX = 'npx --yes @litfamily/litmuse@latest';
|
|
4
|
+
export const GLYPH_CHOICES = ['auto', 'round', 'square'];
|
|
5
|
+
|
|
6
|
+
const SWITCHES = new Map([
|
|
7
|
+
['--dry-run', 'dryRun'], ['--yes', 'yes'], ['-y', 'yes'], ['--approve', 'approve'], ['--json', 'json'], ['--offline', 'offline'],
|
|
8
|
+
['--no-agent-file', 'noAgentFile'], ['--discard-modified', 'discardModified'], ['--card', 'card'], ['--watch', 'watch'],
|
|
9
|
+
['--all', 'all'], ['--allow-shadow', 'allowShadow'], ['--round', 'round'], ['--agent', 'agent'],
|
|
10
|
+
['--help', 'help'], ['-h', 'help'], ['--version', 'version'], ['-v', 'version'],
|
|
11
|
+
]);
|
|
12
|
+
const VALUES = new Map([['--scope', 'scope'], ['--from', 'from'], ['--family', 'family'], ['--older-than', 'olderThan'], ['--glyphs', 'glyphs']]);
|
|
13
|
+
|
|
14
|
+
export const FLAGS = [...SWITCHES.keys(), ...VALUES.keys()];
|
|
15
|
+
|
|
16
|
+
/** `{command, args, flags, problem}`; `problem` is what makes the line unusable, or null. */
|
|
17
|
+
export function parse(argv) {
|
|
18
|
+
const flags = {};
|
|
19
|
+
const rest = [];
|
|
20
|
+
const problems = [];
|
|
21
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
22
|
+
const a = argv[i];
|
|
23
|
+
if (SWITCHES.has(a)) flags[SWITCHES.get(a)] = true;
|
|
24
|
+
else if (!VALUES.has(a)) rest.push(a);
|
|
25
|
+
else if (argv[i + 1] === undefined || argv[i + 1].startsWith('-')) problems.push(`${a} needs a value.`);
|
|
26
|
+
else flags[VALUES.get(a)] = argv[++i];
|
|
27
|
+
}
|
|
28
|
+
const command = rest[0] ?? 'help';
|
|
29
|
+
const unknown = command === 'rewind' ? undefined : rest.find((a) => a.startsWith('-'));
|
|
30
|
+
if (unknown) problems.unshift(`Unknown option: ${unknown}.`);
|
|
31
|
+
if (flags.scope && !['user', 'project'].includes(flags.scope)) problems.push('--scope takes user or project.');
|
|
32
|
+
if (flags.glyphs && !GLYPH_CHOICES.includes(flags.glyphs)) problems.push(`--glyphs takes ${GLYPH_CHOICES.join(', ')}.`);
|
|
33
|
+
if ((flags.round || flags.glyphs) && !['install', 'update'].includes(command)) problems.push('--round and --glyphs work with install and update.');
|
|
34
|
+
return { command, args: rest.slice(1), flags, problem: problems[0] ?? null };
|
|
35
|
+
}
|
package/lib/glyphs.mjs
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
// Whether LitMuse draws round ends (U+E0B6, U+E0B4) on pills and gauges. Every surface asks here, so one terminal never
|
|
2
|
-
// shows both forms. LITMUSE_GLYPHS decides when set (round or nerd, basic or square)
|
|
3
|
-
// word, then, off SSH, whether an icon font is installed here. Only
|
|
2
|
+
// shows both forms. LITMUSE_GLYPHS decides when set (auto, round or nerd, basic or square), then the choice saved by
|
|
3
|
+
// `install --glyphs`; on auto it is the terminal's own word, then, off SSH, whether an icon font is installed here. Only
|
|
4
|
+
// file names in the font folders are read.
|
|
4
5
|
import { readdirSync } from 'node:fs';
|
|
5
6
|
import { homedir } from 'node:os';
|
|
6
|
-
import { join } from 'node:path';
|
|
7
|
+
import { isAbsolute, join } from 'node:path';
|
|
8
|
+
import { readConfig } from './config.mjs';
|
|
9
|
+
import { GLYPH_CHOICES, NPX } from './flags.mjs';
|
|
10
|
+
import { colourDepth } from './mark.mjs';
|
|
7
11
|
|
|
8
12
|
export const CAP_LEFT = '';
|
|
9
13
|
export const CAP_RIGHT = '';
|
|
@@ -11,6 +15,7 @@ const MAX_NAMES = 4000;
|
|
|
11
15
|
const MAX_DEPTH = 3;
|
|
12
16
|
const FONT = /\.(?:ttf|otf|ttc)$/i;
|
|
13
17
|
const ICONS = /nerd[ _-]?font|[ _-]nf[mp]?(?=[ _.-])/i;
|
|
18
|
+
const SETTING = new Map([['auto', 'auto'], ['round', 'round'], ['nerd', 'round'], ['square', 'square'], ['basic', 'square']]);
|
|
14
19
|
|
|
15
20
|
const drawsCaps = (env) => Boolean(env.WT_SESSION || env.KITTY_WINDOW_ID) || env.TERM === 'xterm-kitty'
|
|
16
21
|
|| /^(?:vscode|wezterm|ghostty)$/i.test(env.TERM_PROGRAM ?? '');
|
|
@@ -19,7 +24,7 @@ const fontFolders = (env, platform) => {
|
|
|
19
24
|
const home = env.HOME || homedir();
|
|
20
25
|
if (platform === 'darwin') return [join(home, 'Library', 'Fonts'), '/Library/Fonts'];
|
|
21
26
|
if (platform === 'win32') return [env.LOCALAPPDATA && join(env.LOCALAPPDATA, 'Microsoft', 'Windows', 'Fonts'), env.WINDIR && join(env.WINDIR, 'Fonts')].filter(Boolean);
|
|
22
|
-
return [join(env.XDG_DATA_HOME
|
|
27
|
+
return [join(isAbsolute(env.XDG_DATA_HOME ?? '') ? env.XDG_DATA_HOME : join(home, '.local', 'share'), 'fonts'), join(home, '.fonts'), '/usr/local/share/fonts', '/usr/share/fonts'];
|
|
23
28
|
};
|
|
24
29
|
|
|
25
30
|
/** An icon font file is installed. Links are not followed; an unreadable folder or too many names means no. */
|
|
@@ -46,10 +51,53 @@ export function iconFontInstalled({ env = process.env, platform = process.platfo
|
|
|
46
51
|
let installed = null;
|
|
47
52
|
const iconFontOnce = () => (installed ??= iconFontInstalled());
|
|
48
53
|
|
|
54
|
+
/** A font was added or removed: look again. */
|
|
55
|
+
export const forgetIconFont = () => { installed = null; };
|
|
56
|
+
|
|
57
|
+
/** `{choice, from}`: round, square or auto, and whether LITMUSE_GLYPHS, the saved choice or neither said so. */
|
|
58
|
+
export function glyphChoice(env = process.env) {
|
|
59
|
+
const set = SETTING.get((env.LITMUSE_GLYPHS ?? '').toLowerCase());
|
|
60
|
+
if (set) return { choice: set, from: 'environment' };
|
|
61
|
+
const saved = readConfig(env).glyphs;
|
|
62
|
+
return GLYPH_CHOICES.includes(saved) ? { choice: saved, from: 'saved' } : { choice: 'auto', from: 'default' };
|
|
63
|
+
}
|
|
64
|
+
|
|
49
65
|
export function roundGlyphs(env = process.env, iconFont = iconFontOnce) {
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
if (chosen === 'square' || chosen === 'basic') return false;
|
|
66
|
+
const { choice } = glyphChoice(env);
|
|
67
|
+
if (choice !== 'auto') return choice === 'round';
|
|
53
68
|
if (drawsCaps(env)) return true;
|
|
54
69
|
return !env.SSH_CONNECTION && iconFont();
|
|
55
70
|
}
|
|
71
|
+
|
|
72
|
+
// What the window on stdout rules out. Without a terminal it says nothing about the window the user will look at.
|
|
73
|
+
function windowLimit(env) {
|
|
74
|
+
if (env.NO_COLOR) return 'NO_COLOR is set; unset it';
|
|
75
|
+
if (/^dumb$/i.test(env.TERM ?? '')) return 'TERM is dumb; use a full terminal';
|
|
76
|
+
if (/;(7|15)$/.test(env.COLORFGBG ?? '')) return 'light ground; use a dark terminal';
|
|
77
|
+
return colourDepth({ env, isTTY: true }) === 'truecolor' ? null : 'fewer colours than truecolor; use a truecolor terminal';
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The ROUND_ENDS line of install, update and doctor. `surface` is whether LitMuse is installed, so that its status card
|
|
82
|
+
* is there; `fontWhy` is why --round could not add the font. An installed font is no proof that the terminal uses it.
|
|
83
|
+
*/
|
|
84
|
+
export function roundEndsLine({
|
|
85
|
+
env = process.env, surface = true, tty = Boolean(process.stdout.isTTY), platform = process.platform, fontWhy = null,
|
|
86
|
+
iconFont = () => iconFontInstalled({ env, platform }),
|
|
87
|
+
} = {}) {
|
|
88
|
+
const again = `${NPX} install --yes`;
|
|
89
|
+
const square = (why) => `ROUND_ENDS: square (${why})`;
|
|
90
|
+
const check = (why) => `ROUND_ENDS: check (${why}; show your user the pill in step 7 of ${NPX} install --agent)`;
|
|
91
|
+
if (!surface) return square(`no surface enabled; run ${again} --round`);
|
|
92
|
+
const limit = tty ? windowLimit(env) : null;
|
|
93
|
+
if (limit) return square(limit);
|
|
94
|
+
const { choice, from } = glyphChoice(env);
|
|
95
|
+
if (choice === 'square') return square(`choice is square; ${from === 'environment' ? 'unset LITMUSE_GLYPHS' : `run ${again} --glyphs auto`}`);
|
|
96
|
+
if (choice === 'round') return from === 'saved' || readConfig(env).glyphs === 'round' ? 'ROUND_ENDS: shown' : check('LITMUSE_GLYPHS asks for round ends and no answer is saved');
|
|
97
|
+
if (drawsCaps(env)) return `ROUND_ENDS: ready${tty ? '' : ' in a dark full-colour terminal'}`;
|
|
98
|
+
if (env.SSH_CONNECTION) return square(`SSH; run ${again} --glyphs round when your user sees the pill in step 7 of ${NPX} install --agent as round`);
|
|
99
|
+
if (iconFont()) return check('an icon font is here, and this terminal is not known to use it');
|
|
100
|
+
if (fontWhy) return square(`font not installed (${fontWhy}); run ${again} --round again`);
|
|
101
|
+
if (platform === 'win32') return square('Windows console; use Windows Terminal or VS Code');
|
|
102
|
+
return square(`no icon font; run ${again} --round`);
|
|
103
|
+
}
|
package/lib/guard.mjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { lstatSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { isAbsolute, join, resolve, sep } from 'node:path';
|
|
2
4
|
|
|
3
5
|
const FOREIGN_DIRS = new Set(['.claude', '.codex']);
|
|
4
6
|
|
|
@@ -9,3 +11,38 @@ export function assertSafeWritePath(target) {
|
|
|
9
11
|
if (hit) throw new Error(`refused: LitMuse never writes under ${hit}${sep} (${target})`);
|
|
10
12
|
return target;
|
|
11
13
|
}
|
|
14
|
+
|
|
15
|
+
export const FONT_FILES = Object.freeze({ font: 'SymbolsNerdFontMono-Regular.ttf', license: 'SymbolsNerdFontMono-LICENSE.txt' });
|
|
16
|
+
|
|
17
|
+
/** XDG_DATA_HOME where it is absolute; by the XDG rule a relative one counts as not set. A slash at its end would hide a link. */
|
|
18
|
+
export const xdgData = (env) => (isAbsolute(env.XDG_DATA_HOME ?? '') ? resolve(env.XDG_DATA_HOME) : null);
|
|
19
|
+
|
|
20
|
+
/** The per-user font folder, or null on Windows, where LitMuse installs no font. */
|
|
21
|
+
export function fontFolder({ env = process.env, platform = process.platform } = {}) {
|
|
22
|
+
const home = env.HOME || homedir();
|
|
23
|
+
if (platform === 'win32') return null;
|
|
24
|
+
return platform === 'darwin' ? join(home, 'Library', 'Fonts') : join(xdgData(env) ?? join(home, '.local', 'share'), 'fonts');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Why the font folder cannot be used, or null: it, or a folder between it and the user's home (or XDG_DATA_HOME), is a
|
|
29
|
+
* link or no folder. A missing folder is fine.
|
|
30
|
+
*/
|
|
31
|
+
export function fontFolderProblem({ env = process.env, platform = process.platform } = {}) {
|
|
32
|
+
const home = env.HOME || homedir();
|
|
33
|
+
const steps = platform === 'darwin' ? [join(home, 'Library'), join(home, 'Library', 'Fonts')]
|
|
34
|
+
: xdgData(env) ? [xdgData(env), join(xdgData(env), 'fonts')]
|
|
35
|
+
: [join(home, '.local'), join(home, '.local', 'share'), join(home, '.local', 'share', 'fonts')];
|
|
36
|
+
for (const step of steps) {
|
|
37
|
+
const st = lstatSync(step, { throwIfNoEntry: false });
|
|
38
|
+
if (st && !st.isDirectory()) return `${step} is ${st.isSymbolicLink() ? 'a link' : 'not a folder'}`;
|
|
39
|
+
}
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// `install --round` is the one write outside LitMuse's folder and Muse's own files: these two names, in that folder.
|
|
44
|
+
export function assertFontPath(target, { env = process.env, platform = process.platform } = {}) {
|
|
45
|
+
const dir = fontFolder({ env, platform });
|
|
46
|
+
if (!dir || !Object.values(FONT_FILES).some((name) => target === join(dir, name))) throw new Error(`refused: ${target} is not an icon font path LitMuse writes`);
|
|
47
|
+
return assertSafeWritePath(target);
|
|
48
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
// The opt-in icon font of `install --round`: the symbols-only Nerd Font, which holds the round ends (U+E0B6, U+E0B4).
|
|
2
|
+
// It comes from one pinned release archive, and archive and files must match their SHA-256. A file that is already there
|
|
3
|
+
// is never replaced, and icon-font.json in LitMuse's data folder lists what LitMuse added, so uninstall removes only that.
|
|
4
|
+
import { spawnSync } from 'node:child_process';
|
|
5
|
+
import { createHash } from 'node:crypto';
|
|
6
|
+
import { linkSync, lstatSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
7
|
+
import { dirname, join } from 'node:path';
|
|
8
|
+
import { inflateRawSync } from 'node:zlib';
|
|
9
|
+
import { forgetIconFont, iconFontInstalled } from './glyphs.mjs';
|
|
10
|
+
import { FONT_FILES, assertFontPath, assertSafeWritePath, fontFolder, fontFolderProblem } from './guard.mjs';
|
|
11
|
+
import { paths } from './paths.mjs';
|
|
12
|
+
import { realExistingAncestor, writeFileAtomic } from './safe-write.mjs';
|
|
13
|
+
|
|
14
|
+
const MIB = 1024 * 1024;
|
|
15
|
+
export const ICON_FONT = Object.freeze({
|
|
16
|
+
release: 'v3.5.1',
|
|
17
|
+
url: 'https://github.com/ryanoasis/nerd-fonts/releases/download/v3.5.1/NerdFontsSymbolsOnly.zip',
|
|
18
|
+
sha256: 'fdca3682534f6f65e1ccb2345b0362ccf67d9b8eca7c8025330946e93e2473bc',
|
|
19
|
+
maxBytes: 8 * MIB,
|
|
20
|
+
files: Object.freeze([
|
|
21
|
+
Object.freeze({ entry: 'SymbolsNerdFontMono-Regular.ttf', name: FONT_FILES.font, sha256: 'fe471e538392f51910faab985fa8e192a39dd3426125edd15b71b3680df0e749' }),
|
|
22
|
+
Object.freeze({ entry: 'LICENSE', name: FONT_FILES.license, sha256: '84a7a98c82140fb12c37fe42b93805baa16024cb3e5acc599b7ffe612c55d847' }),
|
|
23
|
+
]),
|
|
24
|
+
});
|
|
25
|
+
const DOWNLOAD_MS = 60_000;
|
|
26
|
+
|
|
27
|
+
const sha256 = (bytes) => createHash('sha256').update(bytes).digest('hex');
|
|
28
|
+
const lstatOrNull = (path) => {
|
|
29
|
+
try {
|
|
30
|
+
return lstatSync(path);
|
|
31
|
+
} catch {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
// absent, same (a regular file with exactly these bytes) or other.
|
|
36
|
+
const stateOf = (path, hash) => {
|
|
37
|
+
const st = lstatOrNull(path);
|
|
38
|
+
if (!st) return 'absent';
|
|
39
|
+
return st.isFile() && sha256(readFileSync(path)) === hash ? 'same' : 'other';
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/** Bytes of the named entries of a zip held in memory; a missing name is left out. */
|
|
43
|
+
export function unzip(zip, names) {
|
|
44
|
+
const out = new Map();
|
|
45
|
+
let end = zip.length - 22;
|
|
46
|
+
while (end >= 0 && zip.readUInt32LE(end) !== 0x06054b50) end -= 1;
|
|
47
|
+
if (end < 0) throw new Error('the archive is not a zip file');
|
|
48
|
+
let at = zip.readUInt32LE(end + 16);
|
|
49
|
+
for (let left = zip.readUInt16LE(end + 10); left > 0; left -= 1) {
|
|
50
|
+
const [nameSize, extraSize, noteSize] = [28, 30, 32].map((offset) => zip.readUInt16LE(at + offset));
|
|
51
|
+
const name = zip.toString('utf8', at + 46, at + 46 + nameSize);
|
|
52
|
+
if (names.includes(name)) {
|
|
53
|
+
const local = zip.readUInt32LE(at + 42);
|
|
54
|
+
const from = local + 30 + zip.readUInt16LE(local + 26) + zip.readUInt16LE(local + 28);
|
|
55
|
+
const data = zip.subarray(from, from + zip.readUInt32LE(at + 20));
|
|
56
|
+
const method = zip.readUInt16LE(at + 10);
|
|
57
|
+
if (method !== 0 && method !== 8) throw new Error(`the archive packs ${name} in a way LitMuse does not read`);
|
|
58
|
+
out.set(name, method === 0 ? Buffer.from(data) : inflateRawSync(data, { maxOutputLength: 4 * ICON_FONT.maxBytes }));
|
|
59
|
+
}
|
|
60
|
+
at += 46 + nameSize + extraSize + noteSize;
|
|
61
|
+
}
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function download(pins, fetchImpl) {
|
|
66
|
+
const res = await fetchImpl(pins.url, { redirect: 'follow', signal: AbortSignal.timeout(DOWNLOAD_MS) });
|
|
67
|
+
if (!res.ok) throw new Error(`the download answered HTTP ${res.status}`);
|
|
68
|
+
const chunks = [];
|
|
69
|
+
let size = 0;
|
|
70
|
+
for await (const chunk of res.body) {
|
|
71
|
+
size += chunk.length;
|
|
72
|
+
if (size > pins.maxBytes) throw new Error('the download is larger than 8 MiB');
|
|
73
|
+
chunks.push(chunk);
|
|
74
|
+
}
|
|
75
|
+
return Buffer.concat(chunks);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** The pinned archive: the file LITMUSE_ICON_FONT_SOURCE names (tests, offline), else the download. */
|
|
79
|
+
async function archiveBytes({ env, pins, fetchImpl }) {
|
|
80
|
+
const local = env.LITMUSE_ICON_FONT_SOURCE;
|
|
81
|
+
let bytes;
|
|
82
|
+
if (local) {
|
|
83
|
+
const st = lstatSync(local);
|
|
84
|
+
if (!st.isFile() || st.size > pins.maxBytes) throw new Error(`${local} is not a regular file of at most 8 MiB`);
|
|
85
|
+
bytes = readFileSync(local);
|
|
86
|
+
} else bytes = await download(pins, fetchImpl);
|
|
87
|
+
if (sha256(bytes) !== pins.sha256) throw new Error('the archive does not match its pinned SHA-256');
|
|
88
|
+
return bytes;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const readManifest = (file) => {
|
|
92
|
+
try {
|
|
93
|
+
const { files } = lstatSync(file).isFile() ? JSON.parse(readFileSync(file, 'utf8')) : {};
|
|
94
|
+
return Array.isArray(files) ? files.filter((f) => typeof f?.path === 'string' && typeof f?.sha256 === 'string') : [];
|
|
95
|
+
} catch {
|
|
96
|
+
return [];
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// Why the folder or the font's own place in it cannot take the file, or null. Nothing is written or fetched before this.
|
|
101
|
+
function blocked(target, where) {
|
|
102
|
+
const problem = fontFolderProblem(where);
|
|
103
|
+
if (problem) return problem;
|
|
104
|
+
assertSafeWritePath(realExistingAncestor(dirname(target)));
|
|
105
|
+
return lstatOrNull(target) ? `something else is already at ${target}` : null;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// The bytes go to a temporary file in LitMuse's own folder; the hard link that claims the name fails when anything is
|
|
109
|
+
// there already. Returns false in that case.
|
|
110
|
+
function claim(target, bytes, data, write) {
|
|
111
|
+
mkdirSync(data, { recursive: true });
|
|
112
|
+
const staged = join(data, `.icon-font-${process.pid}`);
|
|
113
|
+
try {
|
|
114
|
+
write(staged, bytes, { flag: 'wx', mode: 0o644 });
|
|
115
|
+
try {
|
|
116
|
+
linkSync(staged, target);
|
|
117
|
+
} catch (e) {
|
|
118
|
+
if (e.code === 'EEXIST') return false;
|
|
119
|
+
throw e.code === 'EXDEV' ? new Error(`${dirname(target)} and ${data} are on different disks`) : e;
|
|
120
|
+
}
|
|
121
|
+
return true;
|
|
122
|
+
} finally {
|
|
123
|
+
rmSync(staged, { force: true });
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** What `--round` would do, for the plan and the dry run. */
|
|
128
|
+
export function iconFontPlan({ env = process.env, platform = process.platform, hasFont = () => iconFontInstalled({ env, platform }) } = {}) {
|
|
129
|
+
if (hasFont()) return 'an icon font is already here; nothing is added';
|
|
130
|
+
const dir = fontFolder({ env, platform });
|
|
131
|
+
if (!dir) return 'no font is installed on Windows (Windows Terminal and VS Code draw the round ends)';
|
|
132
|
+
return `add ${FONT_FILES.font} and its licence (${FONT_FILES.license}) to ${dir}, ${env.LITMUSE_ICON_FONT_SOURCE ? `from ${env.LITMUSE_ICON_FONT_SOURCE}` : `downloaded from ${ICON_FONT.url}`}`;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Adds the icon font when none is here. Returns `{status, why?, written}` with status here, added, unsupported or failed;
|
|
137
|
+
* it never throws, because an install succeeds with square ends too.
|
|
138
|
+
*/
|
|
139
|
+
export async function addIconFont({
|
|
140
|
+
env = process.env, platform = process.platform, pins = ICON_FONT, fetchImpl = globalThis.fetch, spawn = spawnSync, write = writeFileSync,
|
|
141
|
+
hasFont = () => iconFontInstalled({ env, platform }),
|
|
142
|
+
} = {}) {
|
|
143
|
+
const linked = [];
|
|
144
|
+
try {
|
|
145
|
+
if (hasFont()) return { status: 'here', written: [] };
|
|
146
|
+
const p = paths(env);
|
|
147
|
+
const dir = fontFolder({ env, platform });
|
|
148
|
+
if (!dir) return { status: 'unsupported', why: 'LitMuse installs no font on Windows', written: [] };
|
|
149
|
+
const why = blocked(join(dir, FONT_FILES.font), { env, platform });
|
|
150
|
+
if (why) return { status: 'failed', why, written: [] };
|
|
151
|
+
const entries = unzip(await archiveBytes({ env, pins, fetchImpl }), pins.files.map((f) => f.entry));
|
|
152
|
+
for (const f of pins.files) {
|
|
153
|
+
const bytes = entries.get(f.entry);
|
|
154
|
+
if (!bytes || sha256(bytes) !== f.sha256) throw new Error(`${f.entry} in the archive does not match its pinned SHA-256`);
|
|
155
|
+
}
|
|
156
|
+
mkdirSync(dir, { recursive: true });
|
|
157
|
+
const late = blocked(join(dir, FONT_FILES.font), { env, platform });
|
|
158
|
+
if (late) throw new Error(late);
|
|
159
|
+
for (const f of pins.files) {
|
|
160
|
+
const path = assertFontPath(join(dir, f.name), { env, platform });
|
|
161
|
+
if (claim(path, entries.get(f.entry), p.data, write)) linked.push({ path, sha256: f.sha256 });
|
|
162
|
+
else if (f.name === FONT_FILES.font) throw new Error(`something else is already at ${path}`);
|
|
163
|
+
}
|
|
164
|
+
const kept = readManifest(p.iconFont).filter((f) => !linked.some((l) => l.path === f.path) && stateOf(f.path, f.sha256) === 'same');
|
|
165
|
+
writeFileAtomic(p.iconFont, `${JSON.stringify({ release: pins.release, files: [...kept, ...linked] }, null, 2)}\n`);
|
|
166
|
+
if (platform !== 'darwin') spawn('fc-cache', ['-f', dir], { stdio: 'ignore', timeout: DOWNLOAD_MS });
|
|
167
|
+
return { status: 'added', written: [...linked.map((f) => f.path), p.iconFont] };
|
|
168
|
+
} catch (e) {
|
|
169
|
+
for (const f of linked) rmSync(f.path, { force: true });
|
|
170
|
+
return { status: 'failed', why: e.name === 'TimeoutError' ? 'the download took longer than 60 seconds' : e.code ? `${e.code}${e.path ? ` ${e.path}` : ''}` : e.message, written: [] };
|
|
171
|
+
} finally {
|
|
172
|
+
forgetIconFont();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** The files LitMuse added that are still exactly as written (`remove`), and those that changed since (`keep`). */
|
|
177
|
+
export function ownedIconFont({ env = process.env, platform = process.platform } = {}) {
|
|
178
|
+
const out = { remove: [], keep: [] };
|
|
179
|
+
const linked = fontFolderProblem({ env, platform });
|
|
180
|
+
for (const f of readManifest(paths(env).iconFont)) {
|
|
181
|
+
let state = 'other';
|
|
182
|
+
try {
|
|
183
|
+
const found = stateOf(assertFontPath(f.path, { env, platform }), f.sha256);
|
|
184
|
+
state = linked && found === 'same' ? 'other' : found;
|
|
185
|
+
} catch { /* not a path LitMuse writes: left alone */ }
|
|
186
|
+
if (state !== 'absent') out[state === 'same' ? 'remove' : 'keep'].push(f.path);
|
|
187
|
+
}
|
|
188
|
+
return out;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export function removeIconFont({ env = process.env, platform = process.platform } = {}) {
|
|
192
|
+
const owned = ownedIconFont({ env, platform });
|
|
193
|
+
for (const path of owned.remove) rmSync(path, { force: true });
|
|
194
|
+
const list = assertSafeWritePath(paths(env).iconFont);
|
|
195
|
+
if (lstatOrNull(list)?.isFile()) rmSync(list);
|
|
196
|
+
forgetIconFont();
|
|
197
|
+
return owned;
|
|
198
|
+
}
|
package/lib/install-cards.mjs
CHANGED
|
@@ -197,8 +197,11 @@ export function createCards({ env, stdin, stdout, proc = process, now = Date.now
|
|
|
197
197
|
/** Wrapped text under a heading. A command (four spaces in) stays on one line, so it can be copied. */
|
|
198
198
|
const text = (heading, lines) => { stdout.write(`${apart('text')}${textLines(heading, lines).join('\n')}\n`); };
|
|
199
199
|
|
|
200
|
-
/**
|
|
201
|
-
const
|
|
200
|
+
/** One line that is never wrapped, so it can be found and copied whole. */
|
|
201
|
+
const line = (words) => { stdout.write(`${apart('text')} ${bold(say(words))}\n`); };
|
|
202
|
+
|
|
203
|
+
/** A finished card: sections of { head, rows: [{ mark, label, value }] }. Values wrap and are never cut. The first of `hints` that fits takes the empty top row. */
|
|
204
|
+
const panel = ({ title, sections, bad = false, hints: lines = [] }) => {
|
|
202
205
|
const markCells = 2;
|
|
203
206
|
const labelCells = inner() < 56 ? 0 : LABEL;
|
|
204
207
|
const body = sections.flatMap(({ head, rows: list }) => [
|
|
@@ -214,6 +217,8 @@ export function createCards({ env, stdin, stdout, proc = process, now = Date.now
|
|
|
214
217
|
return wrap(say(short(value)), inner() - cells(start)).map((line, i) => (i ? ' '.repeat(cells(start)) : start) + loud(line));
|
|
215
218
|
}),
|
|
216
219
|
]);
|
|
220
|
+
const hint = lines.find((line) => cells(line) <= inner());
|
|
221
|
+
if (hint) body[0] = dim(say(hint));
|
|
217
222
|
stdout.write(`${apart('card')}${frame({ title, body, bad }).join('\n')}\n`);
|
|
218
223
|
};
|
|
219
224
|
|
|
@@ -397,5 +402,5 @@ export function createCards({ env, stdin, stdout, proc = process, now = Date.now
|
|
|
397
402
|
}
|
|
398
403
|
};
|
|
399
404
|
|
|
400
|
-
return { ask, row, text, panel, work, intro, short };
|
|
405
|
+
return { ask, row, text, line, panel, work, intro, short };
|
|
401
406
|
}
|
package/lib/install.mjs
CHANGED
|
@@ -11,6 +11,10 @@ import { SHELF, extensionsNotice, leftoverRuntime } from '../plugin/hooks/lib/ex
|
|
|
11
11
|
import { noticeHash, wasShown, recordShown } from './shown.mjs';
|
|
12
12
|
import { survey, findings, CLI } from './extensions.mjs';
|
|
13
13
|
import { planRows } from './install-cards.mjs';
|
|
14
|
+
import { AGENT_LINE, AGENT_LINE_SHORT } from './agent-guide.mjs';
|
|
15
|
+
import { writeConfig } from './config.mjs';
|
|
16
|
+
import { addIconFont, iconFontPlan } from './icon-font.mjs';
|
|
17
|
+
import { roundEndsLine } from './glyphs.mjs';
|
|
14
18
|
|
|
15
19
|
function remedy(state, detail, p) {
|
|
16
20
|
const saved = `${p.stage}.saved-${new Date().toISOString().slice(0, 10)}`;
|
|
@@ -72,7 +76,8 @@ const counted = (list) => {
|
|
|
72
76
|
return `${list.length} (${[...of('hook', 'hook'), ...of('agent', 'agent')].join(', ')})`;
|
|
73
77
|
};
|
|
74
78
|
|
|
75
|
-
|
|
79
|
+
// `font` carries test doubles for addIconFont.
|
|
80
|
+
export async function install({ env = process.env, flags = {}, interactive = false, ask, print = console.log, cards = null, tty = Boolean(process.stdout.isTTY), font = {} }) {
|
|
76
81
|
const p = paths(env);
|
|
77
82
|
const version = packageVersion();
|
|
78
83
|
const scope = flags.scope || 'user';
|
|
@@ -142,12 +147,15 @@ export async function install({ env = process.env, flags = {}, interactive = fal
|
|
|
142
147
|
['backups', `${p.backups} (Muse settings.json and installed.json, when present)`],
|
|
143
148
|
['receipt', p.receipt],
|
|
144
149
|
['rules file', agentFilePlan({ env, flags })],
|
|
150
|
+
...(flags.round ? [['icon font', iconFontPlan({ env, ...font })]] : []),
|
|
151
|
+
...(flags.glyphs ? [['round ends', `save ${flags.glyphs} in ${p.config}`]] : []),
|
|
145
152
|
['muse', `muse ${installArgs.join(' ')}`],
|
|
146
153
|
['approvals', `up to ${approvals.length} capabilities may need your approval in Muse (hooks and agents):`],
|
|
147
154
|
];
|
|
148
155
|
if (cards) {
|
|
149
156
|
cards.panel({
|
|
150
157
|
title: `LitMuse ${version} install plan`,
|
|
158
|
+
hints: [AGENT_LINE, AGENT_LINE_SHORT],
|
|
151
159
|
sections: [{ rows: planRows([['Host', mv], ...plan.map(([label, value]) => [label[0].toUpperCase() + label.slice(1), value]).slice(0, -1), ['Approvals', `up to ${counted(approvals)}`]]) }],
|
|
152
160
|
});
|
|
153
161
|
} else {
|
|
@@ -164,7 +172,7 @@ export async function install({ env = process.env, flags = {}, interactive = fal
|
|
|
164
172
|
}
|
|
165
173
|
if (!interactive && !flags.yes) {
|
|
166
174
|
print('');
|
|
167
|
-
print('No files written: this shell has no terminal. Rerun with --yes to install
|
|
175
|
+
print('No files written: this shell has no terminal. Rerun with --yes to install; the capabilities above then wait for approval, and the commands are printed.');
|
|
168
176
|
return 0;
|
|
169
177
|
}
|
|
170
178
|
|
|
@@ -219,7 +227,7 @@ export async function install({ env = process.env, flags = {}, interactive = fal
|
|
|
219
227
|
let states = approvalStates(muse(env, ['plugins', 'inspect', 'litmuse', '--json']).json);
|
|
220
228
|
const pending = states.filter((s) => s.status !== 'trusted_enabled');
|
|
221
229
|
const named = (s) => ` ${s.id} (${s.what})`;
|
|
222
|
-
const asksApproval = pending.length > 0 && !flags.approve && interactive && Boolean(ask);
|
|
230
|
+
const asksApproval = pending.length > 0 && !flags.approve && !flags.yes && interactive && Boolean(ask);
|
|
223
231
|
const questions = Number(asksApproval) + Number(agentFileAsks({ env, flags, interactive, ask, version }));
|
|
224
232
|
if (pending.length) {
|
|
225
233
|
let approve = Boolean(flags.approve);
|
|
@@ -266,7 +274,7 @@ export async function install({ env = process.env, flags = {}, interactive = fal
|
|
|
266
274
|
if (!cards && still.length) section(`${still.length} are still waiting:`, still.map(named));
|
|
267
275
|
else if (!cards) print('No capabilities are still waiting for approval.');
|
|
268
276
|
} else if (!cards) {
|
|
269
|
-
section('Approval needed. Run these when you are ready (or rerun install with --approve):', pending.map((s) => ` muse plugins approve ${s.id}`));
|
|
277
|
+
section(flags.yes ? 'Approval needed. The person who uses Muse runs these when ready:' : 'Approval needed. Run these when you are ready (or rerun install with --approve):', pending.map((s) => ` muse plugins approve ${s.id}`));
|
|
270
278
|
}
|
|
271
279
|
}
|
|
272
280
|
|
|
@@ -280,6 +288,25 @@ export async function install({ env = process.env, flags = {}, interactive = fal
|
|
|
280
288
|
env, flags, interactive, ask, print: cards ? rulesRow : print, version, backupDir: p.backups, tag: `LIT ${questions}/${questions}`,
|
|
281
289
|
}));
|
|
282
290
|
|
|
291
|
+
const told = (mark, label, word, value) => (cards ? cards.row(mark, label, value) : print(`${word}: ${value}`));
|
|
292
|
+
if (flags.glyphs) {
|
|
293
|
+
try {
|
|
294
|
+
written.push(writeConfig(env, { glyphs: flags.glyphs }));
|
|
295
|
+
told('done', 'Round ends', 'GLYPHS', `saved ${flags.glyphs}`);
|
|
296
|
+
} catch (e) {
|
|
297
|
+
told('fail', 'Round ends', 'GLYPHS', `not saved (${e.message})`);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
let fontWhy = null;
|
|
301
|
+
if (flags.round) {
|
|
302
|
+
const added = await addIconFont({ env, ...font });
|
|
303
|
+
written.push(...added.written);
|
|
304
|
+
if (added.status === 'failed') fontWhy = added.why;
|
|
305
|
+
const value = { here: 'an icon font is already here; nothing added', added: `added ${added.written[0]}` }[added.status] ?? `not installed (${added.why})`;
|
|
306
|
+
told(added.status === 'failed' ? 'warn' : 'done', 'Icon font', 'ICON_FONT', value);
|
|
307
|
+
}
|
|
308
|
+
const ends = roundEndsLine({ env, tty, fontWhy, platform: font.platform, iconFont: font.hasFont });
|
|
309
|
+
|
|
283
310
|
const left = states.filter((s) => s.status !== 'trusted_enabled').length;
|
|
284
311
|
// A new version (or a first install) arms the one-time notice for the next Muse session; a same-version reinstall
|
|
285
312
|
// leaves whatever the last one armed.
|
|
@@ -300,9 +327,9 @@ export async function install({ env = process.env, flags = {}, interactive = fal
|
|
|
300
327
|
plain('');
|
|
301
328
|
if (cards) {
|
|
302
329
|
const names = new Map([
|
|
303
|
-
[p.stage, 'Bundle'], [p.museInstalled, 'Muse plugin list'], [cachePath, 'Muse copy'], [p.museRules, 'Rules file'], [p.notice, 'First-run note'], [p.receipt, 'Receipt'], [p.config, 'Config'],
|
|
330
|
+
[p.stage, 'Bundle'], [p.museInstalled, 'Muse plugin list'], [cachePath, 'Muse copy'], [p.museRules, 'Rules file'], [p.notice, 'First-run note'], [p.receipt, 'Receipt'], [p.config, 'Config'], [p.iconFont, 'Icon font list'],
|
|
304
331
|
]);
|
|
305
|
-
const nameOf = (path) => names.get(path) ?? (path.startsWith(p.backups) ? 'Backup' : 'Muse settings');
|
|
332
|
+
const nameOf = (path) => names.get(path) ?? (path.startsWith(p.backups) ? 'Backup' : /SymbolsNerdFont/.test(path) ? 'Icon font' : 'Muse settings');
|
|
306
333
|
const waiting = states.filter((s) => s.status !== 'trusted_enabled');
|
|
307
334
|
cards.panel({
|
|
308
335
|
title: `LitMuse ${version} is installed`,
|
|
@@ -315,11 +342,12 @@ export async function install({ env = process.env, flags = {}, interactive = fal
|
|
|
315
342
|
] },
|
|
316
343
|
{ head: 'Next', rows: planRows([
|
|
317
344
|
...(left ? [['Approve', 'run the commands below']] : []),
|
|
345
|
+
['Restart', 'quit Muse if it is open, then start it again'],
|
|
318
346
|
['Start', 'open Muse in a project and begin a prompt with lit'], ['Check', 'npx @litfamily/litmuse doctor'],
|
|
319
347
|
]) },
|
|
320
348
|
],
|
|
321
349
|
});
|
|
322
|
-
if (left) cards.text('Approval needed. Run these when you are ready (or rerun install with --approve):', waiting.map((s) => ` muse plugins approve ${s.id}`));
|
|
350
|
+
if (left) cards.text(flags.yes ? 'Approval needed. The person who uses Muse runs these when ready:' : 'Approval needed. Run these when you are ready (or rerun install with --approve):', waiting.map((s) => ` muse plugins approve ${s.id}`));
|
|
323
351
|
}
|
|
324
352
|
// The notice and the fixed line after it are printed once per text; the live count of folders to check always is.
|
|
325
353
|
const [fixedLine, ...liveLines] = extensionLines(env);
|
|
@@ -333,11 +361,14 @@ export async function install({ env = process.env, flags = {}, interactive = fal
|
|
|
333
361
|
else for (const line of [...noticeLines, ...liveLines]) print(line);
|
|
334
362
|
recordShown(p.shown, hash);
|
|
335
363
|
}
|
|
336
|
-
if (
|
|
364
|
+
if (cards) cards.line(ends);
|
|
365
|
+
else {
|
|
337
366
|
print('');
|
|
367
|
+
print('Restart: quit Muse if it is open, then start it again, so it loads this LitMuse.');
|
|
338
368
|
print(left === 0
|
|
339
369
|
? 'Status: Ready. Start Muse in a project and begin a prompt with `lit`. Check any time with `npx @litfamily/litmuse doctor`.'
|
|
340
370
|
: `Status: installed, approval needed for ${left} capabilities. Run the commands above, then \`npx @litfamily/litmuse doctor\`.`);
|
|
371
|
+
print(ends);
|
|
341
372
|
}
|
|
342
373
|
return 0;
|
|
343
374
|
}
|
package/lib/paths.mjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { homedir } from 'node:os';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
+
import { xdgData } from './guard.mjs';
|
|
3
4
|
|
|
4
5
|
// Every location LitMuse reads or writes, resolved from one environment so tests can sandbox HOME.
|
|
5
6
|
export function paths(env = process.env) {
|
|
6
7
|
const home = env.HOME || homedir();
|
|
7
8
|
const dataHome = env.XDG_DATA_HOME || join(home, '.local', 'share');
|
|
8
9
|
const configHome = env.XDG_CONFIG_HOME || join(home, '.config');
|
|
9
|
-
|
|
10
|
+
// Our own records stay in one place whatever the working folder; Muse's own files are where Muse puts them.
|
|
11
|
+
const data = join(xdgData(env) ?? join(home, '.local', 'share'), 'litmuse');
|
|
10
12
|
return {
|
|
11
13
|
home,
|
|
12
14
|
data,
|
|
@@ -15,6 +17,7 @@ export function paths(env = process.env) {
|
|
|
15
17
|
receipt: join(data, 'receipt.json'),
|
|
16
18
|
updateCache: join(data, 'update-check.json'),
|
|
17
19
|
config: join(data, 'config.json'),
|
|
20
|
+
iconFont: join(data, 'icon-font.json'),
|
|
18
21
|
notice: join(data, 'first-session-notice.json'),
|
|
19
22
|
shown: join(data, 'shown.jsonl'),
|
|
20
23
|
museSettings: join(configHome, 'muse', 'settings.json'),
|
package/lib/safe-write.mjs
CHANGED
|
@@ -11,7 +11,7 @@ function lstatOrNull(p) {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
// The nearest existing ancestor, resolved through links, so the guard judges where bytes really land.
|
|
14
|
-
function realExistingAncestor(p) {
|
|
14
|
+
export function realExistingAncestor(p) {
|
|
15
15
|
let cur = p;
|
|
16
16
|
while (!lstatOrNull(cur) && dirname(cur) !== cur) cur = dirname(cur);
|
|
17
17
|
return realpathSync(cur);
|
package/lib/uninstall.mjs
CHANGED
|
@@ -6,8 +6,9 @@ import { assertSafeWritePath } from './guard.mjs';
|
|
|
6
6
|
import { removeAgentFile } from './agent-file.mjs';
|
|
7
7
|
import { packageVersion } from './bundle.mjs';
|
|
8
8
|
import { planRows } from './install-cards.mjs';
|
|
9
|
+
import { ownedIconFont, removeIconFont } from './icon-font.mjs';
|
|
9
10
|
|
|
10
|
-
export async function uninstall({ env = process.env, flags = {}, interactive = false, print = console.log, cards = null }) {
|
|
11
|
+
export async function uninstall({ env = process.env, flags = {}, interactive = false, print = console.log, cards = null, font: { platform } = {} }) {
|
|
11
12
|
const p = paths(env);
|
|
12
13
|
const plugin = installedPlugin(env);
|
|
13
14
|
const st = stageState(p);
|
|
@@ -16,10 +17,12 @@ export async function uninstall({ env = process.env, flags = {}, interactive = f
|
|
|
16
17
|
const bundleLine = st.state === 'owned' || discard
|
|
17
18
|
? `remove ${p.stage}${discard ? ` (discarding edits: ${st.detail})` : ''}`
|
|
18
19
|
: st.state === 'absent' ? 'absent' : `keep ${p.stage} (${st.state}: ${st.detail})`;
|
|
20
|
+
const font = ownedIconFont({ env, platform });
|
|
19
21
|
const plan = [
|
|
20
22
|
['muse plugin', pluginLine],
|
|
21
23
|
['bundle', bundleLine],
|
|
22
24
|
...(st.state === 'modified' && !discard ? [['hint', 'add --discard-modified to remove the edited bundle too']] : []),
|
|
25
|
+
...(font.remove.length ? [['icon font', `remove ${font.remove.join(', ')}`]] : []),
|
|
23
26
|
['kept', `${p.backups} and ${p.receipt}`],
|
|
24
27
|
];
|
|
25
28
|
if (cards) cards.panel({ title: 'LitMuse uninstall', sections: [{ rows: planRows(plan.map(([label, value]) => [label[0].toUpperCase() + label.slice(1), value])) }] });
|
|
@@ -52,6 +55,15 @@ export async function uninstall({ env = process.env, flags = {}, interactive = f
|
|
|
52
55
|
if (cards) cards.row('done', 'Bundle', `removed ${p.stage}`);
|
|
53
56
|
else print(`Removed ${p.stage}.`);
|
|
54
57
|
}
|
|
58
|
+
const gone = removeIconFont({ env, platform });
|
|
59
|
+
const fontLines = [
|
|
60
|
+
...(gone.remove.length ? [`removed ${gone.remove.join(', ')}; other products may draw square ends until an icon font is installed again`] : []),
|
|
61
|
+
...(gone.keep.length ? [`kept ${gone.keep.join(', ')} (the file changed, or its folder is now a link)`] : []),
|
|
62
|
+
];
|
|
63
|
+
for (const line of fontLines) {
|
|
64
|
+
if (cards) cards.row('done', 'Icon font', line);
|
|
65
|
+
else print(`Icon font: ${line}.`);
|
|
66
|
+
}
|
|
55
67
|
const rules = removeAgentFile({ env, version: packageVersion() });
|
|
56
68
|
const stays = 'Project files LitMuse sessions wrote (plans/, .litmuse/) stay in each project.';
|
|
57
69
|
if (cards) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@litfamily/litmuse",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"description": "Installer for LitMuse: skills, hooks and agents that help Meta's Muse Code plan, build, check and hand off work.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"muse",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"qa:muse-live": "node scripts/qa-muse-live.mjs",
|
|
30
30
|
"sync:digests": "node scripts/sync-hook-digests.mjs",
|
|
31
31
|
"check:digests": "node scripts/sync-hook-digests.mjs --check",
|
|
32
|
-
"sync:lock": "node scripts/sync-skills-lock.mjs"
|
|
32
|
+
"sync:lock": "node scripts/sync-skills-lock.mjs",
|
|
33
|
+
"eval:routing": "node scripts/routing-eval.mjs dev"
|
|
33
34
|
},
|
|
34
35
|
"files": [
|
|
35
36
|
"bin",
|