@litfamily/litclaude 1.0.37 → 1.0.38
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 +45 -0
- package/README.md +11 -8
- package/README_ko-KR.md +11 -8
- package/bin/litclaude-ai.js +3 -3
- package/docs/assets/readme/badge-version.svg +1 -1
- package/docs/assets/skills/lit-adhd.webp +0 -0
- package/docs/assets/skills/lit-hijack.webp +0 -0
- package/docs/assets/skills/lit-schematic.webp +0 -0
- package/docs/hooks.md +112 -26
- package/docs/workflow-compatibility-audit.md +1 -1
- package/package.json +1 -1
- package/plugins/litclaude/.claude-plugin/plugin.json +1 -1
- package/plugins/litclaude/agents/lit-executor.md +4 -2
- package/plugins/litclaude/bin/litclaude-ai +1 -0
- package/plugins/litclaude/bin/litclaude-hook.js +349 -47
- package/plugins/litclaude/bin/litclaude-mcp.js +1 -1
- package/plugins/litclaude/commands/lit-adhd.md +103 -0
- package/plugins/litclaude/commands/lit-hijack.md +102 -0
- package/plugins/litclaude/commands/lit-loop.md +4 -2
- package/plugins/litclaude/commands/lit-plan.md +5 -4
- package/plugins/litclaude/commands/lit-rewind.md +103 -0
- package/plugins/litclaude/commands/litgoal.md +5 -4
- package/plugins/litclaude/commands/start-work.md +25 -10
- package/plugins/litclaude/hooks/lit-mod.mjs +51 -5
- package/plugins/litclaude/lib/canonical-skill-catalog.mjs +3 -0
- package/plugins/litclaude/lib/canonical-skill-resources.mjs +199 -96
- package/plugins/litclaude/lib/lit-activation.mjs +24 -10
- package/plugins/litclaude/lib/mod/frame.mjs +158 -39
- package/plugins/litclaude/lib/mod/motion.mjs +21 -0
- package/plugins/litclaude/lib/mod/settings.mjs +4 -0
- package/plugins/litclaude/lib/mod/skills.mjs +3 -0
- package/plugins/litclaude/lib/mod/state.mjs +100 -7
- package/plugins/litclaude/lib/mod/svg-card.mjs +115 -15
- package/plugins/litclaude/lib/mod/timeline.mjs +24 -2
- package/plugins/litclaude/lib/mod/toasts.mjs +5 -2
- package/plugins/litclaude/lib/mod/view.mjs +199 -5
- package/plugins/litclaude/lib/mod/workflow.mjs +36 -7
- package/plugins/litclaude/lib/motion-render-gate.mjs +25 -7
- package/plugins/litclaude/lib/render_pages.py +29 -1
- package/plugins/litclaude/lib/rewind/collect.mjs +387 -0
- package/plugins/litclaude/lib/rewind/gauge.mjs +67 -0
- package/plugins/litclaude/lib/rewind/next-step.mjs +89 -0
- package/plugins/litclaude/lib/rewind/redact.mjs +36 -0
- package/plugins/litclaude/lib/rewind/transcripts.mjs +244 -0
- package/plugins/litclaude/lib/start-work-lifecycle.mjs +403 -18
- package/plugins/litclaude/lib/workflow-stack.mjs +243 -0
- package/plugins/litclaude/lib/workflow-stage.mjs +127 -103
- package/plugins/litclaude/scripts/scaffold-plan.mjs +1 -1
- package/plugins/litclaude/skills/frontend-ui-ux/SKILL.md +11 -3
- package/plugins/litclaude/skills/frontend-ui-ux/kit/components.css +414 -0
- package/plugins/litclaude/skills/frontend-ui-ux/kit/fonts.json +22 -0
- package/plugins/litclaude/skills/frontend-ui-ux/kit/layouts/landing.html +164 -0
- package/plugins/litclaude/skills/frontend-ui-ux/kit/layouts/settings.html +114 -0
- package/plugins/litclaude/skills/frontend-ui-ux/kit/layouts/workspace.html +115 -0
- package/plugins/litclaude/skills/frontend-ui-ux/kit/styles/computational-brutalism.json +227 -0
- package/plugins/litclaude/skills/frontend-ui-ux/kit/styles/field-notes.json +205 -0
- package/plugins/litclaude/skills/frontend-ui-ux/kit/styles/graphite.json +200 -0
- package/plugins/litclaude/skills/frontend-ui-ux/kit/styles/meadow.json +199 -0
- package/plugins/litclaude/skills/frontend-ui-ux/kit/styles/neo-brutalism.json +222 -0
- package/plugins/litclaude/skills/frontend-ui-ux/kit/ui.js +226 -0
- package/plugins/litclaude/skills/frontend-ui-ux/references/brand-and-imagery.md +1 -1
- package/plugins/litclaude/skills/frontend-ui-ux/references/complete-contract.md +1 -0
- package/plugins/litclaude/skills/frontend-ui-ux/references/craft-floor.md +9 -4
- package/plugins/litclaude/skills/frontend-ui-ux/references/default-editorial-pixel.json +6 -5
- package/plugins/litclaude/skills/frontend-ui-ux/references/house-styles.md +234 -0
- package/plugins/litclaude/skills/frontend-ui-ux/references/motion-guide.md +3 -3
- package/plugins/litclaude/skills/frontend-ui-ux/references/slop-register.md +7 -7
- package/plugins/litclaude/skills/frontend-ui-ux/scripts/design-lock.mjs +400 -0
- package/plugins/litclaude/skills/frontend-ui-ux/scripts/interface-probe-lock.mjs +196 -0
- package/plugins/litclaude/skills/frontend-ui-ux/scripts/interface-probe-page.mjs +30 -9
- package/plugins/litclaude/skills/frontend-ui-ux/scripts/interface-probe-rules.mjs +19 -7
- package/plugins/litclaude/skills/frontend-ui-ux/scripts/interface-probe-static.mjs +12 -2
- package/plugins/litclaude/skills/frontend-ui-ux/scripts/interface-probe.mjs +53 -6
- package/plugins/litclaude/skills/frontend-ui-ux/scripts/pixel-art.mjs +60 -0
- package/plugins/litclaude/skills/lit-adhd/SKILL.md +151 -0
- package/plugins/litclaude/skills/lit-adhd/references/card-examples.md +69 -0
- package/plugins/litclaude/skills/lit-adhd/references/status-taxonomy.md +43 -0
- package/plugins/litclaude/skills/lit-adhd/scripts/rewind.mjs +11 -0
- package/plugins/litclaude/skills/lit-diagram-drawer/SKILL.md +5 -4
- package/plugins/litclaude/skills/lit-diagram-drawer/references/style-guide.md +20 -11
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-architecture.md +3 -3
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-dependency.md +1 -1
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-tree.md +3 -3
- package/plugins/litclaude/skills/lit-diagram-drawer/references/type-wardley.md +1 -1
- package/plugins/litclaude/skills/lit-diagram-drawer/references/verifier-guide.md +1 -1
- package/plugins/litclaude/skills/lit-diagram-drawer/scripts/visual-quality.mjs +3 -3
- package/plugins/litclaude/skills/lit-handoff/SKILL.md +1 -1
- package/plugins/litclaude/skills/lit-hijack/SKILL.md +551 -0
- package/plugins/litclaude/skills/lit-hijack/references/capture-and-provenance.md +124 -0
- package/plugins/litclaude/skills/lit-hijack/references/clean-room-build.md +133 -0
- package/plugins/litclaude/skills/lit-hijack/references/distil-and-licence.md +128 -0
- package/plugins/litclaude/skills/lit-hijack/references/gap-and-port-design.md +152 -0
- package/plugins/litclaude/skills/lit-hijack/references/parity-and-report.md +131 -0
- package/plugins/litclaude/skills/lit-hijack/scripts/hijack.mjs +854 -0
- package/plugins/litclaude/skills/lit-loop/SKILL.md +4 -3
- package/plugins/litclaude/skills/lit-plan/SKILL.md +16 -10
- package/plugins/litclaude/skills/lit-pptx/SKILL.md +29 -14
- package/plugins/litclaude/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Bold.ttf +0 -0
- package/plugins/litclaude/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Regular.ttf +0 -0
- package/plugins/litclaude/skills/lit-pptx/fonts/jetbrains-mono/OFL.txt +93 -0
- package/plugins/litclaude/skills/lit-pptx/fonts/provenance.json +32 -1
- package/plugins/litclaude/skills/lit-pptx/references/agents/architect.md +1 -1
- package/plugins/litclaude/skills/lit-pptx/references/anti-slop-checklist.md +32 -11
- package/plugins/litclaude/skills/lit-pptx/references/authoring-guide.md +2 -2
- package/plugins/litclaude/skills/lit-pptx/references/data-display-cookbook.md +1 -1
- package/plugins/litclaude/skills/lit-pptx/references/density-and-fill.md +3 -4
- package/plugins/litclaude/skills/lit-pptx/references/direction-step.md +19 -2
- package/plugins/litclaude/skills/lit-pptx/references/examples/13-engineering-review-computational-brutalism-ko.md +173 -0
- package/plugins/litclaude/skills/lit-pptx/references/examples/14-launch-pitch-neo-brutalism-ko.md +154 -0
- package/plugins/litclaude/skills/lit-pptx/references/examples/15-design-lecture-bauhaus-ko.md +139 -0
- package/plugins/litclaude/skills/lit-pptx/references/examples/16-community-programme-riso-ko.md +158 -0
- package/plugins/litclaude/skills/lit-pptx/references/examples/17-public-data-briefing-newsroom-ko.md +179 -0
- package/plugins/litclaude/skills/lit-pptx/references/layout-families.md +22 -26
- package/plugins/litclaude/skills/lit-pptx/references/title-treatments.md +30 -26
- package/plugins/litclaude/skills/lit-pptx/references/tonalities/atlas.md +4 -4
- package/plugins/litclaude/skills/lit-pptx/references/tonalities/bauhaus.md +140 -0
- package/plugins/litclaude/skills/lit-pptx/references/tonalities/chalk.md +3 -3
- package/plugins/litclaude/skills/lit-pptx/references/tonalities/computational-brutalism.md +150 -0
- package/plugins/litclaude/skills/lit-pptx/references/tonalities/gazette.md +1 -1
- package/plugins/litclaude/skills/lit-pptx/references/tonalities/ledger.md +1 -1
- package/plugins/litclaude/skills/lit-pptx/references/tonalities/neo-brutalism.md +161 -0
- package/plugins/litclaude/skills/lit-pptx/references/tonalities/newsroom.md +144 -0
- package/plugins/litclaude/skills/lit-pptx/references/tonalities/night.md +1 -1
- package/plugins/litclaude/skills/lit-pptx/references/tonalities/paper.md +3 -3
- package/plugins/litclaude/skills/lit-pptx/references/tonalities/riso.md +137 -0
- package/plugins/litclaude/skills/lit-pptx/references/tonalities/signal.md +2 -2
- package/plugins/litclaude/skills/lit-pptx/references/tonalities/studio.md +6 -7
- package/plugins/litclaude/skills/lit-pptx/scripts/compile-deck.js +1 -1
- package/plugins/litclaude/skills/lit-pptx/scripts/craft_extras.py +135 -91
- package/plugins/litclaude/skills/lit-pptx/scripts/embed_fonts.py +13 -1
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/grid-resolver.js +101 -110
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/layout-resolver.js +9 -15
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/render-pack.js +370 -563
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/slide-grid.js +104 -0
- package/plugins/litclaude/skills/lit-pptx/scripts/lib/template-registry.js +57 -6
- package/plugins/litclaude/skills/lit-pptx/scripts/qa_deck.py +5 -5
- package/plugins/litclaude/skills/lit-pptx/templates/tonalities/atlas/pack.yaml +1 -1
- package/plugins/litclaude/skills/lit-pptx/templates/tonalities/bauhaus/pack.yaml +98 -0
- package/plugins/litclaude/skills/lit-pptx/templates/tonalities/chalk/pack.yaml +1 -1
- package/plugins/litclaude/skills/lit-pptx/templates/tonalities/computational-brutalism/pack.yaml +99 -0
- package/plugins/litclaude/skills/lit-pptx/templates/tonalities/gazette/pack.yaml +1 -1
- package/plugins/litclaude/skills/lit-pptx/templates/tonalities/ledger/pack.yaml +1 -1
- package/plugins/litclaude/skills/lit-pptx/templates/tonalities/neo-brutalism/pack.yaml +107 -0
- package/plugins/litclaude/skills/lit-pptx/templates/tonalities/newsroom/pack.yaml +99 -0
- package/plugins/litclaude/skills/lit-pptx/templates/tonalities/night/pack.yaml +1 -1
- package/plugins/litclaude/skills/lit-pptx/templates/tonalities/paper/pack.yaml +1 -1
- package/plugins/litclaude/skills/lit-pptx/templates/tonalities/riso/pack.yaml +99 -0
- package/plugins/litclaude/skills/lit-pptx/templates/tonalities/signal/pack.yaml +2 -2
- package/plugins/litclaude/skills/lit-pptx/templates/tonalities/studio/pack.yaml +1 -1
- package/plugins/litclaude/skills/lit-recap/SKILL.md +3 -0
- package/plugins/litclaude/skills/lit-schematic/SKILL.md +112 -0
- package/plugins/litclaude/skills/lit-schematic/examples/iso-heat-exchanger/build.mjs +38 -0
- package/plugins/litclaude/skills/lit-schematic/examples/iso-heat-exchanger/scene.mjs +133 -0
- package/plugins/litclaude/skills/lit-schematic/examples/journal-adsorption-rig/build.mjs +87 -0
- package/plugins/litclaude/skills/lit-schematic/examples/pid-dosing-skid/build.mjs +85 -0
- package/plugins/litclaude/skills/lit-schematic/references/cutaway-outputs.md +70 -0
- package/plugins/litclaude/skills/lit-schematic/references/isometric-craft.md +101 -0
- package/plugins/litclaude/skills/lit-schematic/references/journal-figures.md +72 -0
- package/plugins/litclaude/skills/lit-schematic/references/kit-api.md +134 -0
- package/plugins/litclaude/skills/lit-schematic/references/pfd-and-layout.md +53 -0
- package/plugins/litclaude/skills/lit-schematic/references/pid-drafting.md +103 -0
- package/plugins/litclaude/skills/lit-schematic/references/pid-symbols.md +163 -0
- package/plugins/litclaude/skills/lit-schematic/references/verification.md +100 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/doctor.mjs +57 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/lib/figure.mjs +81 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/lib/fonts.mjs +27 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/lib/geom.mjs +113 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/lib/interactive.mjs +292 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/lib/isa.mjs +115 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/lib/iso.mjs +719 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/lib/legend-sheet.mjs +162 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/lib/pid.mjs +937 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/lib/png.mjs +132 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/lib/qa-core.mjs +658 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/lib/route.mjs +218 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/lib/sheet.mjs +890 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/lib/svg.mjs +82 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/lib/theme.mjs +115 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/motion.mjs +129 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/qa.mjs +92 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/render.mjs +233 -0
- package/plugins/litclaude/skills/lit-schematic/scripts/scaffold.mjs +60 -0
- package/plugins/litclaude/skills/lit-scientific-visualization/SKILL.md +14 -4
- package/plugins/litclaude/skills/lit-typographic-motion/SKILL.md +50 -45
- package/plugins/litclaude/skills/lit-typographic-motion/engine/THIRD_PARTY_NOTICES +11 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/blender/runner.py +218 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/core/presets.mjs +1 -1
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/analysis.mjs +65 -1
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/assets.mjs +208 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/blender.mjs +143 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/board.mjs +136 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/brief.mjs +7 -1
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/chrome.mjs +6 -4
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/cover-assets.mjs +5 -3
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/cover-capture.mjs +4 -4
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/cover-treatment.mjs +37 -4
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/cover.mjs +17 -5
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/done.mjs +42 -3
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/frame-worker.mjs +7 -5
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/gallery.mjs +121 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/house.mjs +44 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/look.mjs +33 -19
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/pipeline.mjs +18 -7
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/scaffold.mjs +210 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/score.mjs +639 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/sound-cli.mjs +21 -4
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/sound.mjs +126 -27
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/stage-capture.mjs +7 -6
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/stage-gate.mjs +59 -5
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/stage-qa.mjs +141 -9
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/stage-serve.mjs +28 -5
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/stage.mjs +82 -14
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/styles.mjs +213 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/node/treatment.mjs +311 -10
- package/plugins/litclaude/skills/lit-typographic-motion/engine/stage/cover-init.js +14 -2
- package/plugins/litclaude/skills/lit-typographic-motion/engine/stage/init.js +11 -1
- package/plugins/litclaude/skills/lit-typographic-motion/engine/stage/qa.js +6 -1
- package/plugins/litclaude/skills/lit-typographic-motion/engine/stage/stage-kit.js +83 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/vendor/three/LICENSE +21 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/vendor/three/addons/environments/RoomEnvironment.js +144 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/vendor/three/addons/geometries/RoundedBoxGeometry.js +155 -0
- package/plugins/litclaude/skills/lit-typographic-motion/engine/vendor/three/three.module.js +54571 -0
- package/plugins/litclaude/skills/lit-typographic-motion/recipes/hero-3d/expected.json +69 -0
- package/plugins/litclaude/skills/lit-typographic-motion/recipes/hero-3d/index.html +139 -0
- package/plugins/litclaude/skills/lit-typographic-motion/recipes/orbit-loop/expected.json +2 -0
- package/plugins/litclaude/skills/lit-typographic-motion/recipes/painted-light/expected.json +2 -0
- package/plugins/litclaude/skills/lit-typographic-motion/recipes/weight-tide/expected.json +2 -0
- package/plugins/litclaude/skills/lit-typographic-motion/references/cover.md +67 -15
- package/plugins/litclaude/skills/lit-typographic-motion/references/craft-loop.md +3 -2
- package/plugins/litclaude/skills/lit-typographic-motion/references/depth.md +122 -0
- package/plugins/litclaude/skills/lit-typographic-motion/references/look.md +28 -13
- package/plugins/litclaude/skills/lit-typographic-motion/references/runtime.md +4 -3
- package/plugins/litclaude/skills/lit-typographic-motion/references/sound.md +92 -23
- package/plugins/litclaude/skills/lit-typographic-motion/references/stage.md +43 -22
- package/plugins/litclaude/skills/lit-typographic-motion/references/studio.md +245 -0
- package/plugins/litclaude/skills/lit-typographic-motion/references/style-bibles.md +30 -6
- package/plugins/litclaude/skills/lit-typographic-motion/references/treatment.md +108 -14
- package/plugins/litclaude/skills/lit-typographic-motion/scripts/motion-doctor.mjs +16 -3
- package/plugins/litclaude/skills/lit-typographic-motion/scripts/motion.mjs +47 -7
- package/plugins/litclaude/skills/lit-typographic-motion/styles/paper.json +41 -0
- package/plugins/litclaude/skills/lit-typographic-motion/styles/swiss-signal.json +41 -0
- package/plugins/litclaude/skills/lit-typographic-motion/styles/terminalcore.json +42 -0
- package/plugins/litclaude/skills/lit-typographic-motion/styles/tidal.json +41 -0
- package/plugins/litclaude/skills/litgoal/SKILL.md +3 -2
- package/plugins/litclaude/skills/litresearch/SKILL.md +5 -0
- package/plugins/litclaude/skills/readme-studio/templates/hyperframes-cover/package-lock.json +3 -3
- package/plugins/litclaude/skills/readme-studio/templates/remotion-cover/package-lock.json +3 -3
- package/plugins/litclaude/skills/start-work/SKILL.md +24 -11
- package/scripts/qa-cover-recipes.mjs +3 -3
|
@@ -3,15 +3,17 @@ import { basename, dirname, join } from "node:path";
|
|
|
3
3
|
|
|
4
4
|
import { ignitionStatePath } from "./hud-ignition.mjs";
|
|
5
5
|
|
|
6
|
-
// Which
|
|
7
|
-
// activation the first time a discipline starts in a session and a short note
|
|
8
|
-
//
|
|
6
|
+
// Which disciplines a session's `lit` prompts already ignited, newest last. The prompt hook sends the
|
|
7
|
+
// full activation the first time a discipline starts in a session and a short note whenever it is
|
|
8
|
+
// asked for again, even after another discipline ran in between (a lit-loop resumed after a
|
|
9
|
+
// brainstorm), so the record is what the hook, not the model, says is loaded.
|
|
9
10
|
// It sits beside the per-session ignition record in the temp directory: the session id is the
|
|
10
11
|
// host's, nothing is written into the repository, and a missing or unreadable record only means
|
|
11
12
|
// the next `lit` gets the full activation again.
|
|
12
13
|
|
|
13
14
|
const DISCIPLINE_PATTERN = /^[a-z][a-z0-9-]{0,40}$/u;
|
|
14
15
|
const MAX_RECORD_BYTES = 4096;
|
|
16
|
+
const MAX_DISCIPLINES = 24;
|
|
15
17
|
|
|
16
18
|
// LITCLAUDE_ACTIVATION_STATE_ROOT moves only this record, so a test run can keep its records apart
|
|
17
19
|
// from the HUD's.
|
|
@@ -23,26 +25,38 @@ const recordPath = (sessionId, env) => {
|
|
|
23
25
|
|
|
24
26
|
const hasSession = (sessionId) => typeof sessionId === "string" && sessionId.trim().length > 0;
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
// The session's activated disciplines as `[name, at]` pairs, oldest first. A record from before the
|
|
29
|
+
// set existed (`{ discipline, at }`) reads as a set of one.
|
|
30
|
+
const readDisciplines = (sessionId, env) => {
|
|
31
|
+
if (!hasSession(sessionId)) return [];
|
|
28
32
|
try {
|
|
29
33
|
const path = recordPath(sessionId, env);
|
|
30
|
-
if (statSync(path).size > MAX_RECORD_BYTES) return
|
|
34
|
+
if (statSync(path).size > MAX_RECORD_BYTES) return [];
|
|
31
35
|
const record = JSON.parse(readFileSync(path, "utf8"));
|
|
32
|
-
if (!record || typeof record !== "object" || record.sessionId !== sessionId) return
|
|
33
|
-
|
|
36
|
+
if (!record || typeof record !== "object" || record.sessionId !== sessionId) return [];
|
|
37
|
+
const entries = record.disciplines && typeof record.disciplines === "object" ? Object.entries(record.disciplines) : [[record.discipline, record.at]];
|
|
38
|
+
return entries.filter(([name, at]) => typeof name === "string" && DISCIPLINE_PATTERN.test(name) && typeof at === "string")
|
|
39
|
+
.sort((a, b) => Date.parse(a[1]) - Date.parse(b[1]));
|
|
34
40
|
} catch {
|
|
35
|
-
return
|
|
41
|
+
return [];
|
|
36
42
|
}
|
|
37
43
|
};
|
|
38
44
|
|
|
45
|
+
/** The discipline the hook activated most recently in this session. */
|
|
46
|
+
export const readActivation = (sessionId, env = process.env) => readDisciplines(sessionId, env).at(-1)?.[0] ?? null;
|
|
47
|
+
|
|
48
|
+
/** Whether the hook already sent this discipline's full activation in this session. */
|
|
49
|
+
export const hasActivated = (sessionId, discipline, env = process.env) => readDisciplines(sessionId, env).some(([name]) => name === discipline);
|
|
50
|
+
|
|
39
51
|
export const recordActivation = (sessionId, discipline, env = process.env, now = () => new Date()) => {
|
|
40
52
|
if (!hasSession(sessionId) || !DISCIPLINE_PATTERN.test(discipline ?? "")) return false;
|
|
41
53
|
try {
|
|
42
54
|
const path = recordPath(sessionId, env);
|
|
43
55
|
mkdirSync(dirname(path), { recursive: true });
|
|
56
|
+
const kept = readDisciplines(sessionId, env).filter(([name]) => name !== discipline).slice(-(MAX_DISCIPLINES - 1));
|
|
57
|
+
const disciplines = Object.fromEntries([...kept, [discipline, now().toISOString()]]);
|
|
44
58
|
const staging = `${path}.${process.pid}.tmp`;
|
|
45
|
-
writeFileSync(staging, `${JSON.stringify({ sessionId,
|
|
59
|
+
writeFileSync(staging, `${JSON.stringify({ sessionId, disciplines })}\n`);
|
|
46
60
|
renameSync(staging, path);
|
|
47
61
|
return true;
|
|
48
62
|
} catch {
|
|
@@ -32,8 +32,9 @@
|
|
|
32
32
|
// and move by colour alone (a colour change on `─` or `━` repaints), and the live step's spinner
|
|
33
33
|
// and clock are ASCII.
|
|
34
34
|
|
|
35
|
+
import { gauge } from "../rewind/gauge.mjs";
|
|
35
36
|
import { textWidth, truncateToWidth } from "./layout.mjs";
|
|
36
|
-
import { barCells, gradientAt, lerpColor } from "./motion.mjs";
|
|
37
|
+
import { barCells, gradientAt, lerpColor, lookOf, rainbowAt } from "./motion.mjs";
|
|
37
38
|
import { glyphSet } from "./settings.mjs";
|
|
38
39
|
import { formatDuration } from "./view.mjs";
|
|
39
40
|
|
|
@@ -167,31 +168,37 @@ const cometColor = (base, k) => {
|
|
|
167
168
|
|
|
168
169
|
// The rule of an edge, `count` cells from column `start`. With a comet ({ x, dir }: its head's
|
|
169
170
|
// column and travel direction) the cells behind the head light up, brightest at the head, and the
|
|
170
|
-
// rule becomes one span per cell; without one it stays a single span.
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
// rule becomes one span per cell; without one it stays a single span. `paint` (column to colour)
|
|
172
|
+
// gives every cell its own colour; the rewind sweep's comet (`arrow`) draws its head as ASCII `<<`.
|
|
173
|
+
const ruleSpans = (count, color, start, comet, paint = null) => {
|
|
174
|
+
if (!comet && !paint) return [span("─".repeat(count), { fg: color })];
|
|
173
175
|
return Array.from({ length: count }, (_, i) => {
|
|
176
|
+
const base = paint ? paint(start + i) : color;
|
|
177
|
+
if (!comet) return span("─", { fg: base });
|
|
174
178
|
const behind = comet.dir * (comet.x - (start + i));
|
|
175
179
|
const k = behind >= 0 && behind <= COMET_TAIL ? 1 - behind / COMET_TAIL : 0;
|
|
176
|
-
return span("─", { fg: k > 0 ? cometColor(
|
|
180
|
+
return span(comet.arrow && behind >= 0 && behind < 2 ? "<" : "─", { fg: k > 0 ? cometColor(base, k) : base });
|
|
177
181
|
});
|
|
178
182
|
};
|
|
179
183
|
|
|
180
184
|
// An edge of the card: `open` and `close` are its corners, `left` its title or figures and
|
|
181
185
|
// `right` the phase indicator, with the rule filling whatever room is left.
|
|
182
|
-
const edgeRow = (open, left, right, close, width, color, comet = null) => {
|
|
183
|
-
const
|
|
186
|
+
const edgeRow = (open, left, right, close, width, color, comet = null, paint = null) => {
|
|
187
|
+
const piece = (text, at) => (paint ? [...text].map((ch, i) => span(ch, { fg: paint(at + i) })) : [span(text, { fg: color })]);
|
|
188
|
+
const tail = right.length ? [span(" "), ...right, ...piece(` ${close}`, width - textWidth(close) - 1)] : piece(close, width - textWidth(close));
|
|
184
189
|
const fill = Math.max(1, width - textWidth(open) - rowWidth(left) - 1 - rowWidth(tail));
|
|
185
190
|
const start = textWidth(open) + rowWidth(left) + 1;
|
|
186
|
-
return clipRow([
|
|
191
|
+
return clipRow([...piece(open, 0), ...left, span(" "), ...ruleSpans(fill, color, start, comet, paint), ...tail], width);
|
|
187
192
|
};
|
|
188
193
|
|
|
189
194
|
// Where the ambient comet is on this card: along the top rule left to right for the first half of
|
|
190
|
-
// its loop, then back along the bottom rule, starting and ending just off the card.
|
|
191
|
-
|
|
195
|
+
// its loop, then back along the bottom rule, starting and ending just off the card. The rewind look
|
|
196
|
+
// spends the whole loop sweeping the bottom rule right to left.
|
|
197
|
+
const cometOn = (sample, edge, width, look = null) => {
|
|
192
198
|
const u = sample.ambient?.comet;
|
|
193
199
|
if (u === null || u === undefined) return null;
|
|
194
200
|
const span = width + 2 * COMET_TAIL;
|
|
201
|
+
if (look === "rewind") return edge === "bottom" ? { x: width + COMET_TAIL - u * span, dir: -1, arrow: true } : null;
|
|
195
202
|
if (edge === "top") return u < 0.5 ? { x: u * 2 * span - COMET_TAIL, dir: 1 } : null;
|
|
196
203
|
return u >= 0.5 ? { x: width + COMET_TAIL - (u - 0.5) * 2 * span, dir: -1 } : null;
|
|
197
204
|
};
|
|
@@ -209,6 +216,7 @@ const indicatorSpans = (model, sample, glyphs, accent) => {
|
|
|
209
216
|
const flow = model.workflow;
|
|
210
217
|
if (flow && flow.current >= 0) {
|
|
211
218
|
const warn = model.ctxWarning && sample.warn > 0.02;
|
|
219
|
+
if (flow.paused) return [span(`${flow.stages[flow.current].id.toUpperCase()} ||`, { fg: PALETTE.dim, bold: true })];
|
|
212
220
|
return [span(`${flow.stages[flow.current].id.toUpperCase()} ${warn ? glyphs.warn : glyphs.now}`, { fg: warn ? lerpColor(accent, PALETTE.amber, sample.warn) : accent, bold: true })];
|
|
213
221
|
}
|
|
214
222
|
if (flow && model.lanes.count === 0) return [span(`DONE ${glyphs.done}`, { fg: PALETTE.green, bold: true })];
|
|
@@ -220,7 +228,7 @@ const indicatorSpans = (model, sample, glyphs, accent) => {
|
|
|
220
228
|
|
|
221
229
|
// ╭─ [🔥 LIT] · <discipline> ──── <PHASE ●> ─╮. On a narrow card the phase indicator goes first,
|
|
222
230
|
// then the discipline shortens, then it goes too.
|
|
223
|
-
const topEdge = (model, sample, { width, glyphs, accent, edge }) => {
|
|
231
|
+
const topEdge = (model, sample, { width, glyphs, accent, edge, look, paint }) => {
|
|
224
232
|
const brand = brandSpans(sample, glyphs);
|
|
225
233
|
const right = indicatorSpans(model, sample, glyphs, accent);
|
|
226
234
|
const name = model.title ?? "ready";
|
|
@@ -228,11 +236,11 @@ const topEdge = (model, sample, { width, glyphs, accent, edge }) => {
|
|
|
228
236
|
const title = (text) => (text ? [span(" · ", { fg: PALETTE.dim }), span(text, nameStyle)] : []);
|
|
229
237
|
const fixed = textWidth("╭─ ") + rowWidth(brand) + 1 + 1;
|
|
230
238
|
const withRight = fixed + rowWidth(title(name)) + 1 + rowWidth(right) + textWidth(" ─╮");
|
|
231
|
-
const comet = cometOn(sample, "top", width);
|
|
232
|
-
if (withRight <= width) return edgeRow("╭─ ", [...brand, ...title(name)], right, "─╮", width, edge, comet);
|
|
239
|
+
const comet = cometOn(sample, "top", width, look);
|
|
240
|
+
if (withRight <= width) return edgeRow("╭─ ", [...brand, ...title(name)], right, "─╮", width, edge, comet, paint[0]);
|
|
233
241
|
const room = width - fixed - textWidth("─╮") - textWidth(" · ");
|
|
234
242
|
const shown = room >= 4 ? truncateToWidth(name, room) : "";
|
|
235
|
-
return edgeRow("╭─ ", [...brand, ...title(shown)], [], "─╮", width, edge, comet);
|
|
243
|
+
return edgeRow("╭─ ", [...brand, ...title(shown)], [], "─╮", width, edge, comet, paint[0]);
|
|
236
244
|
};
|
|
237
245
|
|
|
238
246
|
const barSpans = (fraction, sample, cells) => barCells(fraction, cells, sample.fillGlow ?? 0)
|
|
@@ -281,7 +289,7 @@ const progressSegment = (model, sample, glyphs, cells) => {
|
|
|
281
289
|
// ● PLAN ━━ [WORK] ━━ ○ REVIEW: the active phase is a pill on the accent (amber while the context
|
|
282
290
|
// warning is up), done phases a dim-accent dot and the rest a dim ring. Each form of a label is
|
|
283
291
|
// as wide as the others, so a phase changing state never moves the row.
|
|
284
|
-
const phaseTrack = (model, sample, { glyphs, accent, rail, short }) => {
|
|
292
|
+
const phaseTrack = (model, sample, { glyphs, accent, rail, short, rainbow }) => {
|
|
285
293
|
const ink = inkOf(accent);
|
|
286
294
|
const out = [];
|
|
287
295
|
PHASES.forEach((id, index) => {
|
|
@@ -289,7 +297,7 @@ const phaseTrack = (model, sample, { glyphs, accent, rail, short }) => {
|
|
|
289
297
|
const state = sample.phases[id].to;
|
|
290
298
|
const shown = revealText(state === "now" ? label : `${state === "done" ? "●" : "○"} ${label}`, sample.pills[index + 1]);
|
|
291
299
|
if (shown === null) return;
|
|
292
|
-
if (out.length) out.push(span(` ${glyphs.rail.repeat(rail)} `, { fg: sample.phases[PHASES[index - 1]].to === "done" ? ink.done : PILL.rail }));
|
|
300
|
+
if (out.length) out.push(span(` ${glyphs.rail.repeat(rail)} `, { fg: rainbow ? rainbow(index / PHASES.length) : sample.phases[PHASES[index - 1]].to === "done" ? ink.done : PILL.rail }));
|
|
293
301
|
if (state === "now") {
|
|
294
302
|
const fill = model.idle ? lerpColor(phaseColor(id, sample, ink), PILL.muted, 0.5) : phaseColor(id, sample, ink);
|
|
295
303
|
const sweep = model.idle ? null : sample.ambient?.sweep ?? null;
|
|
@@ -301,9 +309,9 @@ const phaseTrack = (model, sample, { glyphs, accent, rail, short }) => {
|
|
|
301
309
|
return out;
|
|
302
310
|
};
|
|
303
311
|
|
|
304
|
-
const phaseRow = (model, sample, { inner, glyphs, accent }) => {
|
|
312
|
+
const phaseRow = (model, sample, { inner, glyphs, accent, rainbow }) => {
|
|
305
313
|
const variants = [{ rail: 2, short: false }, { rail: 1, short: false }, { rail: 1, short: true }];
|
|
306
|
-
const tracks = variants.map((variant) => phaseTrack(model, sample, { glyphs, accent, ...variant }));
|
|
314
|
+
const tracks = variants.map((variant) => phaseTrack(model, sample, { glyphs, accent, rainbow, ...variant }));
|
|
307
315
|
const right = [];
|
|
308
316
|
if (sample.rest > 0) {
|
|
309
317
|
const warning = model.ctxWarning && sample.warn > 0.02
|
|
@@ -333,9 +341,11 @@ const shortLabel = (label) => label.replace(/^[A-Za-z]+/u, (word) => word.slice(
|
|
|
333
341
|
|
|
334
342
|
// The rail from stage `index - 1` to stage `index`, `cells` wide. Behind the current stage it is
|
|
335
343
|
// `━` graded along the map; leaving it, `━` filled by the stage's count with a bright head while
|
|
336
|
-
// LitClaude works; ahead, dim `─`. With no room for rails, one space.
|
|
337
|
-
|
|
344
|
+
// LitClaude works; ahead, dim `─`. With no room for rails, one space. The rewind look grades the
|
|
345
|
+
// `━` cells by its `rainbow` instead.
|
|
346
|
+
const railSpans = (model, sample, index, cells, accent, rainbow = null) => {
|
|
338
347
|
if (cells === 0) return [span(" ")];
|
|
348
|
+
const grade = rainbow ?? ((position) => mapColor(accent, position));
|
|
339
349
|
const { stages } = model.workflow;
|
|
340
350
|
const last = Math.max(1, stages.length - 1);
|
|
341
351
|
const at = (cell) => (index - 1 + (cell + 0.5) / cells) / last;
|
|
@@ -343,13 +353,13 @@ const railSpans = (model, sample, index, cells, accent) => {
|
|
|
343
353
|
const from = stages[index - 1].state;
|
|
344
354
|
let body;
|
|
345
355
|
if (into === "done" || into === "now") {
|
|
346
|
-
body = Array.from({ length: cells }, (_, cell) => span("━", { fg:
|
|
356
|
+
body = Array.from({ length: cells }, (_, cell) => span("━", { fg: grade(at(cell)) }));
|
|
347
357
|
} else if (from === "now") {
|
|
348
358
|
const filled = model.workflow.count ? sample.fill * cells : 0;
|
|
349
|
-
const flow = model.idle ? null : sample.ambient?.flow ?? null;
|
|
359
|
+
const flow = model.idle || model.workflow.paused ? null : sample.ambient?.flow ?? null;
|
|
350
360
|
const head = flow === null ? -1 : Math.floor(flow * cells);
|
|
351
361
|
body = Array.from({ length: cells }, (_, cell) => {
|
|
352
|
-
const base = cell < filled ?
|
|
362
|
+
const base = cell < filled ? grade(at(cell)) : PILL.rail;
|
|
353
363
|
return span("━", { fg: cell === head ? lerpColor(base, "#ffffff", 0.75) : base });
|
|
354
364
|
});
|
|
355
365
|
} else {
|
|
@@ -359,7 +369,7 @@ const railSpans = (model, sample, index, cells, accent) => {
|
|
|
359
369
|
};
|
|
360
370
|
|
|
361
371
|
// interview ✓ ━━ plan ✓ ━━ [work 3/7] ━━ review · ── done ·
|
|
362
|
-
const mapTrack = (model, sample, { glyphs, accent, rail, short = false, window = false }) => {
|
|
372
|
+
const mapTrack = (model, sample, { glyphs, accent, rail, short = false, window = false, rainbow = null }) => {
|
|
363
373
|
const { stages, current } = model.workflow;
|
|
364
374
|
const last = Math.max(1, stages.length - 1);
|
|
365
375
|
const focus = current < 0 ? stages.length - 1 : current;
|
|
@@ -372,8 +382,11 @@ const mapTrack = (model, sample, { glyphs, accent, rail, short = false, window =
|
|
|
372
382
|
const text = stage.state === "now" ? label : `${label} ${stage.state === "done" ? glyphs.done : "·"}`;
|
|
373
383
|
const revealed = revealText(text, sample.pills[Math.min(3, 1 + Math.floor(index / 2))]);
|
|
374
384
|
if (revealed === null) return;
|
|
375
|
-
if (out.length && !(window && out.length === 1 && shown[0] > 0)) out.push(...railSpans(model, sample, index, rail, accent));
|
|
376
|
-
if (stage.state === "now") {
|
|
385
|
+
if (out.length && !(window && out.length === 1 && shown[0] > 0)) out.push(...railSpans(model, sample, index, rail, accent, rainbow));
|
|
386
|
+
if (stage.state === "now" && model.workflow.paused) {
|
|
387
|
+
// A paused stage holds still: the muted pill, no breath and no light along it.
|
|
388
|
+
out.push(...pill([span(revealed.slice(0, label.length).padEnd(label.length), { fg: PILL.mutedText, bg: PILL.muted, bold: true })], PILL.muted, glyphs));
|
|
389
|
+
} else if (stage.state === "now") {
|
|
377
390
|
let fill = model.idle ? lerpColor(accent, PILL.muted, 0.5) : accent;
|
|
378
391
|
if (model.ctxWarning) fill = lerpColor(fill, PALETTE.amber, sample.warn);
|
|
379
392
|
if (sample.ambient && !model.idle) fill = lerpColor(fill, "#ffffff", 0.2 * sample.ambient.breath);
|
|
@@ -396,8 +409,8 @@ const MAP_VARIANTS = Object.freeze([
|
|
|
396
409
|
]);
|
|
397
410
|
|
|
398
411
|
// The map, then the context warning, the lanes and the autoloop budget while there is room.
|
|
399
|
-
const mapRow = (model, sample, { inner, glyphs, accent }) => {
|
|
400
|
-
const tracks = MAP_VARIANTS.map((variant) => mapTrack(model, sample, { glyphs, accent, ...variant }));
|
|
412
|
+
const mapRow = (model, sample, { inner, glyphs, accent, rainbow }) => {
|
|
413
|
+
const tracks = MAP_VARIANTS.map((variant) => mapTrack(model, sample, { glyphs, accent, rainbow, ...variant }));
|
|
401
414
|
const track = tracks.find((candidate) => rowWidth(candidate) <= inner) ?? tracks.at(-1);
|
|
402
415
|
const right = [];
|
|
403
416
|
if (sample.rest > 0) {
|
|
@@ -490,6 +503,88 @@ const detailRow = (model, sample, { inner, glyphs, accent }) => {
|
|
|
490
503
|
return fitRow([...body, span(" ".repeat(Math.max(1, inner - rowWidth(body) - rowWidth(right)))), ...right], inner);
|
|
491
504
|
};
|
|
492
505
|
|
|
506
|
+
// A thread's state: its glyph, its colour and the word written beside it. The word is ASCII, so a
|
|
507
|
+
// state change always repaints the glyph with it. Paused is an ASCII bar: `‖` is ambiguous-width
|
|
508
|
+
// and some fonts draw it two cells wide, which pushes the card's right edge out.
|
|
509
|
+
const THREAD_STATE = Object.freeze({
|
|
510
|
+
running: (glyphs) => [glyphs.lane, PALETTE.green],
|
|
511
|
+
paused: () => ["|", PALETTE.dim],
|
|
512
|
+
blocked: () => ["!", PALETTE.amber],
|
|
513
|
+
idle: () => ["-", PALETTE.dim],
|
|
514
|
+
done: (glyphs) => [glyphs.done, lerpColor(PALETTE.green, PALETTE.dim, 0.4)],
|
|
515
|
+
});
|
|
516
|
+
// A background task's glyph says its kind (ASCII, so it repaints with the row): a shell or a monitor.
|
|
517
|
+
const TASK_GLYPH = Object.freeze({ shell: "$", monitor: "~" });
|
|
518
|
+
const plural = (count, word) => `${count} ${word}${count === 1 ? "" : "s"}`;
|
|
519
|
+
const parallelCount = ({ laneCount = 0, taskCount = 0 }) => laneCount + taskCount;
|
|
520
|
+
/** `3 lanes in parallel`, `2 lanes · 1 task in parallel`, `2 tasks in parallel`. */
|
|
521
|
+
export const forkLabel = ({ laneCount = 0, taskCount = 0 }) => `${[laneCount ? plural(laneCount, "lane") : null, taskCount ? plural(taskCount, "task") : null].filter(Boolean).join(" · ")} in parallel`;
|
|
522
|
+
// The last child of a branch draws `└─` and the others `├─`. Those are not ASCII, so the name beside
|
|
523
|
+
// them takes a slightly different white: the row repaints when a branch's last child changes.
|
|
524
|
+
const THREAD_NAME = Object.freeze({ mid: PALETTE.white, last: "#d8e0e8" });
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* The thread rows (view.mjs threadsOf), `model.threads.reserve` of them, blank rows filling the
|
|
528
|
+
* rest. The stack goes parent first, each child under the one before it; lanes hang under the top
|
|
529
|
+
* frame, with a fork line over them when two or more run in parallel; other sessions come last.
|
|
530
|
+
*
|
|
531
|
+
* | lit-plan plan [▉▉░░░] 2/5 paused
|
|
532
|
+
* └─ ● lit-loop RED [▉░░░] 1/4 running
|
|
533
|
+
* ┬ 2 lanes · 1 task in parallel
|
|
534
|
+
* ├─ ● executor [▉▉░] 2/3 running
|
|
535
|
+
* ├─ ● reviewer [???] 7/? running
|
|
536
|
+
* └─ $ dev server shell [???] ?/? running
|
|
537
|
+
*/
|
|
538
|
+
const threadRows = (model, { inner, glyphs }) => {
|
|
539
|
+
const { chain, lanes, others, more, reserve } = model.threads;
|
|
540
|
+
const lines = [];
|
|
541
|
+
chain.forEach((thread, index) => lines.push({ thread, lead: index === 0 ? "" : `${" ".repeat(index - 1)}└─ `, last: true }));
|
|
542
|
+
// Lanes and background tasks are children of the top frame, so they hang at its indent.
|
|
543
|
+
const under = " ".repeat(Math.max(0, chain.length - 1));
|
|
544
|
+
if (parallelCount(model.threads) >= 2) {
|
|
545
|
+
lines.push({ fork: `${under}┬ ${forkLabel(model.threads)}` });
|
|
546
|
+
lanes.forEach((thread, index) => {
|
|
547
|
+
const last = index === lanes.length - 1;
|
|
548
|
+
lines.push({ thread, lead: `${under}${last ? "└─" : "├─"} `, last });
|
|
549
|
+
});
|
|
550
|
+
} else {
|
|
551
|
+
lanes.forEach((thread) => lines.push({ thread, lead: chain.length ? `${under}└─ ` : "", last: true }));
|
|
552
|
+
}
|
|
553
|
+
others.forEach((thread) => lines.push({ thread, lead: "", last: true }));
|
|
554
|
+
const rows = lines.map((line) => line.thread ?? null).filter(Boolean);
|
|
555
|
+
// A wide card spends its room on names, so lanes that share a prefix stay apart.
|
|
556
|
+
const nameWidth = Math.min(inner >= 90 ? 28 : 18, Math.max(...rows.map(({ name }) => textWidth(name))));
|
|
557
|
+
const stageWidth = Math.min(10, Math.max(0, ...rows.map(({ stage }) => (stage ? textWidth(stage) : 0))));
|
|
558
|
+
const lastIndex = lines.length - 1;
|
|
559
|
+
const out = lines.map((line, index) => {
|
|
560
|
+
const tail = index === lastIndex && more > 0 ? [span(`+${more} more`, { fg: PALETTE.dim })] : [];
|
|
561
|
+
let body;
|
|
562
|
+
if (line.fork) {
|
|
563
|
+
body = [span(line.fork, { fg: PALETTE.dim })];
|
|
564
|
+
} else {
|
|
565
|
+
const { thread } = line;
|
|
566
|
+
const [stateGlyph, color] = THREAD_STATE[thread.state](glyphs);
|
|
567
|
+
const glyph = thread.task ? TASK_GLYPH[thread.task] ?? "$" : stateGlyph;
|
|
568
|
+
const name = truncateToWidth(thread.name, nameWidth);
|
|
569
|
+
body = [
|
|
570
|
+
span(line.lead, { fg: PALETTE.dim }),
|
|
571
|
+
span(`${glyph} `, { fg: color }),
|
|
572
|
+
span(name + " ".repeat(Math.max(0, nameWidth - textWidth(name))), { fg: line.last ? THREAD_NAME.last : THREAD_NAME.mid, bold: thread.active }),
|
|
573
|
+
...(stageWidth ? [span(` ${(thread.stage ?? "").slice(0, stageWidth).padEnd(stageWidth)}`, { fg: PALETTE.dim })] : []),
|
|
574
|
+
span(` ${gauge(thread.done, thread.total)}`, { fg: PALETTE.white }),
|
|
575
|
+
span(` ${thread.state}`, { fg: color }),
|
|
576
|
+
...(thread.session ? [span(` · other session ${thread.session}`, { fg: PALETTE.dim })] : []),
|
|
577
|
+
];
|
|
578
|
+
}
|
|
579
|
+
if (!tail.length) return fitRow(body, inner);
|
|
580
|
+
const room = inner - rowWidth(tail) - 1;
|
|
581
|
+
const clipped = clipRow(body, room);
|
|
582
|
+
return fitRow([...clipped, span(" ".repeat(Math.max(1, inner - rowWidth(clipped) - rowWidth(tail)))), ...tail], inner);
|
|
583
|
+
});
|
|
584
|
+
while (out.length < reserve) out.push(fitRow([], inner));
|
|
585
|
+
return out;
|
|
586
|
+
};
|
|
587
|
+
|
|
493
588
|
const CHIP_TONE = Object.freeze({
|
|
494
589
|
current: (accent) => ({ fill: accent, text: PILL.ink }),
|
|
495
590
|
recent: () => ({ fill: PILL.muted, text: PILL.mutedText }),
|
|
@@ -515,7 +610,19 @@ const chipSpans = (chip, timed, glyphs, accent, sweep = null) => {
|
|
|
515
610
|
|
|
516
611
|
const mutedPill = (text, glyphs) => pill([span(text, { fg: PALETTE.dim, bg: PILL.muted })], PILL.muted, glyphs);
|
|
517
612
|
|
|
518
|
-
const
|
|
613
|
+
const REWIND_SPARKS = Object.freeze([".", "*", "+", "'"]);
|
|
614
|
+
|
|
615
|
+
// The rewind look's sparks, drifting through the cells the chips leave free (one gap cell kept).
|
|
616
|
+
const sparkled = (row, inner, sample, rainbow) => {
|
|
617
|
+
const sparks = sample.ambient?.sparks;
|
|
618
|
+
const spare = inner - rowWidth(row) - 1;
|
|
619
|
+
if (!rainbow || !sparks || spare < 3) return fitRow(row, inner);
|
|
620
|
+
const sky = Array.from({ length: spare }, () => span(" "));
|
|
621
|
+
for (const { x, glyph } of sparks) sky[Math.min(spare - 1, Math.floor(x * spare))] = span(REWIND_SPARKS[glyph], { fg: rainbow(x) });
|
|
622
|
+
return fitRow([...row, span(" "), ...sky], inner);
|
|
623
|
+
};
|
|
624
|
+
|
|
625
|
+
const chipsRow = (model, sample, { inner, glyphs, accent, rainbow }) => {
|
|
519
626
|
const chips = model.skills;
|
|
520
627
|
if (chips.length === 0) {
|
|
521
628
|
if (!model.idle && model.next && !model.workflow?.next) return fitRow([span("▸ ", { fg: accent }), span(truncateToWidth(model.next, inner - 2), { fg: PALETTE.white })], inner);
|
|
@@ -540,7 +647,7 @@ const chipsRow = (model, sample, { inner, glyphs, accent }) => {
|
|
|
540
647
|
shown += 1;
|
|
541
648
|
}
|
|
542
649
|
if (shown < chips.length) row.push(...(row.length ? [span(" ")] : []), ...mutedPill(`+${chips.length - shown}`, glyphs));
|
|
543
|
-
return
|
|
650
|
+
return sparkled(row, inner, sample, rainbow);
|
|
544
651
|
};
|
|
545
652
|
|
|
546
653
|
const noticeRow = (sample, inner) => {
|
|
@@ -583,7 +690,7 @@ const levelColor = (percent) => (percent >= 90 ? HUD.red : percent >= 70 ? HUD.y
|
|
|
583
690
|
|
|
584
691
|
// ╰─ ctx 42% ▰▰▱▱▱ · 5h 31% · 1w 12% · git main ───╯, or a warning first when one is up. The branch goes
|
|
585
692
|
// first on a narrow card, then the weekly window, the five-hour one and the context bar.
|
|
586
|
-
const bottomEdge = (model, sample, { width, glyphs, accent, edge }) => {
|
|
693
|
+
const bottomEdge = (model, sample, { width, glyphs, accent, edge, look, paint }) => {
|
|
587
694
|
const { context, rates, git } = model.figures;
|
|
588
695
|
const warning = model.warnings[0];
|
|
589
696
|
const segments = [];
|
|
@@ -602,7 +709,7 @@ const bottomEdge = (model, sample, { width, glyphs, accent, edge }) => {
|
|
|
602
709
|
let kept = fitJoined(segments, room);
|
|
603
710
|
if (kept[0]?.id === "ctxbar") kept = kept.slice(1);
|
|
604
711
|
if (kept.length === 0 && warning) kept = [{ ...segments[0], spans: clipRow(segments[0].spans, room) }];
|
|
605
|
-
return edgeRow("╰─ ", joinSegments(kept, edge), [], "─╯", width, edge, cometOn(sample, "bottom", width));
|
|
712
|
+
return edgeRow("╰─ ", joinSegments(kept, edge), [], "─╯", width, edge, cometOn(sample, "bottom", width, look), paint[4]);
|
|
606
713
|
};
|
|
607
714
|
|
|
608
715
|
// The border: red or amber under a warning, otherwise the accent. Idle it is a calm, dim accent;
|
|
@@ -616,8 +723,9 @@ const edgeColor = (model, sample, accent) => {
|
|
|
616
723
|
};
|
|
617
724
|
|
|
618
725
|
/**
|
|
619
|
-
* The card for one frame: `{ mode: "card", border, width, rows }`,
|
|
620
|
-
*
|
|
726
|
+
* The card for one frame: `{ mode: "card", border, width, rows }`, five rows (top edge, workflow
|
|
727
|
+
* map or phase track, detail line, chips row, bottom edge), with the thread rows between the detail
|
|
728
|
+
* line and the chips while more than one thread is live, each exactly `width` cells:
|
|
621
729
|
* the terminal's columns up to CARD_MAX. `accent` is the status line's accent colour
|
|
622
730
|
* (settings.mjs accentFromSettings).
|
|
623
731
|
*/
|
|
@@ -626,18 +734,29 @@ export const composeBand = (model, sample, { columns, glyphs: glyphMode = "basic
|
|
|
626
734
|
const width = Math.max(12, Math.min(CARD_MAX, columns));
|
|
627
735
|
const inner = width - 4;
|
|
628
736
|
const edge = edgeColor(model, sample, accent);
|
|
629
|
-
|
|
630
|
-
|
|
737
|
+
// The rewind look's rainbow turns with the ambient hue (still at 0 with motion off). A warning
|
|
738
|
+
// keeps the border its warning colour; the rails stay rainbow.
|
|
739
|
+
const look = model.idle ? null : lookOf(model.discipline);
|
|
740
|
+
const hue = sample.ambient?.hue ?? 0;
|
|
741
|
+
const rainbow = look === "rewind" ? (position) => rainbowAt(position + hue) : null;
|
|
742
|
+
const painted = rainbow && model.warnings.length === 0;
|
|
743
|
+
const paint = [0, 1, 2, 3, 4].map((r) => (painted ? (col) => rainbow(col / width + r * 0.04) : null));
|
|
744
|
+
const side = (row, r) => (paint[r]
|
|
745
|
+
? [span("│", { fg: paint[r](0) }), span(" "), ...row, span(" "), span("│", { fg: paint[r](width - 1) })]
|
|
746
|
+
: [span("│ ", { fg: edge }), ...row, span(" │", { fg: edge })]);
|
|
747
|
+
const options = { width, inner, glyphs, accent, edge, look, rainbow, paint };
|
|
631
748
|
const middle = sample.completion ? completionRow(sample, inner) : sample.notice ? noticeRow(sample, inner) : chipsRow(model, sample, options);
|
|
632
749
|
return {
|
|
633
750
|
mode: "card",
|
|
634
751
|
border: edge,
|
|
635
752
|
width,
|
|
753
|
+
look,
|
|
636
754
|
rows: [
|
|
637
755
|
topEdge(model, sample, options),
|
|
638
|
-
side(model.workflow ? mapRow(model, sample, options) : phaseRow(model, sample, options)),
|
|
639
|
-
side(detailRow(model, sample, options)),
|
|
640
|
-
side(
|
|
756
|
+
side(model.workflow ? mapRow(model, sample, options) : phaseRow(model, sample, options), 1),
|
|
757
|
+
side(detailRow(model, sample, options), 2),
|
|
758
|
+
...(model.threads ? threadRows(model, options).map((row) => side(row, 2)) : []),
|
|
759
|
+
side(middle, 3),
|
|
641
760
|
bottomEdge(model, sample, options),
|
|
642
761
|
],
|
|
643
762
|
};
|
|
@@ -34,6 +34,8 @@ export const TIMINGS = Object.freeze({
|
|
|
34
34
|
spin: 120,
|
|
35
35
|
ambientFrame: 66,
|
|
36
36
|
clock: 1000,
|
|
37
|
+
hue: 4800,
|
|
38
|
+
sparks: 3600,
|
|
37
39
|
});
|
|
38
40
|
|
|
39
41
|
// full: the approved motion, and while LitClaude works the brand breathes, a light sweeps the active
|
|
@@ -50,6 +52,12 @@ export const motionProfile = (mode) => {
|
|
|
50
52
|
return { mode: "full", duration: (ms) => ms, enterEase: EASE.outBack, noticeEase: EASE.outBack, shimmer: true, embers: true, ambient: { sweep: true, comet: true } };
|
|
51
53
|
};
|
|
52
54
|
|
|
55
|
+
// The rewind look (plans/lit-adhd.md D7): while lit-adhd runs, the card's border and rails take a
|
|
56
|
+
// cycling rainbow, ASCII sparks drift through the skills row and a `<<` comet sweeps the bottom rule
|
|
57
|
+
// right to left. It is keyed on the ignition discipline alone; every other discipline keeps its look.
|
|
58
|
+
const REWIND = new Set(["lit-adhd", "lit-rewind"]);
|
|
59
|
+
export const lookOf = (discipline) => (REWIND.has(discipline) ? "rewind" : null);
|
|
60
|
+
|
|
53
61
|
export const clamp01 = (x) => (x <= 0 ? 0 : x >= 1 ? 1 : x);
|
|
54
62
|
|
|
55
63
|
// Progress through a window that opens at `at` and lasts `dur`; a zero-length window is complete.
|
|
@@ -87,6 +95,19 @@ export const gradientAt = (stops, position) => {
|
|
|
87
95
|
return lerpColor(stops[index], stops[index + 1], scaled - index);
|
|
88
96
|
};
|
|
89
97
|
|
|
98
|
+
// A colour `position` of the way around the hue wheel (wrapping past 1), saturated and light enough
|
|
99
|
+
// to stay bright on the dark card. The rewind look draws only fixed glyphs and ASCII with it.
|
|
100
|
+
export const rainbowAt = (position) => {
|
|
101
|
+
const h = (((position % 1) + 1) % 1) * 6;
|
|
102
|
+
const s = 0.9;
|
|
103
|
+
const l = 0.62;
|
|
104
|
+
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
105
|
+
const x = c * (1 - Math.abs((h % 2) - 1));
|
|
106
|
+
const [r, g, b] = [[c, x, 0], [x, c, 0], [0, c, x], [0, x, c], [x, 0, c], [c, 0, x]][Math.min(5, Math.floor(h))];
|
|
107
|
+
const m = l - c / 2;
|
|
108
|
+
return `#${[r, g, b].map((v) => Math.round((v + m) * 255).toString(16).padStart(2, "0")).join("")}`;
|
|
109
|
+
};
|
|
110
|
+
|
|
90
111
|
export const BAR_STOPS = Object.freeze(["#ff2d95", "#00e5ff"]);
|
|
91
112
|
export const BAR_TRACK = "#30363d";
|
|
92
113
|
|
|
@@ -24,6 +24,10 @@ export const normalizeModSettings = (options) => ({
|
|
|
24
24
|
notify: pick(options?.notify, MOD_CHOICES.notify),
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
+
// Claude Code's own `prefersReducedMotion` setting (/config "Reduce motion") turns the band's motion
|
|
28
|
+
// off, whatever the plugin's `motion` option says; unset or false leaves that option in charge.
|
|
29
|
+
export const effectiveMotion = (motion, hostSettings) => (hostSettings?.prefersReducedMotion === true ? "off" : motion);
|
|
30
|
+
|
|
27
31
|
// The glyph set one surface draws. Private-use Nerd Font glyphs only reach the terminal, which
|
|
28
32
|
// draws with the person's own fonts; `auto` uses them there when the icon font is installed. The
|
|
29
33
|
// desktop app and the other surfaces always get the basic set.
|
|
@@ -13,6 +13,7 @@ export const LIT_SKILL_IDS = Object.freeze([
|
|
|
13
13
|
"debugging",
|
|
14
14
|
"deep-interview",
|
|
15
15
|
"frontend-ui-ux",
|
|
16
|
+
"lit-adhd",
|
|
16
17
|
"lit-brainstorm",
|
|
17
18
|
"lit-burnoff",
|
|
18
19
|
"lit-burnoff-file",
|
|
@@ -23,12 +24,14 @@ export const LIT_SKILL_IDS = Object.freeze([
|
|
|
23
24
|
"lit-diagram-drawer",
|
|
24
25
|
"lit-docx",
|
|
25
26
|
"lit-handoff",
|
|
27
|
+
"lit-hijack",
|
|
26
28
|
"lit-humanizer",
|
|
27
29
|
"lit-init",
|
|
28
30
|
"lit-loop",
|
|
29
31
|
"lit-plan",
|
|
30
32
|
"lit-pptx",
|
|
31
33
|
"lit-recap",
|
|
34
|
+
"lit-schematic",
|
|
32
35
|
"lit-scientific-visualization",
|
|
33
36
|
"lit-team",
|
|
34
37
|
"lit-typographic-motion",
|