@litfamily/litclaude 1.0.50 → 1.0.52
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 +74 -0
- package/README.md +8 -8
- package/README_ko-KR.md +8 -8
- package/bin/extensions.mjs +602 -0
- package/bin/litclaude-ai.js +27 -3
- package/docs/assets/readme/badge-version.svg +1 -1
- package/docs/hooks.md +55 -2
- package/docs/privacy.md +1 -1
- package/package.json +1 -1
- package/plugins/litclaude/.claude-plugin/plugin.json +7 -1
- package/plugins/litclaude/bin/litclaude-hook.js +150 -16
- package/plugins/litclaude/bin/litclaude-mcp.js +1 -1
- package/plugins/litclaude/commands/start-work.md +25 -7
- package/plugins/litclaude/hooks/hooks.json +34 -0
- package/plugins/litclaude/lib/auto-handoff.mjs +115 -2
- package/plugins/litclaude/lib/canonical-skill-resources.mjs +8 -8
- package/plugins/litclaude/lib/check-back.mjs +155 -0
- package/plugins/litclaude/lib/extensions-notice.mjs +82 -5
- package/plugins/litclaude/lib/park-ping.mjs +57 -0
- package/plugins/litclaude/lib/precompact-snapshot.mjs +89 -0
- package/plugins/litclaude/lib/rewind/suggest.mjs +9 -2
- package/plugins/litclaude/lib/shown-ledger.mjs +100 -0
- package/plugins/litclaude/lib/start-work-cli.mjs +9 -0
- package/plugins/litclaude/lib/start-work-lifecycle.mjs +360 -98
- package/plugins/litclaude/skills/frontend-ui-ux/SKILL.md +25 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/SKILL.md +25 -0
- package/plugins/litclaude/skills/lit-docx/SKILL.md +25 -0
- package/plugins/litclaude/skills/lit-loop/SKILL.md +15 -0
- package/plugins/litclaude/skills/lit-pptx/SKILL.md +25 -0
- package/plugins/litclaude/skills/lit-schematic/SKILL.md +25 -0
- package/plugins/litclaude/skills/lit-scientific-visualization/SKILL.md +25 -0
- package/plugins/litclaude/skills/lit-typographic-motion/SKILL.md +25 -0
- package/plugins/litclaude/skills/litgoal/SKILL.md +17 -0
- package/plugins/litclaude/skills/readme-studio/SKILL.md +25 -0
- package/plugins/litclaude/skills/visual-qa/SKILL.md +25 -0
- package/scripts/validate-plugin.mjs +1 -1
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
// `litclaude-ai extensions <verb>`: manage the LitFamily extensions from LitClaude's own CLI. In Claude Code the
|
|
2
|
+
// extensions are plugins of the wjgoarxiv-skills marketplace, so Claude Code itself installs, updates and removes
|
|
3
|
+
// them (its plugin cache is the destination, and its installed_plugins.json record is the receipt). These verbs
|
|
4
|
+
// read that record, look for a skill of the user's own with an extension's name, and run Claude Code's own plugin
|
|
5
|
+
// commands in the order the stubs give them. Every write verb only prints its plan until `--yes` is given.
|
|
6
|
+
import { lstatSync, readFileSync, readdirSync, realpathSync, rmSync } from "node:fs";
|
|
7
|
+
import { homedir } from "node:os";
|
|
8
|
+
import { join, resolve, sep } from "node:path";
|
|
9
|
+
import { spawnSync } from "node:child_process";
|
|
10
|
+
import { shellFreeCommand } from "../plugins/litclaude/lib/npm-invocation.mjs";
|
|
11
|
+
import {
|
|
12
|
+
EXTENSION_SKILLS,
|
|
13
|
+
MARKETPLACE_LINE,
|
|
14
|
+
extensionLeftovers,
|
|
15
|
+
installLine,
|
|
16
|
+
sameNameSkills,
|
|
17
|
+
} from "../plugins/litclaude/lib/extensions-notice.mjs";
|
|
18
|
+
|
|
19
|
+
export const MARKETPLACE = "wjgoarxiv-skills";
|
|
20
|
+
export const DEFAULT_SOURCE = "wjgoarxiv/wjgoarxiv-skills";
|
|
21
|
+
export const CLI = "litclaude-ai extensions";
|
|
22
|
+
export const FAMILIES = Object.freeze([...new Set(Object.values(EXTENSION_SKILLS))]);
|
|
23
|
+
const STAMP = /^\d{8}-\d{6}$/u;
|
|
24
|
+
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
25
|
+
|
|
26
|
+
const pluginId = (family) => `${family}@${MARKETPLACE}`;
|
|
27
|
+
const idsOf = (family) => Object.keys(EXTENSION_SKILLS).filter((id) => EXTENSION_SKILLS[id] === family);
|
|
28
|
+
|
|
29
|
+
const readJson = (path) => {
|
|
30
|
+
try {
|
|
31
|
+
return JSON.parse(readFileSync(path, "utf8"));
|
|
32
|
+
} catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const lstat = (path) => {
|
|
38
|
+
try {
|
|
39
|
+
return lstatSync(path);
|
|
40
|
+
} catch {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const realDir = (path) => {
|
|
46
|
+
const value = lstat(path);
|
|
47
|
+
return Boolean(value && value.isDirectory() && !value.isSymbolicLink());
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// Bytes under a folder, without following symlinks; null when a folder inside cannot be read.
|
|
51
|
+
const folderBytes = (path) => {
|
|
52
|
+
const value = lstat(path);
|
|
53
|
+
if (!value) return 0;
|
|
54
|
+
if (!value.isDirectory() || value.isSymbolicLink()) return value.size;
|
|
55
|
+
let names;
|
|
56
|
+
try {
|
|
57
|
+
names = readdirSync(path);
|
|
58
|
+
} catch {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
let total = 0;
|
|
62
|
+
for (const name of names) {
|
|
63
|
+
const bytes = folderBytes(join(path, name));
|
|
64
|
+
if (bytes === null) return null;
|
|
65
|
+
total += bytes;
|
|
66
|
+
}
|
|
67
|
+
return total;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const sumBytes = (rows) => (rows.some((row) => row.bytes === null) ? null : rows.reduce((sum, row) => sum + row.bytes, 0));
|
|
71
|
+
|
|
72
|
+
const realpath = (path) => {
|
|
73
|
+
try {
|
|
74
|
+
return realpathSync(path);
|
|
75
|
+
} catch {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// A project-scope (or local) install belongs to the folder it was made in; it counts here only from that folder.
|
|
81
|
+
const appliesHere = (entry, cwd) => {
|
|
82
|
+
if (entry.scope === "user" || !entry.projectPath) return true;
|
|
83
|
+
const project = realpath(entry.projectPath);
|
|
84
|
+
const here = realpath(cwd);
|
|
85
|
+
return Boolean(project && here && (here === project || here.startsWith(`${project}${sep}`)));
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const formatBytes = (bytes) => {
|
|
89
|
+
if (bytes === null) return "size unknown";
|
|
90
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
91
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KiB`;
|
|
92
|
+
return `${(bytes / 1024 / 1024).toFixed(1)} MiB`;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const describeSource = (record) => {
|
|
96
|
+
const source = record?.source ?? {};
|
|
97
|
+
if (source.source === "directory" || source.source === "file") return { text: source.path, path: source.path };
|
|
98
|
+
if (source.source === "github") return { text: `github ${source.repo}` };
|
|
99
|
+
if (source.source === "git" || source.source === "url") return { text: source.url };
|
|
100
|
+
return { text: JSON.stringify(source) };
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/** Everything the verbs read: the host's marketplace and plugin records, same-name skills and backups. */
|
|
104
|
+
export const readExtensionsState = ({ claudeHome, cwd, home = homedir() }) => {
|
|
105
|
+
const known = readJson(join(claudeHome, "plugins", "known_marketplaces.json")) ?? {};
|
|
106
|
+
const registry = readJson(join(claudeHome, "plugins", "installed_plugins.json"))?.plugins ?? {};
|
|
107
|
+
const record = known[MARKETPLACE];
|
|
108
|
+
let marketplace = null;
|
|
109
|
+
if (record) {
|
|
110
|
+
const source = describeSource(record);
|
|
111
|
+
marketplace = { source: source.text, path: source.path ?? null, missing: Boolean(source.path) && !lstat(source.path) };
|
|
112
|
+
}
|
|
113
|
+
const installed = {};
|
|
114
|
+
for (const family of FAMILIES) {
|
|
115
|
+
const entries = registry[pluginId(family)];
|
|
116
|
+
if (Array.isArray(entries) && entries.length > 0) {
|
|
117
|
+
installed[family] = entries.map((entry) => ({
|
|
118
|
+
scope: entry.scope ?? "user",
|
|
119
|
+
version: entry.version ?? "unknown",
|
|
120
|
+
installedAt: entry.installedAt ?? null,
|
|
121
|
+
installPath: entry.installPath ?? null,
|
|
122
|
+
projectPath: entry.projectPath ?? null,
|
|
123
|
+
missing: typeof entry.installPath === "string" && !lstat(entry.installPath),
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const sameName = sameNameSkills({ claudeHome, cwd, home });
|
|
128
|
+
const extensions = Object.entries(EXTENSION_SKILLS).map(([id, family]) => {
|
|
129
|
+
const install = installed[family] ?? [];
|
|
130
|
+
const others = sameName.filter((row) => row.id === id);
|
|
131
|
+
const state = install.length > 0 ? (others.length > 0 ? "competing" : "installed") : others.length > 0 ? "user-managed" : "not installed";
|
|
132
|
+
return { id, plugin: family, state, install, others };
|
|
133
|
+
});
|
|
134
|
+
return { marketplace, installed, extensions, sameName, backups: listBackups({ claudeHome, cwd }) };
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// When a backup was made, from its `YYYYmmdd-HHMMSS` name (local time, as `date` wrote it).
|
|
138
|
+
const stampTime = (name) => {
|
|
139
|
+
const [, y, mo, d, h, mi, s] = name.match(/^(\d{4})(\d\d)(\d\d)-(\d\d)(\d\d)(\d\d)$/u).map(Number);
|
|
140
|
+
return new Date(y, mo - 1, d, h, mi, s).getTime();
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
// The backups folder of a base (`<claude home>` or `<project>/.claude`): a real folder that sits directly in the
|
|
144
|
+
// base, reached through no symlink below it. Returns its real path, or null.
|
|
145
|
+
const backupsParent = (base, { baseMayBeLink }) => {
|
|
146
|
+
const parent = join(base, "extension-backups");
|
|
147
|
+
if (!realDir(parent) || (!baseMayBeLink && !realDir(base))) return null;
|
|
148
|
+
const realBase = realpath(base);
|
|
149
|
+
const realParent = realpath(parent);
|
|
150
|
+
return realBase && realParent === join(realBase, "extension-backups") ? realParent : null;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/** Dated backup folders under `<claude home>/extension-backups` and `<project>/.claude/extension-backups`. */
|
|
154
|
+
export const listBackups = ({ claudeHome, cwd, now = Date.now() }) => {
|
|
155
|
+
// The Claude home may itself be a symlink (dotfile setups); a project `.claude` may not.
|
|
156
|
+
const bases = [[claudeHome, true]];
|
|
157
|
+
if (cwd) bases.push([join(cwd, ".claude"), false]);
|
|
158
|
+
const rows = [];
|
|
159
|
+
const seen = new Set();
|
|
160
|
+
for (const [base, baseMayBeLink] of bases) {
|
|
161
|
+
const shown = join(base, "extension-backups");
|
|
162
|
+
if (!lstat(shown)) continue;
|
|
163
|
+
const parent = backupsParent(base, { baseMayBeLink });
|
|
164
|
+
if (!parent) {
|
|
165
|
+
if (seen.has(realpath(shown))) continue;
|
|
166
|
+
rows.push({ path: shown, name: "extension-backups", dated: false, linked: true, bytes: 0, contents: [] });
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
if (seen.has(parent)) continue;
|
|
170
|
+
seen.add(parent);
|
|
171
|
+
let names = [];
|
|
172
|
+
try {
|
|
173
|
+
names = readdirSync(shown).sort();
|
|
174
|
+
} catch {
|
|
175
|
+
rows.push({ path: shown, name: "extension-backups", dated: false, unreadable: true, bytes: 0, contents: [] });
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
for (const name of names) {
|
|
179
|
+
const path = join(shown, name);
|
|
180
|
+
const value = lstat(path);
|
|
181
|
+
const dated = STAMP.test(name) && Boolean(value?.isDirectory()) && !value.isSymbolicLink();
|
|
182
|
+
let contents = [];
|
|
183
|
+
if (dated) {
|
|
184
|
+
try {
|
|
185
|
+
contents = readdirSync(path);
|
|
186
|
+
} catch {
|
|
187
|
+
contents = [];
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
const ageDays = dated ? Math.floor((now - stampTime(name)) / DAY_MS) : null;
|
|
191
|
+
rows.push({ path, parent, name, dated, bytes: dated ? folderBytes(path) : 0, ageDays, contents });
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return rows;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
/** What `check` reports: problems that need action (each with its fix line) and notes that do not. */
|
|
198
|
+
export const checkExtensions = ({ claudeHome, cwd, home = homedir(), litHome, cacheHome, currentVersion }) => {
|
|
199
|
+
const state = readExtensionsState({ claudeHome, cwd, home });
|
|
200
|
+
const problems = [];
|
|
201
|
+
for (const row of state.sameName) {
|
|
202
|
+
const installed = Boolean(state.installed[row.plugin]);
|
|
203
|
+
problems.push({
|
|
204
|
+
kind: installed ? "competing" : "user-managed",
|
|
205
|
+
text: installed
|
|
206
|
+
? `${row.shown} competes with ${row.plugin}:${row.id}; Claude Code loads both`
|
|
207
|
+
: `${row.shown} is a skill of your own with the name of an extension; it would compete with ${row.plugin}:${row.id}`,
|
|
208
|
+
fix: row.move,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
if (state.marketplace?.missing) {
|
|
212
|
+
problems.push({
|
|
213
|
+
kind: "source-missing",
|
|
214
|
+
text: `the ${MARKETPLACE} marketplace points at ${state.marketplace.path}, which no longer exists`,
|
|
215
|
+
fix: MARKETPLACE_LINE,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
for (const [family, entries] of Object.entries(state.installed)) {
|
|
219
|
+
for (const entry of entries.filter((item) => item.missing)) {
|
|
220
|
+
problems.push({
|
|
221
|
+
kind: "install-missing",
|
|
222
|
+
text: `${pluginId(family)} is recorded at ${entry.installPath}, which no longer exists`,
|
|
223
|
+
fix: `claude plugin uninstall ${pluginId(family)} && ${installLine(family)}`,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
const notes = [];
|
|
228
|
+
const dated = state.backups.filter((row) => row.dated);
|
|
229
|
+
if (dated.length > 0) {
|
|
230
|
+
const bytes = sumBytes(dated);
|
|
231
|
+
notes.push({ text: `${dated.length} backup folder(s) in extension-backups, ${formatBytes(bytes)}`, fix: `${CLI} prune-backups` });
|
|
232
|
+
}
|
|
233
|
+
if (litHome && cacheHome && currentVersion) {
|
|
234
|
+
for (const row of extensionLeftovers({ claudeHome, litHome, cacheHome, currentVersion, home })) {
|
|
235
|
+
notes.push({ text: `left by an older LitClaude: ${row}` });
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return { ...state, problems, notes };
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
const VERBS = new Set(["list", "check", "install", "update", "remove", "prune-backups"]);
|
|
242
|
+
|
|
243
|
+
const usageText = `Usage: ${CLI} <list|check|install|update|remove|prune-backups> [...]
|
|
244
|
+
list [--json] each extension: installed, not installed, or a skill of your own
|
|
245
|
+
check [--json] what needs action, with the line that fixes it (exit 1 when something does)
|
|
246
|
+
install <id|plugin...|--all> add the shelf if needed, then claude plugin install
|
|
247
|
+
update [<id|plugin...>|--all] refresh the shelf, then claude plugin update each installed plugin
|
|
248
|
+
remove <id|plugin...> claude plugin uninstall; never touches a skill folder of your own
|
|
249
|
+
prune-backups [--older-than <days>] list dated backups in extension-backups; delete them with --yes
|
|
250
|
+
Write verbs only print their plan; add --yes to run it. --from <path> uses a local wjgoarxiv-skills clone,
|
|
251
|
+
and --allow-shadow lets install go on beside a same-name skill of your own (with a warning).
|
|
252
|
+
`;
|
|
253
|
+
|
|
254
|
+
export const parseExtensionsArgs = (args) => {
|
|
255
|
+
const options = { verb: args[0], targets: [], all: false, yes: false, dryRun: false, json: false, from: null, allowShadow: false, olderThan: null };
|
|
256
|
+
for (let index = 1; index < args.length; index += 1) {
|
|
257
|
+
const arg = args[index];
|
|
258
|
+
const value = () => {
|
|
259
|
+
const next = args[index + 1];
|
|
260
|
+
if (next === undefined || next.startsWith("--")) throw new Error(`${arg} needs a value`);
|
|
261
|
+
index += 1;
|
|
262
|
+
return next;
|
|
263
|
+
};
|
|
264
|
+
if (arg === "--yes" || arg === "-y") options.yes = true;
|
|
265
|
+
else if (arg === "--dry-run" || arg === "--dry-run=true") options.dryRun = true;
|
|
266
|
+
else if (arg === "--json") options.json = true;
|
|
267
|
+
else if (arg === "--all") options.all = true;
|
|
268
|
+
else if (arg === "--allow-shadow") options.allowShadow = true;
|
|
269
|
+
else if (arg === "--from") options.from = value();
|
|
270
|
+
else if (arg === "--family") options.targets.push(value());
|
|
271
|
+
else if (arg === "--older-than") {
|
|
272
|
+
const days = Number(value());
|
|
273
|
+
if (!Number.isInteger(days) || days < 0) throw new Error("--older-than takes a whole number of days");
|
|
274
|
+
options.olderThan = days;
|
|
275
|
+
} else if (arg.startsWith("-")) throw new Error(`Unknown extensions option: ${arg}`);
|
|
276
|
+
else options.targets.push(arg);
|
|
277
|
+
}
|
|
278
|
+
// A dry run asked for anywhere wins over --yes, whatever the order.
|
|
279
|
+
if (options.dryRun) options.yes = false;
|
|
280
|
+
return options;
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
/** Plugins named by extension ids or plugin names; an unknown name is an error. */
|
|
284
|
+
export const resolveFamilies = (targets) => {
|
|
285
|
+
const families = [];
|
|
286
|
+
for (const target of targets) {
|
|
287
|
+
const family = FAMILIES.includes(target) ? target : EXTENSION_SKILLS[target];
|
|
288
|
+
if (!family) throw new Error(`Unknown extension: ${target}. Extensions: ${Object.keys(EXTENSION_SKILLS).join(", ")}; plugins: ${FAMILIES.join(", ")}`);
|
|
289
|
+
if (!families.includes(family)) families.push(family);
|
|
290
|
+
}
|
|
291
|
+
return families;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
const runHost = (args, { env, cwd }) => {
|
|
295
|
+
const invocation = shellFreeCommand("claude", args, { env });
|
|
296
|
+
const result = spawnSync(invocation.command, invocation.args, { encoding: "utf8", env, cwd, stdio: ["ignore", "pipe", "pipe"] });
|
|
297
|
+
return { status: result.error ? null : result.status, output: `${result.stdout ?? ""}${result.stderr ?? ""}`.trim(), error: result.error };
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
const hostAvailable = (context) => {
|
|
301
|
+
const result = runHost(["--version"], context);
|
|
302
|
+
return !result.error && result.status === 0;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
const gitAvailable = ({ env }) => !spawnSync("git", ["--version"], { env, stdio: "ignore" }).error;
|
|
306
|
+
|
|
307
|
+
const fromHint = (verb = "install") => `Without network access, point the shelf at a local clone instead: ${CLI} ${verb}${verb === "install" ? " <plugin>" : ""} --from <path to a wjgoarxiv-skills clone>`;
|
|
308
|
+
|
|
309
|
+
// The marketplace step: `--from` (re)points the shelf at a local clone; otherwise the public shelf is added once.
|
|
310
|
+
const planMarketplace = (state, options, out) => {
|
|
311
|
+
if (options.from) {
|
|
312
|
+
const path = resolve(options.from);
|
|
313
|
+
const catalog = readJson(join(path, ".claude-plugin", "marketplace.json"));
|
|
314
|
+
if (catalog?.name !== MARKETPLACE) {
|
|
315
|
+
return { error: `--from ${path} is not a ${MARKETPLACE} clone (no .claude-plugin/marketplace.json named ${MARKETPLACE})` };
|
|
316
|
+
}
|
|
317
|
+
if (state.marketplace?.path && resolve(state.marketplace.path) === path) return { steps: [] };
|
|
318
|
+
if (state.marketplace) out.push(` The ${MARKETPLACE} marketplace now reads from ${state.marketplace.source}; this points it at ${path}.`);
|
|
319
|
+
return { steps: [["plugin", "marketplace", "add", path]] };
|
|
320
|
+
}
|
|
321
|
+
if (state.marketplace?.missing) {
|
|
322
|
+
return { error: `The ${MARKETPLACE} marketplace points at ${state.marketplace.path}, which no longer exists.\n${fromHint(options.verb)}` };
|
|
323
|
+
}
|
|
324
|
+
if (state.marketplace) return { steps: [] };
|
|
325
|
+
return { steps: [["plugin", "marketplace", "add", DEFAULT_SOURCE]], needsGit: true };
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
const shownLine = (args) => `claude ${args.map((arg) => (/^[\w@./:=+-]+$/u.test(arg) ? arg : `'${arg.replaceAll("'", "'\\''")}'`)).join(" ")}`;
|
|
329
|
+
|
|
330
|
+
const runSteps = (steps, context, write) => {
|
|
331
|
+
for (const step of steps) {
|
|
332
|
+
write(` running: ${shownLine(step)}`);
|
|
333
|
+
const result = runHost(step, context);
|
|
334
|
+
if (result.status !== 0) {
|
|
335
|
+
if (result.output) write(result.output.split("\n").map((line) => ` ${line}`).join("\n"));
|
|
336
|
+
return { failed: step, output: result.output };
|
|
337
|
+
}
|
|
338
|
+
if (result.output) write(` ${result.output.split("\n").filter(Boolean).at(-1)}`);
|
|
339
|
+
}
|
|
340
|
+
return { failed: null };
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
const listLines = (state) => {
|
|
344
|
+
const lines = [
|
|
345
|
+
"LitFamily extensions (Claude Code plugins from the wjgoarxiv-skills marketplace)",
|
|
346
|
+
` Marketplace: ${state.marketplace ? `${MARKETPLACE} from ${state.marketplace.source}${state.marketplace.missing ? " (missing)" : ""}` : "not added"}`,
|
|
347
|
+
];
|
|
348
|
+
for (const row of state.extensions) {
|
|
349
|
+
const head = ` ${row.id.padEnd(30)} ${row.plugin.padEnd(13)}`;
|
|
350
|
+
if (row.install.length === 0) lines.push(`${head}${row.state === "user-managed" ? "not installed; a skill of your own has this name" : "not installed"}`);
|
|
351
|
+
for (const entry of row.install) {
|
|
352
|
+
lines.push(`${head}installed ${entry.version} (${entry.scope}${entry.installedAt ? `, ${entry.installedAt.slice(0, 10)}` : ""})${entry.missing ? " - its folder is gone" : ""}`);
|
|
353
|
+
}
|
|
354
|
+
for (const other of row.others) lines.push(`${" ".repeat(47)}${row.state === "competing" ? "competes with" : "your own skill:"} ${other.shown} (${other.scope})`);
|
|
355
|
+
}
|
|
356
|
+
return lines;
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
export const runExtensionsCli = (args, {
|
|
360
|
+
env = process.env, cwd = process.cwd(), claudeHome, litHome, cacheHome, currentVersion,
|
|
361
|
+
stdout = process.stdout, stderr = process.stderr,
|
|
362
|
+
} = {}) => {
|
|
363
|
+
const home = env.HOME || homedir();
|
|
364
|
+
const write = (line = "") => stdout.write(`${line}\n`);
|
|
365
|
+
const warn = (line) => stderr.write(`${line}\n`);
|
|
366
|
+
let options;
|
|
367
|
+
try {
|
|
368
|
+
options = parseExtensionsArgs(args);
|
|
369
|
+
} catch (error) {
|
|
370
|
+
warn(error.message);
|
|
371
|
+
return 64;
|
|
372
|
+
}
|
|
373
|
+
if (!VERBS.has(options.verb)) {
|
|
374
|
+
if (options.verb && !["help", "--help", "-h"].includes(options.verb)) warn(`Unknown extensions verb: ${options.verb}`);
|
|
375
|
+
stdout.write(usageText);
|
|
376
|
+
return options.verb && !["help", "--help", "-h"].includes(options.verb) ? 64 : 0;
|
|
377
|
+
}
|
|
378
|
+
const context = { env, cwd };
|
|
379
|
+
|
|
380
|
+
if (options.verb === "list") {
|
|
381
|
+
const state = readExtensionsState({ claudeHome, cwd, home });
|
|
382
|
+
if (options.json) {
|
|
383
|
+
write(JSON.stringify({ marketplace: state.marketplace, extensions: state.extensions.map(({ others, ...row }) => ({ ...row, others: others.map(({ scope, path, move }) => ({ scope, path, move })) })) }, null, 2));
|
|
384
|
+
} else {
|
|
385
|
+
for (const line of listLines(state)) write(line);
|
|
386
|
+
write(` Change them with: ${CLI} install|update|remove <plugin> (prints its plan; --yes runs it)`);
|
|
387
|
+
}
|
|
388
|
+
return 0;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
if (options.verb === "check") {
|
|
392
|
+
const result = checkExtensions({ claudeHome, cwd, home, litHome, cacheHome, currentVersion });
|
|
393
|
+
if (options.json) {
|
|
394
|
+
write(JSON.stringify({ ok: result.problems.length === 0, problems: result.problems, notes: result.notes }, null, 2));
|
|
395
|
+
return result.problems.length === 0 ? 0 : 1;
|
|
396
|
+
}
|
|
397
|
+
write("LitFamily extensions check");
|
|
398
|
+
if (result.problems.length === 0) write(" Nothing needs action.");
|
|
399
|
+
for (const problem of result.problems) {
|
|
400
|
+
write(` NEEDS ACTION: ${problem.text}`);
|
|
401
|
+
write(` fix: ${problem.fix}`);
|
|
402
|
+
}
|
|
403
|
+
for (const note of result.notes) write(` note: ${note.text}${note.fix ? ` (${note.fix})` : ""}`);
|
|
404
|
+
return result.problems.length === 0 ? 0 : 1;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
if (options.verb === "prune-backups") {
|
|
408
|
+
const rows = listBackups({ claudeHome, cwd });
|
|
409
|
+
const chosen = rows.filter((row) => row.dated && (options.olderThan === null || row.ageDays >= options.olderThan));
|
|
410
|
+
write(`LitFamily extension backups${options.olderThan === null ? "" : ` older than ${options.olderThan} day(s)`}`);
|
|
411
|
+
if (rows.length === 0) write(" No backups.");
|
|
412
|
+
for (const row of rows) {
|
|
413
|
+
if (row.linked) write(` left alone (reached through a symlink): ${row.path}`);
|
|
414
|
+
else if (row.unreadable) write(` left alone (cannot be read): ${row.path}`);
|
|
415
|
+
else if (!row.dated) write(` left alone (not a dated backup folder): ${row.path}`);
|
|
416
|
+
else write(` ${chosen.includes(row) ? "" : "kept (newer): "}${row.path} ${formatBytes(row.bytes)}, ${row.ageDays} day(s) old${row.contents.length ? `, holds ${row.contents.join(", ")}` : ""}`);
|
|
417
|
+
}
|
|
418
|
+
const bytes = sumBytes(chosen);
|
|
419
|
+
if (chosen.length === 0) return 0;
|
|
420
|
+
if (!options.yes) {
|
|
421
|
+
write(` Would delete ${chosen.length} folder(s), ${formatBytes(bytes)}. Nothing changed; add --yes to delete them.`);
|
|
422
|
+
return 0;
|
|
423
|
+
}
|
|
424
|
+
let failed = false;
|
|
425
|
+
for (const row of chosen) {
|
|
426
|
+
// Look again right before deleting: still a real folder directly inside the vetted extension-backups folder.
|
|
427
|
+
if (!realDir(row.path) || realpath(row.path) !== join(row.parent, row.name)) continue;
|
|
428
|
+
try {
|
|
429
|
+
rmSync(row.path, { recursive: true, force: false });
|
|
430
|
+
write(` deleted ${row.path}`);
|
|
431
|
+
} catch (error) {
|
|
432
|
+
warn(` could not delete ${row.path}: ${error.code ?? error.message}`);
|
|
433
|
+
failed = true;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
if (failed) return 1;
|
|
437
|
+
write(` Freed ${formatBytes(bytes)}.`);
|
|
438
|
+
return 0;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
let families;
|
|
442
|
+
try {
|
|
443
|
+
families = resolveFamilies(options.targets);
|
|
444
|
+
} catch (error) {
|
|
445
|
+
warn(error.message);
|
|
446
|
+
return 64;
|
|
447
|
+
}
|
|
448
|
+
const state = readExtensionsState({ claudeHome, cwd, home });
|
|
449
|
+
if (options.all) families = options.verb === "install" ? [...FAMILIES] : Object.keys(state.installed);
|
|
450
|
+
if (options.verb === "update" && families.length === 0 && options.targets.length === 0) families = Object.keys(state.installed);
|
|
451
|
+
if (families.length === 0) {
|
|
452
|
+
if (options.verb === "update") {
|
|
453
|
+
write("No LitFamily extension is installed, so there is nothing to update.");
|
|
454
|
+
return 0;
|
|
455
|
+
}
|
|
456
|
+
warn(`Name what to ${options.verb}: an extension id or a plugin (${FAMILIES.join(", ")})${options.verb === "install" ? ", or --all" : ""}.`);
|
|
457
|
+
return 64;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
const plan = [];
|
|
461
|
+
const notes = [];
|
|
462
|
+
|
|
463
|
+
if (options.verb === "remove") {
|
|
464
|
+
let refused = false;
|
|
465
|
+
for (const family of families) {
|
|
466
|
+
const recorded = state.installed[family] ?? [];
|
|
467
|
+
const entries = recorded.filter((entry) => appliesHere(entry, cwd));
|
|
468
|
+
for (const entry of recorded.filter((item) => !appliesHere(item, cwd))) {
|
|
469
|
+
notes.push(` ${pluginId(family)} is installed for ${entry.projectPath} (${entry.scope} scope); run remove from that folder.`);
|
|
470
|
+
}
|
|
471
|
+
const own = state.sameName.filter((row) => row.plugin === family && options.targets.some((target) => target === row.id || target === family));
|
|
472
|
+
for (const row of own) {
|
|
473
|
+
// Refused only when nothing else was asked of this plugin; beside an uninstall it is a note.
|
|
474
|
+
if (entries.length === 0) {
|
|
475
|
+
warn(`Refused: ${row.shown} is a skill of your own, not a plugin LitClaude or Claude Code installed; it stays where it is.`);
|
|
476
|
+
refused = true;
|
|
477
|
+
} else notes.push(` ${row.shown} is a skill of your own; it stays where it is.`);
|
|
478
|
+
}
|
|
479
|
+
if (entries.length === 0) {
|
|
480
|
+
if (own.length === 0 && recorded.length === 0) notes.push(` ${pluginId(family)} is not installed.`);
|
|
481
|
+
continue;
|
|
482
|
+
}
|
|
483
|
+
for (const entry of entries) {
|
|
484
|
+
plan.push(entry.scope === "user" ? ["plugin", "uninstall", pluginId(family)] : ["plugin", "uninstall", pluginId(family), "--scope", entry.scope]);
|
|
485
|
+
}
|
|
486
|
+
const siblings = idsOf(family);
|
|
487
|
+
if (siblings.length > 1) notes.push(` ${pluginId(family)} carries ${siblings.join(", ")}; removing it removes all of them.`);
|
|
488
|
+
}
|
|
489
|
+
return finish({ verb: "remove", plan, notes, options, context, write, warn, claudeHome, cwd, home, families, exitOnRefuse: refused });
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
// install and update both start at the shelf.
|
|
493
|
+
const blockers = state.sameName.filter((row) => families.includes(row.plugin));
|
|
494
|
+
if (blockers.length > 0 && options.verb === "install") {
|
|
495
|
+
const lines = blockers.flatMap((row) => [` ${row.shown} would compete with ${row.plugin}:${row.id}`, ` ${row.move}`]);
|
|
496
|
+
if (!options.allowShadow) {
|
|
497
|
+
warn("Stopped: a skill of your own has the name of an extension, and Claude Code would load both.");
|
|
498
|
+
warn("Move it whole into a dated folder Claude Code does not read, then run this again (or add --allow-shadow to keep both):");
|
|
499
|
+
for (const line of lines) warn(line);
|
|
500
|
+
return 1;
|
|
501
|
+
}
|
|
502
|
+
warn("Warning: these skills of your own will load beside the extension and compete with it (--allow-shadow):");
|
|
503
|
+
for (const line of lines) warn(line);
|
|
504
|
+
} else if (blockers.length > 0) {
|
|
505
|
+
warn(`Note: ${blockers.map((row) => row.shown).join(", ")} still competes with the extension; see ${CLI} check.`);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
if (options.verb === "update" && !state.marketplace && !options.from) {
|
|
509
|
+
warn(`The ${MARKETPLACE} marketplace is not added, so nothing can be updated. Install first: ${CLI} install <plugin>`);
|
|
510
|
+
return 1;
|
|
511
|
+
}
|
|
512
|
+
const shelf = planMarketplace(state, options, notes);
|
|
513
|
+
if (shelf.error) {
|
|
514
|
+
warn(shelf.error);
|
|
515
|
+
return 1;
|
|
516
|
+
}
|
|
517
|
+
if (shelf.needsGit && !gitAvailable(context)) {
|
|
518
|
+
warn(`git is not installed, and Claude Code needs it to fetch the ${MARKETPLACE} marketplace from GitHub.\n${fromHint(options.verb)}`);
|
|
519
|
+
return 1;
|
|
520
|
+
}
|
|
521
|
+
plan.push(...shelf.steps);
|
|
522
|
+
|
|
523
|
+
if (options.verb === "install") {
|
|
524
|
+
for (const family of families) {
|
|
525
|
+
const recorded = state.installed[family] ?? [];
|
|
526
|
+
const here = recorded.find((entry) => appliesHere(entry, cwd));
|
|
527
|
+
if (here) notes.push(` ${pluginId(family)} is already installed (${here.version}); use ${CLI} update.`);
|
|
528
|
+
else {
|
|
529
|
+
for (const entry of recorded) notes.push(` ${pluginId(family)} is installed only for ${entry.projectPath} (${entry.scope} scope); this installs it for you.`);
|
|
530
|
+
plan.push(["plugin", "install", pluginId(family)]);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
} else {
|
|
534
|
+
if (shelf.steps.length === 0) plan.push(["plugin", "marketplace", "update", MARKETPLACE]);
|
|
535
|
+
for (const family of families) {
|
|
536
|
+
if (!state.installed[family]) notes.push(` ${pluginId(family)} is not installed; use ${CLI} install ${family}.`);
|
|
537
|
+
else plan.push(["plugin", "update", pluginId(family)]);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
return finish({ verb: options.verb, plan, notes, options, context, write, warn, claudeHome, cwd, home, families, before: state, shelfStep: shelf.steps.length > 0 });
|
|
541
|
+
};
|
|
542
|
+
|
|
543
|
+
function finish({ verb, plan, notes, options, context, write, warn, claudeHome, cwd, home, families, before, shelfStep, exitOnRefuse = false }) {
|
|
544
|
+
write(`LitFamily extensions ${verb}`);
|
|
545
|
+
for (const note of notes) write(note);
|
|
546
|
+
const pluginSteps = plan.filter((step) => step[1] !== "marketplace");
|
|
547
|
+
if (pluginSteps.length === 0) {
|
|
548
|
+
write(" Nothing to run.");
|
|
549
|
+
return exitOnRefuse ? 1 : 0;
|
|
550
|
+
}
|
|
551
|
+
if (!options.yes) {
|
|
552
|
+
write(" Would run, in this order:");
|
|
553
|
+
for (const step of plan) write(` ${shownLine(step)}`);
|
|
554
|
+
write(" Nothing changed. Add --yes to run these.");
|
|
555
|
+
return exitOnRefuse ? 1 : 0;
|
|
556
|
+
}
|
|
557
|
+
if (!hostAvailable(context)) {
|
|
558
|
+
warn("Claude Code (`claude`) is not on PATH, so LitClaude cannot run its plugin commands. Nothing changed.");
|
|
559
|
+
return 1;
|
|
560
|
+
}
|
|
561
|
+
const result = runSteps(plan, context, write);
|
|
562
|
+
if (result.failed) {
|
|
563
|
+
const shelfFailed = result.failed[1] === "marketplace";
|
|
564
|
+
warn(`Stopped: \`${shownLine(result.failed)}\` failed${shelfFailed ? ", so no plugin was installed or updated" : ""}.`);
|
|
565
|
+
if (shelfFailed && !options.from) warn(fromHint(verb));
|
|
566
|
+
return 1;
|
|
567
|
+
}
|
|
568
|
+
const after = readExtensionsState({ claudeHome, cwd, home });
|
|
569
|
+
let changed = verb === "install";
|
|
570
|
+
for (const family of families) {
|
|
571
|
+
if (!plan.some((step) => step[2] === pluginId(family))) continue;
|
|
572
|
+
const now = after.installed[family]?.find((entry) => appliesHere(entry, cwd));
|
|
573
|
+
if (verb === "remove") write(now ? ` ${pluginId(family)} is still recorded; see claude plugin list.` : ` removed ${pluginId(family)}`);
|
|
574
|
+
else if (verb === "install") {
|
|
575
|
+
if (now) write(` installed ${pluginId(family)} ${now.version}`);
|
|
576
|
+
} else if (now) {
|
|
577
|
+
const was = before.installed[family]?.[0]?.version;
|
|
578
|
+
if (was !== now.version) changed = true;
|
|
579
|
+
write(was && was !== now.version ? ` updated ${pluginId(family)} ${was} -> ${now.version}` : ` current ${pluginId(family)} ${now.version}`);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
if (changed) write(" The change loads after /reload-plugins or in a new session.");
|
|
583
|
+
if (shelfStep && verb === "update") write(` The shelf now reads from ${after.marketplace?.source}.`);
|
|
584
|
+
return exitOnRefuse ? 1 : 0;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
/** One doctor line: what is installed and whether `check` finds anything. */
|
|
588
|
+
export const extensionsDoctorLine = (input) => {
|
|
589
|
+
let result;
|
|
590
|
+
try {
|
|
591
|
+
result = checkExtensions(input);
|
|
592
|
+
} catch (error) {
|
|
593
|
+
return `EXTENSIONS: could not be read (${error.code ?? error.message}); run ${CLI} check`;
|
|
594
|
+
}
|
|
595
|
+
const installed = Object.keys(result.installed);
|
|
596
|
+
const head = `EXTENSIONS: ${installed.length === 0 ? "none installed" : `installed ${installed.join(", ")}`}`;
|
|
597
|
+
return result.problems.length === 0
|
|
598
|
+
? `${head}; nothing needs action (${CLI} list)`
|
|
599
|
+
: `${head}; ${result.problems.length} need(s) action - run ${CLI} check`;
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
export { usageText as extensionsUsage };
|
package/bin/litclaude-ai.js
CHANGED
|
@@ -52,7 +52,8 @@ import {
|
|
|
52
52
|
writeAttributionMode,
|
|
53
53
|
} from "../plugins/litclaude/lib/agent-file/attribution.mjs";
|
|
54
54
|
import { officialBuildLines } from "../plugins/litclaude/lib/official-build.mjs";
|
|
55
|
-
import { extensionLeftovers, extensionsNoticeLines } from "../plugins/litclaude/lib/extensions-notice.mjs";
|
|
55
|
+
import { extensionLeftovers, extensionsNoticeLines, sameNameSkills } from "../plugins/litclaude/lib/extensions-notice.mjs";
|
|
56
|
+
import { extensionsDoctorLine, runExtensionsCli } from "./extensions.mjs";
|
|
56
57
|
import { verifyBundledSkillsIntegrity } from "../plugins/litclaude/lib/bundled-skills-integrity.mjs";
|
|
57
58
|
import { verifyCanonicalRuntimeClosures } from "../plugins/litclaude/lib/canonical-runtime-closures.mjs";
|
|
58
59
|
import { verifyCanonicalSkillResources } from "../plugins/litclaude/lib/skill-resource-integrity.mjs";
|
|
@@ -87,7 +88,7 @@ const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
|
87
88
|
const packageJson = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
|
|
88
89
|
const version = packageJson.version;
|
|
89
90
|
|
|
90
|
-
const usage = `Usage: litclaude-ai [--dry-run] <install|doctor|config|invite|path|run|update|uninstall|agent-file|litgoal|wikify|workflow-check|workflow-stage|rewind|start-work|start-work-next|public-read> [...args]
|
|
91
|
+
const usage = `Usage: litclaude-ai [--dry-run] <install|doctor|config|invite|path|run|update|uninstall|extensions|agent-file|litgoal|wikify|workflow-check|workflow-stage|rewind|start-work|start-work-next|public-read> [...args]
|
|
91
92
|
litclaude-ai --version
|
|
92
93
|
|
|
93
94
|
Commands:
|
|
@@ -127,6 +128,14 @@ Commands:
|
|
|
127
128
|
public-read Read a public http(s) source with FetchAttempt/FetchVerdict JSON.
|
|
128
129
|
update Reinstall this package version and refresh the Claude plugin registry.
|
|
129
130
|
uninstall Remove LitClaude-managed install state.
|
|
131
|
+
extensions <list|check|install|update|remove|prune-backups>
|
|
132
|
+
Manage the LitFamily extensions (decks, documents, figures, design,
|
|
133
|
+
video-covers) through Claude Code's own plugin commands. list and
|
|
134
|
+
check only read; install, update and remove print the claude
|
|
135
|
+
plugin lines they would run and run them with --yes. install stops
|
|
136
|
+
at a skill of your own with an extension's name and prints the line
|
|
137
|
+
that moves it aside. --from <path> uses a local wjgoarxiv-skills
|
|
138
|
+
clone. \`litclaude-ai extensions --help\` shows every option.
|
|
130
139
|
|
|
131
140
|
Public read options:
|
|
132
141
|
--json Emit a machine-readable JSON result.
|
|
@@ -1672,11 +1681,21 @@ const install = async ({ dryRun, rest }) => {
|
|
|
1672
1681
|
cacheHome: process.env.XDG_CACHE_HOME || join(homedir(), ".cache"),
|
|
1673
1682
|
currentVersion: version,
|
|
1674
1683
|
});
|
|
1675
|
-
|
|
1684
|
+
const sameName = sameNameSkills({ claudeHome: home, cwd: process.cwd() });
|
|
1685
|
+
process.stdout.write(`\n${extensionsNoticeLines({ leftovers, sameName }).join("\n")}\n\n`);
|
|
1676
1686
|
process.stdout.write("Launch with: claude\n");
|
|
1677
1687
|
if (preservedPath) process.stderr.write(`INSTALL_WARNING: PRESERVED_MODIFIED_SKILL lit-korean at ${preservedPath}\n`);
|
|
1678
1688
|
};
|
|
1679
1689
|
|
|
1690
|
+
const extensionsContext = () => ({
|
|
1691
|
+
env: process.env,
|
|
1692
|
+
cwd: process.cwd(),
|
|
1693
|
+
claudeHome: claudeHome(),
|
|
1694
|
+
litHome: litHome(),
|
|
1695
|
+
cacheHome: process.env.XDG_CACHE_HOME || join(homedir(), ".cache"),
|
|
1696
|
+
currentVersion: version,
|
|
1697
|
+
});
|
|
1698
|
+
|
|
1680
1699
|
// Automatic handoff is stored per project, so the doctor reads the project it was run in.
|
|
1681
1700
|
const writeAutoHandoffDoctorLines = () => {
|
|
1682
1701
|
for (const line of autoHandoffDoctorLines({ env: process.env, stateRoot: resolveProjectStateRoot(process.cwd()) })) {
|
|
@@ -1698,6 +1717,7 @@ const doctor = ({ dryRun }) => {
|
|
|
1698
1717
|
for (const line of automaticUpdateDoctorLines({ env: process.env, litHome: litHome(), claudeHome: claudeHome() })) process.stdout.write(`${line}\n`);
|
|
1699
1718
|
process.stdout.write("Would verify the bundled handoff snapshot hashes\n");
|
|
1700
1719
|
process.stdout.write("Would verify three canonical runtime closures\n");
|
|
1720
|
+
process.stdout.write(`${extensionsDoctorLine(extensionsContext())}\n`);
|
|
1701
1721
|
writeAutoHandoffDoctorLines();
|
|
1702
1722
|
process.stdout.write(`${iconFontDoctorLine()}\n`);
|
|
1703
1723
|
return;
|
|
@@ -1772,6 +1792,7 @@ const doctor = ({ dryRun }) => {
|
|
|
1772
1792
|
const agentFileMode = readAgentFileMode({ litHome: litHome() });
|
|
1773
1793
|
process.stdout.write(`AGENT_FILE: ${agentFileMode === "off" ? "off" : agentFileState({ path: agentFilePath(), version })} (${agentFilePath()}; change: litclaude-ai config agentFile <on|off>)\n`);
|
|
1774
1794
|
process.stdout.write(`ATTRIBUTION: ${readAttributionMode({ litHome: litHome() })} (change: litclaude-ai config attribution <keep|off>)\n`);
|
|
1795
|
+
process.stdout.write(`${extensionsDoctorLine(extensionsContext())}\n`);
|
|
1775
1796
|
for (const line of officialBuildLines(packageJson)) process.stdout.write(`${line}\n`);
|
|
1776
1797
|
|
|
1777
1798
|
const claude = spawnTool("claude", ["--version"], { encoding: "utf8" });
|
|
@@ -2042,6 +2063,9 @@ const main = async () => {
|
|
|
2042
2063
|
case "agent-file":
|
|
2043
2064
|
exitAfterFlush(runAgentFileCli(parsed.rest, { dryRun: parsed.dryRun }));
|
|
2044
2065
|
break;
|
|
2066
|
+
case "extensions":
|
|
2067
|
+
exitAfterFlush(runExtensionsCli(parsed.dryRun ? [...parsed.rest, "--dry-run"] : parsed.rest, extensionsContext()));
|
|
2068
|
+
break;
|
|
2045
2069
|
default:
|
|
2046
2070
|
printUsage();
|
|
2047
2071
|
fail(`Unknown command: ${command}`, 64);
|