@litfamily/litclaude 1.0.62 → 1.0.63
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 +12 -0
- package/README.md +11 -10
- package/README_ko-KR.md +9 -9
- package/bin/litclaude-ai.js +33 -18
- 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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.63 - 2026-11-25
|
|
4
|
+
|
|
5
|
+
- The LIT card wears a sunset in the terminal: a half-sunk sun whose light ripples, a sea that runs outward from it,
|
|
6
|
+
twinkling stars and a neon border from pink to the accent. It is drawn only where no words are, moves while Claude
|
|
7
|
+
works and holds still at rest, and the card's rows, words and widths stay as they were.
|
|
8
|
+
- The gauges on the card and the status line have round ends with the icon font, and without it in Windows
|
|
9
|
+
Terminal 1.21 or later and VS Code. `LITCLAUDE_HUD_GLYPHS=basic` and `glyphs basic` bring the square ends back.
|
|
10
|
+
- A usage window that will run out before its reset shows `! out 1h28m` on the status line.
|
|
11
|
+
- The session state keeps a small receipt for each replay key, so it no longer grows with every start.
|
|
12
|
+
- `TERM=dumb` terminals get plain ASCII art.
|
|
13
|
+
- The READMEs, the guide and the card reference describe and show the new card.
|
|
14
|
+
|
|
3
15
|
## 1.0.62 - 2026-11-24
|
|
4
16
|
|
|
5
17
|
- `lit continue`, `lit resume` and `lit 계속` in a fresh session now carry on the existing work. Before,
|
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
<p align="center"><picture><source media="(prefers-reduced-motion: reduce)" srcset="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.
|
|
1
|
+
<p align="center"><picture><source media="(prefers-reduced-motion: reduce)" srcset="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/docs/assets/cover-motion-still.webp" /><img src="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/docs/assets/cover-motion.webp" width="100%" alt="LitFamily motion cover: seven armored robots power on one by one, the LitClaude robot wakes with glowing eyes and a lit frame, then LITFAMILY and KEEP THE WORK LIT. light up." /></picture></p>
|
|
2
2
|
|
|
3
3
|
<h1 align="center">LitClaude</h1>
|
|
4
4
|
<p align="center"><strong>Keep the work lit.</strong></p>
|
|
5
5
|
<p align="center">LitClaude is an add-on for Claude Code. It makes Claude check its own work before it says "done", and leaves a note so the next session starts where this one stopped.</p>
|
|
6
6
|
<p align="center">
|
|
7
|
-
<img src="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.
|
|
8
|
-
<a href="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.
|
|
7
|
+
<img src="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/docs/assets/readme/badge-version.svg" alt="1.0.63" />
|
|
8
|
+
<a href="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/LICENSE"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/docs/assets/readme/badge-license.svg" alt="MIT license" /></a>
|
|
9
9
|
</p>
|
|
10
10
|
<p align="center">
|
|
11
|
-
<a href="https://github.com/wjgoarxiv/litclaude#readme">Full guide and skills gallery on GitHub</a> · <a href="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.
|
|
11
|
+
<a href="https://github.com/wjgoarxiv/litclaude#readme">Full guide and skills gallery on GitHub</a> · <a href="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/README_ko-KR.md">한국어</a>
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
14
|
You ask Claude for a feature. It writes the code and says it is finished, and a day later you find the tests
|
|
@@ -109,14 +109,15 @@ through the Claude Code marketplace instead has no status line and is updated or
|
|
|
109
109
|
the `/plugin` menu.
|
|
110
110
|
|
|
111
111
|
These commands open with the synthwave LIT mark; a terminal without colour gets it in plain glyphs, and one
|
|
112
|
-
without UTF-8, or piped output, gets the single line `LIT · claude code`.
|
|
113
|
-
|
|
112
|
+
without UTF-8, or piped output, gets the single line `LIT · claude code`. While you work, a card above the prompt shows the
|
|
113
|
+
stage, and a moving sunset fills its free space. A lock left by a crashed
|
|
114
|
+
session clears itself. If `state lock timed out` still appears, close the project's Claude Code sessions and delete
|
|
114
115
|
the lock folder the message names.
|
|
115
116
|
|
|
116
117
|
## More
|
|
117
118
|
|
|
118
119
|
- [Full guide and skills gallery on GitHub](https://github.com/wjgoarxiv/litclaude#readme)
|
|
119
|
-
- [Privacy and network behavior](https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.
|
|
120
|
-
- [Migration and ownership conflicts](https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.
|
|
121
|
-
- [Release history](https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.
|
|
122
|
-
- [MIT license](https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.
|
|
120
|
+
- [Privacy and network behavior](https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/docs/privacy.md)
|
|
121
|
+
- [Migration and ownership conflicts](https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/docs/migration.md)
|
|
122
|
+
- [Release history](https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/CHANGELOG.md)
|
|
123
|
+
- [MIT license](https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/LICENSE)
|
package/README_ko-KR.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
<p align="center"><picture><source media="(prefers-reduced-motion: reduce)" srcset="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.
|
|
1
|
+
<p align="center"><picture><source media="(prefers-reduced-motion: reduce)" srcset="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/docs/assets/cover-motion-still.webp" /><img src="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/docs/assets/cover-motion.webp" width="100%" alt="LitFamily 모션 커버: 일곱 로봇 패널이 차례로 켜지고, LitClaude 로봇의 눈과 테두리가 빛난 뒤 LITFAMILY와 KEEP THE WORK LIT. 문구가 밝아지는 영상" /></picture></p>
|
|
2
2
|
|
|
3
3
|
<h1 align="center">LitClaude</h1>
|
|
4
4
|
<p align="center"><strong>Keep the work lit.</strong></p>
|
|
5
5
|
<p align="center">LitClaude는 Claude Code에 붙이는 추가 기능입니다. Claude가 "다 됐어요"라고 말하기 전에 자기 작업을 직접 확인하게 하고, 다음 세션이 이어서 시작할 수 있도록 기록을 남기게 합니다.</p>
|
|
6
6
|
<p align="center">
|
|
7
|
-
<img src="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.
|
|
8
|
-
<a href="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.
|
|
7
|
+
<img src="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/docs/assets/readme/badge-version.svg" alt="1.0.63" />
|
|
8
|
+
<a href="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/LICENSE"><img src="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/docs/assets/readme/badge-license.svg" alt="MIT license" /></a>
|
|
9
9
|
</p>
|
|
10
10
|
<p align="center">
|
|
11
|
-
<a href="https://github.com/wjgoarxiv/litclaude/blob/main/README_ko-KR.md">전체 안내와 스킬 갤러리는 GitHub에서</a> · <a href="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.
|
|
11
|
+
<a href="https://github.com/wjgoarxiv/litclaude/blob/main/README_ko-KR.md">전체 안내와 스킬 갤러리는 GitHub에서</a> · <a href="https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/README.md">English</a>
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
14
|
Claude에게 기능을 하나 부탁하면 코드를 쓰고 끝났다고 말합니다. 그런데 다음 날 보니 테스트는 한 번도 돌지 않았습니다. 새 세션을 열면 프로젝트 설명을 처음부터 다시 해야 합니다.
|
|
@@ -102,13 +102,13 @@ npx @litfamily/litclaude@latest uninstall
|
|
|
102
102
|
업데이트와 제거는 `/plugin` 메뉴에서 합니다.
|
|
103
103
|
|
|
104
104
|
이 명령들은 신스웨이브 LIT 마크로 시작합니다. 색이 없는 터미널에서는 기호로만 그리고, UTF-8을 쓰지 않는 터미널이나
|
|
105
|
-
파이프로 넘긴 출력에는 `LIT · claude code` 한 줄만 나옵니다. 세션이 비정상으로 끝나 남은 잠금은 저절로 풀립니다. 그래도
|
|
105
|
+
파이프로 넘긴 출력에는 `LIT · claude code` 한 줄만 나옵니다. 일하는 동안 프롬프트 위 카드가 지금 단계를 보여 주고, 빈자리에는 움직이는 노을이 뜹니다. 세션이 비정상으로 끝나 남은 잠금은 저절로 풀립니다. 그래도
|
|
106
106
|
`state lock timed out`이 보이면 그 프로젝트의 Claude Code 세션을 닫고 메시지에 적힌 잠금 폴더를 지우면 됩니다.
|
|
107
107
|
|
|
108
108
|
## 더 보기
|
|
109
109
|
|
|
110
110
|
- [전체 안내와 스킬 갤러리 (GitHub)](https://github.com/wjgoarxiv/litclaude/blob/main/README_ko-KR.md)
|
|
111
|
-
- [개인정보와 네트워크 동작](https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.
|
|
112
|
-
- [이전과 소유권 충돌](https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.
|
|
113
|
-
- [변경 이력](https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.
|
|
114
|
-
- [MIT 라이선스](https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.
|
|
111
|
+
- [개인정보와 네트워크 동작](https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/docs/privacy.md)
|
|
112
|
+
- [이전과 소유권 충돌](https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/docs/migration.md)
|
|
113
|
+
- [변경 이력](https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/CHANGELOG.md)
|
|
114
|
+
- [MIT 라이선스](https://cdn.jsdelivr.net/npm/@litfamily/litclaude@1.0.63/LICENSE)
|
package/bin/litclaude-ai.js
CHANGED
|
@@ -426,7 +426,20 @@ const renderLitClaudeWordmark = ({ color = shouldColorInstall() } = {}) => {
|
|
|
426
426
|
return rows.concat(`${" ".repeat(Math.max(0, Math.floor((markWidth - versionLine.length) / 2)))}${versionLine}`);
|
|
427
427
|
};
|
|
428
428
|
|
|
429
|
-
|
|
429
|
+
// TERM=dumb or a locale that names a non-UTF-8 charset gets ASCII stand-ins for the frame glyphs.
|
|
430
|
+
// An unset locale keeps the frame: Windows Terminal and minimal containers draw it fine.
|
|
431
|
+
const FRAME_ASCII = Object.freeze({ "━": "=", "─": "-", "│": "|", "╭": "+", "╰": "+", "·": "-", "—": "-", "✓": "ok", "✗": "x" });
|
|
432
|
+
const asciiTerminal = () => {
|
|
433
|
+
const locale = process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG || "";
|
|
434
|
+
return process.env.TERM === "dumb" || (locale !== "" && !/utf-?8/iu.test(locale));
|
|
435
|
+
};
|
|
436
|
+
const asciiFrame = (text) => asciiTerminal()
|
|
437
|
+
? text.replace(/[━─│╭╰·—✓✗]/gu, (glyph) => FRAME_ASCII[glyph]).replace(/[⠀-⣿]/gu, "-")
|
|
438
|
+
: text;
|
|
439
|
+
|
|
440
|
+
const familyBanner = (options) => asciiFrame(familyBannerRows(options));
|
|
441
|
+
|
|
442
|
+
const familyBannerRows = ({ color = shouldColorInstall() } = {}) => [
|
|
430
443
|
brandOrange(FAMILY_RULE, color),
|
|
431
444
|
"",
|
|
432
445
|
...renderLitClaudeWordmark({ color }),
|
|
@@ -443,7 +456,7 @@ const printCommandBanner = (parsed) => {
|
|
|
443
456
|
if (["install", "update", "workflow-stage", "rewind", "sessions", "why"].includes(parsed.command)) return;
|
|
444
457
|
if (parsed.rest.some((arg) => arg === "--json" || arg.startsWith("--json="))) return;
|
|
445
458
|
const color = shouldColorInstall();
|
|
446
|
-
process.stdout.write(`${renderLitClaudeWordmark({ color }).join("\n")}\n`);
|
|
459
|
+
process.stdout.write(asciiFrame(`${renderLitClaudeWordmark({ color }).join("\n")}\n`));
|
|
447
460
|
};
|
|
448
461
|
|
|
449
462
|
const createInstallProgress = () => {
|
|
@@ -452,19 +465,21 @@ const createInstallProgress = () => {
|
|
|
452
465
|
// Explicit spinner mode keeps structured progress, but cannot enable terminal escapes.
|
|
453
466
|
const live = animated && shouldColorInstall();
|
|
454
467
|
|
|
468
|
+
const write = (chunk) => process.stdout.write(asciiFrame(chunk));
|
|
469
|
+
|
|
455
470
|
const clearLiveLine = () => {
|
|
456
|
-
if (live)
|
|
471
|
+
if (live) write("\r\x1b[2K");
|
|
457
472
|
};
|
|
458
473
|
|
|
459
474
|
return {
|
|
460
475
|
prepare({ claudeTarget, litTarget }) {
|
|
461
476
|
if (!animated) {
|
|
462
|
-
|
|
463
|
-
|
|
477
|
+
write(`\n${familyBanner({ color: false })}`);
|
|
478
|
+
write(`INSTALL_STEP: Installing LitClaude ${version}\n`);
|
|
464
479
|
return;
|
|
465
480
|
}
|
|
466
|
-
|
|
467
|
-
|
|
481
|
+
write(`\n${familyBanner()}\n`);
|
|
482
|
+
write(
|
|
468
483
|
`\n╭─ PREPARING INSTALL\n` +
|
|
469
484
|
`│ Package LitClaude ${version}\n` +
|
|
470
485
|
`│ Action Installing LitClaude ${version}\n` +
|
|
@@ -476,11 +491,11 @@ const createInstallProgress = () => {
|
|
|
476
491
|
},
|
|
477
492
|
async run({ number, title, label, purpose, target }, work) {
|
|
478
493
|
if (!animated) {
|
|
479
|
-
|
|
494
|
+
write(`INSTALL_STEP: ${label}\n`);
|
|
480
495
|
return work();
|
|
481
496
|
}
|
|
482
497
|
|
|
483
|
-
|
|
498
|
+
write(
|
|
484
499
|
`${String(number).padStart(2, "0")} / 05 ${title}\n` +
|
|
485
500
|
` ${purpose}\n` +
|
|
486
501
|
` target ${target}\n`,
|
|
@@ -490,7 +505,7 @@ const createInstallProgress = () => {
|
|
|
490
505
|
const frame = spinnerFrames[frameIndex % spinnerFrames.length];
|
|
491
506
|
frameIndex += 1;
|
|
492
507
|
const line = ` ${color256(81, frame)} ${formatInstallStep(label)}`;
|
|
493
|
-
|
|
508
|
+
write(live ? `\r\x1b[2K${line}` : `${line}\n`);
|
|
494
509
|
};
|
|
495
510
|
renderSpinner();
|
|
496
511
|
const timer = live ? setInterval(renderSpinner, 80) : undefined;
|
|
@@ -499,12 +514,12 @@ const createInstallProgress = () => {
|
|
|
499
514
|
const result = await work();
|
|
500
515
|
if (timer) clearInterval(timer);
|
|
501
516
|
clearLiveLine();
|
|
502
|
-
|
|
517
|
+
write(` ${color256(119, "✓")} ${bold(label)}\n\n`);
|
|
503
518
|
return result;
|
|
504
519
|
} catch (error) {
|
|
505
520
|
if (timer) clearInterval(timer);
|
|
506
521
|
clearLiveLine();
|
|
507
|
-
|
|
522
|
+
write(
|
|
508
523
|
` ${color256(203, "✗")} ${bold(`${label} failed`)}\n\n` +
|
|
509
524
|
`╭─ INSTALL STOPPED\n` +
|
|
510
525
|
`│ Stage ${String(number).padStart(2, "0")} / 05 · ${title}\n` +
|
|
@@ -517,11 +532,11 @@ const createInstallProgress = () => {
|
|
|
517
532
|
},
|
|
518
533
|
receipt(rows) {
|
|
519
534
|
if (!animated) return;
|
|
520
|
-
|
|
535
|
+
write("\n╭─ INSTALL RECEIPT\n");
|
|
521
536
|
for (const [key, value] of rows) {
|
|
522
|
-
|
|
537
|
+
write(`│ ${key.padEnd(13)} ${value}\n`);
|
|
523
538
|
}
|
|
524
|
-
|
|
539
|
+
write("╰─ Installation complete\n\n");
|
|
525
540
|
},
|
|
526
541
|
};
|
|
527
542
|
};
|
|
@@ -1697,9 +1712,9 @@ const install = async ({ dryRun, rest }) => {
|
|
|
1697
1712
|
process.stdout.write(`Marketplace: ${localMarketplace}\n`);
|
|
1698
1713
|
process.stdout.write(`Plugin path: ${intendedPluginPath(home)}\n`);
|
|
1699
1714
|
process.stdout.write(hudManaged ? `HUD: LitClaude statusLine installed (${hudAccent})\n` : "HUD: user statusLine setting preserved\n");
|
|
1700
|
-
process.stdout.write(`Global Claude settings permissions.allow/deny: ${permissionMode} — ${permissionProfile(permissionMode).description}\n`);
|
|
1701
|
-
process.stdout.write(`MOD_OPTIONS: ${modOptionsLine(readClaudeSettings(home))} (change: litclaude-ai config <option> <value>)\n`);
|
|
1702
|
-
process.stdout.write("DESKTOP_APP: ready — the Claude desktop app's Code tab reads these same settings; open a new session there\n");
|
|
1715
|
+
process.stdout.write(asciiFrame(`Global Claude settings permissions.allow/deny: ${permissionMode} — ${permissionProfile(permissionMode).description}\n`));
|
|
1716
|
+
process.stdout.write(asciiFrame(`MOD_OPTIONS: ${modOptionsLine(readClaudeSettings(home))} (change: litclaude-ai config <option> <value>)\n`));
|
|
1717
|
+
process.stdout.write(asciiFrame("DESKTOP_APP: ready — the Claude desktop app's Code tab reads these same settings; open a new session there\n"));
|
|
1703
1718
|
if (wantsIconFont) await runIconFontInstall();
|
|
1704
1719
|
await installAttribution({ assumeYes });
|
|
1705
1720
|
await installAgentFile({ assumeYes, agentFile });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="146" height="20" role="img" aria-label="release: 1.0.
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="146" height="20" role="img" aria-label="release: 1.0.63"><title>release: 1.0.63</title><g shape-rendering="crispEdges"><rect width="49" height="20" fill="#080d14"/><rect x="49" width="97" height="20" fill="#ff6337"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text x="255" y="140" textLength="390" transform="scale(.1)">release</text><text x="965" y="140" textLength="870" transform="scale(.1)" fill="#080D14">1.0.63</text></g></svg>
|
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.63",
|
|
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.
|
|
@@ -37,12 +37,16 @@ export const effectiveMotion = (motion, hostSettings) => (hostSettings?.prefersR
|
|
|
37
37
|
// The glyph set one surface draws. Private-use Nerd Font glyphs only reach the terminal, which
|
|
38
38
|
// draws with the person's own fonts; `auto` uses them there when the icon font is installed. The
|
|
39
39
|
// desktop app and the other surfaces always get the basic set.
|
|
40
|
-
export const resolveGlyphs = (preference, surface, iconFontPresent) => {
|
|
40
|
+
export const resolveGlyphs = (preference, surface, iconFontPresent, roundCaps = false) => {
|
|
41
41
|
if (surface !== "terminal") return "basic";
|
|
42
|
-
if (preference === "auto") return iconFontPresent ? "nerd" : "basic";
|
|
42
|
+
if (preference === "auto") return iconFontPresent ? "nerd" : roundCaps ? "round" : "basic";
|
|
43
43
|
return preference === "nerd" ? "nerd" : "basic";
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
+
// Windows Terminal (1.21 and later) and VS Code draw the two round caps themselves, whatever font is
|
|
47
|
+
// set, so `auto` rounds the pills there without the icon font and keeps every other symbol basic.
|
|
48
|
+
export const drawsRoundCaps = (env) => Boolean(env?.WT_SESSION) || env?.TERM_PROGRAM === "vscode";
|
|
49
|
+
|
|
46
50
|
const BASIC = Object.freeze({
|
|
47
51
|
capLeft: "",
|
|
48
52
|
capRight: "",
|
|
@@ -73,7 +77,10 @@ const NERD = Object.freeze({
|
|
|
73
77
|
branch: "",
|
|
74
78
|
});
|
|
75
79
|
|
|
76
|
-
|
|
80
|
+
// BASIC with round caps.
|
|
81
|
+
const ROUND = Object.freeze({ ...BASIC, capLeft: "", capRight: "" });
|
|
82
|
+
|
|
83
|
+
export const glyphSet = (glyphs) => (glyphs === "nerd" ? NERD : glyphs === "round" ? ROUND : BASIC);
|
|
77
84
|
|
|
78
85
|
// The status line's accents (hud-accent-palette.mjs HUD_ACCENT_THEMES, kept equal by a test) as
|
|
79
86
|
// xterm 256-colour codes. The mod cannot import that file, so the card reads the same names here.
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// The card's sunset: a half-sunk sun, twinkling stars, a shooting star now and then and a glittering
|
|
2
|
+
// sea, painted over the cells of the last three body rows that no text uses. Text always wins: the
|
|
3
|
+
// sun stays away while any of its cells is taken, and the sea keeps two cells clear of words.
|
|
4
|
+
|
|
5
|
+
import { textWidth } from "./layout.mjs";
|
|
6
|
+
import { lerpColor } from "./motion.mjs";
|
|
7
|
+
|
|
8
|
+
const FAINT = "#30363d";
|
|
9
|
+
const REWIND_SPARKS = Object.freeze([".", "*", "+", "'"]);
|
|
10
|
+
const span = (text, style = {}) => ({ text, ...style });
|
|
11
|
+
|
|
12
|
+
// Cells back to spans: neighbours join when they came from the same span (`from`) and look the same, and the
|
|
13
|
+
// blank gaps between words join, whatever colour their spaces carried.
|
|
14
|
+
const joinCells = (cells) => cells.reduce((out, { from, ...styled }) => {
|
|
15
|
+
const cell = from === "gap" ? { text: styled.text } : styled;
|
|
16
|
+
const last = out.at(-1);
|
|
17
|
+
if (last && last.from === from && last.fg === cell.fg && last.bg === cell.bg && Boolean(last.bold) === Boolean(cell.bold)) last.text += cell.text;
|
|
18
|
+
else out.push({ from, ...cell });
|
|
19
|
+
return out;
|
|
20
|
+
}, []).map(({ from, ...part }) => part);
|
|
21
|
+
// The sunset scene, drawn only in cells no text uses. t is the ambient loop's elapsed seconds, null while the card
|
|
22
|
+
// rests: the same scene then holds still and costs no frames. Shape glyphs never change, only their colour; what does
|
|
23
|
+
// change its glyph (the sea, the stars) is ASCII.
|
|
24
|
+
export const SUN_W = 18;
|
|
25
|
+
const SUN_DARK = "#1a1030";
|
|
26
|
+
const SUN_INK = [["#ffd24a", "#fff0a0"], ["#ff8f3c", "#ffc15a"], ["#ff2d8a", "#ff6b8f"]];
|
|
27
|
+
// The dome's outline in eighth-blocks, so it curves; inside, a thin dark slit over the second row and a thicker one over the third.
|
|
28
|
+
const SUN_CELLS = [0, 1, 2].map((r) => Array.from({ length: SUN_W }, (_, x) => {
|
|
29
|
+
const d = (x - (SUN_W - 1) / 2) / (SUN_W / 2);
|
|
30
|
+
const fill = Math.max(0, Math.min(8, Math.round(Math.sqrt(1 - d * d) * 24) - (2 - r) * 8));
|
|
31
|
+
if (fill === 0) return null;
|
|
32
|
+
if (fill < 8) return ["▁▂▃▄▅▆▇"[fill - 1]];
|
|
33
|
+
return r === 0 ? ["█"] : [r === 1 ? "▇" : "▆", SUN_DARK];
|
|
34
|
+
}));
|
|
35
|
+
const STARS = [[0, -30], [1, -24], [0, -18], [1, -13], [0, -9], [1, -5], [0, 22], [1, 25], [0, 29], [1, 32], [0, 35]];
|
|
36
|
+
// Colours come in eight steps, mixed once and kept, so a frame mixes nothing twice and equal neighbours merge.
|
|
37
|
+
const steps = new Map();
|
|
38
|
+
export const mixed = (a, b, k) => {
|
|
39
|
+
const n = Math.max(0, Math.min(8, Math.round(k * 8)));
|
|
40
|
+
const key = a + b + n;
|
|
41
|
+
if (!steps.has(key)) { if (steps.size > 4000) steps.clear(); steps.set(key, lerpColor(a, b, n / 8)); }
|
|
42
|
+
return steps.get(key);
|
|
43
|
+
};
|
|
44
|
+
// Each look keeps its own colours: the invited card's velvet, YOUR TURN's amber; the rewind sun turns with its rainbow.
|
|
45
|
+
const SUN_LOOK = {
|
|
46
|
+
club: { ink: [["#ffd75f", "#fff6d6"], ["#ffb38a", "#ffe0b8"], ["#ff8fbf", "#ffc4e2"]], sea: ["#ffd75f", "#ffb38a", "#ff8fbf", "#b48cff", "#6a5aa8"] },
|
|
47
|
+
turn: { ink: [["#ffc95a", "#fff0b8"], ["#ffaf3c", "#ffd98a"], ["#e08a1e", "#ffb95a"]], sea: ["#ffd98a", "#ffaf3c", "#e08a1e", "#9a6420", "#5a4020"] },
|
|
48
|
+
};
|
|
49
|
+
const SEA = ["#ffdc73", "#ff9a4a", "#ff4f8b", "#b457d6", "#5a46a8"];
|
|
50
|
+
// The sea's light dx cells from under the sun: waves that travel outward, brightest on the sun's path.
|
|
51
|
+
const seaCell = (dx, t, SEA_INK = SEA) => {
|
|
52
|
+
const far = Math.abs(dx);
|
|
53
|
+
const wave = Math.sin(far * 0.62 - t * 2.3) + 0.8 * Math.sin(dx * 0.31 + t * 1.1) + 0.6 * Math.sin(dx * 1.37 - t * 0.7);
|
|
54
|
+
const level = wave * 0.62 + 1.05 - far / 34;
|
|
55
|
+
if (level < 0.22) return null;
|
|
56
|
+
const hue = Math.min(3.99, far / 13);
|
|
57
|
+
const base = mixed(SEA_INK[Math.floor(hue)], SEA_INK[Math.floor(hue) + 1], hue % 1);
|
|
58
|
+
return { text: level > 1.0 ? "~" : level > 0.55 ? "-" : ".", fg: mixed(FAINT, base, Math.min(1, 0.18 + level * 0.55)), ...(level > 1.5 ? { bold: true } : {}) };
|
|
59
|
+
};
|
|
60
|
+
// A row as one entry per cell; a wide character's second cell is null and a mark stays with its character.
|
|
61
|
+
const toCells = (row) => {
|
|
62
|
+
const cells = [];
|
|
63
|
+
row.forEach((part, index) => {
|
|
64
|
+
const from = part.bg || part.text.trim() ? index : "gap";
|
|
65
|
+
for (const ch of part.text) {
|
|
66
|
+
const width = textWidth(ch);
|
|
67
|
+
const last = cells.findLast(Boolean);
|
|
68
|
+
if (width === 0 && last) last.text += ch;
|
|
69
|
+
else cells.push({ ...part, text: ch, from }, ...(width === 2 ? [null] : []));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return cells;
|
|
73
|
+
};
|
|
74
|
+
const isFree = (cell) => Boolean(cell) && cell.text === " " && !cell.bg;
|
|
75
|
+
// Paints the last three body rows: stars and now and then a shooting star over the sun, the sea on the third.
|
|
76
|
+
// Returns the rows and whether the sun found room; the sea keeps two cells clear of any text.
|
|
77
|
+
export const paintScene = (rows, at, t, dim, sunOk, { look = null, rainbow = null, lift = 1, sparks = null } = {}) => {
|
|
78
|
+
const ink = SUN_LOOK[look]?.ink ?? SUN_INK;
|
|
79
|
+
const s = t ?? 0;
|
|
80
|
+
const grids = rows.map(toCells);
|
|
81
|
+
const shade = (hex) => (dim ? mixed(hex, FAINT, 0.6) : hex);
|
|
82
|
+
const sun = sunOk && grids.every((grid) => grid.slice(at - 2, at + SUN_W + 2).every(isFree) && grid.length >= at + SUN_W + 2);
|
|
83
|
+
const mid = at + SUN_W / 2 - 0.5;
|
|
84
|
+
if (sun) {
|
|
85
|
+
for (const [r, dx] of STARS) {
|
|
86
|
+
const x = at + dx;
|
|
87
|
+
// A star stands clear of words, so it never reads as part of one.
|
|
88
|
+
if (!isFree(grids[r][x]) || ![-3, -2, -1, 1, 2, 3].every((n) => grids[r][x + n] === undefined || isFree(grids[r][x + n]))) continue;
|
|
89
|
+
const tw = 0.5 + 0.5 * Math.sin(s * 1.7 + dx * 2.1);
|
|
90
|
+
grids[r][x] = span(tw > 0.85 ? "*" : tw > 0.45 ? "+" : ".", { fg: mixed(FAINT, shade(dx % 2 ? "#a99bff" : "#ff9ad5"), 0.35 + 0.65 * tw) });
|
|
91
|
+
}
|
|
92
|
+
const dash = t === null ? 9 : s % 9;
|
|
93
|
+
if (dash < 1.1) {
|
|
94
|
+
const head = Math.round(at + SUN_W + 22 - (dash / 1.1) * 34);
|
|
95
|
+
["*", "-", "-", "."].forEach((ch, i) => { if (isFree(grids[0][head + i])) grids[0][head + i] = span(ch, { fg: mixed("#fff4e0", "#b457d6", i / 3), bold: i === 0 }); });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (!rainbow && (t !== null || sun)) {
|
|
99
|
+
const sea = grids[2];
|
|
100
|
+
const before = sea.map(isFree);
|
|
101
|
+
for (let x = 0; x < sea.length; x += 1) {
|
|
102
|
+
const open = before[x] && [1, 2, 3].every((n) => before[x - n] !== false && before[x + n] !== false);
|
|
103
|
+
const cell = open ? seaCell(x - mid, s, SUN_LOOK[look]?.sea) : null;
|
|
104
|
+
if (cell) sea[x] = span(cell.text, { fg: shade(cell.fg), ...(cell.bold ? { bold: true } : {}) });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (sun) {
|
|
108
|
+
SUN_CELLS.forEach((line, r) => line.forEach((cell, x) => {
|
|
109
|
+
if (!cell) return;
|
|
110
|
+
// Heat: light runs up the sun and ripples across it.
|
|
111
|
+
const heat = 0.5 + 0.5 * Math.sin(s * 2.1 + r * 1.5 + 0.55 * Math.sin(x * 0.8 + s * 1.6));
|
|
112
|
+
grids[r][at + x] = span(cell[0], { fg: rainbow ? mixed(rainbow(x / SUN_W / 2 + r * 0.12), "#ffffff", 0.45 + 0.25 * heat) : shade(mixed(ink[r][0], ink[r][1], t === null ? 0.25 : 0.25 + (heat - 0.25) * lift)), ...(cell[1] ? { bg: cell[1] } : {}) });
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
// The rewind sparks keep drifting, behind the sun.
|
|
116
|
+
if (rainbow && sparks) for (const { x, glyph } of sparks) { const at2 = Math.floor(grids[2].length * (0.35 + 0.65 * x)); if (isFree(grids[2][at2]) && isFree(grids[2][at2 - 1])) grids[2][at2] = span(REWIND_SPARKS[glyph], { fg: rainbow(x) }); }
|
|
117
|
+
return { rows: grids.map((grid) => joinCells(grid.filter(Boolean))), sun };
|
|
118
|
+
};
|
|
@@ -167,29 +167,13 @@ const sparksAt = (elapsed) => SPARK_SEEDS.map(({ start, speed, twinkle }) => {
|
|
|
167
167
|
// the card (`comet`, 0 to 1: the top rule left to right, then the bottom rule right to left),
|
|
168
168
|
// where the bright head stands on the rail leaving the current stage (`flow`, 0 to 1), how far the
|
|
169
169
|
// rewind look's hue has turned (`hue`, 0 to 1 over TIMINGS.hue) and its sparks (`sparks`, full only).
|
|
170
|
-
//
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
state = (state * 1103515245 + 12345) % 2147483648;
|
|
177
|
-
return state / 2147483648;
|
|
178
|
-
};
|
|
179
|
-
return Object.freeze(Array.from({ length: 24 }, () => Object.freeze({ offset: next(), drift: next() - 0.5, place: next(), pace: 0.75 + 0.5 * next() })));
|
|
180
|
-
})();
|
|
181
|
-
const placeOf = (seed, generation) => {
|
|
182
|
-
const v = Math.sin((seed.place * 977 + generation * 131.7) * 12.9898) * 43758.5453;
|
|
183
|
-
return v - Math.floor(v);
|
|
170
|
+
// Seconds of glint played so far: it stands still between passes, so whatever follows it never jumps.
|
|
171
|
+
const glintSeconds = (timeline, now) => {
|
|
172
|
+
if (!timeline.glint?.on || timeline.exitAt !== null) return null;
|
|
173
|
+
const elapsed = Math.max(0, now - timeline.glint.at - TIMINGS.clubGlintRest);
|
|
174
|
+
const into = Math.min(TIMINGS.clubGlint, elapsed % TIMINGS.clubGlintPeriod);
|
|
175
|
+
return (Math.floor(elapsed / TIMINGS.clubGlintPeriod) * TIMINGS.clubGlint + into) / 1000;
|
|
184
176
|
};
|
|
185
|
-
const particlesAt = (elapsed, style) => Object.fromEntries(style.rows.map((row, r) => [row, PARTICLE_SEEDS.slice(r * 12, r * 12 + style.count).map((seed) => {
|
|
186
|
-
const cycle = (elapsed * seed.pace) / style.life + seed.offset;
|
|
187
|
-
const generation = Math.floor(cycle);
|
|
188
|
-
const age = cycle - generation;
|
|
189
|
-
const x = placeOf(seed, generation) + seed.drift * 0.08 * age;
|
|
190
|
-
return { x: Math.min(0.999, Math.max(0, x)), age, glyph: Math.min(style.ramp.length - 1, Math.floor(age * style.ramp.length)) };
|
|
191
|
-
})]));
|
|
192
|
-
|
|
193
177
|
const ambientSample = (timeline, now, profile) => {
|
|
194
178
|
if (!ambientActive(timeline, profile)) return null;
|
|
195
179
|
const elapsed = Math.max(0, now - timeline.ambient.at);
|
|
@@ -197,12 +181,12 @@ const ambientSample = (timeline, now, profile) => {
|
|
|
197
181
|
const pass = ((elapsed % TIMINGS.sweep) / TIMINGS.sweep) * 1.6 - 0.3;
|
|
198
182
|
return {
|
|
199
183
|
breath,
|
|
184
|
+
t: profile.ambient.sweep ? elapsed / 1000 : null,
|
|
200
185
|
sweep: profile.ambient.sweep && pass >= -0.2 && pass <= 1.2 ? pass : null,
|
|
201
186
|
comet: profile.ambient.comet ? (elapsed % TIMINGS.comet) / TIMINGS.comet : null,
|
|
202
187
|
flow: profile.ambient.sweep ? (elapsed % TIMINGS.flow) / TIMINGS.flow : null,
|
|
203
188
|
hue: (elapsed % TIMINGS.hue) / TIMINGS.hue,
|
|
204
189
|
sparks: profile.ambient.sweep ? sparksAt(elapsed) : null,
|
|
205
|
-
particles: profile.particles ? { style: profile.particles, rows: particlesAt(elapsed, profile.particles) } : null,
|
|
206
190
|
};
|
|
207
191
|
};
|
|
208
192
|
|
|
@@ -216,7 +200,7 @@ export const timelineBusy = (timeline, now, profile) => {
|
|
|
216
200
|
if (timeline.notice && now < timeline.notice.at + d(TIMINGS.noticeIn)) return true;
|
|
217
201
|
if (timeline.leaving && now < timeline.leaving.at + d(TIMINGS.noticeOut)) return true;
|
|
218
202
|
if (timeline.completion && now < timeline.completion.at + d(TIMINGS.completion)) return true;
|
|
219
|
-
if (profile.
|
|
203
|
+
if (profile.shimmer && timeline.stage?.at !== null && timeline.stage?.at !== undefined && now < timeline.stage.at + TIMINGS.kick) return true;
|
|
220
204
|
return Object.values(timeline.chips).some((chip) => (chip.arrivedAt !== null && now < chip.arrivedAt + d(TIMINGS.shimmer))
|
|
221
205
|
|| (chip.from !== chip.state && now < chip.changedAt + d(TIMINGS.crossfade)));
|
|
222
206
|
};
|
|
@@ -285,9 +269,10 @@ export const sampleTimeline = (timeline, now, profile) => {
|
|
|
285
269
|
chips,
|
|
286
270
|
ambient: ambientSample(timeline, now, profile),
|
|
287
271
|
glint: glintAt(timeline, now),
|
|
272
|
+
glintT: glintSeconds(timeline, now),
|
|
288
273
|
step: timeline.step ? { name: timeline.step.name, elapsedMs: timeline.step.base + Math.max(0, now - timeline.step.at) } : null,
|
|
289
274
|
lanes: timeline.lanes ? { elapsedMs: timeline.lanes.base + Math.max(0, now - timeline.lanes.at) } : null,
|
|
290
|
-
kick: profile.
|
|
275
|
+
kick: profile.shimmer && timeline.stage?.at !== null && timeline.stage?.at !== undefined ? springKick(now - timeline.stage.at) : 0,
|
|
291
276
|
spin: Math.floor(Math.max(0, now) / TIMINGS.spin) % 4,
|
|
292
277
|
};
|
|
293
278
|
};
|
|
@@ -433,13 +433,19 @@ const idempotentReplay = (state, key, fingerprint) => {
|
|
|
433
433
|
const entry = state.idempotency[key];
|
|
434
434
|
if (!entry) return null;
|
|
435
435
|
if (entry.request_hash !== fingerprint) throw new StartWorkLifecycleError("idempotency key conflict", 409);
|
|
436
|
+
// A receipt keeps the response without its state copy; the replay attaches the current state.
|
|
437
|
+
// Entries written before receipts still carry their own state and replay as stored.
|
|
438
|
+
if (entry.state_omitted) return { ...clone(entry.response), state: publicState(state) };
|
|
436
439
|
return clone(entry.response);
|
|
437
440
|
};
|
|
438
441
|
|
|
439
442
|
const rememberIdempotency = (state, key, fingerprint, response) => {
|
|
443
|
+
// Storing `response.state` here kept a full copy of the state per key (16 keys reached ~1 MB).
|
|
444
|
+
const { state: omitted, ...receipt } = response;
|
|
440
445
|
state.idempotency[key] = {
|
|
441
446
|
request_hash: fingerprint,
|
|
442
|
-
response: clone(
|
|
447
|
+
response: clone(receipt),
|
|
448
|
+
...(omitted === undefined ? {} : { state_omitted: true }),
|
|
443
449
|
recorded_at: nowIso(),
|
|
444
450
|
};
|
|
445
451
|
};
|
|
@@ -2464,9 +2470,10 @@ export const startWorkFromInvocation = (root, { sessionId, promptId, plan = null
|
|
|
2464
2470
|
issuedBy: "user-invocation",
|
|
2465
2471
|
originPromptId: promptId,
|
|
2466
2472
|
});
|
|
2467
|
-
|
|
2473
|
+
// A replayed start reads the current state, where a finished work may already be trimmed away.
|
|
2474
|
+
const work = response.state.works[workId] ?? response.state.history.find(({ work_id: id }) => id === workId);
|
|
2468
2475
|
const inside = relative(canonicalRoot, planPath);
|
|
2469
|
-
return { started: { workId, plan: work.
|
|
2476
|
+
return { started: { workId, plan: work?.plan_name ?? planPath.split(/[\\/]/u).at(-1), next: work?.progress?.next_task ?? null, ...(inside && !inside.startsWith("..") && !isAbsolute(inside) ? { ref: inside.split(/[\\/]/u).join("/") } : {}) } };
|
|
2470
2477
|
};
|
|
2471
2478
|
|
|
2472
2479
|
const pendingFor = (state, sessionId) => {
|