@litfamily/litclaude 1.0.41 → 1.0.43

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.
Files changed (39) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/README.md +8 -8
  3. package/README_ko-KR.md +8 -8
  4. package/TRADEMARK.md +12 -0
  5. package/bin/litclaude-ai.js +29 -3
  6. package/docs/assets/readme/badge-version.svg +1 -1
  7. package/docs/hooks.md +35 -6
  8. package/package.json +2 -1
  9. package/plugins/litclaude/.claude-plugin/plugin.json +7 -1
  10. package/plugins/litclaude/bin/litclaude-hook.js +52 -6
  11. package/plugins/litclaude/bin/litclaude-mcp.js +1 -1
  12. package/plugins/litclaude/commands/lit-plan.md +5 -2
  13. package/plugins/litclaude/commands/start-work.md +8 -0
  14. package/plugins/litclaude/hooks/lit-band-client.mjs +9 -4
  15. package/plugins/litclaude/hooks/lit-mod.mjs +31 -1
  16. package/plugins/litclaude/lib/canonical-skill-resources.mjs +8 -8
  17. package/plugins/litclaude/lib/invite.mjs +131 -0
  18. package/plugins/litclaude/lib/lit-plan-persistence.mjs +15 -4
  19. package/plugins/litclaude/lib/mod/frame.mjs +97 -21
  20. package/plugins/litclaude/lib/mod/looks.mjs +13 -0
  21. package/plugins/litclaude/lib/mod/motion.mjs +5 -0
  22. package/plugins/litclaude/lib/mod/settings.mjs +5 -2
  23. package/plugins/litclaude/lib/mod/state.mjs +85 -5
  24. package/plugins/litclaude/lib/mod/svg-card.mjs +66 -16
  25. package/plugins/litclaude/lib/mod/timeline.mjs +32 -0
  26. package/plugins/litclaude/lib/mod/view.mjs +84 -12
  27. package/plugins/litclaude/lib/owner-lock.mjs +11 -1
  28. package/plugins/litclaude/lib/plan-scope-roots.mjs +76 -0
  29. package/plugins/litclaude/lib/plan-task-rows.mjs +17 -4
  30. package/plugins/litclaude/lib/rewind/brief.mjs +62 -8
  31. package/plugins/litclaude/lib/rewind/collect.mjs +114 -25
  32. package/plugins/litclaude/lib/session-liveness.mjs +36 -0
  33. package/plugins/litclaude/lib/start-work-lifecycle.mjs +200 -12
  34. package/plugins/litclaude/scripts/scaffold-plan.mjs +8 -2
  35. package/plugins/litclaude/skills/lit-adhd/SKILL.md +18 -11
  36. package/plugins/litclaude/skills/lit-adhd/references/card-examples.md +2 -2
  37. package/plugins/litclaude/skills/lit-adhd/references/status-taxonomy.md +8 -3
  38. package/plugins/litclaude/skills/lit-plan/SKILL.md +10 -3
  39. package/plugins/litclaude/skills/start-work/SKILL.md +5 -0
@@ -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, readInvited, readLedgerTail, readLitSnapshot, readPluginVersions } from "../lib/mod/state.mjs";
26
26
  import { settledSample } from "../lib/mod/timeline.mjs";
