@litfamily/litclaude 1.0.62 → 1.0.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.md +14 -11
- package/README_ko-KR.md +11 -10
- package/bin/install-ui.mjs +485 -0
- package/bin/litclaude-ai.js +301 -51
- package/docs/assets/readme/badge-version.svg +1 -1
- package/docs/hooks.md +12 -8
- package/package.json +1 -1
- package/plugins/litclaude/.claude-plugin/plugin.json +1 -1
- package/plugins/litclaude/bin/litclaude-hud.js +76 -12
- package/plugins/litclaude/bin/litclaude-mcp.js +1 -1
- package/plugins/litclaude/hooks/lit-mod.mjs +5 -3
- package/plugins/litclaude/lib/hud-accent-palette.mjs +5 -2
- package/plugins/litclaude/lib/mod/frame.mjs +92 -47
- package/plugins/litclaude/lib/mod/motion.mjs +3 -15
- package/plugins/litclaude/lib/mod/settings.mjs +10 -3
- package/plugins/litclaude/lib/mod/sunset.mjs +118 -0
- package/plugins/litclaude/lib/mod/timeline.mjs +10 -25
- package/plugins/litclaude/lib/start-work-lifecycle.mjs +10 -3
package/docs/hooks.md
CHANGED
|
@@ -372,8 +372,8 @@ status line read as one family:
|
|
|
372
372
|
```
|
|
373
373
|
|
|
374
374
|
The brackets stand for the ends of filled pills: rounded caps from the icon font with `nerd`
|
|
375
|
-
glyphs, one cell of the pill's colour with `basic`. The brand is a pink
|
|
376
|
-
|
|
375
|
+
glyphs, one cell of the pill's colour with `basic`. The brand is a pill from orange to pink, the
|
|
376
|
+
current stage runs from violet to the accent, the skills of this request are pills on the accent with dark text, and skills from earlier
|
|
377
377
|
requests are muted grey pills.
|
|
378
378
|
|
|
379
379
|
- The top edge names the discipline the prompt hook ignited (the last one, dimmed, while the
|
|
@@ -514,16 +514,20 @@ Motion: entrances pop in 60 ms apart with a slight overshoot (160 ms each), fill
|
|
|
514
514
|
changes ease in and out (300 ms and 140 ms), notices slide in over 220 ms and leave over 150 ms,
|
|
515
515
|
a chip's arrival light runs 400 ms (a plain fade under `subtle`, nothing under `off`), and the
|
|
516
516
|
finish lasts at most 1.2 s. While LitClaude is at work the card keeps moving so you can tell it
|
|
517
|
-
is active at a glance: the LIT pill
|
|
517
|
+
is active at a glance: the LIT pill, a sunset from orange to pink, breathes brighter every 2.4 s, a light sweeps
|
|
518
518
|
across the current stage and this request's skill chips every 1.8 s, a bright head runs the rail
|
|
519
519
|
leaving the current stage every 1.4 s, the count bar's head shimmers, and a comet runs along the
|
|
520
520
|
top rule and back along the bottom one every 2.6 s. Under `subtle` only the breathing stays; under `off` nothing moves. An
|
|
521
|
-
idle card holds still.
|
|
521
|
+
idle card holds still. On a card at least 90 columns wide a half-sunk sun stands in the last three body rows, with
|
|
522
|
+
stars around it and a sea of `~ - .` along the chips row (`lib/mod/sunset.mjs`). The sun's light ripples, the sea
|
|
523
|
+
runs outward from it, the stars twinkle and a shooting star passes every nine seconds. The scene only uses cells
|
|
524
|
+
that hold no text, and the sun leaves while a notice, `COMPLETE` or a long line needs its place. The invited card's
|
|
525
|
+
scene moves with its glint. `NO_COLOR` draws none of it. The band's `Client` element animates on Claude Code's frame clock, every
|
|
522
526
|
33 ms while a transition plays and every 66 ms during work, once a second while only a clock (the
|
|
523
527
|
step's or the lanes') moves, including under `off`, and stops its timer once the card is idle and
|
|
524
528
|
settled. In Claude
|
|
525
529
|
Code 2.1.292 a terminal row whose only change is a non-ASCII glyph is not repainted, so every
|
|
526
|
-
moving part changes ASCII text or colour: bar cells are coloured spaces, embers are ASCII
|
|
530
|
+
moving part changes ASCII text or colour: bar cells are coloured spaces, the sea, the stars and the embers are ASCII, the sun moves by colour alone,
|
|
527
531
|
a chip's light moves over its ASCII name, the map's `━` and `─` cells move by colour alone, the
|
|
528
532
|
step's spinner (`- \ | /`) and clock are ASCII, and a glyph swaps only together with its words.
|
|
529
533
|
|
|
@@ -556,8 +560,8 @@ Uninstall removes only the defaults it wrote that are still unchanged.
|
|
|
556
560
|
|
|
557
561
|
| Option | Values | Default |
|
|
558
562
|
| --- | --- | --- |
|
|
559
|
-
| `motion` | `full`, `subtle` (no overshoot, shimmer, embers, sweep or comet, shorter; the LIT pill still breathes during work), `off` (final frames only) | `full` |
|
|
560
|
-
| `glyphs` | `auto` (Nerd glyphs when the icon font is installed), `nerd`, or `basic` | `auto` |
|
|
563
|
+
| `motion` | `full`, `subtle` (no overshoot, shimmer, embers, sweep or comet, shorter; the LIT pill still breathes during work and the sunset holds still), `off` (final frames only) | `full` |
|
|
564
|
+
| `glyphs` | `auto` (Nerd glyphs when the icon font is installed; otherwise the basic symbols, with round pills in Windows Terminal 1.21 or later and VS Code, which draw the round caps themselves), `nerd`, or `basic` | `auto` |
|
|
561
565
|
| `band` | `always` (the whole session, idle included), `auto` (only while work is active or a skill of this request is lit), `off` | `always` |
|
|
562
566
|
| `notify` | `off`, `finish` (a notification through your own notification channel, `$.ui.notify`, when LIT work completes or a LIT turn longer than three minutes ends), `finish+sound` (the same; a sound is added once LitClaude ships one, and none ships yet) | `off` |
|
|
563
567
|
| `club` | `on` (the idle card wears the club look once `lit invite` recorded an inviter), `off` (the plain ready card, byte for byte) | `on` |
|
|
@@ -592,7 +596,7 @@ between passes the card draws no frames. With `subtle` or `off` motion the ring
|
|
|
592
596
|
never makes a band show that `band: auto` would hide. No look flips more than a quarter of the card's brightness more than three
|
|
593
597
|
times a second; with `motion` off or reduced motion each look is one still frame, and with
|
|
594
598
|
`NO_COLOR` set the card keeps its labels and draws no colour (basic glyphs, no motion). The desktop
|
|
595
|
-
drawing shows the labels of these looks, not the lane segments or the
|
|
599
|
+
drawing shows the labels of these looks, not the lane segments, the embers or the sunset scene.
|
|
596
600
|
|
|
597
601
|
The icons on `nerd` (the rounded pill caps U+E0B6 and U+E0B4, the chip bolt and the branch mark)
|
|
598
602
|
come from a Nerd Font. `litclaude-ai install
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@litfamily/litclaude",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.64",
|
|
4
4
|
"description": "Claude Code plugin: add lit to a prompt and Claude plans, tests, checks and reviews the work, then leaves a handoff for the next session.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { execFileSync } from "node:child_process";
|
|
4
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
4
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
5
5
|
import { basename, dirname, join } from "node:path";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
import {
|
|
@@ -12,6 +12,9 @@ import {
|
|
|
12
12
|
normalizeHudAppearance,
|
|
13
13
|
} from "../lib/hud-accent-palette.mjs";
|
|
14
14
|
import { latestUsageTokensCached } from "../lib/cache-measurement.mjs";
|
|
15
|
+
import { drawsRoundCaps, xterm256Hex } from "../lib/mod/settings.mjs";
|
|
16
|
+
import { lerpColor } from "../lib/mod/motion.mjs";
|
|
17
|
+
import { iconFontCandidates } from "../lib/mod/state.mjs";
|
|
15
18
|
import { ignitionStatePath } from "../lib/hud-ignition.mjs";
|
|
16
19
|
import { resolveProjectStateRoot } from "../lib/project-state-root.mjs";
|
|
17
20
|
import { recordContextUsage, resolveAutoHandoff } from "../lib/auto-handoff.mjs";
|
|
@@ -46,6 +49,26 @@ const colors = plainOutput
|
|
|
46
49
|
|
|
47
50
|
const accent = (text) => `${colors.accent}${text}${colors.reset}`;
|
|
48
51
|
|
|
52
|
+
const hasIconFont = () => iconFontCandidates(process.env).some((path) => {
|
|
53
|
+
try {
|
|
54
|
+
return statSync(path).isFile();
|
|
55
|
+
} catch {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
// Round gauges and badge on a dark truecolor terminal that can draw round caps: the icon font is
|
|
60
|
+
// installed, or the terminal draws them itself. LITCLAUDE_HUD_GLYPHS=basic keeps the square bars.
|
|
61
|
+
const round = colorDepth === "truecolor" && appearance === "dark" && process.env.LITCLAUDE_HUD_GLYPHS !== "basic"
|
|
62
|
+
&& (process.env.LITCLAUDE_HUD_GLYPHS === "nerd" || drawsRoundCaps(process.env) || hasIconFont());
|
|
63
|
+
const rgb = (hex) => [1, 3, 5].map((i) => Number.parseInt(hex.slice(i, i + 2), 16));
|
|
64
|
+
const fg = (hex) => `\x1b[38;2;${rgb(hex).join(";")}m`;
|
|
65
|
+
const bg = (hex) => `\x1b[48;2;${rgb(hex).join(";")}m`;
|
|
66
|
+
const TRACK = "#2a2340";
|
|
67
|
+
const RAMP = { green: ["#2fd6a0", "#6bf0c8"], yellow: ["#ffcc44", "#ff8833"], red: ["#ff5566", "#ff2d95"] };
|
|
68
|
+
const NEON = ["#ff2d95", "#ff66bb", "#b48cff", "#8fb0ff", "#00e5ff"];
|
|
69
|
+
// The dividers run pink to cyan from left to right.
|
|
70
|
+
const joinSegments = (segments) => segments.reduce((line, segment, i) => `${line} ${round ? `${fg(NEON[(i - 1) % NEON.length])}${sep}${colors.reset}` : accent(sep)} ${segment}`);
|
|
71
|
+
|
|
49
72
|
const readStdin = async () => {
|
|
50
73
|
let input = "";
|
|
51
74
|
for await (const chunk of process.stdin) input += chunk;
|
|
@@ -113,6 +136,28 @@ const makeContextBar = (value, width = 3) => {
|
|
|
113
136
|
return makeBlockBar(pct, width, colors.accent);
|
|
114
137
|
};
|
|
115
138
|
|
|
139
|
+
// The same cells as `[` + makeBlockBar + `]`, with round caps in the bracket cells.
|
|
140
|
+
const roundBar = (value, width, [from, to]) => {
|
|
141
|
+
const pct = clamp(Math.round(value));
|
|
142
|
+
const exact = (pct * width) / 100;
|
|
143
|
+
const full = Math.floor(exact);
|
|
144
|
+
const eighth = exact > full ? Math.max(1, Math.min(7, Math.round((exact - full) * 8))) : 0;
|
|
145
|
+
let out = `${fg(exact > 0 ? from : TRACK)}\ue0b6${bg(TRACK)}`;
|
|
146
|
+
for (let i = 0; i < width; i += 1) {
|
|
147
|
+
out += `${fg(lerpColor(from, to, width < 2 ? 0 : i / (width - 1)))}${i < full ? "█" : i === full && eighth ? "▏▎▍▌▋▊▉"[eighth - 1] : " "}`;
|
|
148
|
+
}
|
|
149
|
+
return `${out}${colors.reset}${fg(full >= width ? to : TRACK)}\ue0b4${colors.reset}`;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// Milliseconds until a window runs out at its average pace so far; null when it lasts to its reset.
|
|
153
|
+
const runsOutIn = (pct, reset, spanMs) => {
|
|
154
|
+
const left = parseResetTarget(reset) - Date.now();
|
|
155
|
+
const elapsed = spanMs - left;
|
|
156
|
+
if (!Number.isFinite(left) || left <= 0 || elapsed < spanMs * 0.1 || pct <= 0 || pct >= 100) return null;
|
|
157
|
+
const out = ((100 - pct) / pct) * elapsed;
|
|
158
|
+
return out < left ? out : null;
|
|
159
|
+
};
|
|
160
|
+
|
|
116
161
|
const latestUserMessage = (transcriptPath) => {
|
|
117
162
|
if (!transcriptPath || !existsSync(transcriptPath)) return "";
|
|
118
163
|
const lines = readFileSync(transcriptPath, "utf8").split(/\r?\n/u).filter(Boolean);
|
|
@@ -249,8 +294,11 @@ const formatReset = (value) => {
|
|
|
249
294
|
const coloredText = appearance === "dark";
|
|
250
295
|
const text = (value) => (coloredText ? accent(value) : value);
|
|
251
296
|
|
|
252
|
-
const
|
|
297
|
+
const HOUR = 3_600_000;
|
|
298
|
+
|
|
299
|
+
const formatUsageSegment = (label, value, reset, spanMs) => {
|
|
253
300
|
const labelText = text(label);
|
|
301
|
+
if (value === null && round) return `${labelText} ${roundBar(0, 2, RAMP.green)}${accent("--%")}`;
|
|
254
302
|
if (value === null) {
|
|
255
303
|
return coloredText
|
|
256
304
|
? `${labelText} ${accent("[")}${colors.accent}░░${colors.reset}${accent("]")}${accent("--%")}`
|
|
@@ -258,8 +306,14 @@ const formatUsageSegment = (label, value, reset) => {
|
|
|
258
306
|
}
|
|
259
307
|
const pct = displayPercent(value);
|
|
260
308
|
const resetText = formatReset(reset);
|
|
261
|
-
|
|
262
|
-
|
|
309
|
+
// At this pace the window runs out before its reset: the figure warns, and the reset time gives way to when.
|
|
310
|
+
const out = runsOutIn(pct, reset, spanMs);
|
|
311
|
+
const level = pct >= 90 ? "red" : pct >= 70 || out !== null ? "yellow" : "green";
|
|
312
|
+
const tone = round ? fg(RAMP[level][0]) : colors[level];
|
|
313
|
+
const pctText = coloredText ? `${tone}${pct}%${colors.reset}` : `${pct}%`;
|
|
314
|
+
const bar = round ? roundBar(pct, 2, RAMP[level]) : `${accent("[")}${makeBlockBar(pct, 2, tone)}${accent("]")}`;
|
|
315
|
+
const tail = out === null ? text(resetText) : `${coloredText ? tone : ""}! out ${formatReset(Date.now() + out).slice(2)}${coloredText ? colors.reset : ""}`;
|
|
316
|
+
return `${labelText} ${bar}${pctText}${resetText ? ` ${tail}` : ""}`;
|
|
263
317
|
};
|
|
264
318
|
|
|
265
319
|
// Automatic handoff: while it is on, leave the percent for the Stop hook and show the setting.
|
|
@@ -267,7 +321,7 @@ const formatUsageSegment = (label, value, reset) => {
|
|
|
267
321
|
const autoHandoffSegment = (status, contextPercent) => {
|
|
268
322
|
try {
|
|
269
323
|
const cwd = typeof status.cwd === "string" && status.cwd ? status.cwd : null;
|
|
270
|
-
if (!cwd) return
|
|
324
|
+
if (!cwd) return null;
|
|
271
325
|
const stateRoot = resolveProjectStateRoot(cwd);
|
|
272
326
|
const setting = resolveAutoHandoff({ env: process.env, stateRoot });
|
|
273
327
|
if (setting.enabled) {
|
|
@@ -277,11 +331,11 @@ const autoHandoffSegment = (status, contextPercent) => {
|
|
|
277
331
|
percent: contextPercent,
|
|
278
332
|
window: Number(status.context_window?.context_window_size),
|
|
279
333
|
});
|
|
280
|
-
return text(`handoff@${setting.percent}%`);
|
|
334
|
+
return { text: text(`handoff@${setting.percent}%`), percent: setting.percent };
|
|
281
335
|
}
|
|
282
|
-
return setting.requested ? text("handoff ⚠") :
|
|
336
|
+
return setting.requested ? { text: text("handoff ⚠"), percent: null } : null;
|
|
283
337
|
} catch {
|
|
284
|
-
return
|
|
338
|
+
return null;
|
|
285
339
|
}
|
|
286
340
|
};
|
|
287
341
|
|
|
@@ -298,20 +352,30 @@ const main = async () => {
|
|
|
298
352
|
// Without a host percent or a transcript usage record the size is unknown, and the line says so.
|
|
299
353
|
const knownContextPct = statusContextPct !== null ? statusContextPct : tokens > 0 ? Math.floor((tokens * 100) / maxContext) : null;
|
|
300
354
|
const usage = parseUsage(status);
|
|
301
|
-
const usageText = ` ${accent(sep)} ${formatUsageSegment("5h", usage.fiveHour, usage.fiveHourReset)} ${accent(sep)} ${formatUsageSegment("1w", usage.weekly, usage.weeklyReset)}`;
|
|
302
355
|
const git = gitStatus(status.cwd);
|
|
303
356
|
const prefix = litBrandPrefix(version, {
|
|
304
357
|
noColor: plainOutput,
|
|
305
358
|
depth: colorDepth,
|
|
306
359
|
appearance,
|
|
360
|
+
roundCaps: round,
|
|
307
361
|
});
|
|
308
362
|
const contextPct = knownContextPct === null ? null : displayPercent(knownContextPct);
|
|
363
|
+
const autoHandoff = autoHandoffSegment(status, knownContextPct);
|
|
364
|
+
// The context gauge turns yellow within ten points of the automatic handoff and red past it.
|
|
365
|
+
const limit = autoHandoff?.percent ?? 90;
|
|
366
|
+
const contextRamp = contextPct >= limit ? RAMP.red : contextPct >= limit - 10 ? RAMP.yellow : ["#b48cff", xterm256Hex(accentCode)];
|
|
309
367
|
const contextText = contextPct === null
|
|
310
368
|
? `${text("ctx")} ${text(`?/${windowText}`)}`
|
|
311
|
-
: `${text("ctx")} ${accent("[")}${makeContextBar(contextPct)}${accent("]")} ${text(`${contextPct}%/${windowText}`)}`;
|
|
369
|
+
: `${text("ctx")} ${round ? roundBar(contextPct, 3, contextRamp) : `${accent("[")}${makeContextBar(contextPct)}${accent("]")}`} ${text(`${contextPct}%/${windowText}`)}`;
|
|
312
370
|
const effort = effortLabel(status);
|
|
313
|
-
const
|
|
314
|
-
|
|
371
|
+
const line = joinSegments([
|
|
372
|
+
`${prefix} ${accent("|")} ${text(model)}${effort ? ` ${text(effort)}` : ""}`,
|
|
373
|
+
contextText,
|
|
374
|
+
...(autoHandoff ? [autoHandoff.text] : []),
|
|
375
|
+
formatUsageSegment("5h", usage.fiveHour, usage.fiveHourReset, 5 * HOUR),
|
|
376
|
+
formatUsageSegment("1w", usage.weekly, usage.weeklyReset, 168 * HOUR),
|
|
377
|
+
...(git ? [`${text("git")} ${text(git)}`] : []),
|
|
378
|
+
]);
|
|
315
379
|
process.stdout.write(`${line}\n`);
|
|
316
380
|
|
|
317
381
|
const lastMessage = latestUserMessage(status.transcript_path);
|
|
@@ -25,7 +25,7 @@ import { BURST_MS, POWER_MS, SCENE, composeScene, lookArgs, lookColors, sceneKey
|
|
|
25
25
|
import { composeBand, composeEvidence } from "../lib/mod/frame.mjs";
|
|
26
26
|
import { TIMINGS } from "../lib/mod/motion.mjs";
|
|
27
27
|
import { renderBand, renderRows } from "../lib/mod/render.mjs";
|
|
28
|
-
import { accentFromSettings, effectiveMotion, normalizeModSettings, resolveGlyphs } from "../lib/mod/settings.mjs";
|
|
28
|
+
import { accentFromSettings, drawsRoundCaps, effectiveMotion, normalizeModSettings, resolveGlyphs } from "../lib/mod/settings.mjs";
|
|
29
29
|
import { composeSvgCard } from "../lib/mod/svg-card.mjs";
|
|
30
30
|
import { chipStates, litSkillId, noteSkill } from "../lib/mod/skills.mjs";
|
|
31
31
|
import { TOAST_GAP_MS, gateToast, statusChanges, statusOf } from "../lib/mod/toasts.mjs";
|
|
@@ -129,6 +129,7 @@ const createLive = (options) => ({
|
|
|
129
129
|
waiting: null,
|
|
130
130
|
answeredBoundary: null,
|
|
131
131
|
noColor: false,
|
|
132
|
+
roundCaps: false,
|
|
132
133
|
// The loaded and installed LitClaude versions (restart chip), and when the installed one was read.
|
|
133
134
|
versions: null,
|
|
134
135
|
versionPaths: null,
|
|
@@ -507,6 +508,7 @@ export const register = (on, options) => {
|
|
|
507
508
|
live.accent = accentFromSettings(hostSettings, await $.env.get("LITCLAUDE_HUD_ACCENT"));
|
|
508
509
|
// NO_COLOR (no-color.org): set and not empty, the card draws no colour and does not move.
|
|
509
510
|
live.noColor = Boolean(await $.env.get("NO_COLOR"));
|
|
511
|
+
live.roundCaps = drawsRoundCaps({ WT_SESSION: await $.env.get("WT_SESSION"), TERM_PROGRAM: await $.env.get("TERM_PROGRAM") });
|
|
510
512
|
live.reducedMotion = hostSettings?.prefersReducedMotion === true;
|
|
511
513
|
live.motion = effectiveMotion(live.motion, hostSettings);
|
|
512
514
|
live.lookSet = await setLook($, live);
|
|
@@ -670,7 +672,7 @@ export const register = (on, options) => {
|
|
|
670
672
|
on("ui.render", { component: "AbovePrompt" }, async ($, e, next) => {
|
|
671
673
|
const settings = normalizeModSettings(options);
|
|
672
674
|
const motion = live.noColor ? "off" : effectiveMotion(settings.motion, { prefersReducedMotion: live.reducedMotion });
|
|
673
|
-
const glyphs = live.noColor ? "basic" : resolveGlyphs(settings.glyphs, e.surface, live.iconFont.present);
|
|
675
|
+
const glyphs = live.noColor ? "basic" : resolveGlyphs(settings.glyphs, e.surface, live.iconFont.present, live.roundCaps);
|
|
674
676
|
const color = !live.noColor;
|
|
675
677
|
const model = live.model;
|
|
676
678
|
if (!model || settings.band === "off" || e.props.hasSurvey || (!model.visible && !live.exiting)) return next(e);
|
|
@@ -729,7 +731,7 @@ export const register = (on, options) => {
|
|
|
729
731
|
|
|
730
732
|
on("ui.render", { component: "Pane", requestId: PANE }, async ($, e) => {
|
|
731
733
|
const settings = normalizeModSettings(options);
|
|
732
|
-
const glyphs = resolveGlyphs(settings.glyphs, e.surface, live.iconFont.present);
|
|
734
|
+
const glyphs = resolveGlyphs(settings.glyphs, e.surface, live.iconFont.present, live.roundCaps);
|
|
733
735
|
const elements = $.ui.resolve(e);
|
|
734
736
|
const columns = Math.max(20, e.props.bodyColumns ?? 60);
|
|
735
737
|
const now = await $.clock.now();
|
|
@@ -91,7 +91,7 @@ export const hudColorDepth = (env = process.env) => {
|
|
|
91
91
|
return /256color/iu.test(String(env.TERM || "")) ? "256" : "16";
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
export const litBrandPrefix = (version, { noColor = false, truecolor = false, depth = "", appearance = "dark" } = {}) => {
|
|
94
|
+
export const litBrandPrefix = (version, { noColor = false, truecolor = false, depth = "", appearance = "dark", roundCaps = false } = {}) => {
|
|
95
95
|
const label = `[🔥${NEON_BRAND} v${version}]`;
|
|
96
96
|
if (noColor) return label;
|
|
97
97
|
const resolvedDepth = depth || (truecolor ? "truecolor" : "256");
|
|
@@ -110,7 +110,10 @@ export const litBrandPrefix = (version, { noColor = false, truecolor = false, de
|
|
|
110
110
|
for (let i = 0; i < n; i += 1) {
|
|
111
111
|
const t = n === 1 ? 0 : i / (n - 1);
|
|
112
112
|
const [r, g, b] = PILL_START.map((v, k) => Math.round(v + (PILL_END[k] - v) * t));
|
|
113
|
-
|
|
113
|
+
// Round caps take the pill's two padding cells, in the same colour.
|
|
114
|
+
out += roundCaps && (i === 0 || i === n - 1)
|
|
115
|
+
? `\x1b[0m\x1b[38;2;${r};${g};${b}m${i === 0 ? "\ue0b6\x1b[1m\x1b[38;2;11;14;20m" : "\ue0b4"}`
|
|
116
|
+
: `\x1b[48;2;${r};${g};${b}m${pill[i]}`;
|
|
114
117
|
}
|
|
115
118
|
return `${out}\x1b[0m`;
|
|
116
119
|
};
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
// family to place the session in, the row is the PLAN / WORK / REVIEW track instead. The third row
|
|
19
19
|
// is the stage's detail and, on the right, the tool the main loop is running and for how long.
|
|
20
20
|
//
|
|
21
|
-
// Each bracket pair stands for the two end cells of a filled pill: the brand on
|
|
22
|
-
// stage
|
|
21
|
+
// Each bracket pair stands for the two end cells of a filled pill: the brand on a sunset from orange
|
|
22
|
+
// to pink, the current stage on violet into the accent, this request's skills on the accent, all with dark text, skills from earlier requests on
|
|
23
23
|
// dark grey. Those end cells are rounded Nerd Font caps in the pill's colour, or one cell of
|
|
24
24
|
// padding in that colour with basic glyphs, so a pill is as wide in either glyph set.
|
|
25
25
|
//
|
|
26
26
|
// In a real Claude Code 2.1.292 terminal, a row whose only change is a non-ASCII glyph (a block,
|
|
27
27
|
// symbol, Hangul or Nerd Font cell) keeps showing the old glyph; a change to ASCII text, or to the
|
|
28
28
|
// colour of an ASCII cell, repaints. So every change is carried by ASCII: a bar cell is a space on
|
|
29
|
-
// its colour and the leading cell fades in by colour, embers are ASCII
|
|
29
|
+
// its colour and the leading cell fades in by colour, the sea, stars and embers are ASCII (sunset.mjs), labels pop in letter
|
|
30
30
|
// by letter, a notice slides by its leading spaces, a chip's light moves over its ASCII name, and a
|
|
31
31
|
// glyph swaps only together with the colour of its words. The map's rail cells keep their glyph
|
|
32
32
|
// and move by colour alone (a colour change on `─` or `━` repaints), and the live step's spinner
|
|
@@ -35,8 +35,9 @@
|
|
|
35
35
|
import { gauge, knownFacts } from "../rewind/gauge.mjs";
|
|
36
36
|
import { textWidth, truncateToWidth } from "./layout.mjs";
|
|
37
37
|
import { CLUB_GLINT, CLUB_GOLD, CLUB_PILL, CLUB_STOPS, LOOKS, laneColor, lookOf } from "./looks.mjs";
|
|
38
|
-
import { barCells,
|
|
38
|
+
import { barCells, gradientAt, lerpColor, rainbowAt } from "./motion.mjs";
|
|
39
39
|
import { glyphSet } from "./settings.mjs";
|
|
40
|
+
import { SUN_W, mixed, paintScene } from "./sunset.mjs";
|
|
40
41
|
import { formatDuration } from "./view.mjs";
|
|
41
42
|
|
|
42
43
|
export const PALETTE = Object.freeze({
|
|
@@ -129,6 +130,26 @@ const pill = (body, fill, glyphs) => (glyphs.capLeft
|
|
|
129
130
|
? [span(glyphs.capLeft, { fg: fill }), ...body, span(glyphs.capRight, { fg: fill })]
|
|
130
131
|
: [span(" ", { bg: fill }), ...body, span(" ", { bg: fill })]);
|
|
131
132
|
|
|
133
|
+
// A pill graded along `stops`; `sweep` is the light passing over it, `lift` brightens it.
|
|
134
|
+
const gradedPill = (text, stops, glyphs, sweep = null, lift = 0) => {
|
|
135
|
+
const chars = [...text];
|
|
136
|
+
const at = (i) => lerpColor(gradientAt(stops, chars.length < 2 ? 0 : i / (chars.length - 1)), "#ffffff", lift);
|
|
137
|
+
const visible = chars.filter((ch) => ch.trim()).length;
|
|
138
|
+
let k = 0;
|
|
139
|
+
const body = chars.map((ch, i) => {
|
|
140
|
+
let fill = at(i);
|
|
141
|
+
if (ch.trim()) {
|
|
142
|
+
const near = sweep === null || sweep === undefined ? 1 : Math.abs((visible < 2 ? 0 : k / (visible - 1)) - sweep);
|
|
143
|
+
k += 1;
|
|
144
|
+
if (near < 0.18) fill = lerpColor(fill, "#ffffff", (1 - near / 0.18) * 0.6);
|
|
145
|
+
}
|
|
146
|
+
return span(ch, { fg: PILL.ink, bg: fill, bold: true });
|
|
147
|
+
});
|
|
148
|
+
return glyphs.capLeft
|
|
149
|
+
? [span(glyphs.capLeft, { fg: at(0) }), ...body, span(glyphs.capRight, { fg: at(chars.length - 1) })]
|
|
150
|
+
: [span(" ", { bg: at(0) }), ...body, span(" ", { bg: at(chars.length - 1) })];
|
|
151
|
+
};
|
|
152
|
+
|
|
132
153
|
// The rewind look's pills: each cell a step further round the hue wheel, lightened so the dark ink
|
|
133
154
|
// keeps its contrast, with each cap in the colour of the cell beside it.
|
|
134
155
|
const RAINBOW_SPREAD = 0.35;
|
|
@@ -236,6 +257,7 @@ const brandSpans = (sample, glyphs, rainbow = null, look = null) => {
|
|
|
236
257
|
const reveal = revealText("🔥 LIT", sample.pills[0]);
|
|
237
258
|
if (reveal === null) return [];
|
|
238
259
|
if (rainbow) return rainbowPill(reveal, rainbow, 0, glyphs);
|
|
260
|
+
if (!look) return gradedPill(reveal, SUNSET, glyphs, sample.completion?.shimmer ?? null, 0.22 * (sample.ambient?.breath ?? 0));
|
|
239
261
|
const fill = look === "turn" ? PALETTE.amber : look === "club" ? CLUB_GOLD : sample.ambient ? lerpColor(PILL.brand, PALETTE.orange, 0.85 * sample.ambient.breath) : PILL.brand;
|
|
240
262
|
return pill(litText(reveal, { fg: PILL.ink, bg: fill, bold: true }, sample.completion?.shimmer ?? null), fill, glyphs);
|
|
241
263
|
};
|
|
@@ -290,8 +312,13 @@ const topEdge = (model, sample, { width, glyphs, accent, edge, look, paint, rain
|
|
|
290
312
|
return edgeRow("╭─ ", [...brand, ...title(shown)], [], "─╮", width, edge, comet, paint[0]);
|
|
291
313
|
};
|
|
292
314
|
|
|
293
|
-
|
|
294
|
-
|
|
315
|
+
// A gauge's end cells become caps and its empty cells one smooth track, in the same number of cells.
|
|
316
|
+
const TRACK = "#2a2340";
|
|
317
|
+
const roundGauge = (cells, glyphs) => {
|
|
318
|
+
if (!glyphs.capLeft) return cells.map(({ glyph, color }) => (glyph === "█" ? span(" ", { bg: color }) : span(glyph, { fg: color })));
|
|
319
|
+
const paint = cells.map(({ glyph, color }) => (glyph === "█" ? color : TRACK));
|
|
320
|
+
return paint.map((color, i) => (i === 0 ? span(glyphs.capLeft, { fg: color }) : i === paint.length - 1 ? span(glyphs.capRight, { fg: color }) : span(" ", { bg: color })));
|
|
321
|
+
};
|
|
295
322
|
|
|
296
323
|
// ●● 2 lanes 1:07: a dot per lane (amber once stalled, dim and still while idle), the count and the longest lane's
|
|
297
324
|
// clock. While LitClaude works a light walks across the dots (full motion) or they breathe (subtle),
|
|
@@ -318,7 +345,7 @@ const progressSegment = (model, sample, glyphs, cells) => {
|
|
|
318
345
|
const label = model.progress.unit === "tasks" ? "tasks" : "goal";
|
|
319
346
|
return segment("progress", 1, [
|
|
320
347
|
span(`${label} `, { fg: PALETTE.dim }),
|
|
321
|
-
...
|
|
348
|
+
...roundGauge(barCells(sample.fill, cells, sample.fillGlow ?? 0), glyphs),
|
|
322
349
|
span(" "),
|
|
323
350
|
span(String(model.progress.done), { fg: lerpColor(PALETTE.white, PALETTE.cyan, Math.max(sample.flash, sample.fillGlow ?? 0)), bold: true }),
|
|
324
351
|
span(`/${model.progress.total}`, { fg: PALETTE.dim }),
|
|
@@ -446,7 +473,8 @@ const mapTrack = (model, sample, { glyphs, accent, rail, short = false, window =
|
|
|
446
473
|
if (kick > 0) fill = lerpColor(fill, "#ffffff", 0.7 * kick);
|
|
447
474
|
else if (kick < 0) fill = lerpColor(fill, PILL.ink, -0.35 * kick);
|
|
448
475
|
const sweep = model.idle ? null : sample.ambient?.sweep ?? null;
|
|
449
|
-
|
|
476
|
+
const text = revealed.slice(0, label.length).padEnd(label.length);
|
|
477
|
+
out.push(...(model.look === null && !model.idle && !model.ctxWarning ? gradedPill(text, [lerpColor(fill, PALETTE.violet, 0.75), fill], glyphs, sweep) : pill(litText(text, { fg: PILL.ink, bg: fill, bold: true }, sweep), fill, glyphs)));
|
|
450
478
|
} else {
|
|
451
479
|
const done = mapColor(accent, index / last);
|
|
452
480
|
out.push(span(revealed, { fg: stage.state === "done" ? (model.idle ? lerpColor(done, PALETTE.dim, 0.6) : done) : PALETTE.dim }));
|
|
@@ -530,7 +558,7 @@ const detailRow = (model, sample, { inner, glyphs, accent }) => {
|
|
|
530
558
|
if (flow?.count) {
|
|
531
559
|
const { done, total, unit } = flow.count;
|
|
532
560
|
const glow = sample.ambient && !model.idle ? 0.5 * sample.ambient.breath : sample.fillGlow ?? 0;
|
|
533
|
-
const bar = barCells(sample.fill, inner >= 70 ? 8 : 5, glow)
|
|
561
|
+
const bar = roundGauge(barCells(sample.fill, inner >= 70 ? 8 : 5, glow), glyphs);
|
|
534
562
|
segments.push(segment("count", 1, [
|
|
535
563
|
span(`${unit} `, { fg: PALETTE.dim }),
|
|
536
564
|
span(String(done), { fg: lerpColor(PALETTE.white, PALETTE.cyan, Math.max(sample.flash, sample.fillGlow ?? 0)), bold: true }),
|
|
@@ -605,18 +633,23 @@ const pulseSpans = (sample, rainbow, index) => {
|
|
|
605
633
|
return span("━", { fg: cell === head ? lerpColor(base, "#ffffff", rainbow ? 0.45 : 0.7) : rainbow ? lerpColor(base, PALETTE.faint, 0.35) : base });
|
|
606
634
|
});
|
|
607
635
|
};
|
|
608
|
-
const gaugeSpans = (text, rainbow, index) => {
|
|
609
|
-
if (!rainbow) return [span(text, { fg: PALETTE.white })];
|
|
636
|
+
const gaugeSpans = (text, rainbow, index, color = PALETTE.white, glyphs = {}) => {
|
|
610
637
|
const [, cells, count] = /^\[([▉░]+)\](.*)$/u.exec(text);
|
|
638
|
+
if (!rainbow) {
|
|
639
|
+
if (!glyphs.capLeft) return [span(text, { fg: PALETTE.white })];
|
|
640
|
+
const full = cells.replace(/░/gu, "").length;
|
|
641
|
+
const tint = (i) => (i < full ? lerpColor(color, "#ffffff", 0.25 * (i / cells.length)) : TRACK);
|
|
642
|
+
return [span(glyphs.capLeft, { fg: tint(0) }), ...[...cells].map((_, i) => span(" ", { bg: tint(i) })), span(glyphs.capRight, { fg: tint(cells.length - 1) }), span(count, { fg: PALETTE.white })];
|
|
643
|
+
}
|
|
611
644
|
return [
|
|
612
645
|
span("[", { fg: PALETTE.white }),
|
|
613
646
|
...[...cells].map((cell, i) => span(cell, { fg: cell === "▉" ? rainbow(i / cells.length + index * 0.1) : PALETTE.dim })),
|
|
614
647
|
span(`]${count}`, { fg: PALETTE.white }),
|
|
615
648
|
];
|
|
616
649
|
};
|
|
617
|
-
const progressSpans = (thread, sample, rainbow, index, color) => {
|
|
650
|
+
const progressSpans = (thread, sample, rainbow, index, color, glyphs) => {
|
|
618
651
|
const drawn = gauge(thread.done, thread.total);
|
|
619
|
-
if (drawn) return [span(" "), ...gaugeSpans(drawn, rainbow, index), span(` ${thread.state}`, { fg: color })];
|
|
652
|
+
if (drawn) return [span(" "), ...gaugeSpans(drawn, rainbow, index, color, glyphs), span(` ${thread.state}`, { fg: color })];
|
|
620
653
|
const facts = knownFacts({ steps: thread.steps, elapsedMs: thread.elapsedMs, last: thread.last, state: thread.state });
|
|
621
654
|
const words = facts.startsWith(thread.state)
|
|
622
655
|
? [span(facts, { fg: color })]
|
|
@@ -667,7 +700,7 @@ const threadRows = (model, sample, { inner, glyphs, rainbow }) => {
|
|
|
667
700
|
span(`${glyph} `, { fg: color }),
|
|
668
701
|
span(name + " ".repeat(Math.max(0, nameWidth + leadWidth - textWidth(line.lead) - textWidth(name))), { fg: line.last ? THREAD_NAME.last : THREAD_NAME.mid, bold: thread.active }),
|
|
669
702
|
...(stageWidth ? [span(` ${(thread.stage ?? "").slice(0, stageWidth).padEnd(stageWidth)}`, { fg: PALETTE.dim })] : []),
|
|
670
|
-
...progressSpans(thread, sample, rainbow, index, color),
|
|
703
|
+
...progressSpans(thread, sample, rainbow, index, color, glyphs),
|
|
671
704
|
...(thread.session ? [span(` · other session ${thread.session}`, { fg: PALETTE.dim })] : []),
|
|
672
705
|
];
|
|
673
706
|
}
|
|
@@ -703,36 +736,9 @@ const chipSpans = (chip, timed, glyphs, accent, sweep = null) => {
|
|
|
703
736
|
], fill, glyphs);
|
|
704
737
|
};
|
|
705
738
|
|
|
739
|
+
const SUNSET = ["#ffa033", "#ff6a55", "#ff3388"];
|
|
706
740
|
const mutedPill = (text, glyphs) => pill([span(text, { fg: PALETTE.dim, bg: PILL.muted })], PILL.muted, glyphs);
|
|
707
741
|
|
|
708
|
-
const REWIND_SPARKS = Object.freeze([".", "*", "+", "'"]);
|
|
709
|
-
|
|
710
|
-
// The rewind look's sparks, drifting through the cells the chips leave free (one gap cell kept).
|
|
711
|
-
const sparkled = (row, inner, sample, rainbow) => {
|
|
712
|
-
const sparks = sample.ambient?.sparks;
|
|
713
|
-
const spare = inner - rowWidth(row) - 1;
|
|
714
|
-
if (!rainbow || !sparks || spare < 3) return fitRow(row, inner);
|
|
715
|
-
const sky = Array.from({ length: spare }, () => span(" "));
|
|
716
|
-
for (const { x, glyph } of sparks) sky[Math.min(spare - 1, Math.floor(x * spare))] = span(REWIND_SPARKS[glyph], { fg: rainbow(x) });
|
|
717
|
-
return fitRow([...row, span(" "), ...sky], inner);
|
|
718
|
-
};
|
|
719
|
-
|
|
720
|
-
// The glyph particles of body row `r`, drifting through the cells the row leaves free (two gap
|
|
721
|
-
// cells kept), while LitClaude works. Each is ASCII and moves by its glyph and colour together.
|
|
722
|
-
const embered = (row, inner, sample, model, r) => {
|
|
723
|
-
const particles = model.idle ? null : sample.ambient?.particles;
|
|
724
|
-
const list = particles?.rows[r];
|
|
725
|
-
const spare = inner - rowWidth(row) - 2;
|
|
726
|
-
if (!list || spare < 4) return fitRow(row, inner);
|
|
727
|
-
const sky = Array.from({ length: spare }, () => span(" "));
|
|
728
|
-
for (const { x, age, glyph } of list) {
|
|
729
|
-
const cell = Math.min(spare - 1, Math.floor(x * spare));
|
|
730
|
-
const color = emberColor(age, particles.style.heat);
|
|
731
|
-
if (color !== PALETTE.faint) sky[cell] = span(particles.style.ramp[glyph], { fg: color, bold: age < 0.3 });
|
|
732
|
-
}
|
|
733
|
-
return fitRow([...row, span(" "), ...sky], inner);
|
|
734
|
-
};
|
|
735
|
-
|
|
736
742
|
// After a break the idle card offers the cross-session brief, in the longest form that fits.
|
|
737
743
|
const AWAY_HINTS = Object.freeze([[" · back? type ", "lit adhd", " to catch up"], [" · back? ", "lit adhd", ""], [" ", "lit adhd", ""]]);
|
|
738
744
|
const awayHint = (room, accent) => {
|
|
@@ -754,7 +760,7 @@ const chipsRow = (model, sample, { inner, glyphs, accent, rainbow }) => {
|
|
|
754
760
|
const invite = inviteChip(model, glyphs);
|
|
755
761
|
if (chips.length === 0) {
|
|
756
762
|
if (!model.idle && model.next && !model.workflow?.next) return fitRow([span("▸ ", { fg: accent }), span(truncateToWidth(model.next, inner - 2), { fg: PALETTE.white })], inner);
|
|
757
|
-
if (!model.idle) return
|
|
763
|
+
if (!model.idle) return fitRow([span("no LitFamily skill yet in this request", { fg: PALETTE.dim })], inner);
|
|
758
764
|
const hints = [
|
|
759
765
|
[span("no LitFamily skill yet · type ", { fg: PALETTE.dim }), span("lit <task>", { fg: accent }), span(" to start one", { fg: PALETTE.dim })],
|
|
760
766
|
[span("no skill yet · type ", { fg: PALETTE.dim }), span("lit <task>", { fg: accent })],
|
|
@@ -782,7 +788,7 @@ const chipsRow = (model, sample, { inner, glyphs, accent, rainbow }) => {
|
|
|
782
788
|
}
|
|
783
789
|
if (shown < chips.length) row.push(...(row.length ? [span(" ")] : []), ...mutedPill(`+${chips.length - shown}`, glyphs));
|
|
784
790
|
if (model.away) return fitRow([...row, ...awayHint(inner - rowWidth(row), accent)], inner);
|
|
785
|
-
return withChip(row, invite, inner) ?? (
|
|
791
|
+
return withChip(row, invite, inner) ?? fitRow(row, inner);
|
|
786
792
|
};
|
|
787
793
|
|
|
788
794
|
const noticeRow = (sample, inner) => {
|
|
@@ -821,6 +827,7 @@ const completionRow = (sample, inner) => {
|
|
|
821
827
|
return fitRow([...row, ...words], inner);
|
|
822
828
|
};
|
|
823
829
|
|
|
830
|
+
const TRACK_EDGE = "#4a3f6b";
|
|
824
831
|
const levelColor = (percent) => (percent >= 90 ? HUD.red : percent >= 70 ? HUD.yellow : HUD.green);
|
|
825
832
|
|
|
826
833
|
// ╰─ ctx 42% ▰▰▱▱▱ · 5h 31% · 1w 12% · git main ───╯, or a warning first when one is up. The branch goes
|
|
@@ -839,7 +846,7 @@ const bottomEdge = (model, sample, { width, glyphs, accent, edge, look, paint, r
|
|
|
839
846
|
// The rewind look turns every cell of the bar, filled or not, so even 0% shows the colour.
|
|
840
847
|
const cells = rainbow
|
|
841
848
|
? [...Array(5)].map((_, i) => span(i < filled ? "▰" : "▱", { fg: i < filled ? rainbow(i / 5) : lerpColor(rainbow(i / 5), HUD.empty, 0.5) }))
|
|
842
|
-
: [span("▰"
|
|
849
|
+
: [...Array.from({ length: filled }, (_, i) => span("▰", { fg: model.ctxWarning ? PALETTE.amber : gradientAt([PALETTE.violet, accent], i / 4) })), span("▱".repeat(5 - filled), { fg: TRACK_EDGE })];
|
|
843
850
|
segments.push(segment("ctxbar", 2, cells, " "));
|
|
844
851
|
}
|
|
845
852
|
rates.forEach((rate, index) => segments.push(segment(`rate-${rate.label}`, 3 + index * 0.5, [span(`${rate.label} `, { fg: PALETTE.dim }), span(`${rate.percent}%`, { fg: levelColor(rate.percent) })], " · ")));
|
|
@@ -864,6 +871,14 @@ const edgeColor = (model, sample, accent, look) => {
|
|
|
864
871
|
return lerpColor(accent, "#ffffff", 0.15 + 0.3 * (sample.ambient?.breath ?? 0));
|
|
865
872
|
};
|
|
866
873
|
|
|
874
|
+
// A painted rule comes one span per cell; neighbours of one colour join, so a frame draws fewer elements.
|
|
875
|
+
const joinRules = (row) => row.reduce((out, part) => {
|
|
876
|
+
const last = out.at(-1);
|
|
877
|
+
if (last && last.fg === part.fg && /^─+$/u.test(part.text) && /^─+$/u.test(last.text)) out[out.length - 1] = { ...last, text: last.text + part.text };
|
|
878
|
+
else out.push(part);
|
|
879
|
+
return out;
|
|
880
|
+
}, []);
|
|
881
|
+
|
|
867
882
|
// How far the glint's light reaches either side of its centre, in cells.
|
|
868
883
|
const GLINT_REACH = 8;
|
|
869
884
|
|
|
@@ -920,12 +935,42 @@ export const composeBand = (model, sample, { columns, glyphs: glyphMode = "basic
|
|
|
920
935
|
...(model.threads ? threadRows(model, sample, options).map((row) => [row, 2]) : []),
|
|
921
936
|
[middle, 3],
|
|
922
937
|
];
|
|
938
|
+
// The sun's place is fixed on the card, and it stays away while any of its cells hold text.
|
|
939
|
+
const sunAt = Math.round(inner * 0.62);
|
|
940
|
+
// The invited card rests between glints, so its sea and sun move only while a glint passes, swelling and settling with it.
|
|
941
|
+
const t = look === "club" ? sample.glintT ?? null : (model.idle && look === null ? null : sample.ambient?.t ?? null);
|
|
942
|
+
const lift = look === "club" ? Math.sin(Math.PI * (sample.glint ?? 0)) : 1;
|
|
943
|
+
let sun = false;
|
|
944
|
+
if (color && !sample.completion && !sample.notice) {
|
|
945
|
+
const last = body.slice(-3);
|
|
946
|
+
const scene = paintScene(last.map(([row]) => row), sunAt, t, model.idle && look === null, width >= 90, { look, rainbow, lift, sparks: sample.ambient?.sparks ?? null });
|
|
947
|
+
sun = scene.sun;
|
|
948
|
+
scene.rows.forEach((row, i) => { last[i][0] = row; });
|
|
949
|
+
}
|
|
950
|
+
const breath = t === null ? 0 : 0.3 * (sample.ambient?.breath ?? 0);
|
|
951
|
+
const neonOn = look === null && color && model.warnings.length === 0;
|
|
952
|
+
const neonStops = ["#ff2d95", "#b48cff", accent];
|
|
953
|
+
const neon = (col, r) => {
|
|
954
|
+
const i = Math.floor(col / 4) * 4;
|
|
955
|
+
const g = i / width;
|
|
956
|
+
let hue = g < 0.5 ? mixed(neonStops[0], neonStops[1], g * 2) : mixed(neonStops[1], neonStops[2], g * 2 - 1);
|
|
957
|
+
hue = mixed(hue, "#ffffff", breath);
|
|
958
|
+
// Under the sun the rule is water: rings of sunset light run outward along it.
|
|
959
|
+
if (r === 4 && sun) {
|
|
960
|
+
const dx = i - (sunAt + 1.5 + SUN_W / 2);
|
|
961
|
+
const near = Math.max(0, 1 - Math.abs(dx) / 26);
|
|
962
|
+
const ring = 0.5 + 0.5 * Math.sin(Math.abs(dx) * 0.55 - (t ?? 0) * 2.6);
|
|
963
|
+
hue = mixed(hue, near > 0.6 ? "#ffd24a" : "#ff8f3c", Math.min(1, near * (0.45 + 0.85 * ring)));
|
|
964
|
+
}
|
|
965
|
+
return model.idle ? mixed(hue, PALETTE.faint, 0.45) : hue;
|
|
966
|
+
};
|
|
923
967
|
// The club look's ring: its velvet laid clockwise round the whole border, with the glint's light
|
|
924
968
|
// crossing the top edge while a pass runs. Without warnings only; it never touches the body.
|
|
925
969
|
const ring = look === "club" && model.warnings.length === 0 ? clubRing(width, body.length + 2, sample.glint ?? null) : null;
|
|
926
970
|
const paint = [0, 1, 2, 3, 4].map((r) => {
|
|
927
971
|
if (painted) return (col) => rainbow(col / width + r * 0.04);
|
|
928
972
|
if (ring) return r === 0 ? (col) => ring(col, 0) : r === 4 ? (col) => ring(col, body.length + 1) : null;
|
|
973
|
+
if (neonOn) return (col) => neon(col, r);
|
|
929
974
|
return r === 0 || r === 4 ? lanePaint : null;
|
|
930
975
|
});
|
|
931
976
|
const side = (row, r, y) => {
|
|
@@ -936,9 +981,9 @@ export const composeBand = (model, sample, { columns, glyphs: glyphMode = "basic
|
|
|
936
981
|
};
|
|
937
982
|
const edges = { ...options, paint };
|
|
938
983
|
const rows = [
|
|
939
|
-
topEdge(model, sample, edges),
|
|
984
|
+
joinRules(topEdge(model, sample, edges)),
|
|
940
985
|
...body.map(([row, r], index) => side(row, r, index + 1)),
|
|
941
|
-
bottomEdge(model, sample, edges),
|
|
986
|
+
joinRules(bottomEdge(model, sample, edges)),
|
|
942
987
|
];
|
|
943
988
|
return {
|
|
944
989
|
mode: "card",
|
|
@@ -50,26 +50,14 @@ export const TIMINGS = Object.freeze({
|
|
|
50
50
|
// draws its final frame and starts no frame timer; a clock on the card still ticks each second.
|
|
51
51
|
export const motionProfile = (mode) => {
|
|
52
52
|
if (mode === "off") {
|
|
53
|
-
return { mode, duration: () => 0, enterEase: EASE.linear, noticeEase: EASE.linear, shimmer: false, embers: false, ambient: null
|
|
53
|
+
return { mode, duration: () => 0, enterEase: EASE.linear, noticeEase: EASE.linear, shimmer: false, embers: false, ambient: null };
|
|
54
54
|
}
|
|
55
55
|
if (mode === "subtle") {
|
|
56
|
-
return { mode, duration: (ms) => Math.round(ms * 0.75), enterEase: EASE.outCubic, noticeEase: EASE.outCubic, shimmer: false, embers: false, ambient: { sweep: false, comet: false }
|
|
56
|
+
return { mode, duration: (ms) => Math.round(ms * 0.75), enterEase: EASE.outCubic, noticeEase: EASE.outCubic, shimmer: false, embers: false, ambient: { sweep: false, comet: false } };
|
|
57
57
|
}
|
|
58
|
-
return { mode: "full", duration: (ms) => ms, enterEase: EASE.outBack, noticeEase: EASE.outBack, shimmer: true, embers: true, ambient: { sweep: true, comet: true }
|
|
58
|
+
return { mode: "full", duration: (ms) => ms, enterEase: EASE.outBack, noticeEase: EASE.outBack, shimmer: true, embers: true, ambient: { sweep: true, comet: true } };
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
// The glyph particles that drift through the card's free cells while LitClaude works (full motion
|
|
62
|
-
// only). Every particle is ASCII, so each change repaints (see frame.mjs). A particle is born as a
|
|
63
|
-
// spinning stroke (`| / - \`), cools into a spark (`* +`) and dies as a dot (`. '`); its colour runs
|
|
64
|
-
// white-hot, flame orange, pink, then fades into the card. `rows` names the body rows that carry
|
|
65
|
-
// them (3 the skills row; the map row's text never moves), `count` how many burn per row, `life` a
|
|
66
|
-
// particle's lifetime in ms and `heat` how bright they burn (0 to 1).
|
|
67
|
-
export const PARTICLES = Object.freeze({ rows: Object.freeze([3]), count: 12, life: 1800, heat: 1, ramp: Object.freeze(["|", "/", "-", "\\", "*", "+", "+", "'", "."]) });
|
|
68
|
-
|
|
69
|
-
// The particle ink by age (0 just born, 1 gone), drawn over the card's background.
|
|
70
|
-
const EMBER_STOPS = Object.freeze(["#fff4e0", "#ffb070", "#ff6337", "#ff2d95", "#30363d"]);
|
|
71
|
-
export const emberColor = (age, heat = 1) => lerpColor("#30363d", gradientAt(EMBER_STOPS, age), heat * Math.sin(Math.PI * Math.min(1, Math.max(0, age)) ** 0.6));
|
|
72
|
-
|
|
73
61
|
// The stage kick `t` ms after the current stage changed: how far the new stage's pill lights
|
|
74
62
|
// toward white (above 0) or dips toward its ink (below 0): a damped spring that overshoots twice
|
|
75
63
|
// and is still by TIMINGS.kick.
|