@litfamily/litclaude 1.0.40 → 1.0.42
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 +47 -0
- package/README.md +8 -8
- package/README_ko-KR.md +8 -8
- package/docs/assets/readme/badge-version.svg +1 -1
- package/docs/hooks.md +35 -8
- package/package.json +1 -1
- package/plugins/litclaude/.claude-plugin/plugin.json +1 -1
- package/plugins/litclaude/bin/litclaude-hook.js +49 -8
- package/plugins/litclaude/bin/litclaude-mcp.js +1 -1
- package/plugins/litclaude/commands/lit-plan.md +5 -2
- package/plugins/litclaude/commands/start-work.md +8 -0
- package/plugins/litclaude/hooks/lit-band-client.mjs +1 -1
- package/plugins/litclaude/hooks/lit-mod.mjs +89 -9
- package/plugins/litclaude/lib/canonical-skill-resources.mjs +10 -10
- package/plugins/litclaude/lib/lit-plan-persistence.mjs +15 -4
- package/plugins/litclaude/lib/mod/frame.mjs +55 -29
- package/plugins/litclaude/lib/mod/looks.mjs +36 -0
- package/plugins/litclaude/lib/mod/motion.mjs +2 -3
- package/plugins/litclaude/lib/mod/state.mjs +72 -7
- package/plugins/litclaude/lib/mod/svg-card.mjs +13 -5
- package/plugins/litclaude/lib/mod/timeline.mjs +3 -3
- package/plugins/litclaude/lib/mod/view.mjs +155 -19
- package/plugins/litclaude/lib/mod/workflow.mjs +2 -0
- package/plugins/litclaude/lib/plan-scope-roots.mjs +76 -0
- package/plugins/litclaude/lib/rewind/brief.mjs +62 -8
- package/plugins/litclaude/lib/rewind/collect.mjs +114 -25
- package/plugins/litclaude/lib/session-liveness.mjs +36 -0
- package/plugins/litclaude/lib/start-work-lifecycle.mjs +158 -5
- package/plugins/litclaude/lib/workflow-stage.mjs +104 -22
- package/plugins/litclaude/scripts/scaffold-plan.mjs +8 -2
- package/plugins/litclaude/skills/lit-adhd/SKILL.md +18 -11
- package/plugins/litclaude/skills/lit-adhd/references/card-examples.md +2 -2
- package/plugins/litclaude/skills/lit-adhd/references/status-taxonomy.md +8 -3
- package/plugins/litclaude/skills/lit-hijack/references/capture-and-provenance.md +2 -1
- package/plugins/litclaude/skills/lit-hijack/scripts/hijack.mjs +40 -12
- package/plugins/litclaude/skills/lit-plan/SKILL.md +10 -3
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/assets.mjs +45 -17
- package/plugins/litclaude/skills/lit-typographic-motion/references/treatment.md +2 -1
|
@@ -22,7 +22,7 @@ import { accentFromSettings, effectiveMotion, normalizeModSettings, resolveGlyph
|
|
|
22
22
|
import { composeSvgCard } from "../lib/mod/svg-card.mjs";
|
|
23
23
|
import { chipStates, litSkillId, noteSkill } from "../lib/mod/skills.mjs";
|
|
24
24
|
import { TOAST_GAP_MS, gateToast, statusChanges, statusOf } from "../lib/mod/toasts.mjs";
|
|
25
|
-
import { detectIconFont, readGitBranch, readLedgerTail, readLitSnapshot } from "../lib/mod/state.mjs";
|
|
25
|
+
import { detectIconFont, readGitBranch, readLedgerTail, readLitSnapshot, readPluginVersions } from "../lib/mod/state.mjs";
|
|
26
26
|
import { settledSample } from "../lib/mod/timeline.mjs";
|
|
27
27
|
import {
|
|
28
28
|
EMPTY_ACTIVITY,
|
|
@@ -42,8 +42,11 @@ import {
|
|
|
42
42
|
noteSpawn,
|
|
43
43
|
noteSpawnActivity,
|
|
44
44
|
noteSpawnEnded,
|
|
45
|
+
releaseFinish,
|
|
45
46
|
spinnerSuffix,
|
|
46
47
|
trackAgents,
|
|
48
|
+
waitingReason,
|
|
49
|
+
workflowFinish,
|
|
47
50
|
} from "../lib/mod/view.mjs";
|
|
48
51
|
|
|
49
52
|
const PANE = "lit-evidence";
|
|
@@ -85,7 +88,9 @@ const createLive = (options) => ({
|
|
|
85
88
|
evidenceTab: "goal",
|
|
86
89
|
ledger: [],
|
|
87
90
|
celebrated: new Set(),
|
|
88
|
-
accent:
|
|
91
|
+
// The default accent until session.start reads the settings: the host refuses a Client prop
|
|
92
|
+
// that is undefined, and a skill can fire before session.start has run.
|
|
93
|
+
accent: accentFromSettings(null, undefined),
|
|
89
94
|
git: null,
|
|
90
95
|
fired: [],
|
|
91
96
|
settledAt: 0,
|
|
@@ -97,8 +102,29 @@ const createLive = (options) => ({
|
|
|
97
102
|
turnNotified: false,
|
|
98
103
|
lists: EMPTY_LISTS,
|
|
99
104
|
tasks: EMPTY_TASKS,
|
|
105
|
+
waiting: null,
|
|
106
|
+
answeredBoundary: null,
|
|
107
|
+
noColor: false,
|
|
108
|
+
// The loaded and installed LitClaude versions (restart chip), and when the installed one was read.
|
|
109
|
+
versions: null,
|
|
110
|
+
versionPaths: null,
|
|
111
|
+
versionsAt: Number.NEGATIVE_INFINITY,
|
|
100
112
|
});
|
|
101
113
|
|
|
114
|
+
// This plugin's own manifest, beside the hooks folder; null when the mod was not loaded from a file.
|
|
115
|
+
const OWN_MANIFEST = (() => {
|
|
116
|
+
const url = new URL("../.claude-plugin/plugin.json", import.meta.url);
|
|
117
|
+
return url.protocol === "file:" ? decodeURIComponent(url.pathname) : null;
|
|
118
|
+
})();
|
|
119
|
+
const VERSION_RECHECK_MS = 60_000;
|
|
120
|
+
|
|
121
|
+
// The installed version is read again at most once a minute; an unreadable file only hides the chip.
|
|
122
|
+
async function readVersions($, live, now) {
|
|
123
|
+
if (!live.versionPaths || now - live.versionsAt < VERSION_RECHECK_MS) return;
|
|
124
|
+
live.versionsAt = now;
|
|
125
|
+
live.versions = await readPluginVersions(stateIo($), live.versionPaths).catch(() => null);
|
|
126
|
+
}
|
|
127
|
+
|
|
102
128
|
const stateIo = ($) => ({
|
|
103
129
|
stat: (path) => $.fs.stat(path, { resolve: true }),
|
|
104
130
|
read: (path) => $.fs.read(path),
|
|
@@ -142,6 +168,21 @@ function drawnKey(live, model) {
|
|
|
142
168
|
: JSON.stringify(withSvg ? stillModel(model) : model))).join("\n");
|
|
143
169
|
}
|
|
144
170
|
|
|
171
|
+
// What the session waits on the user for: the last answer's question or BLOCKED report, an
|
|
172
|
+
// AskUserQuestion on screen, or a start-work boundary the user has not answered since it appeared.
|
|
173
|
+
function waitingOf(live) {
|
|
174
|
+
const boundary = live.snapshot?.work?.awaiting ?? null;
|
|
175
|
+
return live.waiting ?? (boundary && boundary !== live.answeredBoundary ? { reason: "boundary" } : null);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// The user is answering: YOUR TURN ends now, and a boundary on screen stays answered.
|
|
179
|
+
async function endWaiting($, live, redraw = true) {
|
|
180
|
+
if (!waitingOf(live)) return;
|
|
181
|
+
live.waiting = null;
|
|
182
|
+
live.answeredBoundary = live.snapshot?.work?.awaiting ?? live.answeredBoundary;
|
|
183
|
+
if (redraw) await rebuild($, live);
|
|
184
|
+
}
|
|
185
|
+
|
|
145
186
|
async function rebuild($, live) {
|
|
146
187
|
const now = await $.clock.now();
|
|
147
188
|
const previous = live.model;
|
|
@@ -161,6 +202,9 @@ async function rebuild($, live) {
|
|
|
161
202
|
step: live.step,
|
|
162
203
|
lists: live.lists,
|
|
163
204
|
tasks: live.tasks,
|
|
205
|
+
turnStartedAt: live.turnStartedAt,
|
|
206
|
+
waiting: waitingOf(live),
|
|
207
|
+
versions: live.versions,
|
|
164
208
|
// The thread rows stay reserved while threads are live, so the card does not shrink between repaints.
|
|
165
209
|
threadReserve: previous?.threads?.reserve ?? 0,
|
|
166
210
|
});
|
|
@@ -258,6 +302,7 @@ async function refresh($, live, options) {
|
|
|
258
302
|
const listed = await $.agent.list().catch(() => []);
|
|
259
303
|
live.usage = await $.session.usage().catch(() => live.usage);
|
|
260
304
|
const now = await $.clock.now();
|
|
305
|
+
await readVersions($, live, now);
|
|
261
306
|
({ agents: live.agents, spawned: live.spawned } = mergeSpawned(listed, live.spawned, now));
|
|
262
307
|
live.activity = trackAgents(live.activity, live.agents, live.statusById, now);
|
|
263
308
|
live.statusById = Object.fromEntries(live.agents.map((agent) => [agent.id, agent.status]));
|
|
@@ -267,7 +312,12 @@ async function refresh($, live, options) {
|
|
|
267
312
|
noteIgnition(live, fresh.ignition, now);
|
|
268
313
|
const finish = detectCompletion(before, fresh);
|
|
269
314
|
if (finish) celebrate($, live, finish, options);
|
|
270
|
-
|
|
315
|
+
let next = await rebuild($, live);
|
|
316
|
+
const reviewed = workflowFinish(previousModel, next);
|
|
317
|
+
if (reviewed) {
|
|
318
|
+
celebrate($, live, { ...reviewed, id: `${reviewed.id}:${now}` }, options);
|
|
319
|
+
next = await rebuild($, live);
|
|
320
|
+
}
|
|
271
321
|
const raised = diffNotices(before, fresh, previousModel, next);
|
|
272
322
|
if (raised.length > 0) {
|
|
273
323
|
raiseToasts($, live, raised.map(noticeEntry), now);
|
|
@@ -307,8 +357,12 @@ export const register = (on, options) => {
|
|
|
307
357
|
LOCALAPPDATA: await $.env.get("LOCALAPPDATA"),
|
|
308
358
|
});
|
|
309
359
|
live.settledAt = await $.clock.now();
|
|
360
|
+
const configDir = (await $.env.get("CLAUDE_CONFIG_DIR"))?.trim() || ((await $.env.get("HOME")) ? `${await $.env.get("HOME")}/.claude` : null);
|
|
361
|
+
live.versionPaths = OWN_MANIFEST && configDir ? { pluginJson: OWN_MANIFEST, installedFile: `${configDir}/plugins/installed_plugins.json` } : null;
|
|
310
362
|
const hostSettings = await $.settings.read().catch(() => null);
|
|
311
363
|
live.accent = accentFromSettings(hostSettings, await $.env.get("LITCLAUDE_HUD_ACCENT"));
|
|
364
|
+
// NO_COLOR (no-color.org): set and not empty, the card draws no colour and does not move.
|
|
365
|
+
live.noColor = Boolean(await $.env.get("NO_COLOR"));
|
|
312
366
|
live.reducedMotion = hostSettings?.prefersReducedMotion === true;
|
|
313
367
|
live.motion = effectiveMotion(live.motion, hostSettings);
|
|
314
368
|
await $.command.register({ name: PANE, description: "Show LitClaude goal criteria, evidence, lanes and gates in a pane" });
|
|
@@ -320,6 +374,7 @@ export const register = (on, options) => {
|
|
|
320
374
|
});
|
|
321
375
|
|
|
322
376
|
on("turn.start", async ($, e, next) => {
|
|
377
|
+
if (typeof e.agentId !== "string") await endWaiting($, live, false);
|
|
323
378
|
live.isWorking = true;
|
|
324
379
|
live.mainToolCalls = 0;
|
|
325
380
|
live.turnStartedAt = await $.clock.now();
|
|
@@ -345,8 +400,11 @@ export const register = (on, options) => {
|
|
|
345
400
|
live.turnNotified = true;
|
|
346
401
|
notifyFinish($, options, `LIT turn finished · ${live.model.title ?? "LitClaude"} · ${formatDuration(took)}`);
|
|
347
402
|
}
|
|
348
|
-
// The request is over: its chips dim to the recent list until a skill fires again.
|
|
403
|
+
// The request is over: its chips dim to the recent list until a skill fires again. An answer
|
|
404
|
+
// that asks the user something or reports BLOCKED leaves the card on YOUR TURN.
|
|
349
405
|
live.settledAt = now;
|
|
406
|
+
const reason = e.isAborted ? null : waitingReason(e.answer);
|
|
407
|
+
live.waiting = reason ? { reason } : null;
|
|
350
408
|
refreshSoon($, live, options);
|
|
351
409
|
return next(e);
|
|
352
410
|
});
|
|
@@ -366,6 +424,9 @@ export const register = (on, options) => {
|
|
|
366
424
|
// The live step: the main loop's tool by name and since when, nothing else of the call.
|
|
367
425
|
const step = typeof e.agentId === "string" ? null : { name: e.tool, at: await $.clock.now() };
|
|
368
426
|
if (step) live.mainToolCalls += 1;
|
|
427
|
+
// A question to the user is on screen until its call returns.
|
|
428
|
+
const asking = step !== null && e.tool === "AskUserQuestion";
|
|
429
|
+
if (asking) live.waiting = { reason: "question" };
|
|
369
430
|
if (step) {
|
|
370
431
|
live.step = step;
|
|
371
432
|
await rebuild($, live);
|
|
@@ -374,6 +435,7 @@ export const register = (on, options) => {
|
|
|
374
435
|
try {
|
|
375
436
|
result = await next(e);
|
|
376
437
|
} finally {
|
|
438
|
+
if (asking && live.waiting?.reason === "question") live.waiting = null;
|
|
377
439
|
if (step && live.step === step) live.step = live.isWorking ? { name: "thinking", at: await $.clock.now() } : null;
|
|
378
440
|
if (typeof e.agentId === "string") {
|
|
379
441
|
const now = await $.clock.now();
|
|
@@ -381,11 +443,28 @@ export const register = (on, options) => {
|
|
|
381
443
|
live.spawned = noteSpawnActivity(live.spawned, e.agentId, now, -1);
|
|
382
444
|
}
|
|
383
445
|
}
|
|
384
|
-
|
|
446
|
+
const now = await $.clock.now();
|
|
447
|
+
noteToolOutcome(live, e, result, now);
|
|
448
|
+
const release = releaseFinish(e, result);
|
|
449
|
+
if (release) {
|
|
450
|
+
celebrate($, live, { ...release, id: `${release.id}:${now}` }, options);
|
|
451
|
+
await rebuild($, live);
|
|
452
|
+
}
|
|
385
453
|
refreshSoon($, live, options);
|
|
386
454
|
return result;
|
|
387
455
|
}).catch(($, e, next) => next(e));
|
|
388
456
|
|
|
457
|
+
// The user typing, or recalling or undoing a draft, answers YOUR TURN.
|
|
458
|
+
on("prompt.edit", async ($, e, next) => {
|
|
459
|
+
await endWaiting($, live);
|
|
460
|
+
return next(e);
|
|
461
|
+
}).catch(($, e, next) => next(e));
|
|
462
|
+
|
|
463
|
+
on("prompt.change", async ($, e, next) => {
|
|
464
|
+
if (e.origin?.kind === "history" || e.origin?.kind === "undo") await endWaiting($, live);
|
|
465
|
+
return next(e);
|
|
466
|
+
}).catch(($, e, next) => next(e));
|
|
467
|
+
|
|
389
468
|
// A background task's notification ends its thread row: its text is read for ids alone.
|
|
390
469
|
on("prompt.submit", async ($, e, next) => {
|
|
391
470
|
if (e.origin?.kind === "task-notification") {
|
|
@@ -437,8 +516,9 @@ export const register = (on, options) => {
|
|
|
437
516
|
|
|
438
517
|
on("ui.render", { component: "AbovePrompt" }, async ($, e, next) => {
|
|
439
518
|
const settings = normalizeModSettings(options);
|
|
440
|
-
const motion = effectiveMotion(settings.motion, { prefersReducedMotion: live.reducedMotion });
|
|
441
|
-
const glyphs = resolveGlyphs(settings.glyphs, e.surface, live.iconFont.present);
|
|
519
|
+
const motion = live.noColor ? "off" : effectiveMotion(settings.motion, { prefersReducedMotion: live.reducedMotion });
|
|
520
|
+
const glyphs = live.noColor ? "basic" : resolveGlyphs(settings.glyphs, e.surface, live.iconFont.present);
|
|
521
|
+
const color = !live.noColor;
|
|
442
522
|
const model = live.model;
|
|
443
523
|
if (!model || settings.band === "off" || e.props.hasSurvey || (!model.visible && !live.exiting)) return next(e);
|
|
444
524
|
const elements = $.ui.resolve(e);
|
|
@@ -453,9 +533,9 @@ export const register = (on, options) => {
|
|
|
453
533
|
drawn = elements.Svg({ source, alt, ...(animated ? { isInteractive: true } : {}) });
|
|
454
534
|
}
|
|
455
535
|
} else if (elements.Client && !live.clientFailed) {
|
|
456
|
-
drawn = elements.Client({ key: "lit-band", module: "./lit-band-client.mjs", props: { model, columns, glyphs, motion, accent: live.accent } });
|
|
536
|
+
drawn = elements.Client({ key: "lit-band", module: "./lit-band-client.mjs", props: { model, columns, glyphs, motion, accent: live.accent, color } });
|
|
457
537
|
} else if (model.visible) {
|
|
458
|
-
drawn = renderBand(elements, composeBand(model, settledSample(model), { columns, glyphs, accent: live.accent }));
|
|
538
|
+
drawn = renderBand(elements, composeBand(model, settledSample(model), { columns, glyphs, accent: live.accent, color }));
|
|
459
539
|
}
|
|
460
540
|
const below = await next(e);
|
|
461
541
|
if (!drawn) return below;
|
|
@@ -23,8 +23,8 @@ export const canonicalSkillResourceManifest = Object.freeze(
|
|
|
23
23
|
["lib/plan-task-rows.mjs", "5ba6c6e3cd04fb3f1be33cf5692a05f46948390e70ca096b9516f1589c6ddde9"],
|
|
24
24
|
["lib/rename-aliases.mjs", "3ee93aec10d0dbe785c554ab3040173ee94fde27da1b440a54b0513e5d11a508"],
|
|
25
25
|
["lib/render_pages.py", "69e20951dff5af47cff074b699ad992f489f5ac14559a5c114e17aa4dbaa5db7"],
|
|
26
|
-
["lib/rewind/brief.mjs", "
|
|
27
|
-
["lib/rewind/collect.mjs", "
|
|
26
|
+
["lib/rewind/brief.mjs", "e21bb31476ea38a87ef0a5042f688bde7ab1028dead61f32d2d7502a9271964f"],
|
|
27
|
+
["lib/rewind/collect.mjs", "80a6e2bbde749530275426c58be34e85567143bb76f0c68d4d8af0b519cbd33d"],
|
|
28
28
|
["lib/rewind/gauge.mjs", "347095c1d36492bb996a679b67847261d15388b29962ed2ebaabec3cf0a5d9df"],
|
|
29
29
|
["lib/rewind/next-step.mjs", "c8a7cd99647afd403c35b9f793b410172564090d50158814ff20c41c30725b74"],
|
|
30
30
|
["lib/rewind/redact.mjs", "5bff5f69191f2ec07720f2dde20a850730fed884efb47a43f2604d7295a1615a"],
|
|
@@ -44,7 +44,7 @@ export const canonicalSkillResourceManifest = Object.freeze(
|
|
|
44
44
|
["lib/strict-json.mjs", "d941f327aabce5ffc212770852cfbc7e08dd03471e4e9bc9560eff54f06d489a"],
|
|
45
45
|
["lib/wikify-knowledge-cli.mjs", "6835f8d6d98a3dd26266409366c23b2da437c0cd41e63537f0f200667655132b"],
|
|
46
46
|
["lib/wikify-knowledge.mjs", "feaa8d1fc9606b00f5fa49115385a797c285eefdc9e202d94809f6c3cff5d224"],
|
|
47
|
-
["scripts/scaffold-plan.mjs", "
|
|
47
|
+
["scripts/scaffold-plan.mjs", "295247e2d68617236dafabaff5706a43970cf34384b5fd0cfcd437e417507ad7"],
|
|
48
48
|
["skills/autoconference/SKILL.md", "e034a0232d59bea9f9ed27bb8844a7ee039dd5c7d38aeaffaa32e7ee63daa5ad"],
|
|
49
49
|
["skills/autoresearch/SKILL.md", "2b69c53bade3851cfb9c770bce80afe5f9e75b9629719e9ba95a4b0045eaf5b3"],
|
|
50
50
|
["skills/browser-drive/scripts/capability-probe.mjs", "69fbf97638165d8dac5297c6c2e7b18c5757605acdcaed3ce96f745dc3c72532"],
|
|
@@ -133,9 +133,9 @@ export const canonicalSkillResourceManifest = Object.freeze(
|
|
|
133
133
|
["skills/frontend-ui-ux/scripts/search.mjs", "a08531cf2fece7b4cf4a7290cb7afbdbf90b72c0cf6cd0101df86986da86b517"],
|
|
134
134
|
["skills/frontend-ui-ux/scripts/source-replay.mjs", "2c24537a8b9f2161c1d06e42e7d5d44ab921b083f41d93d3e44da835cf932fb8"],
|
|
135
135
|
["skills/frontend-ui-ux/scripts/validate-design-contract.mjs", "f05997c3836764b9f6326efe457b91fe187ca5735bb0ce10f54f14b5b1ca0e3a"],
|
|
136
|
-
["skills/lit-adhd/SKILL.md", "
|
|
137
|
-
["skills/lit-adhd/references/card-examples.md", "
|
|
138
|
-
["skills/lit-adhd/references/status-taxonomy.md", "
|
|
136
|
+
["skills/lit-adhd/SKILL.md", "0033f9049d59e5be1378ef2ef977cac46caf36c20ad7516af92cd74ba271a092"],
|
|
137
|
+
["skills/lit-adhd/references/card-examples.md", "7466a0b73ecb9dce5e08cc12362fbc21dce1ef5cdb85c359fec5bfddfc684a62"],
|
|
138
|
+
["skills/lit-adhd/references/status-taxonomy.md", "ad647edea7394d8927e68ac5d9dd638285a4e19743cb0371e3b3c9a105ace321"],
|
|
139
139
|
["skills/lit-adhd/scripts/rewind.mjs", "23810ec5afaf9b90cfb784d380739d85a752a9405c594052b3dc21af74ecd175"],
|
|
140
140
|
["skills/lit-brainstorm/SKILL.md", "1951c64654ef4cfcea356cf76a18bac108a5580a3c6acc5289b58c456dffdde1"],
|
|
141
141
|
["skills/lit-brainstorm/references/idea-lenses.md", "798e4402ab028876367d236f555b5596458a88a1f2cbbaad9c8cbf56ca566ac4"],
|
|
@@ -587,12 +587,12 @@ export const canonicalSkillResourceManifest = Object.freeze(
|
|
|
587
587
|
["skills/lit-docx/templates/tonalities/proposal.yaml", "b1b7f4875a89208939ca82d69e6cfb30c35b64ea91d67d5aecc98fe04bde3bfc"],
|
|
588
588
|
["skills/lit-docx/templates/tonalities/report.yaml", "23ac1d24f8936c6d522e19354d5948f0d00dce6d60c34fa42e37adafcc68cb8c"],
|
|
589
589
|
["skills/lit-hijack/SKILL.md", "58283031ebf2828843ccb234a8f12f657c8be67068759e7012e303446a4bb5b2"],
|
|
590
|
-
["skills/lit-hijack/references/capture-and-provenance.md", "
|
|
590
|
+
["skills/lit-hijack/references/capture-and-provenance.md", "7e2db27da3b62ea1ede767485fca0f679d88bc6894d4e693928ee14f8c0ecfe8"],
|
|
591
591
|
["skills/lit-hijack/references/clean-room-build.md", "09b932c591d64bcd5308b7cfa431d11272a69cb0433db681ad2e766d7687cab2"],
|
|
592
592
|
["skills/lit-hijack/references/distil-and-licence.md", "693618b7f8b4b9bd2e07424f22a07a50bcdce7d5c46e6708974226bce643aefb"],
|
|
593
593
|
["skills/lit-hijack/references/gap-and-port-design.md", "3f81b510abdb0966f20d75ed354b44b497ea7fc82888f1b490be571ac6949bd0"],
|
|
594
594
|
["skills/lit-hijack/references/parity-and-report.md", "095dd50851a2c299038a6048d7453b7d180d57237746d692453b1e0b08f577e9"],
|
|
595
|
-
["skills/lit-hijack/scripts/hijack.mjs", "
|
|
595
|
+
["skills/lit-hijack/scripts/hijack.mjs", "34f777ac3b6965dfa2dcbd72b4db4c68c7325fc500b1bebd520ebad2d222d929"],
|
|
596
596
|
["skills/lit-humanizer/NOTICE", "c2608d2bc42cac22e77ac64eb137f8fc40d8f9a0b08ae7d7a8a75cf11d9289be"],
|
|
597
597
|
["skills/lit-humanizer/SKILL.md", "32f1405440a226b30e0e3e511c47314ee4422cf48689e2e8e269c17bb8edc694"],
|
|
598
598
|
["skills/lit-humanizer/assets/always-on-rule.md", "1c0e1d9724f012f05142c69d06e8a8cc89596556cba2c8ff1438e99c7848a5cf"],
|
|
@@ -838,7 +838,7 @@ export const canonicalSkillResourceManifest = Object.freeze(
|
|
|
838
838
|
["skills/lit-typographic-motion/engine/core/voices.mjs", "41933e9738d9c2bd8ccb7e6e4ed33953d062e2847026b11703564bcf953ab6f5"],
|
|
839
839
|
["skills/lit-typographic-motion/engine/models/word-timing.json", "f9771cd09fc55af1e068ad8ba094d718c9066ac22099f6e394189ad81561e648"],
|
|
840
840
|
["skills/lit-typographic-motion/engine/node/analysis.mjs", "d3c20b50fb16a114376289fb9f7f567b37cbea5dab2f6a19248ab5b0243169dd"],
|
|
841
|
-
["skills/lit-typographic-motion/engine/node/assets.mjs", "
|
|
841
|
+
["skills/lit-typographic-motion/engine/node/assets.mjs", "aea99074e36144dbef78056adf5b420781cafd2a7aeab307452bc442978ca3a1"],
|
|
842
842
|
["skills/lit-typographic-motion/engine/node/blender.mjs", "26b5fe46b63450481b4e620aba5d7e0b86bdb39026dfda02ee95364fe98eea54"],
|
|
843
843
|
["skills/lit-typographic-motion/engine/node/board.mjs", "22c7873542e3f96c1e55b61475d79eebcf951bb87e1a9bfeaf9762c1e3a1ed22"],
|
|
844
844
|
["skills/lit-typographic-motion/engine/node/brief.mjs", "67417c46d7467c4a12d523e88876bf432f605c45b6c7723e0b8f04fa8fa429cb"],
|
|
@@ -965,7 +965,7 @@ export const canonicalSkillResourceManifest = Object.freeze(
|
|
|
965
965
|
["skills/lit-typographic-motion/references/stage.md", "fb3477e552c2995bab1ee4322b88c60f3212fa6974584559891a91222a2b287a"],
|
|
966
966
|
["skills/lit-typographic-motion/references/studio.md", "e8908e245c3cd8e27a55e00f37a0772209cea747b301341686cf810015c9638a"],
|
|
967
967
|
["skills/lit-typographic-motion/references/style-bibles.md", "2b7a6117d4774fec7a18cf0cf0d7fb26cf3b642b6688a60169de9336e46836da"],
|
|
968
|
-
["skills/lit-typographic-motion/references/treatment.md", "
|
|
968
|
+
["skills/lit-typographic-motion/references/treatment.md", "0456ec5d17356be3d3f1b2b28394d723f9ec511a677901191ed6323abd36f548"],
|
|
969
969
|
["skills/lit-typographic-motion/references/type-craft.md", "5bac1461a4ecb64dc4492e7b765934e2ec0d17f848e720f281cb3031b7750903"],
|
|
970
970
|
["skills/lit-typographic-motion/scripts/motion-doctor.mjs", "ad2d2434f363d26dd1b907ec2030600a69bf740775da9a53874f5d74f196cb36"],
|
|
971
971
|
["skills/lit-typographic-motion/scripts/motion-runtime.mjs", "8cf247a25b9ec3c4745f608fd618aeb4e069940cdb97354682066121eea50f47"],
|
|
@@ -6,11 +6,13 @@
|
|
|
6
6
|
import { existsSync, readdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { join, resolve } from "node:path";
|
|
8
8
|
|
|
9
|
+
import { describeScopePath, uncoveredScopePaths } from "./plan-scope-roots.mjs";
|
|
9
10
|
import { requireStateDir, resolveProjectStateRoot, STATE_WRITE_FLAG } from "./project-state-root.mjs";
|
|
10
11
|
import { findProjectRoot } from "./rules/discovery.mjs";
|
|
11
12
|
|
|
12
13
|
export const LIT_PLAN_MAX_BLOCKS = 2;
|
|
13
14
|
export const LIT_PLAN_BLOCK_REASON = "lit-plan must persist plans/<slug>.md (run scaffold-plan.mjs) before finishing";
|
|
15
|
+
export const LIT_PLAN_SCOPE_REASON = "lit-plan must grant the outside folders its todos name with Scope roots lines before finishing";
|
|
14
16
|
|
|
15
17
|
// Filesystem mtime granularity can lag the wall clock the hook sampled.
|
|
16
18
|
const MTIME_TOLERANCE_MS = 1000;
|
|
@@ -106,6 +108,7 @@ export const evaluateLitPlanStop = ({ cwd, sessionId, now = Date.now() }) => {
|
|
|
106
108
|
}
|
|
107
109
|
|
|
108
110
|
let detail;
|
|
111
|
+
let scope = null;
|
|
109
112
|
if (!newest) {
|
|
110
113
|
detail = "no file under plans/ was written this turn";
|
|
111
114
|
} else {
|
|
@@ -115,8 +118,14 @@ export const evaluateLitPlanStop = ({ cwd, sessionId, now = Date.now() }) => {
|
|
|
115
118
|
} catch {
|
|
116
119
|
text = "";
|
|
117
120
|
}
|
|
118
|
-
if (TASK_ROW.test(text))
|
|
119
|
-
|
|
121
|
+
if (TASK_ROW.test(text)) {
|
|
122
|
+
// A todo naming a folder outside the project needs its Scope roots line before the work starts.
|
|
123
|
+
const uncovered = uncoveredScopePaths(text, cwd);
|
|
124
|
+
if (uncovered.length === 0) return { action: "allow", why: "plan-persisted", planPath: newest.absolutePath };
|
|
125
|
+
scope = `plans/${newest.name}: ${uncovered.map(describeScopePath).join("; ")}`;
|
|
126
|
+
} else {
|
|
127
|
+
detail = `plans/${newest.name} has no checkbox task rows (\`- [ ] N.\`)`;
|
|
128
|
+
}
|
|
120
129
|
}
|
|
121
130
|
|
|
122
131
|
if (turn.blockCount >= LIT_PLAN_MAX_BLOCKS) {
|
|
@@ -125,10 +134,12 @@ export const evaluateLitPlanStop = ({ cwd, sessionId, now = Date.now() }) => {
|
|
|
125
134
|
return {
|
|
126
135
|
action: "warn",
|
|
127
136
|
why: "capped",
|
|
128
|
-
systemMessage:
|
|
137
|
+
systemMessage: scope
|
|
138
|
+
? `LitClaude lit-plan: Scope roots lines still missing after ${LIT_PLAN_MAX_BLOCKS} blocks (${scope}); allowing the stop.`
|
|
139
|
+
: `LitClaude lit-plan: no persisted plans/<slug>.md with task rows after ${LIT_PLAN_MAX_BLOCKS} blocks (${detail}); allowing the stop. Run scaffold-plan.mjs before /start-work.`,
|
|
129
140
|
};
|
|
130
141
|
}
|
|
131
142
|
|
|
132
143
|
writeTurn(cwd, { ...turn, blockCount: turn.blockCount + 1, lastBlockAt: now });
|
|
133
|
-
return { action: "block", reason: `${LIT_PLAN_BLOCK_REASON}: ${detail}` };
|
|
144
|
+
return { action: "block", reason: scope ? `${LIT_PLAN_SCOPE_REASON}: ${scope}` : `${LIT_PLAN_BLOCK_REASON}: ${detail}` };
|
|
134
145
|
};
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
|
|
35
35
|
import { gauge, knownFacts } from "../rewind/gauge.mjs";
|
|
36
36
|
import { textWidth, truncateToWidth } from "./layout.mjs";
|
|
37
|
-
import {
|
|
37
|
+
import { LOOKS, laneColor, lookOf } from "./looks.mjs";
|
|
38
|
+
import { barCells, gradientAt, lerpColor, rainbowAt } from "./motion.mjs";
|
|
38
39
|
import { glyphSet } from "./settings.mjs";
|
|
39
40
|
import { formatDuration } from "./view.mjs";
|
|
40
41
|
|
|
@@ -206,31 +207,39 @@ const edgeRow = (open, left, right, close, width, color, comet = null, paint = n
|
|
|
206
207
|
|
|
207
208
|
// Where the ambient comet is on this card: along the top rule left to right for the first half of
|
|
208
209
|
// its loop, then back along the bottom rule, starting and ending just off the card. The rewind look
|
|
209
|
-
// spends the whole loop sweeping the bottom rule right to left.
|
|
210
|
+
// spends the whole loop sweeping the bottom rule right to left; the other looks run no comet.
|
|
210
211
|
const cometOn = (sample, edge, width, look = null) => {
|
|
211
212
|
const u = sample.ambient?.comet;
|
|
212
213
|
if (u === null || u === undefined) return null;
|
|
213
214
|
const span = width + 2 * COMET_TAIL;
|
|
214
215
|
if (look === "rewind") return edge === "bottom" ? { x: width + COMET_TAIL - u * span, dir: -1, arrow: true } : null;
|
|
216
|
+
if (look) return null;
|
|
215
217
|
if (edge === "top") return u < 0.5 ? { x: u * 2 * span - COMET_TAIL, dir: 1 } : null;
|
|
216
218
|
return u >= 0.5 ? { x: width + COMET_TAIL - (u - 0.5) * 2 * span, dir: -1 } : null;
|
|
217
219
|
};
|
|
218
220
|
|
|
219
221
|
// While LitClaude works the brand pill breathes from its pink toward the flame orange and back.
|
|
220
|
-
// The rewind look turns it through the rainbow instead, lightened so its dark ink stays readable
|
|
221
|
-
|
|
222
|
+
// The rewind look turns it through the rainbow instead, lightened so its dark ink stays readable;
|
|
223
|
+
// YOUR TURN holds it amber.
|
|
224
|
+
const brandSpans = (sample, glyphs, rainbow = null, look = null) => {
|
|
222
225
|
const reveal = revealText("🔥 LIT", sample.pills[0]);
|
|
223
226
|
if (reveal === null) return [];
|
|
224
227
|
if (rainbow) return rainbowPill(reveal, rainbow, 0, glyphs);
|
|
225
|
-
const fill = sample.ambient ? lerpColor(PILL.brand, PALETTE.orange, 0.85 * sample.ambient.breath) : PILL.brand;
|
|
228
|
+
const fill = look === "turn" ? PALETTE.amber : sample.ambient ? lerpColor(PILL.brand, PALETTE.orange, 0.85 * sample.ambient.breath) : PILL.brand;
|
|
226
229
|
return pill(litText(reveal, { fg: PILL.ink, bg: fill, bold: true }, sample.completion?.shimmer ?? null), fill, glyphs);
|
|
227
230
|
};
|
|
228
231
|
// `REWIND <<` while the rewind look is on, each letter a step further round the hue wheel, lightened
|
|
229
232
|
// to keep 4.5:1 on the card; the letters stay put and only their colours move.
|
|
230
233
|
const rewindSpans = (rainbow) => [..."REWIND <<"].map((ch, i) => span(ch, { fg: lerpColor(rainbow(i / 9), "#ffffff", 0.4), bold: true }));
|
|
231
|
-
|
|
234
|
+
// The review look counts the lanes that have reported, passed or failed.
|
|
235
|
+
const indicatorSpans = (model, sample, glyphs, accent, rainbow = null, look = null) => {
|
|
232
236
|
if (sample.completion) return [span(`DONE ${glyphs.done}`, { fg: PALETTE.green, bold: true })];
|
|
233
237
|
if (rainbow) return rewindSpans(rainbow);
|
|
238
|
+
if (look === "turn") return [span(LOOKS.turn.label, { fg: PALETTE.amber, bold: true })];
|
|
239
|
+
if (look === "review") {
|
|
240
|
+
const lanes = model.workflow.verdicts;
|
|
241
|
+
return [span(`${LOOKS.review.label} ${lanes.filter(({ state }) => state === "pass" || state === "fail").length}/${lanes.length}`, { fg: accent, bold: true })];
|
|
242
|
+
}
|
|
234
243
|
if (model.idle) return [span("idle", { fg: PALETTE.dim })];
|
|
235
244
|
const flow = model.workflow;
|
|
236
245
|
if (flow && flow.current >= 0) {
|
|
@@ -247,13 +256,18 @@ const indicatorSpans = (model, sample, glyphs, accent, rainbow = null) => {
|
|
|
247
256
|
|
|
248
257
|
// ╭─ [🔥 LIT] · <discipline> ──── <PHASE ●> ─╮. On a narrow card the phase indicator goes first,
|
|
249
258
|
// then the discipline shortens, then it goes too.
|
|
259
|
+
// A newer LitClaude installed than the one loaded adds `restart to <version>` before the
|
|
260
|
+
// indicator, dropped first when the edge has no room for it.
|
|
250
261
|
const topEdge = (model, sample, { width, glyphs, accent, edge, look, paint, rainbow }) => {
|
|
251
|
-
const brand = brandSpans(sample, glyphs, rainbow);
|
|
252
|
-
const
|
|
262
|
+
const brand = brandSpans(sample, glyphs, rainbow, look);
|
|
263
|
+
const indicator = indicatorSpans(model, sample, glyphs, accent, rainbow, look);
|
|
253
264
|
const name = model.title ?? "ready";
|
|
254
265
|
const nameStyle = model.idle && !rainbow ? { fg: PALETTE.dim } : { fg: accent, bold: true };
|
|
255
266
|
const title = (text) => (text ? [span(" · ", { fg: PALETTE.dim }), span(text, nameStyle)] : []);
|
|
256
267
|
const fixed = textWidth("╭─ ") + rowWidth(brand) + 1 + 1;
|
|
268
|
+
const fits = (spans) => fixed + rowWidth(title(name)) + 1 + rowWidth(spans) + textWidth(" ─╮") <= width;
|
|
269
|
+
const chip = model.restart ? [span(`restart to ${model.restart}`, { fg: PALETTE.amber }), span(" · ", { fg: PALETTE.dim }), ...indicator] : null;
|
|
270
|
+
const right = chip && fits(chip) ? chip : indicator;
|
|
257
271
|
const withRight = fixed + rowWidth(title(name)) + 1 + rowWidth(right) + textWidth(" ─╮");
|
|
258
272
|
const comet = cometOn(sample, "top", width, look);
|
|
259
273
|
if (withRight <= width) return edgeRow("╭─ ", [...brand, ...title(name)], right, "─╮", width, edge, comet, paint[0]);
|
|
@@ -265,13 +279,14 @@ const topEdge = (model, sample, { width, glyphs, accent, edge, look, paint, rain
|
|
|
265
279
|
const barSpans = (fraction, sample, cells) => barCells(fraction, cells, sample.fillGlow ?? 0)
|
|
266
280
|
.map(({ glyph, color }) => (glyph === "█" ? span(" ", { bg: color }) : span(glyph, { fg: color })));
|
|
267
281
|
|
|
268
|
-
// ●● 2 lanes 1:07: a dot per
|
|
282
|
+
// ●● 2 lanes 1:07: a dot per lane (amber once stalled, dim and still while idle), the count and the longest lane's
|
|
269
283
|
// clock. While LitClaude works a light walks across the dots (full motion) or they breathe (subtle),
|
|
270
284
|
// so running lanes move while the main turn waits; a dot changes only by colour, which repaints.
|
|
271
285
|
const laneSegment = (model, sample, glyphs) => {
|
|
272
286
|
const list = model.lanes.list.slice(0, 4);
|
|
273
287
|
const ambient = model.idle ? null : sample.ambient;
|
|
274
288
|
const dots = list.map((lane, index) => {
|
|
289
|
+
if (lane.status === "idle") return span(glyphs.lane, { fg: PALETTE.dim });
|
|
275
290
|
const base = lane.status === "stalled" ? PALETTE.amber : PALETTE.green;
|
|
276
291
|
let light = 0;
|
|
277
292
|
if (ambient?.flow !== null && ambient?.flow !== undefined) light = 0.8 * Math.max(0, 1 - Math.abs(ambient.flow * (list.length + 1) - 0.5 - index));
|
|
@@ -586,11 +601,13 @@ const progressSpans = (thread, sample, rainbow, index, color) => {
|
|
|
586
601
|
const words = facts.startsWith(thread.state)
|
|
587
602
|
? [span(facts, { fg: color })]
|
|
588
603
|
: [span(thread.state, { fg: color }), span(` · ${facts}`, { fg: PALETTE.dim })];
|
|
589
|
-
|
|
604
|
+
// An idle thread does nothing, so its pulse carries no moving light.
|
|
605
|
+
const pulse = thread.state === "idle" ? { ...sample, ambient: null } : sample;
|
|
606
|
+
return [span(" "), ...pulseSpans(pulse, rainbow, index), span(" "), ...words];
|
|
590
607
|
};
|
|
591
608
|
|
|
592
609
|
const threadRows = (model, sample, { inner, glyphs, rainbow }) => {
|
|
593
|
-
const { chain, lanes, others, more, reserve } = model.threads;
|
|
610
|
+
const { chain, lanes, herdrLanes = [], others, more, reserve } = model.threads;
|
|
594
611
|
const lines = [];
|
|
595
612
|
chain.forEach((thread, index) => lines.push({ thread, lead: index === 0 ? "" : `${" ".repeat(index - 1)}└─ `, last: true }));
|
|
596
613
|
// Lanes and background tasks are children of the top frame, so they hang at its indent.
|
|
@@ -604,6 +621,8 @@ const threadRows = (model, sample, { inner, glyphs, rainbow }) => {
|
|
|
604
621
|
} else {
|
|
605
622
|
lanes.forEach((thread) => lines.push({ thread, lead: chain.length ? `${under}└─ ` : "", last: true }));
|
|
606
623
|
}
|
|
624
|
+
// herdr lanes of this project run beside this session, so they sit at the root, before other sessions.
|
|
625
|
+
herdrLanes.forEach((thread) => lines.push({ thread, lead: "", last: true }));
|
|
607
626
|
others.forEach((thread) => lines.push({ thread, lead: "", last: true }));
|
|
608
627
|
const rows = lines.map((line) => line.thread ?? null).filter(Boolean);
|
|
609
628
|
// A wide card spends its room on names, so lanes that share a prefix stay apart.
|
|
@@ -740,7 +759,7 @@ const completionRow = (sample, inner) => {
|
|
|
740
759
|
const life = Math.min(1, Math.max(0, completion.embers * 1.6 - i * 0.04));
|
|
741
760
|
const alpha = life <= 0 || life >= 1 ? 0 : Math.sin(life * Math.PI);
|
|
742
761
|
const glyph = alpha < 0.05 ? " " : SPARKS[Math.min(2, Math.floor(alpha * 3))];
|
|
743
|
-
row.push(span(glyph, { fg: lerpColor(PALETTE.faint, i
|
|
762
|
+
row.push(span(glyph, { fg: lerpColor(PALETTE.faint, rainbowAt(i / count), alpha) }), span(" "));
|
|
744
763
|
}
|
|
745
764
|
row.push(span(" "));
|
|
746
765
|
} else {
|
|
@@ -781,9 +800,10 @@ const bottomEdge = (model, sample, { width, glyphs, accent, edge, look, paint, r
|
|
|
781
800
|
|
|
782
801
|
// The border: red or amber under a warning, otherwise the accent. Idle it is a calm, dim accent;
|
|
783
802
|
// while LitClaude works it sits a step above the accent and breathes brighter toward white with the
|
|
784
|
-
// brand pill.
|
|
785
|
-
const edgeColor = (model, sample, accent) => {
|
|
803
|
+
// brand pill. YOUR TURN breathes amber over TIMINGS.breath, and holds it with motion off.
|
|
804
|
+
const edgeColor = (model, sample, accent, look) => {
|
|
786
805
|
if (model.warnings.some(({ tone }) => tone === "red")) return PALETTE.red;
|
|
806
|
+
if (look === "turn") return sample.ambient ? lerpColor(lerpColor(PALETTE.amber, PALETTE.faint, 0.5), PALETTE.amber, sample.ambient.breath) : PALETTE.amber;
|
|
787
807
|
if (model.warnings.length) return PALETTE.amber;
|
|
788
808
|
if (model.idle) return lerpColor(PALETTE.faint, accent, 0.35);
|
|
789
809
|
return lerpColor(accent, "#ffffff", 0.15 + 0.3 * (sample.ambient?.breath ?? 0));
|
|
@@ -794,38 +814,44 @@ const edgeColor = (model, sample, accent) => {
|
|
|
794
814
|
* map or phase track, detail line, chips row, bottom edge), with the thread rows between the detail
|
|
795
815
|
* line and the chips while more than one thread is live, each exactly `width` cells:
|
|
796
816
|
* the terminal's columns up to CARD_MAX. `accent` is the status line's accent colour
|
|
797
|
-
* (settings.mjs accentFromSettings).
|
|
817
|
+
* (settings.mjs accentFromSettings). `color: false` (NO_COLOR) draws the same cells with no colour.
|
|
798
818
|
*/
|
|
799
|
-
export const composeBand = (model, sample, { columns, glyphs: glyphMode = "basic", accent = PALETTE.accent }) => {
|
|
819
|
+
export const composeBand = (model, sample, { columns, glyphs: glyphMode = "basic", accent = PALETTE.accent, color = true }) => {
|
|
800
820
|
const glyphs = glyphSet(glyphMode);
|
|
801
821
|
const width = Math.max(12, Math.min(CARD_MAX, columns));
|
|
802
822
|
const inner = width - 4;
|
|
803
|
-
|
|
823
|
+
// The model names its look (looks.mjs); a model built without one keeps the rewind rule it had.
|
|
824
|
+
const look = "look" in model ? model.look : model.rewind ? "rewind" : model.idle || lookOf(model.discipline) !== "rewind" ? null : "rewind";
|
|
825
|
+
const edge = edgeColor(model, sample, accent, look);
|
|
804
826
|
// The rewind look's rainbow turns with the ambient hue (still at 0 with motion off). A warning
|
|
805
|
-
// keeps the border its warning colour; the rails stay rainbow.
|
|
806
|
-
|
|
827
|
+
// keeps the border its warning colour; the rails stay rainbow. The review look splits the top
|
|
828
|
+
// and bottom rules into its five lanes, a fifth of the width each.
|
|
807
829
|
const hue = sample.ambient?.hue ?? 0;
|
|
808
830
|
const rainbow = look === "rewind" ? (position) => rainbowAt(position + hue) : null;
|
|
809
831
|
const painted = rainbow && model.warnings.length === 0;
|
|
810
|
-
const
|
|
832
|
+
const lanes = look === "review" ? model.workflow.verdicts : null;
|
|
833
|
+
const laneAt = (col) => Math.min(lanes.length - 1, Math.floor((col * lanes.length) / width));
|
|
834
|
+
const lanePaint = lanes ? (col) => laneColor(laneAt(col), lanes[laneAt(col)].state) : null;
|
|
835
|
+
const paint = [0, 1, 2, 3, 4].map((r) => (painted ? (col) => rainbow(col / width + r * 0.04) : r === 0 || r === 4 ? lanePaint : null));
|
|
811
836
|
const side = (row, r) => (paint[r]
|
|
812
837
|
? [span("│", { fg: paint[r](0) }), span(" "), ...row, span(" "), span("│", { fg: paint[r](width - 1) })]
|
|
813
838
|
: [span("│ ", { fg: edge }), ...row, span(" │", { fg: edge })]);
|
|
814
839
|
const options = { width, inner, glyphs, accent, edge, look, rainbow, paint };
|
|
815
840
|
const middle = sample.completion ? completionRow(sample, inner) : sample.notice ? noticeRow(sample, inner) : chipsRow(model, sample, options);
|
|
841
|
+
const rows = [
|
|
842
|
+
topEdge(model, sample, options),
|
|
843
|
+
side(model.workflow ? mapRow(model, sample, options) : phaseRow(model, sample, options), 1),
|
|
844
|
+
side(detailRow(model, sample, options), 2),
|
|
845
|
+
...(model.threads ? threadRows(model, sample, options).map((row) => side(row, 2)) : []),
|
|
846
|
+
side(middle, 3),
|
|
847
|
+
bottomEdge(model, sample, options),
|
|
848
|
+
];
|
|
816
849
|
return {
|
|
817
850
|
mode: "card",
|
|
818
|
-
border: edge,
|
|
851
|
+
border: color ? edge : null,
|
|
819
852
|
width,
|
|
820
853
|
look,
|
|
821
|
-
rows:
|
|
822
|
-
topEdge(model, sample, options),
|
|
823
|
-
side(model.workflow ? mapRow(model, sample, options) : phaseRow(model, sample, options), 1),
|
|
824
|
-
side(detailRow(model, sample, options), 2),
|
|
825
|
-
...(model.threads ? threadRows(model, sample, options).map((row) => side(row, 2)) : []),
|
|
826
|
-
side(middle, 3),
|
|
827
|
-
bottomEdge(model, sample, options),
|
|
828
|
-
],
|
|
854
|
+
rows: color ? rows : rows.map((row) => row.map(({ text, bold }) => (bold ? { text, bold } : { text }))),
|
|
829
855
|
};
|
|
830
856
|
};
|
|
831
857
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// The LIT card's looks (plans/mod-skill-looks.md): what a skill or a session state turns the card
|
|
2
|
+
// into. A look names its palette, its corner label, its comet path and its pill style; frame.mjs and
|
|
3
|
+
// svg-card.mjs draw them. view.mjs picks one look per model, a finish first, then the session
|
|
4
|
+
// waiting on the user, then the look of a skill running this turn (whatever route ran it).
|
|
5
|
+
//
|
|
6
|
+
// rewind lit-adhd and lit-rewind: rainbow border and rails, `REWIND <<`, a `<<` comet
|
|
7
|
+
// review review-work: the top and bottom rules split into the five review lanes
|
|
8
|
+
// turn waiting on the user: an amber border breathing over TIMINGS.breath, `YOUR TURN`
|
|
9
|
+
// done a plan, goal, review or release finished: one rainbow spray of embers
|
|
10
|
+
|
|
11
|
+
export const LOOKS = Object.freeze({
|
|
12
|
+
rewind: Object.freeze({ label: "REWIND <<", palette: "rainbow", comet: "bottom-leftward", pill: "rainbow" }),
|
|
13
|
+
review: Object.freeze({ label: "REVIEW", palette: "lanes", comet: "none", pill: "accent" }),
|
|
14
|
+
turn: Object.freeze({ label: "YOUR TURN", palette: "amber", comet: "none", pill: "amber" }),
|
|
15
|
+
done: Object.freeze({ label: "DONE", palette: "rainbow", comet: "none", pill: "brand" }),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const LOOK_BY_SKILL = Object.freeze({ "lit-adhd": "rewind", "lit-rewind": "rewind", "review-work": "review" });
|
|
19
|
+
const BY_SKILL = new Map(Object.entries(LOOK_BY_SKILL));
|
|
20
|
+
|
|
21
|
+
/** The look a skill or discipline id brings, or null for one that keeps the card's own look. */
|
|
22
|
+
export const lookOf = (id) => BY_SKILL.get(id) ?? null;
|
|
23
|
+
|
|
24
|
+
// One colour per review lane in workflow.mjs REVIEW_LANES order (goal, quality, security, qa,
|
|
25
|
+
// context), and each one 45% of the way to the dim segment while its reviewer is still running.
|
|
26
|
+
export const LANE_COLORS = Object.freeze(["#5fd7ff", "#b48cff", "#ff6fae", "#6bdb8f", "#ffd75f"]);
|
|
27
|
+
const LANE_RUNNING = Object.freeze(["#5095af", "#7e6caf", "#a85c82", "#569771", "#a89557"]);
|
|
28
|
+
const LANE_DIM = "#3d444d";
|
|
29
|
+
const LANE_FAIL = "#ff5f5f";
|
|
30
|
+
|
|
31
|
+
/** A lane segment's colour: its own once it passed, red once it failed, dim until it reports. */
|
|
32
|
+
export const laneColor = (index, state) => {
|
|
33
|
+
if (state === "pass") return LANE_COLORS[index];
|
|
34
|
+
if (state === "running") return LANE_RUNNING[index];
|
|
35
|
+
return state === "fail" ? LANE_FAIL : LANE_DIM;
|
|
36
|
+
};
|
|
@@ -54,9 +54,8 @@ export const motionProfile = (mode) => {
|
|
|
54
54
|
|
|
55
55
|
// The rewind look (plans/lit-adhd.md D7): while lit-adhd runs, the card's border and rails take a
|
|
56
56
|
// cycling rainbow, ASCII sparks drift through the skills row and a `<<` comet sweeps the bottom rule
|
|
57
|
-
// right to left.
|
|
58
|
-
|
|
59
|
-
export const lookOf = (discipline) => (REWIND.has(discipline) ? "rewind" : null);
|
|
57
|
+
// right to left. Which skill brings which look lives in looks.mjs.
|
|
58
|
+
export { lookOf } from "./looks.mjs";
|
|
60
59
|
|
|
61
60
|
export const clamp01 = (x) => (x <= 0 ? 0 : x >= 1 ? 1 : x);
|
|
62
61
|
|