@litfamily/litclaude 1.0.37 → 1.0.39
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 +71 -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 +117 -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 +373 -53
- package/plugins/litclaude/bin/litclaude-mcp.js +1 -1
- package/plugins/litclaude/commands/lit-adhd.md +107 -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 +107 -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 +205 -101
- package/plugins/litclaude/lib/lit-activation.mjs +24 -10
- package/plugins/litclaude/lib/mod/frame.mjs +235 -49
- 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 +167 -25
- package/plugins/litclaude/lib/mod/timeline.mjs +28 -5
- package/plugins/litclaude/lib/mod/toasts.mjs +5 -2
- package/plugins/litclaude/lib/mod/view.mjs +240 -6
- 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/brief.mjs +370 -0
- package/plugins/litclaude/lib/rewind/collect.mjs +413 -0
- package/plugins/litclaude/lib/rewind/gauge.mjs +87 -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/suggest.mjs +51 -0
- package/plugins/litclaude/lib/rewind/transcripts.mjs +259 -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 +18 -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/production-interview.md +1 -1
- 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 +168 -0
- package/plugins/litclaude/skills/lit-adhd/references/card-examples.md +125 -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 +17 -5
- 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-docx/SKILL.md +6 -1
- package/plugins/litclaude/skills/lit-docx/references/direction-step.md +8 -4
- package/plugins/litclaude/skills/lit-handoff/SKILL.md +2 -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 +35 -15
- 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 +23 -4
- 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 +4 -0
- package/plugins/litclaude/skills/lit-schematic/SKILL.md +123 -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 +54 -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/SKILL.md +10 -0
- package/plugins/litclaude/skills/readme-studio/references/production-interview.md +2 -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, knownFacts } 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
|
|
|
@@ -127,6 +128,19 @@ const pill = (body, fill, glyphs) => (glyphs.capLeft
|
|
|
127
128
|
? [span(glyphs.capLeft, { fg: fill }), ...body, span(glyphs.capRight, { fg: fill })]
|
|
128
129
|
: [span(" ", { bg: fill }), ...body, span(" ", { bg: fill })]);
|
|
129
130
|
|
|
131
|
+
// The rewind look's pills: each cell a step further round the hue wheel, lightened so the dark ink
|
|
132
|
+
// keeps its contrast, with each cap in the colour of the cell beside it.
|
|
133
|
+
const RAINBOW_SPREAD = 0.35;
|
|
134
|
+
const rainbowCell = (rainbow, at) => lerpColor(rainbow(at), "#ffffff", 0.3);
|
|
135
|
+
const rainbowPill = (text, rainbow, from, glyphs, bold = true) => {
|
|
136
|
+
const chars = [...text];
|
|
137
|
+
const at = (i) => from + (chars.length <= 1 ? 0 : (i / (chars.length - 1)) * RAINBOW_SPREAD);
|
|
138
|
+
const body = chars.map((ch, i) => span(ch, { fg: PILL.ink, bg: rainbowCell(rainbow, at(i)), bold }));
|
|
139
|
+
return glyphs.capLeft
|
|
140
|
+
? [span(glyphs.capLeft, { fg: rainbowCell(rainbow, at(0)) }), ...body, span(glyphs.capRight, { fg: rainbowCell(rainbow, at(chars.length - 1)) })]
|
|
141
|
+
: [span(" ", { bg: rainbowCell(rainbow, at(0)) }), ...body, span(" ", { bg: rainbowCell(rainbow, at(chars.length - 1)) })];
|
|
142
|
+
};
|
|
143
|
+
|
|
130
144
|
const inkOf = (accent) => ({ done: lerpColor(accent, PALETTE.dim, 0.45), now: accent, todo: PALETTE.dim, warn: PALETTE.amber });
|
|
131
145
|
|
|
132
146
|
// Colour of one phase in this frame: the crossfade from its previous state, then the amber mix for
|
|
@@ -167,48 +181,61 @@ const cometColor = (base, k) => {
|
|
|
167
181
|
|
|
168
182
|
// The rule of an edge, `count` cells from column `start`. With a comet ({ x, dir }: its head's
|
|
169
183
|
// 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
|
-
|
|
184
|
+
// rule becomes one span per cell; without one it stays a single span. `paint` (column to colour)
|
|
185
|
+
// gives every cell its own colour; the rewind sweep's comet (`arrow`) draws its head as ASCII `<<`.
|
|
186
|
+
const ruleSpans = (count, color, start, comet, paint = null) => {
|
|
187
|
+
if (!comet && !paint) return [span("─".repeat(count), { fg: color })];
|
|
173
188
|
return Array.from({ length: count }, (_, i) => {
|
|
189
|
+
const base = paint ? paint(start + i) : color;
|
|
190
|
+
if (!comet) return span("─", { fg: base });
|
|
174
191
|
const behind = comet.dir * (comet.x - (start + i));
|
|
175
192
|
const k = behind >= 0 && behind <= COMET_TAIL ? 1 - behind / COMET_TAIL : 0;
|
|
176
|
-
return span("─", { fg: k > 0 ? cometColor(
|
|
193
|
+
return span(comet.arrow && behind >= 0 && behind < 2 ? "<" : "─", { fg: k > 0 ? cometColor(base, k) : base });
|
|
177
194
|
});
|
|
178
195
|
};
|
|
179
196
|
|
|
180
197
|
// An edge of the card: `open` and `close` are its corners, `left` its title or figures and
|
|
181
198
|
// `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
|
|
199
|
+
const edgeRow = (open, left, right, close, width, color, comet = null, paint = null) => {
|
|
200
|
+
const piece = (text, at) => (paint ? [...text].map((ch, i) => span(ch, { fg: paint(at + i) })) : [span(text, { fg: color })]);
|
|
201
|
+
const tail = right.length ? [span(" "), ...right, ...piece(` ${close}`, width - textWidth(close) - 1)] : piece(close, width - textWidth(close));
|
|
184
202
|
const fill = Math.max(1, width - textWidth(open) - rowWidth(left) - 1 - rowWidth(tail));
|
|
185
203
|
const start = textWidth(open) + rowWidth(left) + 1;
|
|
186
|
-
return clipRow([
|
|
204
|
+
return clipRow([...piece(open, 0), ...left, span(" "), ...ruleSpans(fill, color, start, comet, paint), ...tail], width);
|
|
187
205
|
};
|
|
188
206
|
|
|
189
207
|
// 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
|
-
|
|
208
|
+
// its loop, then back along the bottom rule, starting and ending just off the card. The rewind look
|
|
209
|
+
// spends the whole loop sweeping the bottom rule right to left.
|
|
210
|
+
const cometOn = (sample, edge, width, look = null) => {
|
|
192
211
|
const u = sample.ambient?.comet;
|
|
193
212
|
if (u === null || u === undefined) return null;
|
|
194
213
|
const span = width + 2 * COMET_TAIL;
|
|
214
|
+
if (look === "rewind") return edge === "bottom" ? { x: width + COMET_TAIL - u * span, dir: -1, arrow: true } : null;
|
|
195
215
|
if (edge === "top") return u < 0.5 ? { x: u * 2 * span - COMET_TAIL, dir: 1 } : null;
|
|
196
216
|
return u >= 0.5 ? { x: width + COMET_TAIL - (u - 0.5) * 2 * span, dir: -1 } : null;
|
|
197
217
|
};
|
|
198
218
|
|
|
199
219
|
// While LitClaude works the brand pill breathes from its pink toward the flame orange and back.
|
|
200
|
-
|
|
220
|
+
// The rewind look turns it through the rainbow instead, lightened so its dark ink stays readable.
|
|
221
|
+
const brandSpans = (sample, glyphs, rainbow = null) => {
|
|
201
222
|
const reveal = revealText("🔥 LIT", sample.pills[0]);
|
|
202
223
|
if (reveal === null) return [];
|
|
224
|
+
if (rainbow) return rainbowPill(reveal, rainbow, 0, glyphs);
|
|
203
225
|
const fill = sample.ambient ? lerpColor(PILL.brand, PALETTE.orange, 0.85 * sample.ambient.breath) : PILL.brand;
|
|
204
226
|
return pill(litText(reveal, { fg: PILL.ink, bg: fill, bold: true }, sample.completion?.shimmer ?? null), fill, glyphs);
|
|
205
227
|
};
|
|
206
|
-
|
|
228
|
+
// `REWIND <<` while the rewind look is on, each letter a step further round the hue wheel, lightened
|
|
229
|
+
// to keep 4.5:1 on the card; the letters stay put and only their colours move.
|
|
230
|
+
const rewindSpans = (rainbow) => [..."REWIND <<"].map((ch, i) => span(ch, { fg: lerpColor(rainbow(i / 9), "#ffffff", 0.4), bold: true }));
|
|
231
|
+
const indicatorSpans = (model, sample, glyphs, accent, rainbow = null) => {
|
|
207
232
|
if (sample.completion) return [span(`DONE ${glyphs.done}`, { fg: PALETTE.green, bold: true })];
|
|
233
|
+
if (rainbow) return rewindSpans(rainbow);
|
|
208
234
|
if (model.idle) return [span("idle", { fg: PALETTE.dim })];
|
|
209
235
|
const flow = model.workflow;
|
|
210
236
|
if (flow && flow.current >= 0) {
|
|
211
237
|
const warn = model.ctxWarning && sample.warn > 0.02;
|
|
238
|
+
if (flow.paused) return [span(`${flow.stages[flow.current].id.toUpperCase()} ||`, { fg: PALETTE.dim, bold: true })];
|
|
212
239
|
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
240
|
}
|
|
214
241
|
if (flow && model.lanes.count === 0) return [span(`DONE ${glyphs.done}`, { fg: PALETTE.green, bold: true })];
|
|
@@ -220,19 +247,19 @@ const indicatorSpans = (model, sample, glyphs, accent) => {
|
|
|
220
247
|
|
|
221
248
|
// ╭─ [🔥 LIT] · <discipline> ──── <PHASE ●> ─╮. On a narrow card the phase indicator goes first,
|
|
222
249
|
// then the discipline shortens, then it goes too.
|
|
223
|
-
const topEdge = (model, sample, { width, glyphs, accent, edge }) => {
|
|
224
|
-
const brand = brandSpans(sample, glyphs);
|
|
225
|
-
const right = indicatorSpans(model, sample, glyphs, accent);
|
|
250
|
+
const topEdge = (model, sample, { width, glyphs, accent, edge, look, paint, rainbow }) => {
|
|
251
|
+
const brand = brandSpans(sample, glyphs, rainbow);
|
|
252
|
+
const right = indicatorSpans(model, sample, glyphs, accent, rainbow);
|
|
226
253
|
const name = model.title ?? "ready";
|
|
227
|
-
const nameStyle = model.idle ? { fg: PALETTE.dim } : { fg: accent, bold: true };
|
|
254
|
+
const nameStyle = model.idle && !rainbow ? { fg: PALETTE.dim } : { fg: accent, bold: true };
|
|
228
255
|
const title = (text) => (text ? [span(" · ", { fg: PALETTE.dim }), span(text, nameStyle)] : []);
|
|
229
256
|
const fixed = textWidth("╭─ ") + rowWidth(brand) + 1 + 1;
|
|
230
257
|
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);
|
|
258
|
+
const comet = cometOn(sample, "top", width, look);
|
|
259
|
+
if (withRight <= width) return edgeRow("╭─ ", [...brand, ...title(name)], right, "─╮", width, edge, comet, paint[0]);
|
|
233
260
|
const room = width - fixed - textWidth("─╮") - textWidth(" · ");
|
|
234
261
|
const shown = room >= 4 ? truncateToWidth(name, room) : "";
|
|
235
|
-
return edgeRow("╭─ ", [...brand, ...title(shown)], [], "─╮", width, edge, comet);
|
|
262
|
+
return edgeRow("╭─ ", [...brand, ...title(shown)], [], "─╮", width, edge, comet, paint[0]);
|
|
236
263
|
};
|
|
237
264
|
|
|
238
265
|
const barSpans = (fraction, sample, cells) => barCells(fraction, cells, sample.fillGlow ?? 0)
|
|
@@ -281,7 +308,7 @@ const progressSegment = (model, sample, glyphs, cells) => {
|
|
|
281
308
|
// ● PLAN ━━ [WORK] ━━ ○ REVIEW: the active phase is a pill on the accent (amber while the context
|
|
282
309
|
// warning is up), done phases a dim-accent dot and the rest a dim ring. Each form of a label is
|
|
283
310
|
// as wide as the others, so a phase changing state never moves the row.
|
|
284
|
-
const phaseTrack = (model, sample, { glyphs, accent, rail, short }) => {
|
|
311
|
+
const phaseTrack = (model, sample, { glyphs, accent, rail, short, rainbow }) => {
|
|
285
312
|
const ink = inkOf(accent);
|
|
286
313
|
const out = [];
|
|
287
314
|
PHASES.forEach((id, index) => {
|
|
@@ -289,21 +316,23 @@ const phaseTrack = (model, sample, { glyphs, accent, rail, short }) => {
|
|
|
289
316
|
const state = sample.phases[id].to;
|
|
290
317
|
const shown = revealText(state === "now" ? label : `${state === "done" ? "●" : "○"} ${label}`, sample.pills[index + 1]);
|
|
291
318
|
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 }));
|
|
293
|
-
if (state === "now") {
|
|
319
|
+
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 }));
|
|
320
|
+
if (state === "now" && rainbow) {
|
|
321
|
+
out.push(...rainbowPill(shown.slice(0, label.length).padEnd(label.length), rainbow, index / PHASES.length, glyphs));
|
|
322
|
+
} else if (state === "now") {
|
|
294
323
|
const fill = model.idle ? lerpColor(phaseColor(id, sample, ink), PILL.muted, 0.5) : phaseColor(id, sample, ink);
|
|
295
324
|
const sweep = model.idle ? null : sample.ambient?.sweep ?? null;
|
|
296
325
|
out.push(...pill(litText(shown.slice(0, label.length).padEnd(label.length), { fg: PILL.ink, bg: fill, bold: true }, sweep), fill, glyphs));
|
|
297
326
|
} else {
|
|
298
|
-
out.push(span(warned(id, sample) ? shown.replace(/^[●○]/u, glyphs.warn) : shown, { fg: phaseColor(id, sample, ink) }));
|
|
327
|
+
out.push(span(warned(id, sample) ? shown.replace(/^[●○]/u, glyphs.warn) : shown, { fg: rainbow && !warned(id, sample) ? rainbow(index / PHASES.length + 0.15) : phaseColor(id, sample, ink), bold: Boolean(rainbow) }));
|
|
299
328
|
}
|
|
300
329
|
});
|
|
301
330
|
return out;
|
|
302
331
|
};
|
|
303
332
|
|
|
304
|
-
const phaseRow = (model, sample, { inner, glyphs, accent }) => {
|
|
333
|
+
const phaseRow = (model, sample, { inner, glyphs, accent, rainbow }) => {
|
|
305
334
|
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 }));
|
|
335
|
+
const tracks = variants.map((variant) => phaseTrack(model, sample, { glyphs, accent, rainbow, ...variant }));
|
|
307
336
|
const right = [];
|
|
308
337
|
if (sample.rest > 0) {
|
|
309
338
|
const warning = model.ctxWarning && sample.warn > 0.02
|
|
@@ -333,9 +362,11 @@ const shortLabel = (label) => label.replace(/^[A-Za-z]+/u, (word) => word.slice(
|
|
|
333
362
|
|
|
334
363
|
// The rail from stage `index - 1` to stage `index`, `cells` wide. Behind the current stage it is
|
|
335
364
|
// `━` 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
|
-
|
|
365
|
+
// LitClaude works; ahead, dim `─`. With no room for rails, one space. The rewind look grades the
|
|
366
|
+
// `━` cells by its `rainbow` instead.
|
|
367
|
+
const railSpans = (model, sample, index, cells, accent, rainbow = null) => {
|
|
338
368
|
if (cells === 0) return [span(" ")];
|
|
369
|
+
const grade = rainbow ?? ((position) => mapColor(accent, position));
|
|
339
370
|
const { stages } = model.workflow;
|
|
340
371
|
const last = Math.max(1, stages.length - 1);
|
|
341
372
|
const at = (cell) => (index - 1 + (cell + 0.5) / cells) / last;
|
|
@@ -343,13 +374,13 @@ const railSpans = (model, sample, index, cells, accent) => {
|
|
|
343
374
|
const from = stages[index - 1].state;
|
|
344
375
|
let body;
|
|
345
376
|
if (into === "done" || into === "now") {
|
|
346
|
-
body = Array.from({ length: cells }, (_, cell) => span("━", { fg:
|
|
377
|
+
body = Array.from({ length: cells }, (_, cell) => span("━", { fg: grade(at(cell)) }));
|
|
347
378
|
} else if (from === "now") {
|
|
348
379
|
const filled = model.workflow.count ? sample.fill * cells : 0;
|
|
349
|
-
const flow = model.idle ? null : sample.ambient?.flow ?? null;
|
|
380
|
+
const flow = model.idle || model.workflow.paused ? null : sample.ambient?.flow ?? null;
|
|
350
381
|
const head = flow === null ? -1 : Math.floor(flow * cells);
|
|
351
382
|
body = Array.from({ length: cells }, (_, cell) => {
|
|
352
|
-
const base = cell < filled ?
|
|
383
|
+
const base = cell < filled ? grade(at(cell)) : PILL.rail;
|
|
353
384
|
return span("━", { fg: cell === head ? lerpColor(base, "#ffffff", 0.75) : base });
|
|
354
385
|
});
|
|
355
386
|
} else {
|
|
@@ -359,7 +390,7 @@ const railSpans = (model, sample, index, cells, accent) => {
|
|
|
359
390
|
};
|
|
360
391
|
|
|
361
392
|
// interview ✓ ━━ plan ✓ ━━ [work 3/7] ━━ review · ── done ·
|
|
362
|
-
const mapTrack = (model, sample, { glyphs, accent, rail, short = false, window = false }) => {
|
|
393
|
+
const mapTrack = (model, sample, { glyphs, accent, rail, short = false, window = false, rainbow = null }) => {
|
|
363
394
|
const { stages, current } = model.workflow;
|
|
364
395
|
const last = Math.max(1, stages.length - 1);
|
|
365
396
|
const focus = current < 0 ? stages.length - 1 : current;
|
|
@@ -372,8 +403,11 @@ const mapTrack = (model, sample, { glyphs, accent, rail, short = false, window =
|
|
|
372
403
|
const text = stage.state === "now" ? label : `${label} ${stage.state === "done" ? glyphs.done : "·"}`;
|
|
373
404
|
const revealed = revealText(text, sample.pills[Math.min(3, 1 + Math.floor(index / 2))]);
|
|
374
405
|
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") {
|
|
406
|
+
if (out.length && !(window && out.length === 1 && shown[0] > 0)) out.push(...railSpans(model, sample, index, rail, accent, rainbow));
|
|
407
|
+
if (stage.state === "now" && model.workflow.paused) {
|
|
408
|
+
// A paused stage holds still: the muted pill, no breath and no light along it.
|
|
409
|
+
out.push(...pill([span(revealed.slice(0, label.length).padEnd(label.length), { fg: PILL.mutedText, bg: PILL.muted, bold: true })], PILL.muted, glyphs));
|
|
410
|
+
} else if (stage.state === "now") {
|
|
377
411
|
let fill = model.idle ? lerpColor(accent, PILL.muted, 0.5) : accent;
|
|
378
412
|
if (model.ctxWarning) fill = lerpColor(fill, PALETTE.amber, sample.warn);
|
|
379
413
|
if (sample.ambient && !model.idle) fill = lerpColor(fill, "#ffffff", 0.2 * sample.ambient.breath);
|
|
@@ -396,8 +430,8 @@ const MAP_VARIANTS = Object.freeze([
|
|
|
396
430
|
]);
|
|
397
431
|
|
|
398
432
|
// 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 }));
|
|
433
|
+
const mapRow = (model, sample, { inner, glyphs, accent, rainbow }) => {
|
|
434
|
+
const tracks = MAP_VARIANTS.map((variant) => mapTrack(model, sample, { glyphs, accent, rainbow, ...variant }));
|
|
401
435
|
const track = tracks.find((candidate) => rowWidth(candidate) <= inner) ?? tracks.at(-1);
|
|
402
436
|
const right = [];
|
|
403
437
|
if (sample.rest > 0) {
|
|
@@ -490,6 +524,120 @@ const detailRow = (model, sample, { inner, glyphs, accent }) => {
|
|
|
490
524
|
return fitRow([...body, span(" ".repeat(Math.max(1, inner - rowWidth(body) - rowWidth(right)))), ...right], inner);
|
|
491
525
|
};
|
|
492
526
|
|
|
527
|
+
// A thread's state: its glyph, its colour and the word written beside it. The word is ASCII, so a
|
|
528
|
+
// state change always repaints the glyph with it. Paused is an ASCII bar: `‖` is ambiguous-width
|
|
529
|
+
// and some fonts draw it two cells wide, which pushes the card's right edge out.
|
|
530
|
+
const THREAD_STATE = Object.freeze({
|
|
531
|
+
running: (glyphs) => [glyphs.lane, PALETTE.green],
|
|
532
|
+
paused: () => ["|", PALETTE.dim],
|
|
533
|
+
blocked: () => ["!", PALETTE.amber],
|
|
534
|
+
idle: () => ["-", PALETTE.dim],
|
|
535
|
+
done: (glyphs) => [glyphs.done, lerpColor(PALETTE.green, PALETTE.dim, 0.4)],
|
|
536
|
+
});
|
|
537
|
+
// A background task's glyph says its kind (ASCII, so it repaints with the row): a shell or a monitor.
|
|
538
|
+
const TASK_GLYPH = Object.freeze({ shell: "$", monitor: "~" });
|
|
539
|
+
const plural = (count, word) => `${count} ${word}${count === 1 ? "" : "s"}`;
|
|
540
|
+
const parallelCount = ({ laneCount = 0, taskCount = 0 }) => laneCount + taskCount;
|
|
541
|
+
/** `3 lanes in parallel`, `2 lanes · 1 task in parallel`, `2 tasks in parallel`. */
|
|
542
|
+
export const forkLabel = ({ laneCount = 0, taskCount = 0 }) => `${[laneCount ? plural(laneCount, "lane") : null, taskCount ? plural(taskCount, "task") : null].filter(Boolean).join(" · ")} in parallel`;
|
|
543
|
+
// The last child of a branch draws `└─` and the others `├─`. Those are not ASCII, so the name beside
|
|
544
|
+
// them takes a slightly different white: the row repaints when a branch's last child changes.
|
|
545
|
+
const THREAD_NAME = Object.freeze({ mid: PALETTE.white, last: "#d8e0e8" });
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* The thread rows (view.mjs threadsOf), `model.threads.reserve` of them, blank rows filling the
|
|
549
|
+
* rest. The stack goes parent first, each child under the one before it; lanes hang under the top
|
|
550
|
+
* frame, with a fork line over them when two or more run in parallel; other sessions come last.
|
|
551
|
+
*
|
|
552
|
+
* | lit-plan plan [▉▉░░░] 2/5 paused
|
|
553
|
+
* └─ ● lit-loop RED [▉░░░] 1/4 running
|
|
554
|
+
* ┬ 2 lanes · 1 task in parallel
|
|
555
|
+
* ├─ ● executor [▉▉░] 2/3 running
|
|
556
|
+
* ├─ ● reviewer ━━━━━ running · 7 steps · 2m · last: Read a.mjs
|
|
557
|
+
* └─ $ dev server shell ━━━━━ running 4m
|
|
558
|
+
*
|
|
559
|
+
* A thread with two real numbers draws its gauge. One without a total never draws a guess: an
|
|
560
|
+
* indeterminate pulse (fixed `━` cells whose light moves by colour while the card animates) and
|
|
561
|
+
* what is known in words. The rewind look turns the gauge cells and the pulse through its rainbow.
|
|
562
|
+
*/
|
|
563
|
+
const PULSE_CELLS = 5;
|
|
564
|
+
const pulseSpans = (sample, rainbow, index) => {
|
|
565
|
+
const ambient = sample.ambient;
|
|
566
|
+
const at = ambient?.flow ?? (ambient ? ambient.breath : null);
|
|
567
|
+
const head = at === null ? -1 : Math.floor(((at + index * 0.17) % 1) * PULSE_CELLS);
|
|
568
|
+
return Array.from({ length: PULSE_CELLS }, (_, cell) => {
|
|
569
|
+
const base = rainbow ? rainbow(cell / PULSE_CELLS + index * 0.1) : PILL.rail;
|
|
570
|
+
return span("━", { fg: cell === head ? lerpColor(base, "#ffffff", rainbow ? 0.45 : 0.7) : rainbow ? lerpColor(base, PALETTE.faint, 0.35) : base });
|
|
571
|
+
});
|
|
572
|
+
};
|
|
573
|
+
const gaugeSpans = (text, rainbow, index) => {
|
|
574
|
+
if (!rainbow) return [span(text, { fg: PALETTE.white })];
|
|
575
|
+
const [, cells, count] = /^\[([▉░]+)\](.*)$/u.exec(text);
|
|
576
|
+
return [
|
|
577
|
+
span("[", { fg: PALETTE.white }),
|
|
578
|
+
...[...cells].map((cell, i) => span(cell, { fg: cell === "▉" ? rainbow(i / cells.length + index * 0.1) : PALETTE.dim })),
|
|
579
|
+
span(`]${count}`, { fg: PALETTE.white }),
|
|
580
|
+
];
|
|
581
|
+
};
|
|
582
|
+
const progressSpans = (thread, sample, rainbow, index, color) => {
|
|
583
|
+
const drawn = gauge(thread.done, thread.total);
|
|
584
|
+
if (drawn) return [span(" "), ...gaugeSpans(drawn, rainbow, index), span(` ${thread.state}`, { fg: color })];
|
|
585
|
+
const facts = knownFacts({ steps: thread.steps, elapsedMs: thread.elapsedMs, last: thread.last, state: thread.state });
|
|
586
|
+
const words = facts.startsWith(thread.state)
|
|
587
|
+
? [span(facts, { fg: color })]
|
|
588
|
+
: [span(thread.state, { fg: color }), span(` · ${facts}`, { fg: PALETTE.dim })];
|
|
589
|
+
return [span(" "), ...pulseSpans(sample, rainbow, index), span(" "), ...words];
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
const threadRows = (model, sample, { inner, glyphs, rainbow }) => {
|
|
593
|
+
const { chain, lanes, others, more, reserve } = model.threads;
|
|
594
|
+
const lines = [];
|
|
595
|
+
chain.forEach((thread, index) => lines.push({ thread, lead: index === 0 ? "" : `${" ".repeat(index - 1)}└─ `, last: true }));
|
|
596
|
+
// Lanes and background tasks are children of the top frame, so they hang at its indent.
|
|
597
|
+
const under = " ".repeat(Math.max(0, chain.length - 1));
|
|
598
|
+
if (parallelCount(model.threads) >= 2) {
|
|
599
|
+
lines.push({ fork: `${under}┬ ${forkLabel(model.threads)}` });
|
|
600
|
+
lanes.forEach((thread, index) => {
|
|
601
|
+
const last = index === lanes.length - 1;
|
|
602
|
+
lines.push({ thread, lead: `${under}${last ? "└─" : "├─"} `, last });
|
|
603
|
+
});
|
|
604
|
+
} else {
|
|
605
|
+
lanes.forEach((thread) => lines.push({ thread, lead: chain.length ? `${under}└─ ` : "", last: true }));
|
|
606
|
+
}
|
|
607
|
+
others.forEach((thread) => lines.push({ thread, lead: "", last: true }));
|
|
608
|
+
const rows = lines.map((line) => line.thread ?? null).filter(Boolean);
|
|
609
|
+
// A wide card spends its room on names, so lanes that share a prefix stay apart.
|
|
610
|
+
const nameWidth = Math.min(inner >= 90 ? 28 : 18, Math.max(...rows.map(({ name }) => textWidth(name))));
|
|
611
|
+
const stageWidth = Math.min(10, Math.max(0, ...rows.map(({ stage }) => (stage ? textWidth(stage) : 0))));
|
|
612
|
+
const lastIndex = lines.length - 1;
|
|
613
|
+
const out = lines.map((line, index) => {
|
|
614
|
+
const tail = index === lastIndex && more > 0 ? [span(`+${more} more`, { fg: PALETTE.dim })] : [];
|
|
615
|
+
let body;
|
|
616
|
+
if (line.fork) {
|
|
617
|
+
body = [span(line.fork, { fg: PALETTE.dim })];
|
|
618
|
+
} else {
|
|
619
|
+
const { thread } = line;
|
|
620
|
+
const [stateGlyph, color] = THREAD_STATE[thread.state](glyphs);
|
|
621
|
+
const glyph = thread.task ? TASK_GLYPH[thread.task] ?? "$" : stateGlyph;
|
|
622
|
+
const name = truncateToWidth(thread.name, nameWidth);
|
|
623
|
+
body = [
|
|
624
|
+
span(line.lead, { fg: PALETTE.dim }),
|
|
625
|
+
span(`${glyph} `, { fg: color }),
|
|
626
|
+
span(name + " ".repeat(Math.max(0, nameWidth - textWidth(name))), { fg: line.last ? THREAD_NAME.last : THREAD_NAME.mid, bold: thread.active }),
|
|
627
|
+
...(stageWidth ? [span(` ${(thread.stage ?? "").slice(0, stageWidth).padEnd(stageWidth)}`, { fg: PALETTE.dim })] : []),
|
|
628
|
+
...progressSpans(thread, sample, rainbow, index, color),
|
|
629
|
+
...(thread.session ? [span(` · other session ${thread.session}`, { fg: PALETTE.dim })] : []),
|
|
630
|
+
];
|
|
631
|
+
}
|
|
632
|
+
if (!tail.length) return fitRow(body, inner);
|
|
633
|
+
const room = inner - rowWidth(tail) - 1;
|
|
634
|
+
const clipped = clipRow(body, room);
|
|
635
|
+
return fitRow([...clipped, span(" ".repeat(Math.max(1, inner - rowWidth(clipped) - rowWidth(tail)))), ...tail], inner);
|
|
636
|
+
});
|
|
637
|
+
while (out.length < reserve) out.push(fitRow([], inner));
|
|
638
|
+
return out;
|
|
639
|
+
};
|
|
640
|
+
|
|
493
641
|
const CHIP_TONE = Object.freeze({
|
|
494
642
|
current: (accent) => ({ fill: accent, text: PILL.ink }),
|
|
495
643
|
recent: () => ({ fill: PILL.muted, text: PILL.mutedText }),
|
|
@@ -515,7 +663,26 @@ const chipSpans = (chip, timed, glyphs, accent, sweep = null) => {
|
|
|
515
663
|
|
|
516
664
|
const mutedPill = (text, glyphs) => pill([span(text, { fg: PALETTE.dim, bg: PILL.muted })], PILL.muted, glyphs);
|
|
517
665
|
|
|
518
|
-
const
|
|
666
|
+
const REWIND_SPARKS = Object.freeze([".", "*", "+", "'"]);
|
|
667
|
+
|
|
668
|
+
// The rewind look's sparks, drifting through the cells the chips leave free (one gap cell kept).
|
|
669
|
+
const sparkled = (row, inner, sample, rainbow) => {
|
|
670
|
+
const sparks = sample.ambient?.sparks;
|
|
671
|
+
const spare = inner - rowWidth(row) - 1;
|
|
672
|
+
if (!rainbow || !sparks || spare < 3) return fitRow(row, inner);
|
|
673
|
+
const sky = Array.from({ length: spare }, () => span(" "));
|
|
674
|
+
for (const { x, glyph } of sparks) sky[Math.min(spare - 1, Math.floor(x * spare))] = span(REWIND_SPARKS[glyph], { fg: rainbow(x) });
|
|
675
|
+
return fitRow([...row, span(" "), ...sky], inner);
|
|
676
|
+
};
|
|
677
|
+
|
|
678
|
+
// After a break the idle card offers the cross-session brief, in the longest form that fits.
|
|
679
|
+
const AWAY_HINTS = Object.freeze([[" · back? type ", "lit adhd", " to catch up"], [" · back? ", "lit adhd", ""], [" ", "lit adhd", ""]]);
|
|
680
|
+
const awayHint = (room, accent) => {
|
|
681
|
+
const hint = AWAY_HINTS.find((parts) => textWidth(parts.join("")) <= room);
|
|
682
|
+
return hint ? [span(hint[0], { fg: PALETTE.dim }), span(hint[1], { fg: accent }), ...(hint[2] ? [span(hint[2], { fg: PALETTE.dim })] : [])] : [];
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
const chipsRow = (model, sample, { inner, glyphs, accent, rainbow }) => {
|
|
519
686
|
const chips = model.skills;
|
|
520
687
|
if (chips.length === 0) {
|
|
521
688
|
if (!model.idle && model.next && !model.workflow?.next) return fitRow([span("▸ ", { fg: accent }), span(truncateToWidth(model.next, inner - 2), { fg: PALETTE.white })], inner);
|
|
@@ -531,7 +698,9 @@ const chipsRow = (model, sample, { inner, glyphs, accent }) => {
|
|
|
531
698
|
let shown = 0;
|
|
532
699
|
for (const chip of chips) {
|
|
533
700
|
// While LitClaude works the light that crosses the active phase crosses this request's chips too.
|
|
534
|
-
const entry =
|
|
701
|
+
const entry = rainbow && lookOf(chip.id) === "rewind"
|
|
702
|
+
? rainbowPill(`${chip.state === "current" ? glyphs.bolt : glyphs.recentBolt} ${chip.id}`, rainbow, 0.5, glyphs)
|
|
703
|
+
: chipSpans(chip, sample.chips?.[chip.id], glyphs, accent, model.idle ? null : sample.ambient?.sweep ?? null);
|
|
535
704
|
const gap = row.length ? [span(" ")] : [];
|
|
536
705
|
const rest = chips.length - shown - 1;
|
|
537
706
|
const reserve = rest > 0 ? 1 + rowWidth(mutedPill(`+${rest}`, glyphs)) : 0;
|
|
@@ -540,7 +709,8 @@ const chipsRow = (model, sample, { inner, glyphs, accent }) => {
|
|
|
540
709
|
shown += 1;
|
|
541
710
|
}
|
|
542
711
|
if (shown < chips.length) row.push(...(row.length ? [span(" ")] : []), ...mutedPill(`+${chips.length - shown}`, glyphs));
|
|
543
|
-
return fitRow(row, inner);
|
|
712
|
+
if (model.away) return fitRow([...row, ...awayHint(inner - rowWidth(row), accent)], inner);
|
|
713
|
+
return sparkled(row, inner, sample, rainbow);
|
|
544
714
|
};
|
|
545
715
|
|
|
546
716
|
const noticeRow = (sample, inner) => {
|
|
@@ -583,7 +753,7 @@ const levelColor = (percent) => (percent >= 90 ? HUD.red : percent >= 70 ? HUD.y
|
|
|
583
753
|
|
|
584
754
|
// ╰─ ctx 42% ▰▰▱▱▱ · 5h 31% · 1w 12% · git main ───╯, or a warning first when one is up. The branch goes
|
|
585
755
|
// 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 }) => {
|
|
756
|
+
const bottomEdge = (model, sample, { width, glyphs, accent, edge, look, paint, rainbow }) => {
|
|
587
757
|
const { context, rates, git } = model.figures;
|
|
588
758
|
const warning = model.warnings[0];
|
|
589
759
|
const segments = [];
|
|
@@ -592,9 +762,13 @@ const bottomEdge = (model, sample, { width, glyphs, accent, edge }) => {
|
|
|
592
762
|
segments.push(segment("warning", 0, [span(`${warning.tone === "red" ? glyphs.fail : "⚠"} ${warning.subject}`, { fg: color, bold: true }), span(` ${warning.text}`, { fg: color })], " · "));
|
|
593
763
|
}
|
|
594
764
|
if (context !== null) {
|
|
595
|
-
segments.push(segment("ctx", 1, [span("ctx ", { fg: PALETTE.dim }), span(`${context}%`, { fg: accent })], " · "));
|
|
765
|
+
segments.push(segment("ctx", 1, [span("ctx ", { fg: PALETTE.dim }), span(`${context}%`, { fg: rainbow ? rainbow(0.8) : accent, bold: Boolean(rainbow) })], " · "));
|
|
596
766
|
const filled = Math.max(0, Math.min(5, Math.round(context / 20)));
|
|
597
|
-
|
|
767
|
+
// The rewind look turns every cell of the bar, filled or not, so even 0% shows the colour.
|
|
768
|
+
const cells = rainbow
|
|
769
|
+
? [...Array(5)].map((_, i) => span(i < filled ? "▰" : "▱", { fg: i < filled ? rainbow(i / 5) : lerpColor(rainbow(i / 5), HUD.empty, 0.5) }))
|
|
770
|
+
: [span("▰".repeat(filled), { fg: accent }), span("▱".repeat(5 - filled), { fg: HUD.empty })];
|
|
771
|
+
segments.push(segment("ctxbar", 2, cells, " "));
|
|
598
772
|
}
|
|
599
773
|
rates.forEach((rate, index) => segments.push(segment(`rate-${rate.label}`, 3 + index * 0.5, [span(`${rate.label} `, { fg: PALETTE.dim }), span(`${rate.percent}%`, { fg: levelColor(rate.percent) })], " · ")));
|
|
600
774
|
if (git) segments.push(segment("git", 4, [span(`${glyphs.branch} `, { fg: PALETTE.dim }), span(git, { fg: accent })], " · "));
|
|
@@ -602,7 +776,7 @@ const bottomEdge = (model, sample, { width, glyphs, accent, edge }) => {
|
|
|
602
776
|
let kept = fitJoined(segments, room);
|
|
603
777
|
if (kept[0]?.id === "ctxbar") kept = kept.slice(1);
|
|
604
778
|
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));
|
|
779
|
+
return edgeRow("╰─ ", joinSegments(kept, edge), [], "─╯", width, edge, cometOn(sample, "bottom", width, look), paint[4]);
|
|
606
780
|
};
|
|
607
781
|
|
|
608
782
|
// The border: red or amber under a warning, otherwise the accent. Idle it is a calm, dim accent;
|
|
@@ -616,8 +790,9 @@ const edgeColor = (model, sample, accent) => {
|
|
|
616
790
|
};
|
|
617
791
|
|
|
618
792
|
/**
|
|
619
|
-
* The card for one frame: `{ mode: "card", border, width, rows }`,
|
|
620
|
-
*
|
|
793
|
+
* The card for one frame: `{ mode: "card", border, width, rows }`, five rows (top edge, workflow
|
|
794
|
+
* map or phase track, detail line, chips row, bottom edge), with the thread rows between the detail
|
|
795
|
+
* line and the chips while more than one thread is live, each exactly `width` cells:
|
|
621
796
|
* the terminal's columns up to CARD_MAX. `accent` is the status line's accent colour
|
|
622
797
|
* (settings.mjs accentFromSettings).
|
|
623
798
|
*/
|
|
@@ -626,18 +801,29 @@ export const composeBand = (model, sample, { columns, glyphs: glyphMode = "basic
|
|
|
626
801
|
const width = Math.max(12, Math.min(CARD_MAX, columns));
|
|
627
802
|
const inner = width - 4;
|
|
628
803
|
const edge = edgeColor(model, sample, accent);
|
|
629
|
-
|
|
630
|
-
|
|
804
|
+
// The rewind look's rainbow turns with the ambient hue (still at 0 with motion off). A warning
|
|
805
|
+
// keeps the border its warning colour; the rails stay rainbow.
|
|
806
|
+
const look = model.rewind ? "rewind" : model.idle ? null : lookOf(model.discipline);
|
|
807
|
+
const hue = sample.ambient?.hue ?? 0;
|
|
808
|
+
const rainbow = look === "rewind" ? (position) => rainbowAt(position + hue) : null;
|
|
809
|
+
const painted = rainbow && model.warnings.length === 0;
|
|
810
|
+
const paint = [0, 1, 2, 3, 4].map((r) => (painted ? (col) => rainbow(col / width + r * 0.04) : null));
|
|
811
|
+
const side = (row, r) => (paint[r]
|
|
812
|
+
? [span("│", { fg: paint[r](0) }), span(" "), ...row, span(" "), span("│", { fg: paint[r](width - 1) })]
|
|
813
|
+
: [span("│ ", { fg: edge }), ...row, span(" │", { fg: edge })]);
|
|
814
|
+
const options = { width, inner, glyphs, accent, edge, look, rainbow, paint };
|
|
631
815
|
const middle = sample.completion ? completionRow(sample, inner) : sample.notice ? noticeRow(sample, inner) : chipsRow(model, sample, options);
|
|
632
816
|
return {
|
|
633
817
|
mode: "card",
|
|
634
818
|
border: edge,
|
|
635
819
|
width,
|
|
820
|
+
look,
|
|
636
821
|
rows: [
|
|
637
822
|
topEdge(model, sample, options),
|
|
638
|
-
side(model.workflow ? mapRow(model, sample, options) : phaseRow(model, sample, options)),
|
|
639
|
-
side(detailRow(model, sample, options)),
|
|
640
|
-
side(
|
|
823
|
+
side(model.workflow ? mapRow(model, sample, options) : phaseRow(model, sample, options), 1),
|
|
824
|
+
side(detailRow(model, sample, options), 2),
|
|
825
|
+
...(model.threads ? threadRows(model, sample, options).map((row) => side(row, 2)) : []),
|
|
826
|
+
side(middle, 3),
|
|
641
827
|
bottomEdge(model, sample, options),
|
|
642
828
|
],
|
|
643
829
|
};
|
|
@@ -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",
|