@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
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
// while boulder.json is found the way `lifecycleRootFor` in bin/litclaude-hook.js finds it, walking up
|
|
13
13
|
// from the working directory and across a linked Git worktree to its main checkout.
|
|
14
14
|
|
|
15
|
+
import { parsePlanTaskRows } from "../plan-task-rows.mjs";
|
|
15
16
|
import { parseStageRecord } from "./workflow.mjs";
|
|
16
17
|
|
|
17
18
|
export const STATE_CAPS = Object.freeze({
|
|
@@ -85,7 +86,19 @@ export const resolveStateRoot = async (io, cwd) => {
|
|
|
85
86
|
return normalizePath(cwd);
|
|
86
87
|
};
|
|
87
88
|
|
|
88
|
-
|
|
89
|
+
// The main checkout's run reaches a linked worktree only when the run's worktree covers cwd or the
|
|
90
|
+
// session is one of the run's; a sibling worktree reads its own state (the hook's rule, mirrored).
|
|
91
|
+
const governsLinkedCwd = async (io, mainRoot, cwd, sessionId) => {
|
|
92
|
+
const state = await readGuardedJson(io, mainRoot, joinPath(".litclaude", "boulder.json"), STATE_CAPS.boulder);
|
|
93
|
+
const work = state?.active_work_id ? state.works?.[state.active_work_id] : null;
|
|
94
|
+
if (!work || !["active", "paused"].includes(work.status)) return true;
|
|
95
|
+
if (typeof sessionId === "string" && Array.isArray(work.session_ids) && work.session_ids.includes(sessionId)) return true;
|
|
96
|
+
const scope = splitPath(normalizePath(String(work.effective_worktree_root ?? work.worktree_path ?? mainRoot)).normalize("NFC"));
|
|
97
|
+
const here = splitPath(normalizePath((await statOf(io, cwd))?.realPath ?? cwd).normalize("NFC"));
|
|
98
|
+
return scope.every((part, index) => here[index] === part);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const resolveLifecycleRoot = async (io, cwd, stateRoot, sessionId = null) => {
|
|
89
102
|
for (const directory of ancestors(cwd)) {
|
|
90
103
|
if (await statOf(io, joinPath(directory, ".litclaude", "boulder.json"))) return directory;
|
|
91
104
|
const marker = joinPath(directory, ".git");
|
|
@@ -102,7 +115,7 @@ export const resolveLifecycleRoot = async (io, cwd, stateRoot) => {
|
|
|
102
115
|
const worktreesDir = parentOf(resolvePath(directory, match[1]));
|
|
103
116
|
if (splitPath(worktreesDir).at(-1) === "worktrees") {
|
|
104
117
|
const mainRoot = parentOf(parentOf(worktreesDir));
|
|
105
|
-
if (await statOf(io, joinPath(mainRoot, ".litclaude", "boulder.json"))) return mainRoot;
|
|
118
|
+
if (await statOf(io, joinPath(mainRoot, ".litclaude", "boulder.json")) && await governsLinkedCwd(io, mainRoot, cwd, sessionId)) return mainRoot;
|
|
106
119
|
}
|
|
107
120
|
}
|
|
108
121
|
}
|
|
@@ -336,14 +349,85 @@ export const summarizeResearchFiles = (entries, slug) => {
|
|
|
336
349
|
};
|
|
337
350
|
};
|
|
338
351
|
|
|
352
|
+
const FRAME_SKILL = /^[a-z][a-z0-9-]{0,40}$/u;
|
|
353
|
+
// The plan a frame works from, as lib/workflow-stack.mjs keeps it: a project-relative `plans/<name>.md`.
|
|
354
|
+
const FRAME_PLAN = /^plans\/[A-Za-z0-9_-][A-Za-z0-9._-]*\.md$/u;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* The session's workflow stack (lib/workflow-stack.mjs) as the card trusts it: at most three frames,
|
|
358
|
+
* each with its skill, role, status and stage record, and the frame whose map the card draws, which
|
|
359
|
+
* is the nearest paused spine while a side frame is on top and the top frame otherwise. The owner's
|
|
360
|
+
* record carries the top frame's time, so a side frame keeps the paused map fresh.
|
|
361
|
+
*/
|
|
362
|
+
export const parseWorkflowStack = (stack, sessionId) => {
|
|
363
|
+
if (!stack || typeof stack !== "object" || !Array.isArray(stack.frames) || !stack.frames.length || stack.frames.length > 3) return null;
|
|
364
|
+
const frames = stack.frames.map((frame) => ({
|
|
365
|
+
skill: typeof frame?.skill === "string" && FRAME_SKILL.test(frame.skill) ? frame.skill : null,
|
|
366
|
+
role: frame?.role === "side" ? "side" : "spine",
|
|
367
|
+
status: frame?.status === "paused" ? "paused" : "active",
|
|
368
|
+
record: parseStageRecord({ ...frame, sessionId: undefined }, sessionId),
|
|
369
|
+
at: typeof frame?.at === "string" ? Date.parse(frame.at) : Number.NaN,
|
|
370
|
+
planRef: typeof frame?.ref?.plan === "string" && FRAME_PLAN.test(frame.ref.plan) && !frame.ref.plan.includes("..") ? frame.ref.plan : null,
|
|
371
|
+
plan: null,
|
|
372
|
+
}));
|
|
373
|
+
const top = frames.at(-1);
|
|
374
|
+
const owner = top.role === "side" ? frames.findLast(({ role }) => role === "spine") ?? top : top;
|
|
375
|
+
const record = owner.record && Number.isFinite(top.at) ? { ...owner.record, at: Math.max(owner.record.at, top.at), stacked: true } : null;
|
|
376
|
+
return { frames, owner: frames.indexOf(owner), record };
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
/** A plan's `{ done, total }` by the start-work checkbox grammar, or null when it has no task rows. */
|
|
380
|
+
export const countPlanTasks = (text) => {
|
|
381
|
+
const rows = parsePlanTaskRows(String(text ?? ""));
|
|
382
|
+
return rows.length ? { done: rows.filter(({ checked }) => checked).length, total: rows.length } : null;
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
// Each frame that names a plan gets that plan's checkbox counts, read once per plan under the cap.
|
|
386
|
+
const withPlanCounts = async (io, stateRoot, frames) => {
|
|
387
|
+
const refs = [...new Set(frames.map(({ planRef }) => planRef).filter(Boolean))];
|
|
388
|
+
const counts = new Map(await Promise.all(refs.map(async (ref) => [ref, countPlanTasks(await readGuarded(io, stateRoot, ref, STATE_CAPS.goals))])));
|
|
389
|
+
for (const frame of frames) frame.plan = frame.planRef ? counts.get(frame.planRef) ?? null : null;
|
|
390
|
+
return frames;
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
const OTHER_STACKS = 6;
|
|
394
|
+
|
|
395
|
+
// The stacks other sessions of this project keep beside this one's, newest first and at most
|
|
396
|
+
// OTHER_STACKS: `{ id8, at, frames }` each, `at` being the file's mtime. Links, this session's own
|
|
397
|
+
// file and the unknown-session file are skipped; whether one is still live is the view's call.
|
|
398
|
+
const readOtherStacks = async (io, stateRoot, sessionId) => {
|
|
399
|
+
const own = new Set([ignitionFileName(sessionId), ignitionFileName(null)]);
|
|
400
|
+
const files = (await listOf(io, joinPath(stateRoot, ".litclaude", "workflow-stack")))
|
|
401
|
+
.filter((entry) => entry?.kind === "file" && !entry.isLink && /^[A-Za-z0-9._-]+\.json$/u.test(entry.name) && !own.has(entry.name))
|
|
402
|
+
.sort((a, b) => b.mtimeMs - a.mtimeMs)
|
|
403
|
+
.slice(0, OTHER_STACKS);
|
|
404
|
+
const read = await Promise.all(files.map(async (entry) => {
|
|
405
|
+
const raw = await readGuardedJson(io, stateRoot, joinPath(".litclaude", "workflow-stack", entry.name), STATE_CAPS.small);
|
|
406
|
+
const id = typeof raw?.sessionId === "string" ? raw.sessionId : null;
|
|
407
|
+
const parsed = id ? parseWorkflowStack(raw, id) : null;
|
|
408
|
+
if (parsed) await withPlanCounts(io, stateRoot, parsed.frames.slice(-1));
|
|
409
|
+
return parsed ? { id8: id.replace(/[^A-Za-z0-9]/gu, "").slice(0, 8), at: entry.mtimeMs, frames: parsed.frames } : null;
|
|
410
|
+
}));
|
|
411
|
+
return read.filter(Boolean);
|
|
412
|
+
};
|
|
413
|
+
|
|
339
414
|
const readWorkflowSources = async (io, stateRoot, sessionId) => {
|
|
340
415
|
const dir = (name) => joinPath(stateRoot, ".litclaude", name);
|
|
341
|
-
const [interviews, drafts, researches,
|
|
416
|
+
const [interviews, drafts, researches, ownStack, unknownStack] = await Promise.all([
|
|
342
417
|
listOf(io, dir("deep-interview")),
|
|
343
418
|
listOf(io, dir("drafts")),
|
|
344
419
|
listOf(io, dir("litresearch")),
|
|
345
|
-
readGuardedJson(io, stateRoot, ".litclaude
|
|
420
|
+
readGuardedJson(io, stateRoot, joinPath(".litclaude", "workflow-stack", ignitionFileName(sessionId)), STATE_CAPS.small),
|
|
421
|
+
readGuardedJson(io, stateRoot, joinPath(".litclaude", "workflow-stack", ignitionFileName(null)), STATE_CAPS.small),
|
|
346
422
|
]);
|
|
423
|
+
const stack = parseWorkflowStack(ownStack, sessionId) ?? parseWorkflowStack(unknownStack, sessionId);
|
|
424
|
+
if (stack) {
|
|
425
|
+
await withPlanCounts(io, stateRoot, stack.frames);
|
|
426
|
+
if (stack.record) stack.record.plan = stack.frames[stack.owner].plan;
|
|
427
|
+
}
|
|
428
|
+
const others = await readOtherStacks(io, stateRoot, sessionId);
|
|
429
|
+
// A record written before the stack existed, read only while this session has no stack.
|
|
430
|
+
const legacy = stack ? null : await readGuardedJson(io, stateRoot, ".litclaude/workflow-stage.json", STATE_CAPS.small);
|
|
347
431
|
const interviewFile = newestFile(interviews, /^[A-Za-z0-9._-]+-state\.json$/u);
|
|
348
432
|
const draftFile = newestFile(drafts, /^[A-Za-z0-9._-]+\.md$/u);
|
|
349
433
|
let research = null;
|
|
@@ -358,7 +442,9 @@ const readWorkflowSources = async (io, stateRoot, sessionId) => {
|
|
|
358
442
|
draftFile ? readGuarded(io, stateRoot, `.litclaude/drafts/${draftFile.name}`, STATE_CAPS.goals) : null,
|
|
359
443
|
]);
|
|
360
444
|
return {
|
|
361
|
-
record: parseStageRecord(
|
|
445
|
+
record: stack?.record ?? parseStageRecord(legacy, sessionId),
|
|
446
|
+
stack,
|
|
447
|
+
others,
|
|
362
448
|
interview: interview ? parseInterviewState(interview, interviewFile.mtimeMs) : null,
|
|
363
449
|
draft: draft === null ? null : parseDraftStatus(draft, draftFile.name.replace(/\.md$/u, ""), draftFile.mtimeMs),
|
|
364
450
|
research,
|
|
@@ -367,7 +453,7 @@ const readWorkflowSources = async (io, stateRoot, sessionId) => {
|
|
|
367
453
|
|
|
368
454
|
export const readLitSnapshot = async (io, { cwd, sessionId, env = {} }) => {
|
|
369
455
|
const stateRoot = await resolveStateRoot(io, cwd);
|
|
370
|
-
const lifecycleRoot = await resolveLifecycleRoot(io, cwd, stateRoot);
|
|
456
|
+
const lifecycleRoot = await resolveLifecycleRoot(io, cwd, stateRoot, sessionId);
|
|
371
457
|
const state = (relative, cap = STATE_CAPS.small) => readGuardedJson(io, stateRoot, joinPath(".litclaude", relative), cap);
|
|
372
458
|
const handoffId = handoffSessionId(sessionId);
|
|
373
459
|
const [ignition, boulder, goals, autoloop, litPlan, probe, motion, handoffSettings, handoffSession] = await Promise.all([
|
|
@@ -475,6 +561,13 @@ export const detectIconFont = async (io, env) => {
|
|
|
475
561
|
|
|
476
562
|
// The litgoal ledger's newest entries for the evidence pane, newest first. Lines that are not JSON
|
|
477
563
|
// objects are skipped; the file is read only under its cap.
|
|
564
|
+
// A workflow stack event's place: `lit-loop RED 1/4`.
|
|
565
|
+
const stackDetail = (entry) => {
|
|
566
|
+
if (!String(entry.event ?? "").startsWith("workflow.") || typeof entry.skill !== "string") return null;
|
|
567
|
+
const count = Number.isInteger(entry.n) && Number.isInteger(entry.total) ? ` ${entry.n}/${entry.total}` : "";
|
|
568
|
+
return `${entry.skill}${typeof entry.stage === "string" ? ` ${entry.stage}${count}` : ""}`;
|
|
569
|
+
};
|
|
570
|
+
|
|
478
571
|
export const readLedgerTail = async (io, stateRoot, limit = 8) => {
|
|
479
572
|
const text = await readGuarded(io, stateRoot, ".litclaude/litgoal/ledger.jsonl", STATE_CAPS.ledger);
|
|
480
573
|
if (text === null) return [];
|
|
@@ -488,7 +581,7 @@ export const readLedgerTail = async (io, stateRoot, limit = 8) => {
|
|
|
488
581
|
entries.push({
|
|
489
582
|
event: str(entry.event, 60) ?? "event",
|
|
490
583
|
at: time(entry.timestamp),
|
|
491
|
-
detail: str(entry.criterionId ?? entry.note ?? entry.objective ?? entry.status, 120) ?? "",
|
|
584
|
+
detail: str(entry.criterionId ?? entry.note ?? entry.objective ?? stackDetail(entry) ?? entry.status, 120) ?? "",
|
|
492
585
|
status: str(entry.status, 40),
|
|
493
586
|
});
|
|
494
587
|
} catch {
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
// terminal card's text border and its padded pills come apart there. Those surfaces carry an `Svg`
|
|
4
4
|
// element instead, and this module draws the same card into it: the brand pill, the discipline and
|
|
5
5
|
// the stage indicator on top, the workflow map (or the phase track and progress when no family
|
|
6
|
-
// places the session), the detail line with the live step, the
|
|
7
|
-
//
|
|
6
|
+
// places the session), the detail line with the live step, the thread rows while more than one
|
|
7
|
+
// thread is live (the terminal card's rows, drawn the same way), the skill chips (or the notice or
|
|
8
|
+
// the finish), and the live figures at the bottom.
|
|
8
9
|
//
|
|
9
10
|
// It draws the settled state of the model; the terminal's entrances and crossfades stay terminal
|
|
10
11
|
// only. While LitClaude works and motion allows, SMIL animation in the drawing keeps it moving: the
|
|
@@ -19,8 +20,9 @@
|
|
|
19
20
|
// Text is set in a monospace face and placed by counted cells (Hangul and emoji as two), so the
|
|
20
21
|
// layout does not depend on measuring a font the drawing cannot see.
|
|
21
22
|
|
|
23
|
+
import { gauge, knownFacts } from "../rewind/gauge.mjs";
|
|
22
24
|
import { textWidth, truncateToWidth } from "./layout.mjs";
|
|
23
|
-
import { TIMINGS, barCells, gradientAt } from "./motion.mjs";
|
|
25
|
+
import { TIMINGS, barCells, gradientAt, lookOf, rainbowAt } from "./motion.mjs";
|
|
24
26
|
|
|
25
27
|
const C = Object.freeze({
|
|
26
28
|
bg: "#0d1117",
|
|
@@ -48,6 +50,8 @@ const PHASES = Object.freeze(["plan", "work", "review"]);
|
|
|
48
50
|
// Drawing units: CSS pixels at the card's natural size; the surface draws it at that width, up to its slot.
|
|
49
51
|
export const SVG_CARD = Object.freeze({ width: 880, height: 160, font: 13, cell: 7.8, pad: 18 });
|
|
50
52
|
const ROW_Y = Object.freeze([28, 58, 86, 114, 142]);
|
|
53
|
+
// Each reserved thread row adds this much height, between the detail line and the chips.
|
|
54
|
+
export const THREAD_ROW_H = 22;
|
|
51
55
|
const PILL_H = 20;
|
|
52
56
|
const FONT = "ui-monospace, 'SF Mono', SFMono-Regular, Menlo, 'JetBrains Mono', Consolas, monospace";
|
|
53
57
|
|
|
@@ -84,10 +88,12 @@ const run = (x, y, pieces) => {
|
|
|
84
88
|
};
|
|
85
89
|
|
|
86
90
|
// A filled pill holding `label`, its left edge at `x`. `sweep` lays the moving light over it.
|
|
87
|
-
|
|
91
|
+
// `veil` lays white over a rainbow fill so the dark ink keeps its contrast on every hue.
|
|
92
|
+
const pill = (x, y, label, { fill, ink, bold = true, sweep = false, breath = null, breathPeak = 0.85, veil = false }) => {
|
|
88
93
|
const w = widthOf(label) + 16;
|
|
89
94
|
const top = y - PILL_H + 6;
|
|
90
95
|
const parts = [`<rect x="${x.toFixed(1)}" y="${top}" width="${w.toFixed(1)}" height="${PILL_H}" rx="${PILL_H / 2}" fill="${fill}"/>`];
|
|
96
|
+
if (veil) parts.push(`<rect x="${x.toFixed(1)}" y="${top}" width="${w.toFixed(1)}" height="${PILL_H}" rx="${PILL_H / 2}" fill="#ffffff" opacity="0.3"/>`);
|
|
91
97
|
if (breath) parts.push(`<rect x="${x.toFixed(1)}" y="${top}" width="${w.toFixed(1)}" height="${PILL_H}" rx="${PILL_H / 2}" fill="${breath}" opacity="0"><animate attributeName="opacity" values="0;${breathPeak};0" ${loop(TIMINGS.breath, BREATH_PHASE)}/></rect>`);
|
|
92
98
|
if (sweep) parts.push(`<rect x="${x.toFixed(1)}" y="${top}" width="${w.toFixed(1)}" height="${PILL_H}" rx="${PILL_H / 2}" fill="url(#lit-sweep)"/>`);
|
|
93
99
|
parts.push(text(x + 8, y, label, { fill: ink, bold }));
|
|
@@ -98,6 +104,7 @@ const indicatorOf = (model, accent) => {
|
|
|
98
104
|
if (model.completion) return { label: "DONE ✓", fill: C.green };
|
|
99
105
|
if (model.idle) return { label: "idle", fill: C.dim, plain: true };
|
|
100
106
|
const flow = model.workflow;
|
|
107
|
+
if (flow?.paused && flow.current >= 0) return { label: `${flow.stages[flow.current].id.toUpperCase()} ||`, fill: C.dim };
|
|
101
108
|
if (flow && flow.current >= 0) return { label: `${flow.stages[flow.current].id.toUpperCase()} ●`, fill: model.ctxWarning ? C.amber : accent };
|
|
102
109
|
if (flow && model.lanes.count === 0) return { label: "DONE ✓", fill: C.green };
|
|
103
110
|
const current = PHASES.find((id) => model.phases[id] === "now");
|
|
@@ -106,15 +113,18 @@ const indicatorOf = (model, accent) => {
|
|
|
106
113
|
return { label: "LIVE ●", fill: accent };
|
|
107
114
|
};
|
|
108
115
|
|
|
109
|
-
|
|
116
|
+
// The rewind look draws the LIT pill and a `REWIND <<` indicator in the turning rainbow.
|
|
117
|
+
const topRow = (model, accent, animate, rewind = false) => {
|
|
110
118
|
const { width, pad } = SVG_CARD;
|
|
111
119
|
const y = ROW_Y[0];
|
|
112
|
-
const brand =
|
|
113
|
-
|
|
120
|
+
const brand = rewind
|
|
121
|
+
? pill(pad, y, "🔥 LIT", { fill: "url(#lit-rainbow)", ink: C.ink, veil: true })
|
|
122
|
+
: pill(pad, y, "🔥 LIT", { fill: C.pink, ink: C.ink, breath: animate.breath ? C.orange : null });
|
|
123
|
+
const indicator = rewind && !model.completion ? { label: "REWIND <<", fill: "url(#lit-rainbow)" } : indicatorOf(model, accent);
|
|
114
124
|
const right = text(width - pad, y, indicator.label, { fill: indicator.fill, bold: !indicator.plain, anchor: "end" });
|
|
115
125
|
const room = width - pad - widthOf(indicator.label) - 16 - brand.end - widthOf(" · ");
|
|
116
126
|
const name = truncateToWidth(model.title ?? "ready", Math.max(4, Math.floor(room / SVG_CARD.cell)));
|
|
117
|
-
const title = run(brand.end + 4, y, [[" · ", { fill: C.dim }], [name, model.idle ? { fill: C.dim } : { fill: accent, bold: true }]]);
|
|
127
|
+
const title = run(brand.end + 4, y, [[" · ", { fill: C.dim }], [name, model.idle && !rewind ? { fill: C.dim } : { fill: accent, bold: true }]]);
|
|
118
128
|
return brand.markup + title.markup + right;
|
|
119
129
|
};
|
|
120
130
|
|
|
@@ -206,14 +216,19 @@ const mapRowSvg = (model, accent, animate) => {
|
|
|
206
216
|
out.push(`<line x1="${x1.toFixed(1)}" y1="${y - 4}" x2="${x2.toFixed(1)}" y2="${y - 4}" stroke="${C.rail}" stroke-width="2.5" stroke-linecap="round"/>`);
|
|
207
217
|
const filled = count && count.total > 0 ? Math.min(1, count.done / count.total) : 0;
|
|
208
218
|
if (filled > 0) out.push(`<line x1="${x1.toFixed(1)}" y1="${y - 4}" x2="${(x1 + filled * layout.rail).toFixed(1)}" y2="${y - 4}" stroke="${mapColor(accent, mid)}" stroke-width="2.5" stroke-linecap="round"/>`);
|
|
209
|
-
if (animate.sweep) out.push(`<circle cx="${x1.toFixed(1)}" cy="${y - 4}" r="2.5" fill="#ffffff"><animate attributeName="cx" values="${x1.toFixed(1)};${x2.toFixed(1)}" ${loop(TIMINGS.flow, 0.5)}/></circle>`);
|
|
219
|
+
if (animate.sweep && !model.workflow.paused) out.push(`<circle cx="${x1.toFixed(1)}" cy="${y - 4}" r="2.5" fill="#ffffff"><animate attributeName="cx" values="${x1.toFixed(1)};${x2.toFixed(1)}" ${loop(TIMINGS.flow, 0.5)}/></circle>`);
|
|
210
220
|
} else {
|
|
211
221
|
out.push(`<line x1="${x1.toFixed(1)}" y1="${y - 4}" x2="${x2.toFixed(1)}" y2="${y - 4}" stroke="${C.rail}" stroke-width="1.5" stroke-linecap="round" stroke-opacity="0.7"/>`);
|
|
212
222
|
}
|
|
213
223
|
x = x2 + 6;
|
|
214
224
|
}
|
|
215
225
|
const label = labelOf(stage, layout.short);
|
|
216
|
-
if (stage.state === "now") {
|
|
226
|
+
if (stage.state === "now" && model.workflow.paused) {
|
|
227
|
+
// A paused stage holds still, as on the terminal card.
|
|
228
|
+
const drawn = pill(x, y, label, { fill: C.muted, ink: C.mutedText });
|
|
229
|
+
out.push(drawn.markup);
|
|
230
|
+
x = drawn.end;
|
|
231
|
+
} else if (stage.state === "now") {
|
|
217
232
|
const fill = model.idle ? C.muted : model.ctxWarning ? C.amber : accent;
|
|
218
233
|
const drawn = pill(x, y, label, { fill, ink: model.idle ? C.mutedText : C.ink, sweep: animate.sweep, breath: animate.breath ? "#ffffff" : null, breathPeak: 0.2 });
|
|
219
234
|
out.push(drawn.markup);
|
|
@@ -288,9 +303,9 @@ const detailRowSvg = (model, accent, animate) => {
|
|
|
288
303
|
const TONES = Object.freeze({ pink: [C.pink, "#ff6fae", "🔥"], amber: [C.amber, C.amber, "⚠"], red: [C.red, C.red, "✗"] });
|
|
289
304
|
|
|
290
305
|
// Skill chips, or the notice or the finish while one is up, or the hint while nothing has fired.
|
|
291
|
-
const middleRow = (model, accent, animate) => {
|
|
306
|
+
const middleRow = (model, accent, animate, shift = 0, rewind = false) => {
|
|
292
307
|
const { width, pad } = SVG_CARD;
|
|
293
|
-
const y = ROW_Y[3];
|
|
308
|
+
const y = ROW_Y[3] + shift;
|
|
294
309
|
const room = width - pad;
|
|
295
310
|
if (model.completion) {
|
|
296
311
|
return run(pad, y, [["✦ ", { fill: C.pink }], ["COMPLETE", { fill: C.white, bold: true }], [` · ${model.completion.detail ?? ""}`, { fill: C.green }]]).markup;
|
|
@@ -318,17 +333,37 @@ const middleRow = (model, accent, animate) => {
|
|
|
318
333
|
x = null;
|
|
319
334
|
return;
|
|
320
335
|
}
|
|
321
|
-
const
|
|
336
|
+
const tinted = rewind && lookOf(chip.id) === "rewind";
|
|
337
|
+
const drawn = tinted
|
|
338
|
+
? pill(x, y, label, { fill: "url(#lit-rainbow)", ink: C.ink, veil: true, sweep: animate.sweep })
|
|
339
|
+
: pill(x, y, label, { fill: current ? accent : C.muted, ink: current ? C.ink : C.mutedText, bold: current, sweep: current && animate.sweep });
|
|
322
340
|
out.push(drawn.markup);
|
|
323
341
|
x = drawn.end + 8;
|
|
324
342
|
});
|
|
343
|
+
if (rewind && animate.sweep && x !== null) out.push(sparksSvg(x, width - pad, y));
|
|
344
|
+
if (model.away && x !== null && x + widthOf("back? type lit adhd to catch up") <= room) out.push(run(x, y, [["back? type ", { fill: C.dim }], ["lit adhd", { fill: accent }], [" to catch up", { fill: C.dim }]]).markup);
|
|
325
345
|
return out.join("");
|
|
326
346
|
};
|
|
327
347
|
|
|
348
|
+
// The rewind look's sparks: ASCII stars drifting right to left through the room the chips leave,
|
|
349
|
+
// each fading in and out on its own slow loop (no faster than TIMINGS.sparks / 4 per twinkle).
|
|
350
|
+
const SPARK_SEEDS = Object.freeze([[0.08, 1.0, "*"], [0.22, 1.3, "+"], [0.37, 0.8, "."], [0.51, 1.1, "*"], [0.66, 0.9, "'"], [0.79, 1.4, "+"], [0.93, 0.7, "*"]]);
|
|
351
|
+
const sparksSvg = (from, to, y) => {
|
|
352
|
+
const span = to - from;
|
|
353
|
+
if (span < 60) return "";
|
|
354
|
+
return SPARK_SEEDS.map(([start, speed, glyph], i) => {
|
|
355
|
+
const x = from + start * span;
|
|
356
|
+
const dur = Math.round(TIMINGS.sparks / speed);
|
|
357
|
+
return `<text class="lit-spark" x="${x.toFixed(1)}" y="${y}" fill="${rainbowAt(start)}" opacity="0.8">${esc(glyph)}`
|
|
358
|
+
+ `<animateTransform attributeName="transform" type="translate" values="0 0;${(-start * span).toFixed(1)} 0" ${loop(dur, 0)}/>`
|
|
359
|
+
+ `<animate attributeName="opacity" values="0.3;0.9;0.3" ${loop(Math.round(TIMINGS.sparks / 2), i / SPARK_SEEDS.length)}/></text>`;
|
|
360
|
+
}).join("");
|
|
361
|
+
};
|
|
362
|
+
|
|
328
363
|
// ctx 42% ▰▰▱▱▱ · 5h 31% · 1w 12% · git main, after a warning when one is up.
|
|
329
|
-
const bottomRow = (model, accent) => {
|
|
364
|
+
const bottomRow = (model, accent, shift = 0) => {
|
|
330
365
|
const { width, pad } = SVG_CARD;
|
|
331
|
-
const y = ROW_Y[4];
|
|
366
|
+
const y = ROW_Y[4] + shift;
|
|
332
367
|
const groups = [];
|
|
333
368
|
const warning = model.warnings[0];
|
|
334
369
|
if (warning) {
|
|
@@ -360,15 +395,115 @@ const bottomRow = (model, accent) => {
|
|
|
360
395
|
return out.join("");
|
|
361
396
|
};
|
|
362
397
|
|
|
398
|
+
const THREAD_FILL = Object.freeze({ running: ["●", C.green], paused: ["|", C.dim], blocked: ["!", C.amber], idle: ["-", C.dim], done: ["✓", C.green] });
|
|
399
|
+
const TASK_MARK = Object.freeze({ shell: "$", monitor: "~" });
|
|
400
|
+
const plural = (count, word) => `${count} ${word}${count === 1 ? "" : "s"}`;
|
|
401
|
+
|
|
402
|
+
// What a thread with no total says instead of a gauge. Each new drawing restarts the card's
|
|
403
|
+
// animations, so the drawing leaves out the last step (it changes on every tool call) and counts
|
|
404
|
+
// steps by tens past ten.
|
|
405
|
+
const threadFacts = ({ steps, elapsedMs, state }) => knownFacts({ steps: Number.isInteger(steps) && steps >= 10 ? Math.floor(steps / 10) * 10 : steps, elapsedMs, state })
|
|
406
|
+
.replace(/^(\d+0) steps/u, (all, n) => (steps >= 10 ? `${n}+ steps` : all));
|
|
407
|
+
const PULSE = "━━━━━";
|
|
408
|
+
// The indeterminate pulse over a thread with no total: a light that slides along its track, or a
|
|
409
|
+
// still track with motion off.
|
|
410
|
+
const pulseSvg = (x, y, animate, fill) => {
|
|
411
|
+
const w = widthOf(PULSE);
|
|
412
|
+
if (!animate) return "";
|
|
413
|
+
return `<rect x="${x.toFixed(1)}" y="${y - 8}" width="${(w / 3).toFixed(1)}" height="4" rx="2" fill="${fill}" opacity="0.9"><animate attributeName="x" values="${x.toFixed(1)};${(x + (w * 2) / 3).toFixed(1)};${x.toFixed(1)}" ${loop(TIMINGS.flow * 2, 0.25)}/></rect>`;
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* The thread rows (view.mjs threadsOf), as the terminal card lays them out (frame.mjs threadRows):
|
|
418
|
+
* the stack parent first with each child under it, lanes and background tasks under a fork line
|
|
419
|
+
* when two or more run, other sessions last, `+N more` on the last row. Returns the markup.
|
|
420
|
+
*/
|
|
421
|
+
const threadRowsSvg = (model, { animate = false, rewind = false } = {}) => {
|
|
422
|
+
const { width, pad } = SVG_CARD;
|
|
423
|
+
const { chain, lanes, others, laneCount = 0, taskCount = 0, more } = model.threads;
|
|
424
|
+
const lines = [];
|
|
425
|
+
chain.forEach((thread, index) => lines.push({ thread, lead: index === 0 ? "" : `${" ".repeat(index - 1)}└─ ` }));
|
|
426
|
+
const under = " ".repeat(Math.max(0, chain.length - 1));
|
|
427
|
+
if (laneCount + taskCount >= 2) {
|
|
428
|
+
const label = [laneCount ? plural(laneCount, "lane") : null, taskCount ? plural(taskCount, "task") : null].filter(Boolean).join(" · ");
|
|
429
|
+
lines.push({ fork: `${under}┬ ${label} in parallel` });
|
|
430
|
+
lanes.forEach((thread, index) => lines.push({ thread, lead: `${under}${index === lanes.length - 1 ? "└─" : "├─"} ` }));
|
|
431
|
+
} else {
|
|
432
|
+
lanes.forEach((thread) => lines.push({ thread, lead: chain.length ? `${under}└─ ` : "" }));
|
|
433
|
+
}
|
|
434
|
+
others.forEach((thread) => lines.push({ thread, lead: "" }));
|
|
435
|
+
const threads = lines.filter(({ thread }) => thread).map(({ thread }) => thread);
|
|
436
|
+
const nameCells = Math.min(28, Math.max(...threads.map(({ name }) => textWidth(name))));
|
|
437
|
+
const stageCells = Math.min(10, Math.max(0, ...threads.map(({ stage }) => (stage ? textWidth(stage) : 0))));
|
|
438
|
+
const out = [];
|
|
439
|
+
lines.forEach((line, index) => {
|
|
440
|
+
const y = ROW_Y[2] + THREAD_ROW_H * (index + 1);
|
|
441
|
+
const tail = index === lines.length - 1 && more > 0 ? `+${more} more` : null;
|
|
442
|
+
if (tail) out.push(text(width - pad, y, tail, { fill: C.dim, anchor: "end" }));
|
|
443
|
+
const room = Math.floor((width - pad * 2 - (tail ? widthOf(tail) + 16 : 0)) / SVG_CARD.cell);
|
|
444
|
+
if (line.fork) {
|
|
445
|
+
out.push(text(pad, y, truncateToWidth(line.fork, room), { fill: C.dim }));
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
const { thread } = line;
|
|
449
|
+
const [stateMark, color] = THREAD_FILL[thread.state] ?? THREAD_FILL.running;
|
|
450
|
+
const mark = thread.task ? TASK_MARK[thread.task] ?? "$" : stateMark;
|
|
451
|
+
const name = truncateToWidth(thread.name, nameCells);
|
|
452
|
+
const drawn = gauge(thread.done, thread.total);
|
|
453
|
+
const facts = drawn ? null : threadFacts(thread);
|
|
454
|
+
const progress = drawn
|
|
455
|
+
? [[` ${drawn}`, { fill: C.white }], [` ${thread.state}`, { fill: color }]]
|
|
456
|
+
: [[" ", {}], [PULSE, { fill: rewind ? "url(#lit-rainbow)" : C.rail, pulse: true }], [" ", {}],
|
|
457
|
+
...(facts.startsWith(thread.state) ? [[facts, { fill: color }]] : [[thread.state, { fill: color }], [` · ${facts}`, { fill: C.dim }]])];
|
|
458
|
+
const pieces = [
|
|
459
|
+
[line.lead, { fill: C.dim }],
|
|
460
|
+
[`${mark} `, { fill: color, bold: true }],
|
|
461
|
+
[name + " ".repeat(Math.max(0, nameCells - textWidth(name))), { fill: C.white, bold: thread.active }],
|
|
462
|
+
...(stageCells ? [[` ${truncateToWidth(thread.stage ?? "", stageCells).padEnd(stageCells)}`, { fill: C.dim }]] : []),
|
|
463
|
+
...progress,
|
|
464
|
+
...(thread.session ? [[` · other session ${thread.session}`, { fill: C.dim }]] : []),
|
|
465
|
+
];
|
|
466
|
+
// Pieces past the room are cut from the right, as the terminal card clips its rows.
|
|
467
|
+
let used = 0;
|
|
468
|
+
const kept = [];
|
|
469
|
+
for (const [body, style] of pieces) {
|
|
470
|
+
const cells = textWidth(body);
|
|
471
|
+
if (used + cells > room) {
|
|
472
|
+
if (room - used > 1) kept.push([truncateToWidth(body, room - used), style]);
|
|
473
|
+
break;
|
|
474
|
+
}
|
|
475
|
+
kept.push([body, style]);
|
|
476
|
+
used += cells;
|
|
477
|
+
}
|
|
478
|
+
out.push(run(pad, y, kept).markup);
|
|
479
|
+
const before = kept.findIndex(([, style]) => style.pulse);
|
|
480
|
+
if (before >= 0) out.push(pulseSvg(pad + kept.slice(0, before).reduce((sum, [body]) => sum + widthOf(body), 0), y, animate, rewind ? "#ffffff" : C.white));
|
|
481
|
+
});
|
|
482
|
+
return out.join("");
|
|
483
|
+
};
|
|
484
|
+
|
|
363
485
|
const borderColor = (model, accent) => {
|
|
364
486
|
if (model.warnings.some(({ tone }) => tone === "red")) return C.red;
|
|
365
487
|
if (model.warnings.length) return C.amber;
|
|
366
488
|
return model.idle ? C.faint : accent;
|
|
367
489
|
};
|
|
368
490
|
|
|
491
|
+
// The rewind look's border (plans/lit-adhd.md D7): a rainbow gradient whose stops each walk the hue
|
|
492
|
+
// wheel over TIMINGS.hue while the card moves, so the colours cycle; with motion off it stands still.
|
|
493
|
+
const RAINBOW_STOPS = 6;
|
|
494
|
+
const rainbowDefs = (animate) => {
|
|
495
|
+
const stops = Array.from({ length: RAINBOW_STOPS + 1 }, (_, i) => {
|
|
496
|
+
const color = rainbowAt(i / RAINBOW_STOPS);
|
|
497
|
+
if (!animate) return `<stop offset="${(i / RAINBOW_STOPS).toFixed(3)}" stop-color="${color}"/>`;
|
|
498
|
+
const values = Array.from({ length: RAINBOW_STOPS + 1 }, (_, j) => rainbowAt((i + j) / RAINBOW_STOPS)).join(";");
|
|
499
|
+
return `<stop offset="${(i / RAINBOW_STOPS).toFixed(3)}" stop-color="${color}"><animate attributeName="stop-color" values="${values}" ${loop(TIMINGS.hue, 0.5)}/></stop>`;
|
|
500
|
+
});
|
|
501
|
+
return `<defs><linearGradient id="lit-rainbow" x1="0" x2="1" y1="0" y2="1">${stops.join("")}</linearGradient></defs>`;
|
|
502
|
+
};
|
|
503
|
+
|
|
369
504
|
/** What the card says, for a reader that cannot see the drawing. */
|
|
370
505
|
export const svgCardAlt = (model) => {
|
|
371
|
-
const parts = [`LIT ${model.idle ? "idle" : "working"}`];
|
|
506
|
+
const parts = [`LIT ${model.rewind ? "rewind" : model.idle ? "idle" : "working"}`];
|
|
372
507
|
if (model.title) parts.push(model.title);
|
|
373
508
|
const flow = model.workflow;
|
|
374
509
|
const current = PHASES.find((id) => model.phases[id] === "now");
|
|
@@ -380,6 +515,8 @@ export const svgCardAlt = (model) => {
|
|
|
380
515
|
parts.push(`phase ${LABELS[current]}`);
|
|
381
516
|
}
|
|
382
517
|
if (model.step) parts.push(`running ${model.step.name}`);
|
|
518
|
+
const threads = model.threads ? [...model.threads.chain, ...model.threads.lanes, ...model.threads.others] : [];
|
|
519
|
+
if (threads.length) parts.push(`threads ${threads.map((thread) => `${thread.name} ${gauge(thread.done, thread.total) ? `${gauge(thread.done, thread.total)} ${thread.state}` : threadFacts(thread)}`).join(", ")}${model.threads.more ? `, ${model.threads.more} more` : ""}`);
|
|
383
520
|
if (model.skills.length) parts.push(`skills ${model.skills.map(({ id }) => id).join(", ")}`);
|
|
384
521
|
const { context, rates } = model.figures;
|
|
385
522
|
if (context !== null) parts.push(`context ${context}%`);
|
|
@@ -392,15 +529,19 @@ export const svgCardAlt = (model) => {
|
|
|
392
529
|
* mod's setting; the drawing moves only while the model is not idle and motion is not off.
|
|
393
530
|
*/
|
|
394
531
|
export const composeSvgCard = (model, { motion = "full", accent = "#5fd7ff" } = {}) => {
|
|
395
|
-
const { width
|
|
396
|
-
|
|
532
|
+
const { width } = SVG_CARD;
|
|
533
|
+
// The thread rows sit between the detail line and the chips; the card grows by their reserve.
|
|
534
|
+
const shift = model.threads ? THREAD_ROW_H * model.threads.reserve : 0;
|
|
535
|
+
const height = SVG_CARD.height + shift;
|
|
536
|
+
const rewind = (model.rewind === true || (!model.idle && lookOf(model.discipline) === "rewind")) && model.warnings.length === 0;
|
|
537
|
+
const working = (!model.idle || rewind) && motion !== "off";
|
|
397
538
|
const animate = { breath: working, sweep: working && motion === "full", comet: working && motion === "full" };
|
|
398
|
-
const edge = borderColor(model, accent);
|
|
539
|
+
const edge = rewind ? "url(#lit-rainbow)" : borderColor(model, accent);
|
|
399
540
|
const perimeter = 1000;
|
|
400
|
-
const defs = animate.sweep
|
|
541
|
+
const defs = (rewind ? rainbowDefs(animate.breath) : "") + (animate.sweep
|
|
401
542
|
? `<defs><linearGradient id="lit-sweep" x1="0" x2="1" y1="0" y2="0"><stop offset="0" stop-color="#fff" stop-opacity="0"/><stop offset="0.5" stop-color="#fff" stop-opacity="0.55"/><stop offset="1" stop-color="#fff" stop-opacity="0"/><animateTransform attributeName="gradientTransform" type="translate" values="-1.2 0;1.2 0" ${loop(TIMINGS.sweep, 0.5)}/></linearGradient></defs>`
|
|
402
|
-
: "";
|
|
403
|
-
const frame = `<rect x="1" y="1" width="${width - 2}" height="${height - 2}" rx="14" fill="${C.bg}" stroke="${edge}" stroke-width="${model.idle ? "1.5" : "2.5"}"${model.idle ? ' stroke-opacity="0.8"' : ""}>`
|
|
543
|
+
: "");
|
|
544
|
+
const frame = `<rect x="1" y="1" width="${width - 2}" height="${height - 2}" rx="14" fill="${C.bg}" stroke="${edge}" stroke-width="${model.idle && !rewind ? "1.5" : "2.5"}"${model.idle && !rewind ? ' stroke-opacity="0.8"' : ""}>`
|
|
404
545
|
+ (animate.breath && !model.warnings.length ? `<animate attributeName="stroke-opacity" values="0.85;1;0.85" ${loop(TIMINGS.breath, BREATH_PHASE)}/>` : "")
|
|
405
546
|
+ "</rect>";
|
|
406
547
|
const comet = animate.comet
|
|
@@ -408,11 +549,12 @@ export const composeSvgCard = (model, { motion = "full", accent = "#5fd7ff" } =
|
|
|
408
549
|
+ `<defs><linearGradient id="lit-comet" x1="0" x2="1" y1="0" y2="1"><stop offset="0" stop-color="${C.orange}"/><stop offset="0.6" stop-color="${C.pink}"/><stop offset="1" stop-color="#ffffff"/></linearGradient></defs>`
|
|
409
550
|
: "";
|
|
410
551
|
const body = [
|
|
411
|
-
topRow(model, accent, animate),
|
|
552
|
+
topRow(model, accent, animate, rewind),
|
|
412
553
|
model.workflow ? mapRowSvg(model, accent, animate) : phaseRow(model, accent, animate),
|
|
413
554
|
detailRowSvg(model, accent, animate),
|
|
414
|
-
|
|
415
|
-
|
|
555
|
+
model.threads ? threadRowsSvg(model, { animate: animate.sweep, rewind }) : "",
|
|
556
|
+
middleRow(model, accent, animate, shift, rewind),
|
|
557
|
+
bottomRow(model, accent, shift),
|
|
416
558
|
].join("");
|
|
417
559
|
const source = `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}" font-family="${FONT}" font-size="${SVG_CARD.font}">${defs}${frame}${comet}${body}</svg>`;
|
|
418
560
|
return { source, alt: svgCardAlt(model), animated: working };
|
|
@@ -37,10 +37,11 @@ const chipsOf = (model, now, previous = null) => Object.fromEntries((model.skill
|
|
|
37
37
|
return [chip.id, known];
|
|
38
38
|
}));
|
|
39
39
|
|
|
40
|
-
// The ambient loop runs while the card shows LitClaude at work, so motion itself says "active"
|
|
41
|
-
// `at` is when the current run
|
|
40
|
+
// The ambient loop runs while the card shows LitClaude at work, so motion itself says "active",
|
|
41
|
+
// and while the rewind look lingers after a brief; `at` is when the current run began, so the loop
|
|
42
|
+
// does not restart on every new model.
|
|
42
43
|
const ambientOf = (model, now, profile, previous = null) => {
|
|
43
|
-
const on = Boolean(profile.ambient) && model.visible && !model.idle;
|
|
44
|
+
const on = Boolean(profile.ambient) && model.visible && (!model.idle || model.rewind === true);
|
|
44
45
|
return { on, at: on && previous?.on ? previous.at : now };
|
|
45
46
|
};
|
|
46
47
|
|
|
@@ -100,10 +101,30 @@ export const clockShown = (timeline) => timeline.exitAt === null && Boolean(time
|
|
|
100
101
|
/** True while the ambient loop runs; the surface module then keeps a slower frame timer going. */
|
|
101
102
|
export const ambientActive = (timeline, profile) => Boolean(profile.ambient) && timeline.exitAt === null && timeline.ambient.on;
|
|
102
103
|
|
|
104
|
+
// The rewind look's sparks: fixed seeds (a small LCG, so every surface draws the same sky), each a
|
|
105
|
+
// starting place, a drift speed and a twinkle offset.
|
|
106
|
+
const SPARK_SEEDS = (() => {
|
|
107
|
+
let state = 13;
|
|
108
|
+
const next = () => {
|
|
109
|
+
state = (state * 1103515245 + 12345) % 2147483648;
|
|
110
|
+
return state / 2147483648;
|
|
111
|
+
};
|
|
112
|
+
return Object.freeze(Array.from({ length: 7 }, () => Object.freeze({ start: next(), speed: 0.6 + 0.8 * next(), twinkle: next() })));
|
|
113
|
+
})();
|
|
114
|
+
|
|
115
|
+
// Where each spark stands at `elapsed` (`x`, 0 to 1, drifting right to left) and which of the four
|
|
116
|
+
// ASCII sparks it shows (`glyph`, 0 to 3).
|
|
117
|
+
const sparksAt = (elapsed) => SPARK_SEEDS.map(({ start, speed, twinkle }) => {
|
|
118
|
+
const x = start - (elapsed * speed) / TIMINGS.sparks;
|
|
119
|
+
const t = elapsed / (TIMINGS.sparks / 4) + twinkle;
|
|
120
|
+
return { x: ((x % 1) + 1) % 1, glyph: Math.floor((((t % 1) + 1) % 1) * 4) };
|
|
121
|
+
});
|
|
122
|
+
|
|
103
123
|
// One frame of the ambient loop: `breath` (0 to 1 and back over TIMINGS.breath), where the light
|
|
104
124
|
// stands on the active phase (`sweep`, null between passes), how far the comet has gone around
|
|
105
|
-
// the card (`comet`, 0 to 1: the top rule left to right, then the bottom rule right to left)
|
|
106
|
-
// where the bright head stands on the rail leaving the current stage (`flow`, 0 to 1)
|
|
125
|
+
// the card (`comet`, 0 to 1: the top rule left to right, then the bottom rule right to left),
|
|
126
|
+
// where the bright head stands on the rail leaving the current stage (`flow`, 0 to 1), how far the
|
|
127
|
+
// rewind look's hue has turned (`hue`, 0 to 1 over TIMINGS.hue) and its sparks (`sparks`, full only).
|
|
107
128
|
const ambientSample = (timeline, now, profile) => {
|
|
108
129
|
if (!ambientActive(timeline, profile)) return null;
|
|
109
130
|
const elapsed = Math.max(0, now - timeline.ambient.at);
|
|
@@ -114,6 +135,8 @@ const ambientSample = (timeline, now, profile) => {
|
|
|
114
135
|
sweep: profile.ambient.sweep && pass >= -0.2 && pass <= 1.2 ? pass : null,
|
|
115
136
|
comet: profile.ambient.comet ? (elapsed % TIMINGS.comet) / TIMINGS.comet : null,
|
|
116
137
|
flow: profile.ambient.sweep ? (elapsed % TIMINGS.flow) / TIMINGS.flow : null,
|
|
138
|
+
hue: (elapsed % TIMINGS.hue) / TIMINGS.hue,
|
|
139
|
+
sparks: profile.ambient.sweep ? sparksAt(elapsed) : null,
|
|
117
140
|
};
|
|
118
141
|
};
|
|
119
142
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// The toasts the mod raises when the LIT state really changes: a discipline starts or
|
|
1
|
+
// The toasts the mod raises when the LIT state really changes: a discipline starts, switches or resumes, the
|
|
2
2
|
// workflow stage moves, a goal is set or met, a lane starts or finishes. Pure: the mod keeps the last
|
|
3
3
|
// status it saw and a gate, and hands each new status in; what comes back is at most one short line
|
|
4
4
|
// to show, never more than one per TOAST_GAP_MS. Gate notices (state.mjs gates, the auto-handoff)
|
|
@@ -25,6 +25,8 @@ export const statusOf = ({ discipline, model, snapshot }, previous = null) => {
|
|
|
25
25
|
discipline: DISCIPLINE_ENTRY[discipline] ? discipline : previous?.discipline ?? null,
|
|
26
26
|
stage: stage && `${flow.family}:${stage}`,
|
|
27
27
|
goal: goal ? { key: goal.createdAt ?? goal.objective, objective: String(goal.objective ?? ""), status: goal.status, passed: goal.criteria.filter(({ status }) => status === "pass").length, total: goal.criteria.length } : null,
|
|
28
|
+
paused: flow?.paused?.parent ?? null,
|
|
29
|
+
place: stage && `${flow.stages[flow.current].id}${flow.paused?.count ?? flow.count ? ` ${(flow.paused?.count ?? flow.count).done}/${(flow.paused?.count ?? flow.count).total}` : ""}`,
|
|
28
30
|
lanes: Object.fromEntries((model?.lanes?.list ?? []).filter(({ id }) => id).map(({ id, name }) => [id, name])),
|
|
29
31
|
};
|
|
30
32
|
};
|
|
@@ -38,7 +40,8 @@ const laneEntries = (ids, names, verb) => {
|
|
|
38
40
|
export const statusChanges = (previous, next) => {
|
|
39
41
|
if (!previous) return [];
|
|
40
42
|
const entries = [];
|
|
41
|
-
if (next.
|
|
43
|
+
if (previous.paused && !next.paused && next.discipline === previous.paused) entries.push({ kind: "resumed", text: `resumed ${next.discipline}${next.place ? ` · ${next.place}` : ""}` });
|
|
44
|
+
else if (next.discipline && next.discipline !== previous.discipline) entries.push({ kind: "discipline", from: previous.discipline, to: next.discipline });
|
|
42
45
|
else if (next.stage && next.stage !== previous.stage) entries.push({ kind: "stage", text: `stage · ${next.stage.split(":")[1]}` });
|
|
43
46
|
const goal = next.goal;
|
|
44
47
|
const sameGoal = goal && previous.goal?.key === goal.key;
|