@litfamily/litclaude 1.0.52 → 1.0.53
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 +17 -0
- package/README.md +8 -8
- package/README_ko-KR.md +8 -8
- package/docs/assets/readme/badge-version.svg +1 -1
- package/docs/hooks.md +76 -9
- package/package.json +1 -1
- package/plugins/litclaude/.claude-plugin/plugin.json +7 -1
- package/plugins/litclaude/bin/litclaude-mcp.js +1 -1
- package/plugins/litclaude/hooks/lit-mod.mjs +81 -6
- package/plugins/litclaude/hooks/make-colors.d.ts +35 -0
- package/plugins/litclaude/hooks/make-colors.js +1016 -0
- package/plugins/litclaude/lib/mod/backdrop.mjs +675 -0
- package/plugins/litclaude/lib/mod/settings.mjs +5 -2
- package/plugins/litclaude/lib/mod/skills.mjs +10 -0
- package/plugins/litclaude/lib/mod/svg-card.mjs +34 -13
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
// The LIT band's
|
|
1
|
+
// The LIT band's six userConfig options. The manifest declares them as plain strings without an
|
|
2
2
|
// `options` list, because Claude Code 2.1.270 and older refuse a whole plugin whose userConfig has
|
|
3
3
|
// one; the values are checked here instead, and anything unknown falls back to the default (the
|
|
4
4
|
// first choice). `notify` raises a notification through the person's own channel when LIT work
|
|
5
5
|
// completes or a LIT turn longer than three minutes ends; `finish+sound` adds a sound only where
|
|
6
6
|
// the plugin ships one, and none ships yet, so it notifies like `finish`. `club` lets an invited
|
|
7
|
-
// card wear the club look while idle (plans/invite-pilot.md).
|
|
7
|
+
// card wear the club look while idle (plans/invite-pilot.md). `look` dresses the desktop and mobile
|
|
8
|
+
// apps in the Ignition colours and backdrop scene (lib/mod/backdrop.mjs): on (moving), still or off.
|
|
8
9
|
|
|
9
10
|
export const MOD_CHOICES = Object.freeze({
|
|
10
11
|
motion: ["full", "subtle", "off"],
|
|
@@ -12,6 +13,7 @@ export const MOD_CHOICES = Object.freeze({
|
|
|
12
13
|
band: ["always", "auto", "off"],
|
|
13
14
|
notify: ["off", "finish", "finish+sound"],
|
|
14
15
|
club: ["on", "off"],
|
|
16
|
+
look: ["on", "still", "off"],
|
|
15
17
|
});
|
|
16
18
|
|
|
17
19
|
const pick = (value, choices) => {
|
|
@@ -25,6 +27,7 @@ export const normalizeModSettings = (options) => ({
|
|
|
25
27
|
band: pick(options?.band, MOD_CHOICES.band),
|
|
26
28
|
notify: pick(options?.notify, MOD_CHOICES.notify),
|
|
27
29
|
club: pick(options?.club, MOD_CHOICES.club),
|
|
30
|
+
look: pick(options?.look, MOD_CHOICES.look),
|
|
28
31
|
});
|
|
29
32
|
|
|
30
33
|
// Claude Code's own `prefersReducedMotion` setting (/config "Reduce motion") turns the band's motion
|
|
@@ -50,7 +50,12 @@ export const LIT_SKILL_IDS = Object.freeze([
|
|
|
50
50
|
"wikify",
|
|
51
51
|
]);
|
|
52
52
|
|
|
53
|
+
// The wjgoarxiv-skills plugins that ship LitFamily's moved skills (extensions-notice.mjs
|
|
54
|
+
// EXTENSION_SKILLS, kept equal by a test). A skill they carry fires as `<plugin>:<id>`.
|
|
55
|
+
export const EXTENSION_PLUGINS = Object.freeze(["decks", "documents", "figures", "design", "video-covers"]);
|
|
56
|
+
|
|
53
57
|
const KNOWN = new Set(LIT_SKILL_IDS);
|
|
58
|
+
const EXTENSIONS = new Set(EXTENSION_PLUGINS);
|
|
54
59
|
const PLUGIN_PREFIX = "litclaude:";
|
|
55
60
|
const KEEP = 12;
|
|
56
61
|
// A Skill call and the prompt expansion it causes arrive moments apart; they are one firing.
|
|
@@ -63,6 +68,11 @@ export const litSkillId = (name) => {
|
|
|
63
68
|
const id = raw.slice(PLUGIN_PREFIX.length);
|
|
64
69
|
return /^[a-z0-9][a-z0-9-]{0,63}$/u.test(id) ? id : null;
|
|
65
70
|
}
|
|
71
|
+
const colon = raw.indexOf(":");
|
|
72
|
+
if (colon > 0 && EXTENSIONS.has(raw.slice(0, colon))) {
|
|
73
|
+
const id = raw.slice(colon + 1);
|
|
74
|
+
return KNOWN.has(id) ? id : null;
|
|
75
|
+
}
|
|
66
76
|
return KNOWN.has(raw) ? raw : null;
|
|
67
77
|
};
|
|
68
78
|
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
// head shimmers, the step spinner turns and a comet runs around the border (full only). Idle, it is
|
|
15
15
|
// still. The drawing carries no step clock and no loop countdown: the surface loads each new
|
|
16
16
|
// drawing afresh, restarting every animation, so a figure that moves with time alone would make the
|
|
17
|
-
// card blink on every poll. Each loop opens
|
|
18
|
-
//
|
|
17
|
+
// card blink on every poll. Each loop opens where the session clock has it (see `loop`), so a fresh
|
|
18
|
+
// load carries on from the frame the last one showed rather than opening on a dim border and a
|
|
19
|
+
// comet at the corner; what breathes, sweeps or shuttles eases in and out.
|
|
19
20
|
//
|
|
20
21
|
// Text is set in a monospace face and placed by counted cells (Hangul and emoji as two), so the
|
|
21
22
|
// layout does not depend on measuring a font the drawing cannot see.
|
|
@@ -56,11 +57,21 @@ export const THREAD_ROW_H = 22;
|
|
|
56
57
|
const PILL_H = 20;
|
|
57
58
|
const FONT = "ui-monospace, 'SF Mono', SFMono-Regular, Menlo, 'JetBrains Mono', Consolas, monospace";
|
|
58
59
|
|
|
59
|
-
// Timing of one looping animation,
|
|
60
|
+
// Timing of one looping animation, `phase` of the way into its cycle at the session clock the card
|
|
61
|
+
// is composed at (`clockMs`, set by composeSvgCard; 0 draws the fixed phases). The surface loads
|
|
60
62
|
// each new drawing afresh, so every loop would otherwise open on its first frame: the breathing at
|
|
61
63
|
// its dimmest, the light off the pill's left edge, the comet parked at the top-left corner. A
|
|
62
|
-
// negative begin
|
|
63
|
-
|
|
64
|
+
// negative begin taken from the clock opens each loop where the drawing before it had reached.
|
|
65
|
+
// `eased`, the count of values, moves each step on an ease-in-out spline; spins, the comet, the
|
|
66
|
+
// hue and the drifting sparks keep an even pace.
|
|
67
|
+
let clockMs = 0;
|
|
68
|
+
const IN_OUT = "0.45 0 0.55 1";
|
|
69
|
+
const loop = (ms, phase, eased = 0) => {
|
|
70
|
+
const spline = eased > 1
|
|
71
|
+
? ` calcMode="spline" keyTimes="${Array.from({ length: eased }, (_, i) => +(i / (eased - 1)).toFixed(3)).join(";")}" keySplines="${Array(eased - 1).fill(IN_OUT).join(";")}"`
|
|
72
|
+
: "";
|
|
73
|
+
return `dur="${ms}ms" begin="-${Math.round((clockMs + ms * phase) % ms)}ms" repeatCount="indefinite"${spline}`;
|
|
74
|
+
};
|
|
64
75
|
// The breathing pieces share one phase so the pill, the border and the count bar's head stay in step.
|
|
65
76
|
const BREATH_PHASE = 0.25;
|
|
66
77
|
|
|
@@ -95,7 +106,7 @@ const pill = (x, y, label, { fill, ink, bold = true, sweep = false, breath = nul
|
|
|
95
106
|
const top = y - PILL_H + 6;
|
|
96
107
|
const parts = [`<rect x="${x.toFixed(1)}" y="${top}" width="${w.toFixed(1)}" height="${PILL_H}" rx="${PILL_H / 2}" fill="${fill}"/>`];
|
|
97
108
|
if (veil) parts.push(`<rect x="${x.toFixed(1)}" y="${top}" width="${w.toFixed(1)}" height="${PILL_H}" rx="${PILL_H / 2}" fill="#ffffff" opacity="0.3"/>`);
|
|
98
|
-
if (breath) parts.push(`<rect x="${x.toFixed(1)}" y="${top}" width="${w.toFixed(1)}" height="${PILL_H}" rx="${PILL_H / 2}" fill="${breath}" opacity="0"><animate attributeName="opacity" values="0;${breathPeak};0" ${loop(TIMINGS.breath, BREATH_PHASE)}/></rect>`);
|
|
109
|
+
if (breath) parts.push(`<rect x="${x.toFixed(1)}" y="${top}" width="${w.toFixed(1)}" height="${PILL_H}" rx="${PILL_H / 2}" fill="${breath}" opacity="0"><animate attributeName="opacity" values="0;${breathPeak};0" ${loop(TIMINGS.breath, BREATH_PHASE, 3)}/></rect>`);
|
|
99
110
|
if (sweep) parts.push(`<rect x="${x.toFixed(1)}" y="${top}" width="${w.toFixed(1)}" height="${PILL_H}" rx="${PILL_H / 2}" fill="url(#lit-sweep)"/>`);
|
|
100
111
|
parts.push(text(x + 8, y, label, { fill: ink, bold }));
|
|
101
112
|
return { markup: parts.join(""), end: x + w };
|
|
@@ -233,7 +244,7 @@ const mapRowSvg = (model, accent, animate) => {
|
|
|
233
244
|
out.push(`<line x1="${x1.toFixed(1)}" y1="${y - 4}" x2="${x2.toFixed(1)}" y2="${y - 4}" stroke="${C.rail}" stroke-width="2.5" stroke-linecap="round"/>`);
|
|
234
245
|
const filled = count && count.total > 0 ? Math.min(1, count.done / count.total) : 0;
|
|
235
246
|
if (filled > 0) out.push(`<line x1="${x1.toFixed(1)}" y1="${y - 4}" x2="${(x1 + filled * layout.rail).toFixed(1)}" y2="${y - 4}" stroke="${mapColor(accent, mid)}" stroke-width="2.5" stroke-linecap="round"/>`);
|
|
236
|
-
if (animate.sweep && !model.workflow.paused) out.push(`<circle cx="${x1.toFixed(1)}" cy="${y - 4}" r="2.5" fill="#ffffff"><animate attributeName="cx" values="${x1.toFixed(1)};${x2.toFixed(1)}" ${loop(TIMINGS.flow, 0.5)}/></circle>`);
|
|
247
|
+
if (animate.sweep && !model.workflow.paused) out.push(`<circle cx="${x1.toFixed(1)}" cy="${y - 4}" r="2.5" fill="#ffffff"><animate attributeName="cx" values="${x1.toFixed(1)};${x2.toFixed(1)}" ${loop(TIMINGS.flow, 0.5, 2)}/></circle>`);
|
|
237
248
|
} else {
|
|
238
249
|
out.push(`<line x1="${x1.toFixed(1)}" y1="${y - 4}" x2="${x2.toFixed(1)}" y2="${y - 4}" stroke="${C.rail}" stroke-width="1.5" stroke-linecap="round" stroke-opacity="0.7"/>`);
|
|
239
250
|
}
|
|
@@ -293,7 +304,7 @@ const detailRowSvg = (model, accent, animate) => {
|
|
|
293
304
|
const cells = barCells(total > 0 ? done / total : 0, 8);
|
|
294
305
|
cells.forEach(({ glyph, color }, index) => out.push(`<rect x="${(x + index * 9).toFixed(1)}" y="${y - 10}" width="7" height="10" rx="1.5" fill="${glyph === "█" ? color : C.empty}"/>`));
|
|
295
306
|
const head = cells.findLastIndex(({ glyph }) => glyph === "█");
|
|
296
|
-
if (head >= 0 && animate.sweep) out.push(`<rect x="${(x + head * 9).toFixed(1)}" y="${y - 10}" width="7" height="10" rx="1.5" fill="#ffffff" opacity="0"><animate attributeName="opacity" values="0;0.6;0" ${loop(TIMINGS.breath, BREATH_PHASE)}/></rect>`);
|
|
307
|
+
if (head >= 0 && animate.sweep) out.push(`<rect x="${(x + head * 9).toFixed(1)}" y="${y - 10}" width="7" height="10" rx="1.5" fill="#ffffff" opacity="0"><animate attributeName="opacity" values="0;0.6;0" ${loop(TIMINGS.breath, BREATH_PHASE, 3)}/></rect>`);
|
|
297
308
|
x += 8 * 9 + 4;
|
|
298
309
|
}
|
|
299
310
|
const pieces = [];
|
|
@@ -387,7 +398,7 @@ const sparksSvg = (from, to, y) => {
|
|
|
387
398
|
const dur = Math.round(TIMINGS.sparks / speed);
|
|
388
399
|
return `<text class="lit-spark" x="${x.toFixed(1)}" y="${y}" fill="${rainbowAt(start)}" opacity="0.8">${esc(glyph)}`
|
|
389
400
|
+ `<animateTransform attributeName="transform" type="translate" values="0 0;${(-start * span).toFixed(1)} 0" ${loop(dur, 0)}/>`
|
|
390
|
-
+ `<animate attributeName="opacity" values="0.3;0.9;0.3" ${loop(Math.round(TIMINGS.sparks / 2), i / SPARK_SEEDS.length)}/></text>`;
|
|
401
|
+
+ `<animate attributeName="opacity" values="0.3;0.9;0.3" ${loop(Math.round(TIMINGS.sparks / 2), i / SPARK_SEEDS.length, 3)}/></text>`;
|
|
391
402
|
}).join("");
|
|
392
403
|
};
|
|
393
404
|
|
|
@@ -441,7 +452,7 @@ const PULSE = "━━━━━";
|
|
|
441
452
|
const pulseSvg = (x, y, animate, fill) => {
|
|
442
453
|
const w = widthOf(PULSE);
|
|
443
454
|
if (!animate) return "";
|
|
444
|
-
return `<rect x="${x.toFixed(1)}" y="${y - 8}" width="${(w / 3).toFixed(1)}" height="4" rx="2" fill="${fill}" opacity="0.9"><animate attributeName="x" values="${x.toFixed(1)};${(x + (w * 2) / 3).toFixed(1)};${x.toFixed(1)}" ${loop(TIMINGS.flow * 2, 0.25)}/></rect>`;
|
|
455
|
+
return `<rect x="${x.toFixed(1)}" y="${y - 8}" width="${(w / 3).toFixed(1)}" height="4" rx="2" fill="${fill}" opacity="0.9"><animate attributeName="x" values="${x.toFixed(1)};${(x + (w * 2) / 3).toFixed(1)};${x.toFixed(1)}" ${loop(TIMINGS.flow * 2, 0.25, 3)}/></rect>`;
|
|
445
456
|
};
|
|
446
457
|
|
|
447
458
|
/**
|
|
@@ -578,8 +589,18 @@ export const svgCardAlt = (model) => {
|
|
|
578
589
|
/**
|
|
579
590
|
* The card as `{ source, alt, animated }`: an SVG document and its description. `motion` is the
|
|
580
591
|
* mod's setting; the drawing moves only while the model is not idle and motion is not off.
|
|
592
|
+
* `clock`, the session clock in ms, sets where each loop opens (0, the fixed phases).
|
|
581
593
|
*/
|
|
582
|
-
export const composeSvgCard = (model, { motion = "full", accent = "#5fd7ff" } = {}) => {
|
|
594
|
+
export const composeSvgCard = (model, { motion = "full", accent = "#5fd7ff", clock = 0 } = {}) => {
|
|
595
|
+
clockMs = clock;
|
|
596
|
+
try {
|
|
597
|
+
return composeCard(model, motion, accent);
|
|
598
|
+
} finally {
|
|
599
|
+
clockMs = 0;
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
const composeCard = (model, motion, accent) => {
|
|
583
604
|
const { width } = SVG_CARD;
|
|
584
605
|
// The thread rows sit between the detail line and the chips; the card grows by their reserve.
|
|
585
606
|
const shift = model.threads ? THREAD_ROW_H * model.threads.reserve : 0;
|
|
@@ -591,10 +612,10 @@ export const composeSvgCard = (model, { motion = "full", accent = "#5fd7ff" } =
|
|
|
591
612
|
const edge = rewind ? "url(#lit-rainbow)" : club ? "url(#lit-club)" : borderColor(model, accent);
|
|
592
613
|
const perimeter = 1000;
|
|
593
614
|
const defs = (rewind ? rainbowDefs(animate.breath) : club ? clubDefs() : "") + (animate.sweep
|
|
594
|
-
? `<defs><linearGradient id="lit-sweep" x1="0" x2="1" y1="0" y2="0"><stop offset="0" stop-color="#fff" stop-opacity="0"/><stop offset="0.5" stop-color="#fff" stop-opacity="0.55"/><stop offset="1" stop-color="#fff" stop-opacity="0"/><animateTransform attributeName="gradientTransform" type="translate" values="-1.2 0;1.2 0" ${loop(TIMINGS.sweep, 0.5)}/></linearGradient></defs>`
|
|
615
|
+
? `<defs><linearGradient id="lit-sweep" x1="0" x2="1" y1="0" y2="0"><stop offset="0" stop-color="#fff" stop-opacity="0"/><stop offset="0.5" stop-color="#fff" stop-opacity="0.55"/><stop offset="1" stop-color="#fff" stop-opacity="0"/><animateTransform attributeName="gradientTransform" type="translate" values="-1.2 0;1.2 0" ${loop(TIMINGS.sweep, 0.5, 2)}/></linearGradient></defs>`
|
|
595
616
|
: "");
|
|
596
617
|
const frame = `<rect x="1" y="1" width="${width - 2}" height="${height - 2}" rx="14" fill="${C.bg}" stroke="${edge}" stroke-width="${model.idle && !rewind && !club ? "1.5" : "2.5"}"${model.idle && !rewind && !club ? ' stroke-opacity="0.8"' : ""}>`
|
|
597
|
-
+ (animate.breath && !model.warnings.length ? `<animate attributeName="stroke-opacity" values="0.85;1;0.85" ${loop(TIMINGS.breath, BREATH_PHASE)}/>` : "")
|
|
618
|
+
+ (animate.breath && !model.warnings.length ? `<animate attributeName="stroke-opacity" values="0.85;1;0.85" ${loop(TIMINGS.breath, BREATH_PHASE, 3)}/>` : "")
|
|
598
619
|
+ "</rect>";
|
|
599
620
|
const comet = animate.comet
|
|
600
621
|
? `<rect x="1" y="1" width="${width - 2}" height="${height - 2}" rx="14" fill="none" stroke="url(#lit-comet)" stroke-width="2.5" stroke-linecap="round" pathLength="${perimeter}" stroke-dasharray="70 ${perimeter - 70}"><animate attributeName="stroke-dashoffset" values="0;-${perimeter}" ${loop(TIMINGS.comet * 2, 0.5)}/></rect>`
|