27
27
  import {
28
28
  EMPTY_ACTIVITY,
@@ -64,6 +64,9 @@ const LONG_TURN_MS = 3 * 60 * 1000;
64
64
  const createLive = (options) => ({
65
65
  band: normalizeModSettings(options).band,
66
66
  motion: normalizeModSettings(options).motion,
67
+ club: normalizeModSettings(options).club === "on",
68
+ // The inviter `lit invite` recorded on this machine, or null (state.mjs readInvited).
69
+ invited: null,
67
70
  drawnOn: {},
68
71
  iconFont: { present: false, path: null, note: "basic: not checked yet" },
69
72
  env: {},
@@ -105,8 +108,26 @@ const createLive = (options) => ({
105
108
  waiting: null,
106
109
  answeredBoundary: null,
107
110
  noColor: false,
111
+ // The loaded and installed LitClaude versions (restart chip), and when the installed one was read.
112
+ versions: null,
113
+ versionPaths: null,
114
+ versionsAt: Number.NEGATIVE_INFINITY,
108
115
  });
109
116
 
117
+ // This plugin's own manifest, beside the hooks folder; null when the mod was not loaded from a file.
118
+ const OWN_MANIFEST = (() => {
119
+ const url = new URL("../.claude-plugin/plugin.json", import.meta.url);
120
+ return url.protocol === "file:" ? decodeURIComponent(url.pathname) : null;
121
+ })();
122
+ const VERSION_RECHECK_MS = 60_000;
123
+
124
+ // The installed version is read again at most once a minute; an unreadable file only hides the chip.
125
+ async function readVersions($, live, now) {
126
+ if (!live.versionPaths || now - live.versionsAt < VERSION_RECHECK_MS) return;
127
+ live.versionsAt = now;
128
+ live.versions = await readPluginVersions(stateIo($), live.versionPaths).catch(() => null);
129
+ }
130
+
110
131
  const stateIo = ($) => ({
111
132
  stat: (path) => $.fs.stat(path, { resolve: true }),
112
133
  read: (path) => $.fs.read(path),
@@ -186,6 +207,9 @@ async function rebuild($, live) {
186
207
  tasks: live.tasks,
187
208
  turnStartedAt: live.turnStartedAt,
188
209
  waiting: waitingOf(live),
210
+ versions: live.versions,
211
+ club: live.club && live.invited !== null,
212
+ invitedBy: live.club ? live.invited : null,
189
213
  // The thread rows stay reserved while threads are live, so the card does not shrink between repaints.
190
214
  threadReserve: previous?.threads?.reserve ?? 0,
191
215
  });
@@ -280,9 +304,11 @@ async function refresh($, live, options) {
280
304
  const [cwd, sessionId] = await Promise.all([$.session.cwd(), $.session.id()]);
281
305
  const fresh = await readLitSnapshot(stateIo($), { cwd, sessionId, env: live.env });
282
306
  live.git = await readGitBranch(stateIo($), cwd).catch(() => live.git);
307
+ if (live.club) live.invited = await readInvited(stateIo($), live.env).catch(() => live.invited);
283
308
  const listed = await $.agent.list().catch(() => []);
284
309
  live.usage = await $.session.usage().catch(() => live.usage);
285
310
  const now = await $.clock.now();
311
+ await readVersions($, live, now);
286
312
  ({ agents: live.agents, spawned: live.spawned } = mergeSpawned(listed, live.spawned, now));
287
313
  live.activity = trackAgents(live.activity, live.agents, live.statusById, now);
288
314
  live.statusById = Object.fromEntries(live.agents.map((agent) => [agent.id, agent.status]));
@@ -330,6 +356,8 @@ export const register = (on, options) => {
330
356
  LITCLAUDE_HUD_STATE_ROOT: await $.env.get("LITCLAUDE_HUD_STATE_ROOT"),
331
357
  LITCLAUDE_AUTO_HANDOFF: await $.env.get("LITCLAUDE_AUTO_HANDOFF"),
332
358
  LITCLAUDE_AUTO_HANDOFF_PERCENT: await $.env.get("LITCLAUDE_AUTO_HANDOFF_PERCENT"),
359
+ LITCLAUDE_HOME: await $.env.get("LITCLAUDE_HOME"),
360
+ HOME: await $.env.get("HOME"),
333
361
  };
334
362
  live.iconFont = await detectIconFont(stateIo($), {
335
363
  HOME: await $.env.get("HOME"),
@@ -337,6 +365,8 @@ export const register = (on, options) => {
337
365
  LOCALAPPDATA: await $.env.get("LOCALAPPDATA"),
338
366
  });
339
367
  live.settledAt = await $.clock.now();
368
+ const configDir = (await $.env.get("CLAUDE_CONFIG_DIR"))?.trim() || ((await $.env.get("HOME")) ? `${await $.env.get("HOME")}/.claude` : null);
369
+ live.versionPaths = OWN_MANIFEST && configDir ? { pluginJson: OWN_MANIFEST, installedFile: `${configDir}/plugins/installed_plugins.json` } : null;
340
370
  const hostSettings = await $.settings.read().catch(() => null);
341
371
  live.accent = accentFromSettings(hostSettings, await $.env.get("LITCLAUDE_HUD_ACCENT"));
342
372
  // NO_COLOR (no-color.org): set and not empty, the card draws no colour and does not move.
@@ -19,12 +19,12 @@ export const canonicalSkillResourceManifest = Object.freeze(
19
19
  ["lib/office_data.py", "0f4c2449622b6d59630e60508594d181279052c41918df4370e11a68df1ee239"],
20
20
  ["lib/office_runtime_bootstrap.py", "6b32ab8d9ae46963770310c559825c83aa6ff80752df7de497c6cf0148d9f48e"],
21
21
  ["lib/ooxml_integrity.py", "85e5cba28aa3b9f4f4c28f59c6118439a985fe4f29e25274ae63e9ef1edf15e3"],
22
- ["lib/owner-lock.mjs", "2368724b7e48ce14c83121b529e4d491319201348c012b6141f137dd3451b65c"],
23
- ["lib/plan-task-rows.mjs", "5ba6c6e3cd04fb3f1be33cf5692a05f46948390e70ca096b9516f1589c6ddde9"],
22
+ ["lib/owner-lock.mjs", "d70c57b603987f0865add60dad442489acb42541a8dedeb3fe254429f4bfa7b6"],
23
+ ["lib/plan-task-rows.mjs", "ca45412631cdfa805102a42dbb3cfc9a43f6f1ecbcdabe1cc5059d2dcb5e58df"],
24
24
  ["lib/rename-aliases.mjs", "3ee93aec10d0dbe785c554ab3040173ee94fde27da1b440a54b0513e5d11a508"],
25
25
  ["lib/render_pages.py", "69e20951dff5af47cff074b699ad992f489f5ac14559a5c114e17aa4dbaa5db7"],
26
- ["lib/rewind/brief.mjs", "39afb666bb89244e374da48a71755e51690573f06f7d3de2a85e1100249c93cb"],
27
- ["lib/rewind/collect.mjs", "4bb6809e851276757585c89508949f86a1739ab9e0381eb315cb04f21faaac71"],
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", "d009e240882d015023ec091cc0f3ef64dcee8c458b6786d6bea027cd8f07d429"],
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", "e17fb4259f19c93f4231aa7c455b9c6ef172d538c9a8d00aef5e9b6b007e4e9c"],
137
- ["skills/lit-adhd/references/card-examples.md", "5ef967e39355e8674c630c12875668c2eb7391dc3ed468e69dd8e33423e0e413"],
138
- ["skills/lit-adhd/references/status-taxonomy.md", "4223a91f0ec2772be977d20890d94f6eab56381937b33380f85f48b492c3dd7a"],
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"],
@@ -0,0 +1,131 @@
1
+ // `lit invite @<github-id>` (plans/invite-pilot.md): the invitee records who invited them, and the
2
+ // LIT card shows its `club` look from then on. Honor system and cosmetic only: the record lives in
3
+ // `$LITCLAUDE_HOME/invite.json` (`~/.litclaude/invite.json` by default) on this machine, nothing is
4
+ // sent anywhere, and the messages only print the Discussions link where invites are counted.
5
+ //
6
+ // The home folder and `invite.json` must be real (a symlink at either is refused), the record is
7
+ // written to a fresh temporary file and renamed into place, and the first inviter is kept.
8
+
9
+ import { closeSync, constants, lstatSync, mkdirSync, openSync, readFileSync, renameSync, rmSync, writeSync } from "node:fs";
10
+ import { homedir } from "node:os";
11
+ import { join } from "node:path";
12
+
13
+ export const DISCUSSIONS_URL = "https://github.com/wjgoarxiv/litfamily/discussions";
14
+ export const INVITE_FILE = "invite.json";
15
+
16
+ const ID = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$/u;
17
+ const MAX_RECORD_BYTES = 4096;
18
+ const NO_FOLLOW = constants.O_NOFOLLOW ?? 0;
19
+
20
+ /** The GitHub id after stripping one leading `@`, or null when it is not one. */
21
+ export const parseInviteId = (raw) => {
22
+ if (typeof raw !== "string") return null;
23
+ const id = raw.startsWith("@") ? raw.slice(1) : raw;
24
+ return ID.test(id) ? id : null;
25
+ };
26
+
27
+ // Only a whole prompt counts, spelled like `lit approve` (start-work-lifecycle.mjs APPROVE_TOKEN):
28
+ // a longer, quoted or relayed message that merely mentions `lit invite` keeps its ordinary route.
29
+ const INVITE_PROMPT = /^lit[ \t]+invite(?:[ \t]+(\S+))?$/iu;
30
+
31
+ /** `{ id }` (null for a bare `lit invite`) when the whole prompt is an invite, else null. */
32
+ export const parseInvitePrompt = (prompt) => {
33
+ if (typeof prompt !== "string" || prompt.length > 512) return null;
34
+ const match = INVITE_PROMPT.exec(prompt.trim());
35
+ return match ? { id: match[1] ?? null } : null;
36
+ };
37
+
38
+ /** Same rule as automatic-update.mjs resolveHome: LITCLAUDE_HOME, else ~/.litclaude. */
39
+ export const inviteHome = (env = process.env) => (env.LITCLAUDE_HOME ? env.LITCLAUDE_HOME : join(homedir(), ".litclaude"));
40
+
41
+ const validRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value)
42
+ && value.version === 1 && parseInviteId(value.invitedBy) === value.invitedBy && typeof value.at === "string" && Number.isFinite(Date.parse(value.at));
43
+
44
+ const realFolder = (path) => {
45
+ try {
46
+ return lstatSync(path).isDirectory();
47
+ } catch {
48
+ return false;
49
+ }
50
+ };
51
+
52
+ /** The stored record, or null when there is none or it is not a real, well-formed file. */
53
+ export const readInvite = ({ home = inviteHome() } = {}) => {
54
+ if (!realFolder(home)) return null;
55
+ const path = join(home, INVITE_FILE);
56
+ try {
57
+ const stat = lstatSync(path);
58
+ if (!stat.isFile() || stat.size > MAX_RECORD_BYTES) return null;
59
+ const value = JSON.parse(readFileSync(path, "utf8"));
60
+ return validRecord(value) ? { version: 1, invitedBy: value.invitedBy, at: value.at } : null;
61
+ } catch {
62
+ return null;
63
+ }
64
+ };
65
+
66
+ const writeRecord = (home, record) => {
67
+ mkdirSync(home, { recursive: true, mode: 0o700 });
68
+ if (!realFolder(home)) throw new Error("the LitClaude home is not a real folder");
69
+ const target = join(home, INVITE_FILE);
70
+ try {
71
+ if (!lstatSync(target).isFile()) throw new Error("invite.json is not a regular file");
72
+ } catch (error) {
73
+ if (error?.code !== "ENOENT") throw error;
74
+ }
75
+ const temporary = join(home, `.${INVITE_FILE}.${process.pid}.${Date.now()}.tmp`);
76
+ const fd = openSync(temporary, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | NO_FOLLOW, 0o600);
77
+ try {
78
+ try {
79
+ writeSync(fd, `${JSON.stringify(record)}\n`);
80
+ } finally {
81
+ closeSync(fd);
82
+ }
83
+ renameSync(temporary, target);
84
+ } catch (error) {
85
+ rmSync(temporary, { force: true });
86
+ throw error;
87
+ }
88
+ };
89
+
90
+ /**
91
+ * Records `raw` as this machine's inviter. `{ status }` is `invalid` (nothing written), `recorded`,
92
+ * `same` (that id is already the inviter), `kept` (another id already is; `requested` is the one
93
+ * refused) or `failed` (the home or the file could not be written safely; nothing written).
94
+ */
95
+ export const recordInvite = (raw, { home = inviteHome(), now = () => new Date() } = {}) => {
96
+ const id = parseInviteId(raw);
97
+ if (!id) return { status: "invalid", input: typeof raw === "string" ? raw : "" };
98
+ const existing = readInvite({ home });
99
+ if (existing) {
100
+ return existing.invitedBy.toLowerCase() === id.toLowerCase()
101
+ ? { status: "same", record: existing }
102
+ : { status: "kept", record: existing, requested: id };
103
+ }
104
+ const record = { version: 1, invitedBy: id, at: now().toISOString() };
105
+ try {
106
+ writeRecord(home, record);
107
+ } catch (error) {
108
+ return { status: "failed", reason: error?.code ?? (error instanceof Error ? error.message : "write failed") };
109
+ }
110
+ return { status: "recorded", record };
111
+ };
112
+
113
+ /** What to tell friends: the line they type, and where invites are counted. */
114
+ export const shareLine = () =>
115
+ `Invite a friend: ask them to type \`lit invite @<your GitHub id>\` in Claude Code with LitClaude. They get the club card look, and you both can say hi in ${DISCUSSIONS_URL}`;
116
+
117
+ /** The message one recordInvite result prints, in the CLI and as the prompt hook's answer. */
118
+ export const inviteMessage = (result) => {
119
+ switch (result?.status) {
120
+ case "recorded":
121
+ return `Thanks for joining through @${result.record.invitedBy}. The club look is on for your LIT card (turn it off with \`litclaude-ai config club off\`). Nothing was sent anywhere; if you like, post "invited by @${result.record.invitedBy}" in ${DISCUSSIONS_URL}`;
122
+ case "same":
123
+ return `You were already invited by @${result.record.invitedBy}; nothing changed. The thread: ${DISCUSSIONS_URL}`;
124
+ case "kept":
125
+ return `You were already invited by @${result.record.invitedBy}, and the first invite stays; @${result.requested} was not recorded. The thread: ${DISCUSSIONS_URL}`;
126
+ case "invalid":
127
+ return "That is not a GitHub id: use letters, digits and single hyphens, up to 39 characters, not starting with a hyphen (for example `lit invite @octocat`). Nothing was recorded.";
128
+ default:
129
+ return `The invite could not be saved (${result?.reason ?? "unknown error"}): the LitClaude home folder or invite.json is not a plain, writable file. Nothing was recorded.`;
130
+ }
131
+ };
@@ -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)) return { action: "allow", why: "plan-persisted", planPath: newest.absolutePath };
119
- detail = `plans/${newest.name} has no checkbox task rows (\`- [ ] N.\`)`;
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: `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.`,
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,7 @@
34
34
 
35
35
  import { gauge, knownFacts } from "../rewind/gauge.mjs";
36
36
  import { textWidth, truncateToWidth } from "./layout.mjs";
37
- import { LOOKS, laneColor, lookOf } from "./looks.mjs";
37
+ import { CLUB_GLINT, CLUB_GOLD, CLUB_PILL, CLUB_STOPS, LOOKS, laneColor, lookOf } from "./looks.mjs";
38
38
  import { barCells, gradientAt, lerpColor, rainbowAt } from "./motion.mjs";
39
39
  import { glyphSet } from "./settings.mjs";
40
40
  import { formatDuration } from "./view.mjs";
@@ -142,6 +142,17 @@ const rainbowPill = (text, rainbow, from, glyphs, bold = true) => {
142
142
  : [span(" ", { bg: rainbowCell(rainbow, at(0)) }), ...body, span(" ", { bg: rainbowCell(rainbow, at(chars.length - 1)) })];
143
143
  };
144
144
 
145
+ // The club look's `CLUB ✦`: dark ink on a fill graded gold to rose, a cell at a time, each cap in
146
+ // the colour of the cell beside it.
147
+ const clubPill = (text, glyphs) => {
148
+ const chars = [...text];
149
+ const fill = (i) => gradientAt(CLUB_PILL, chars.length <= 1 ? 0 : i / (chars.length - 1));
150
+ const body = chars.map((ch, i) => span(ch, { fg: PILL.ink, bg: fill(i), bold: true }));
151
+ return glyphs.capLeft
152
+ ? [span(glyphs.capLeft, { fg: fill(0) }), ...body, span(glyphs.capRight, { fg: fill(chars.length - 1) })]
153
+ : [span(" ", { bg: fill(0) }), ...body, span(" ", { bg: fill(chars.length - 1) })];
154
+ };
155
+
145
156
  const inkOf = (accent) => ({ done: lerpColor(accent, PALETTE.dim, 0.45), now: accent, todo: PALETTE.dim, warn: PALETTE.amber });
146
157
 
147
158
  // Colour of one phase in this frame: the crossfade from its previous state, then the amber mix for
@@ -220,12 +231,12 @@ const cometOn = (sample, edge, width, look = null) => {
220
231
 
221
232
  // While LitClaude works the brand pill breathes from its pink toward the flame orange and back.
222
233
  // The rewind look turns it through the rainbow instead, lightened so its dark ink stays readable;
223
- // YOUR TURN holds it amber.
234
+ // YOUR TURN holds it amber, the club look gold.
224
235
  const brandSpans = (sample, glyphs, rainbow = null, look = null) => {
225
236
  const reveal = revealText("🔥 LIT", sample.pills[0]);
226
237
  if (reveal === null) return [];
227
238
  if (rainbow) return rainbowPill(reveal, rainbow, 0, glyphs);
228
- const fill = look === "turn" ? PALETTE.amber : sample.ambient ? lerpColor(PILL.brand, PALETTE.orange, 0.85 * sample.ambient.breath) : PILL.brand;
239
+ const fill = look === "turn" ? PALETTE.amber : look === "club" ? CLUB_GOLD : sample.ambient ? lerpColor(PILL.brand, PALETTE.orange, 0.85 * sample.ambient.breath) : PILL.brand;
229
240
  return pill(litText(reveal, { fg: PILL.ink, bg: fill, bold: true }, sample.completion?.shimmer ?? null), fill, glyphs);
230
241
  };
231
242
  // `REWIND <<` while the rewind look is on, each letter a step further round the hue wheel, lightened
@@ -240,6 +251,7 @@ const indicatorSpans = (model, sample, glyphs, accent, rainbow = null, look = nu
240
251
  const lanes = model.workflow.verdicts;
241
252
  return [span(`${LOOKS.review.label} ${lanes.filter(({ state }) => state === "pass" || state === "fail").length}/${lanes.length}`, { fg: accent, bold: true })];
242
253
  }
254
+ if (look === "club") return clubPill(`${LOOKS.club.label} ✦`, glyphs);
243
255
  if (model.idle) return [span("idle", { fg: PALETTE.dim })];
244
256
  const flow = model.workflow;
245
257
  if (flow && flow.current >= 0) {
@@ -256,13 +268,20 @@ const indicatorSpans = (model, sample, glyphs, accent, rainbow = null, look = nu
256
268
 
257
269
  // ╭─ [🔥 LIT] · <discipline> ──── <PHASE ●> ─╮. On a narrow card the phase indicator goes first,
258
270
  // then the discipline shortens, then it goes too.
271
+ // A newer LitClaude installed than the one loaded adds `restart to <version>` before the
272
+ // indicator, dropped first when the edge has no room for it.
273
+ // The club look sets a sparkle at each corner of the title: `✧` before the brand, `✦` after the name.
259
274
  const topEdge = (model, sample, { width, glyphs, accent, edge, look, paint, rainbow }) => {
260
- const brand = brandSpans(sample, glyphs, rainbow, look);
261
- const right = indicatorSpans(model, sample, glyphs, accent, rainbow, look);
275
+ const sparkle = look === "club";
276
+ const brand = [...(sparkle ? [span("✧ ", { fg: CLUB_STOPS[1] })] : []), ...brandSpans(sample, glyphs, rainbow, look)];
277
+ const indicator = indicatorSpans(model, sample, glyphs, accent, rainbow, look);
262
278
  const name = model.title ?? "ready";
263
- const nameStyle = model.idle && !rainbow ? { fg: PALETTE.dim } : { fg: accent, bold: true };
264
- const title = (text) => (text ? [span(" · ", { fg: PALETTE.dim }), span(text, nameStyle)] : []);
279
+ const nameStyle = look === "club" ? { fg: CLUB_STOPS[1] } : model.idle && !rainbow ? { fg: PALETTE.dim } : { fg: accent, bold: true };
280
+ const title = (text) => (text ? [span(" · ", { fg: PALETTE.dim }), span(text, nameStyle), ...(sparkle ? [span(" ✦", { fg: CLUB_GOLD })] : [])] : []);
265
281
  const fixed = textWidth("╭─ ") + rowWidth(brand) + 1 + 1;
282
+ const fits = (spans) => fixed + rowWidth(title(name)) + 1 + rowWidth(spans) + textWidth(" ─╮") <= width;
283
+ const chip = model.restart ? [span(`restart to ${model.restart}`, { fg: PALETTE.amber }), span(" · ", { fg: PALETTE.dim }), ...indicator] : null;
284
+ const right = chip && fits(chip) ? chip : indicator;
266
285
  const withRight = fixed + rowWidth(title(name)) + 1 + rowWidth(right) + textWidth(" ─╮");
267
286
  const comet = cometOn(sample, "top", width, look);
268
287
  if (withRight <= width) return edgeRow("╭─ ", [...brand, ...title(name)], right, "─╮", width, edge, comet, paint[0]);
@@ -602,7 +621,7 @@ const progressSpans = (thread, sample, rainbow, index, color) => {
602
621
  };
603
622
 
604
623
  const threadRows = (model, sample, { inner, glyphs, rainbow }) => {
605
- const { chain, lanes, others, more, reserve } = model.threads;
624
+ const { chain, lanes, herdrLanes = [], others, more, reserve } = model.threads;
606
625
  const lines = [];
607
626
  chain.forEach((thread, index) => lines.push({ thread, lead: index === 0 ? "" : `${" ".repeat(index - 1)}└─ `, last: true }));
608
627
  // Lanes and background tasks are children of the top frame, so they hang at its indent.
@@ -616,6 +635,8 @@ const threadRows = (model, sample, { inner, glyphs, rainbow }) => {
616
635
  } else {
617
636
  lanes.forEach((thread) => lines.push({ thread, lead: chain.length ? `${under}└─ ` : "", last: true }));
618
637
  }
638
+ // herdr lanes of this project run beside this session, so they sit at the root, before other sessions.
639
+ herdrLanes.forEach((thread) => lines.push({ thread, lead: "", last: true }));
619
640
  others.forEach((thread) => lines.push({ thread, lead: "", last: true }));
620
641
  const rows = lines.map((line) => line.thread ?? null).filter(Boolean);
621
642
  // A wide card spends its room on names, so lanes that share a prefix stay apart.
@@ -694,8 +715,18 @@ const awayHint = (room, accent) => {
694
715
  return hint ? [span(hint[0], { fg: PALETTE.dim }), span(hint[1], { fg: accent }), ...(hint[2] ? [span(hint[2], { fg: PALETTE.dim })] : [])] : [];
695
716
  };
696
717
 
718
+ // The club card's quiet `invited by @<id>` chip, on the muted pill.
719
+ const inviteChip = (model, glyphs) => (model.invitedBy
720
+ ? pill([span("invited by ", { fg: PILL.mutedText, bg: PILL.muted }), span(`@${model.invitedBy}`, { fg: CLUB_STOPS[1], bg: PILL.muted, bold: true })], PILL.muted, glyphs)
721
+ : null);
722
+ // `row` with the chip at its right end, two cells apart at least, or null when they do not both fit.
723
+ const withChip = (row, chip, inner) => (chip && rowWidth(row) + 2 + rowWidth(chip) <= inner
724
+ ? fitRow([...row, span(" ".repeat(inner - rowWidth(row) - rowWidth(chip))), ...chip], inner)
725
+ : null);
726
+
697
727
  const chipsRow = (model, sample, { inner, glyphs, accent, rainbow }) => {
698
728
  const chips = model.skills;
729
+ const invite = inviteChip(model, glyphs);
699
730
  if (chips.length === 0) {
700
731
  if (!model.idle && model.next && !model.workflow?.next) return fitRow([span("▸ ", { fg: accent }), span(truncateToWidth(model.next, inner - 2), { fg: PALETTE.white })], inner);
701
732
  if (!model.idle) return fitRow([span("no LitFamily skill yet in this request", { fg: PALETTE.dim })], inner);
@@ -704,6 +735,10 @@ const chipsRow = (model, sample, { inner, glyphs, accent, rainbow }) => {
704
735
  [span("no skill yet · type ", { fg: PALETTE.dim }), span("lit <task>", { fg: accent })],
705
736
  [span("type ", { fg: PALETTE.dim }), span("lit <task>", { fg: accent })],
706
737
  ];
738
+ for (const hint of hints) {
739
+ const shown = withChip(hint, invite, inner);
740
+ if (shown) return shown;
741
+ }
707
742
  return fitRow(hints.find((hint) => rowWidth(hint) <= inner) ?? hints.at(-1), inner);
708
743
  }
709
744
  const row = inner >= 30 ? [span("skills", { fg: PALETTE.dim })] : [];
@@ -722,7 +757,7 @@ const chipsRow = (model, sample, { inner, glyphs, accent, rainbow }) => {
722
757
  }
723
758
  if (shown < chips.length) row.push(...(row.length ? [span(" ")] : []), ...mutedPill(`+${chips.length - shown}`, glyphs));
724
759
  if (model.away) return fitRow([...row, ...awayHint(inner - rowWidth(row), accent)], inner);
725
- return sparkled(row, inner, sample, rainbow);
760
+ return withChip(row, invite, inner) ?? sparkled(row, inner, sample, rainbow);
726
761
  };
727
762
 
728
763
  const noticeRow = (sample, inner) => {
@@ -793,15 +828,41 @@ const bottomEdge = (model, sample, { width, glyphs, accent, edge, look, paint, r
793
828
 
794
829
  // The border: red or amber under a warning, otherwise the accent. Idle it is a calm, dim accent;
795
830
  // while LitClaude works it sits a step above the accent and breathes brighter toward white with the
796
- // brand pill. YOUR TURN breathes amber over TIMINGS.breath, and holds it with motion off.
831
+ // brand pill. YOUR TURN breathes amber over TIMINGS.breath, and holds it with motion off. The club
832
+ // look's border is gold (its rules and sides are painted with CLUB_STOPS).
797
833
  const edgeColor = (model, sample, accent, look) => {
798
834
  if (model.warnings.some(({ tone }) => tone === "red")) return PALETTE.red;
799
835
  if (look === "turn") return sample.ambient ? lerpColor(lerpColor(PALETTE.amber, PALETTE.faint, 0.5), PALETTE.amber, sample.ambient.breath) : PALETTE.amber;
800
836
  if (model.warnings.length) return PALETTE.amber;
837
+ if (look === "club") return CLUB_GOLD;
801
838
  if (model.idle) return lerpColor(PALETTE.faint, accent, 0.35);
802
839
  return lerpColor(accent, "#ffffff", 0.15 + 0.3 * (sample.ambient?.breath ?? 0));
803
840
  };
804
841
 
842
+ // How far the glint's light reaches either side of its centre, in cells.
843
+ const GLINT_REACH = 8;
844
+
845
+ // The club ring's colour at a border cell (`col`, `y`) of a card `width` by `height`: CLUB_STOPS laid
846
+ // clockwise from the top-left corner, so the ring closes gold on gold. `glint` (0 to 1 across its
847
+ // pass, or null) lays a warm white light over the top edge, entering and leaving off the card.
848
+ const clubRing = (width, height, glint) => {
849
+ const right = width - 1;
850
+ const bottom = height - 1;
851
+ const perimeter = 2 * right + 2 * bottom;
852
+ const along = (col, y) => {
853
+ if (y === 0) return col;
854
+ if (y === bottom) return right + bottom + (right - col);
855
+ return col === right ? right + y : 2 * right + bottom + (bottom - y);
856
+ };
857
+ const center = glint === null ? null : glint * (width + 2 * GLINT_REACH) - GLINT_REACH;
858
+ return (col, y) => {
859
+ const base = gradientAt(CLUB_STOPS, along(col, y) / perimeter);
860
+ if (center === null || y !== 0) return base;
861
+ const k = Math.max(0, 1 - Math.abs(col - center) / GLINT_REACH);
862
+ return k > 0 ? lerpColor(base, CLUB_GLINT, 0.8 * k) : base;
863
+ };
864
+ };
865
+
805
866
  /**
806
867
  * The card for one frame: `{ mode: "card", border, width, rows }`, five rows (top edge, workflow
807
868
  * map or phase track, detail line, chips row, bottom edge), with the thread rows between the detail
@@ -825,19 +886,34 @@ export const composeBand = (model, sample, { columns, glyphs: glyphMode = "basic
825
886
  const lanes = look === "review" ? model.workflow.verdicts : null;
826
887
  const laneAt = (col) => Math.min(lanes.length - 1, Math.floor((col * lanes.length) / width));
827
888
  const lanePaint = lanes ? (col) => laneColor(laneAt(col), lanes[laneAt(col)].state) : null;
828
- const paint = [0, 1, 2, 3, 4].map((r) => (painted ? (col) => rainbow(col / width + r * 0.04) : r === 0 || r === 4 ? lanePaint : null));
829
- const side = (row, r) => (paint[r]
830
- ? [span("│", { fg: paint[r](0) }), span(" "), ...row, span(" "), span("│", { fg: paint[r](width - 1) })]
831
- : [span("│ ", { fg: edge }), ...row, span(" │", { fg: edge })]);
832
- const options = { width, inner, glyphs, accent, edge, look, rainbow, paint };
889
+ const options = { width, inner, glyphs, accent, edge, look, rainbow };
833
890
  const middle = sample.completion ? completionRow(sample, inner) : sample.notice ? noticeRow(sample, inner) : chipsRow(model, sample, options);
891
+ // The rows between the edges, each with the paint slot its sides take (thread rows share the detail line's).
892
+ const body = [
893
+ [model.workflow ? mapRow(model, sample, options) : phaseRow(model, sample, options), 1],
894
+ [detailRow(model, sample, options), 2],
895
+ ...(model.threads ? threadRows(model, sample, options).map((row) => [row, 2]) : []),
896
+ [middle, 3],
897
+ ];
898
+ // The club look's ring: its velvet laid clockwise round the whole border, with the glint's light
899
+ // crossing the top edge while a pass runs. Without warnings only; it never touches the body.
900
+ const ring = look === "club" && model.warnings.length === 0 ? clubRing(width, body.length + 2, sample.glint ?? null) : null;
901
+ const paint = [0, 1, 2, 3, 4].map((r) => {
902
+ if (painted) return (col) => rainbow(col / width + r * 0.04);
903
+ if (ring) return r === 0 ? (col) => ring(col, 0) : r === 4 ? (col) => ring(col, body.length + 1) : null;
904
+ return r === 0 || r === 4 ? lanePaint : null;
905
+ });
906
+ const side = (row, r, y) => {
907
+ const at = ring ? (col) => ring(col, y) : paint[r];
908
+ return at
909
+ ? [span("│", { fg: at(0) }), span(" "), ...row, span(" "), span("│", { fg: at(width - 1) })]
910
+ : [span("│ ", { fg: edge }), ...row, span(" │", { fg: edge })];
911
+ };
912
+ const edges = { ...options, paint };
834
913
  const rows = [
835
- topEdge(model, sample, options),
836
- side(model.workflow ? mapRow(model, sample, options) : phaseRow(model, sample, options), 1),
837
- side(detailRow(model, sample, options), 2),
838
- ...(model.threads ? threadRows(model, sample, options).map((row) => side(row, 2)) : []),
839
- side(middle, 3),
840
- bottomEdge(model, sample, options),
914
+ topEdge(model, sample, edges),
915
+ ...body.map(([row, r], index) => side(row, r, index + 1)),
916
+ bottomEdge(model, sample, edges),
841
917
  ];
842
918
  return {
843
919
  mode: "card",
@@ -7,14 +7,27 @@
7
7
  // review review-work: the top and bottom rules split into the five review lanes
8
8
  // turn waiting on the user: an amber border breathing over TIMINGS.breath, `YOUR TURN`
9
9
  // done a plan, goal, review or release finished: one rainbow spray of embers
10
+ // club the idle card once `lit invite` recorded an inviter (plans/invite-pilot.md): a gold →
11
+ // rose → violet ring round all four borders with a slow gold glint along the top (full
12
+ // motion only), a gold LIT pill, `CLUB ✦` on a gold-gradient pill, sparkles at the
13
+ // title's corners and an `invited by @<id>` chip; below every other look
10
14
 
11
15
  export const LOOKS = Object.freeze({
12
16
  rewind: Object.freeze({ label: "REWIND <<", palette: "rainbow", comet: "bottom-leftward", pill: "rainbow" }),
13
17
  review: Object.freeze({ label: "REVIEW", palette: "lanes", comet: "none", pill: "accent" }),
14
18
  turn: Object.freeze({ label: "YOUR TURN", palette: "amber", comet: "none", pill: "amber" }),
15
19
  done: Object.freeze({ label: "DONE", palette: "rainbow", comet: "none", pill: "brand" }),
20
+ club: Object.freeze({ label: "CLUB", palette: "velvet", comet: "none", pill: "gold" }),
16
21
  });
17
22
 
23
+ // The club look's velvet: gold through rose to violet and back to gold, laid round the border so
24
+ // the ring closes in the same colour it starts with. CLUB_GOLD fills its LIT pill under dark ink,
25
+ // CLUB_PILL grades the `CLUB ✦` pill and CLUB_GLINT is the light that runs along the top.
26
+ export const CLUB_STOPS = Object.freeze(["#ffd75f", "#ff8fbf", "#b48cff", "#ff8fbf", "#ffd75f"]);
27
+ export const CLUB_GOLD = "#ffd75f";
28
+ export const CLUB_PILL = Object.freeze(["#ffd75f", "#ffb38a", "#ff8fbf"]);
29
+ export const CLUB_GLINT = "#fff6d6";
30
+
18
31
  export const LOOK_BY_SKILL = Object.freeze({ "lit-adhd": "rewind", "lit-rewind": "rewind", "review-work": "review" });
19
32
  const BY_SKILL = new Map(Object.entries(LOOK_BY_SKILL));
20
33
 
@@ -36,6 +36,11 @@ export const TIMINGS = Object.freeze({
36
36
  clock: 1000,
37
37
  hue: 4800,
38
38
  sparks: 3600,
39
+ // The club look's glint along the top border (full motion only): the first pass waits
40
+ // `clubGlintRest`, each pass lasts `clubGlint`, and passes start `clubGlintPeriod` apart.
41
+ clubGlint: 1400,
42
+ clubGlintRest: 1200,
43
+ clubGlintPeriod: 3600,
39
44
  });
40
45
 
41
46
  // full: the approved motion, and while LitClaude works the brand breathes, a light sweeps the active
@@ -1,15 +1,17 @@
1
- // The LIT band's four userConfig options. The manifest declares them as plain strings without an
1
+ // The LIT band's five userConfig options. The manifest declares them as plain strings without an
2
2
  // `options` list, because Claude Code 2.1.270 and older refuse a whole plugin whose userConfig has
3
3
  // one; the values are checked here instead, and anything unknown falls back to the default (the
4
4
  // first choice). `notify` raises a notification through the person's own channel when LIT work
5
5
  // completes or a LIT turn longer than three minutes ends; `finish+sound` adds a sound only where
6
- // the plugin ships one, and none ships yet, so it notifies like `finish`.
6
+ // the plugin ships one, and none ships yet, so it notifies like `finish`. `club` lets an invited
7
+ // card wear the club look while idle (plans/invite-pilot.md).
7
8
 
8
9
  export const MOD_CHOICES = Object.freeze({
9
10
  motion: ["full", "subtle", "off"],
10
11
  glyphs: ["auto", "nerd", "basic"],
11
12
  band: ["always", "auto", "off"],
12
13
  notify: ["off", "finish", "finish+sound"],
14
+ club: ["on", "off"],
13
15
  });
14
16
 
15
17
  const pick = (value, choices) => {
@@ -22,6 +24,7 @@ export const normalizeModSettings = (options) => ({
22
24
  glyphs: pick(options?.glyphs, MOD_CHOICES.glyphs),
23
25
  band: pick(options?.band, MOD_CHOICES.band),
24
26
  notify: pick(options?.notify, MOD_CHOICES.notify),
27
+ club: pick(options?.club, MOD_CHOICES.club),
25
28
  });
26
29
 
27
30
  // Claude Code's own `prefersReducedMotion` setting (/config "Reduce motion") turns the band's motion