@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
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// The SessionStart nudge toward lit-adhd: when this folder has other Claude Code sessions from the
|
|
2
|
+
// last three days, say once a day that `lit adhd` briefs them all on one screen. It looks only at
|
|
3
|
+
// this folder's own transcript folder (no scan of other projects) and stats file times, never
|
|
4
|
+
// contents, so it stays cheap on every session start. A marker under `.litclaude/adhd/` keeps it
|
|
5
|
+
// to one nudge per calendar day per project.
|
|
6
|
+
import { lstatSync, mkdirSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
7
|
+
import { join } from "node:path";
|
|
8
|
+
|
|
9
|
+
import { projectSlug } from "./transcripts.mjs";
|
|
10
|
+
|
|
11
|
+
export const RECENT_MS = 3 * 24 * 60 * 60 * 1000;
|
|
12
|
+
const SCAN_LIMIT = 400;
|
|
13
|
+
|
|
14
|
+
const dayOf = (now) => new Date(now).toISOString().slice(0, 10);
|
|
15
|
+
|
|
16
|
+
const recentOthers = (folder, sessionId, now) => {
|
|
17
|
+
let names;
|
|
18
|
+
try {
|
|
19
|
+
names = readdirSync(folder).filter((name) => name.endsWith(".jsonl")).slice(0, SCAN_LIMIT);
|
|
20
|
+
} catch {
|
|
21
|
+
return 0;
|
|
22
|
+
}
|
|
23
|
+
return names.filter((name) => {
|
|
24
|
+
if (name === `${sessionId}.jsonl`) return false;
|
|
25
|
+
try {
|
|
26
|
+
const stat = lstatSync(join(folder, name));
|
|
27
|
+
return stat.isFile() && now - stat.mtimeMs < RECENT_MS;
|
|
28
|
+
} catch {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}).length;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The one-line suggestion, or null when there is nothing to suggest or it was already made today.
|
|
36
|
+
* Making it records today's date in `<stateRoot>/.litclaude/adhd/suggested.json`.
|
|
37
|
+
*/
|
|
38
|
+
export const adhdSuggestion = ({ cwd, sessionId, configDir, stateRoot, now = Date.now() }) => {
|
|
39
|
+
const count = recentOthers(join(configDir, "projects", projectSlug(cwd)), sessionId, now);
|
|
40
|
+
if (count === 0) return null;
|
|
41
|
+
const dir = join(stateRoot, ".litclaude", "adhd");
|
|
42
|
+
const marker = join(dir, "suggested.json");
|
|
43
|
+
try {
|
|
44
|
+
if (JSON.parse(readFileSync(marker, "utf8")).day === dayOf(now)) return null;
|
|
45
|
+
} catch {
|
|
46
|
+
// No marker yet, or an unreadable one: suggest and rewrite it.
|
|
47
|
+
}
|
|
48
|
+
mkdirSync(dir, { recursive: true });
|
|
49
|
+
writeFileSync(marker, `${JSON.stringify({ day: dayOf(now) })}\n`);
|
|
50
|
+
return `${count} other recent ${count === 1 ? "session" : "sessions"} here · type \`lit adhd\` for a one-screen brief of where each stands`;
|
|
51
|
+
};
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
// Claude Code session transcripts for the lit-adhd collector. Claude stores one JSONL file per
|
|
2
|
+
// session under `<config>/projects/<slug>/`, where the slug is the session's absolute cwd with every
|
|
3
|
+
// character outside [A-Za-z0-9] turned into `-`. Files reach tens of thousands of lines, so each is
|
|
4
|
+
// read as its head and tail only, under a budget shared by the whole run, through a descriptor
|
|
5
|
+
// opened without following links. Subagent transcripts (in subfolders, or lines marked
|
|
6
|
+
// `isSidechain`) are not sessions of their own and are skipped.
|
|
7
|
+
|
|
8
|
+
import { closeSync, constants, fstatSync, lstatSync, openSync, readSync, readdirSync } from "node:fs";
|
|
9
|
+
import { join, relative } from "node:path";
|
|
10
|
+
|
|
11
|
+
export const HEAD_BYTES = 64 * 1024;
|
|
12
|
+
export const TAIL_BYTES = 256 * 1024;
|
|
13
|
+
export const TOTAL_BUDGET_BYTES = 8 * 1024 * 1024;
|
|
14
|
+
const FALLBACK_DIR_LIMIT = 200;
|
|
15
|
+
const FALLBACK_PEEK_BYTES = 4 * 1024;
|
|
16
|
+
const ACTIVE_MS = 15 * 60 * 1000;
|
|
17
|
+
|
|
18
|
+
export const projectSlug = (path) => String(path).replace(/[^A-Za-z0-9]/gu, "-");
|
|
19
|
+
|
|
20
|
+
/** A byte budget shared by every read of one collector run. */
|
|
21
|
+
export const makeBudget = (limit = TOTAL_BUDGET_BYTES) => ({ limit, used: 0, exhausted: false });
|
|
22
|
+
|
|
23
|
+
const readSlice = (fd, position, length, budget) => {
|
|
24
|
+
const allowed = Math.min(length, budget.limit - budget.used);
|
|
25
|
+
if (allowed <= 0) {
|
|
26
|
+
budget.exhausted = true;
|
|
27
|
+
return "";
|
|
28
|
+
}
|
|
29
|
+
const buffer = Buffer.alloc(allowed);
|
|
30
|
+
const read = readSync(fd, buffer, 0, allowed, position);
|
|
31
|
+
budget.used += read;
|
|
32
|
+
if (allowed < length) budget.exhausted = true;
|
|
33
|
+
return buffer.subarray(0, read).toString("utf8");
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** The parsed lines of a transcript's head and tail; a link or a non-file reads as null. */
|
|
37
|
+
export const readTranscriptLines = (path, budget, { head = HEAD_BYTES, tail = TAIL_BYTES } = {}) => {
|
|
38
|
+
let fd;
|
|
39
|
+
try {
|
|
40
|
+
if (!lstatSync(path).isFile()) return null;
|
|
41
|
+
fd = openSync(path, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0));
|
|
42
|
+
const { size } = fstatSync(fd);
|
|
43
|
+
const chunks = size <= head + tail
|
|
44
|
+
? [readSlice(fd, 0, size, budget)]
|
|
45
|
+
: [readSlice(fd, 0, head, budget), readSlice(fd, size - tail, tail, budget)];
|
|
46
|
+
const lines = [];
|
|
47
|
+
for (const chunk of chunks) {
|
|
48
|
+
for (const line of chunk.split("\n")) {
|
|
49
|
+
if (!line.trim()) continue;
|
|
50
|
+
try {
|
|
51
|
+
const parsed = JSON.parse(line);
|
|
52
|
+
if (parsed && typeof parsed === "object") lines.push(parsed);
|
|
53
|
+
} catch {
|
|
54
|
+
// A line cut at a slice edge, or a malformed one, is skipped.
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return lines;
|
|
59
|
+
} catch {
|
|
60
|
+
return null;
|
|
61
|
+
} finally {
|
|
62
|
+
if (fd !== undefined) closeSync(fd);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const topLevelTranscripts = (directory) => {
|
|
67
|
+
try {
|
|
68
|
+
return readdirSync(directory, { withFileTypes: true })
|
|
69
|
+
.filter((entry) => entry.isFile() && entry.name.endsWith(".jsonl"))
|
|
70
|
+
.map((entry) => join(directory, entry.name));
|
|
71
|
+
} catch {
|
|
72
|
+
return [];
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const newestFirst = (paths) => paths
|
|
77
|
+
.map((path) => {
|
|
78
|
+
try {
|
|
79
|
+
return { path, mtimeMs: lstatSync(path).mtimeMs };
|
|
80
|
+
} catch {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
.filter(Boolean)
|
|
85
|
+
.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
86
|
+
|
|
87
|
+
const peekCwd = (path) => {
|
|
88
|
+
let fd;
|
|
89
|
+
try {
|
|
90
|
+
if (!lstatSync(path).isFile()) return null;
|
|
91
|
+
fd = openSync(path, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0));
|
|
92
|
+
const buffer = Buffer.alloc(FALLBACK_PEEK_BYTES);
|
|
93
|
+
const read = readSync(fd, buffer, 0, FALLBACK_PEEK_BYTES, 0);
|
|
94
|
+
for (const line of buffer.subarray(0, read).toString("utf8").split("\n")) {
|
|
95
|
+
try {
|
|
96
|
+
const parsed = JSON.parse(line);
|
|
97
|
+
if (typeof parsed?.cwd === "string") return parsed.cwd;
|
|
98
|
+
} catch {
|
|
99
|
+
// Partial or malformed line.
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
} catch {
|
|
104
|
+
return null;
|
|
105
|
+
} finally {
|
|
106
|
+
if (fd !== undefined) closeSync(fd);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The transcript files of every given worktree path, newest first, and whether the projects folder
|
|
112
|
+
* was there at all. A path whose slug folder is missing is looked for among at most 200 project
|
|
113
|
+
* folders by the `cwd` in the first 4 KiB of each folder's newest file.
|
|
114
|
+
*/
|
|
115
|
+
export const findTranscripts = (configDir, paths) => {
|
|
116
|
+
const projects = join(configDir, "projects");
|
|
117
|
+
try {
|
|
118
|
+
if (!lstatSync(projects).isDirectory()) return { status: "unknown", files: [] };
|
|
119
|
+
} catch {
|
|
120
|
+
return { status: "unknown", files: [] };
|
|
121
|
+
}
|
|
122
|
+
const files = new Set();
|
|
123
|
+
const missing = [];
|
|
124
|
+
for (const path of paths) {
|
|
125
|
+
const found = topLevelTranscripts(join(projects, projectSlug(path)));
|
|
126
|
+
if (found.length) found.forEach((file) => files.add(file));
|
|
127
|
+
else missing.push(path);
|
|
128
|
+
}
|
|
129
|
+
if (missing.length) {
|
|
130
|
+
let folders = [];
|
|
131
|
+
try {
|
|
132
|
+
folders = readdirSync(projects, { withFileTypes: true }).filter((entry) => entry.isDirectory()).slice(0, FALLBACK_DIR_LIMIT);
|
|
133
|
+
} catch {
|
|
134
|
+
folders = [];
|
|
135
|
+
}
|
|
136
|
+
for (const folder of folders) {
|
|
137
|
+
const transcripts = topLevelTranscripts(join(projects, folder.name));
|
|
138
|
+
const newest = newestFirst(transcripts)[0];
|
|
139
|
+
const cwd = newest ? peekCwd(newest.path) : null;
|
|
140
|
+
if (cwd && missing.some((path) => path.normalize("NFC") === cwd.normalize("NFC"))) transcripts.forEach((file) => files.add(file));
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return { status: "ok", files: newestFirst([...files]).map(({ path }) => path) };
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
const textOf = (content) => {
|
|
147
|
+
if (typeof content === "string") return content;
|
|
148
|
+
if (!Array.isArray(content)) return "";
|
|
149
|
+
return content.filter((part) => part?.type === "text" && typeof part.text === "string").map((part) => part.text).join("\n");
|
|
150
|
+
};
|
|
151
|
+
const isToolResult = (content) => Array.isArray(content) && content.some((part) => part?.type === "tool_result");
|
|
152
|
+
const clip = (text, max) => {
|
|
153
|
+
const flat = String(text).replace(/\s+/gu, " ").trim();
|
|
154
|
+
return flat.length > max ? `${flat.slice(0, max - 1)}…` : flat;
|
|
155
|
+
};
|
|
156
|
+
// A typed slash command is stored as `<command-name>` and `<command-args>` tags; it reads as the
|
|
157
|
+
// command line the user typed. A namespaced command always counts, a built-in only with arguments.
|
|
158
|
+
const slashPrompt = (text) => {
|
|
159
|
+
if (!/^<command-(?:message|name)>/u.test(text)) return text;
|
|
160
|
+
const name = /<command-name>([^<]{1,120})<\/command-name>/u.exec(text)?.[1]?.trim();
|
|
161
|
+
const args = /<command-args>([^<]{0,2000})<\/command-args>/u.exec(text)?.[1]?.trim() ?? "";
|
|
162
|
+
if (!name || (!name.includes(":") && !args)) return text;
|
|
163
|
+
return args ? `${name} ${args}` : name;
|
|
164
|
+
};
|
|
165
|
+
const FILE_TOOLS = new Set(["Write", "Edit", "MultiEdit", "NotebookEdit"]);
|
|
166
|
+
// What a tool call was about, in a few words: a file's base name, a shell call's own description,
|
|
167
|
+
// a search pattern, a subagent's or skill's name. Never a command line or file contents.
|
|
168
|
+
const actionTarget = (name, input) => {
|
|
169
|
+
const path = input?.file_path ?? input?.notebook_path ?? input?.path;
|
|
170
|
+
if (["Read", ...FILE_TOOLS].includes(name) && typeof path === "string") return path.split(/[\\/]/u).at(-1);
|
|
171
|
+
if (name === "Bash" && typeof input?.description === "string") return input.description;
|
|
172
|
+
if ((name === "Grep" || name === "Glob") && typeof input?.pattern === "string") return input.pattern;
|
|
173
|
+
if ((name === "Agent" || name === "Task") && typeof input?.description === "string") return input.description;
|
|
174
|
+
if (name === "Skill" && typeof input?.skill === "string") return input.skill;
|
|
175
|
+
return null;
|
|
176
|
+
};
|
|
177
|
+
const WAITING_TEXT = /[??]\s*$|`?lit approve`?|`?lit deny`?|승인해\s*주|확인해\s*주|괜찮을까요|할까요/iu;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* One session's record from its transcript lines: what it was asked, what it did, what it said last,
|
|
181
|
+
* and where it stands. `redact` runs over every text field it returns.
|
|
182
|
+
*/
|
|
183
|
+
export const sessionRecord = (lines, { redact = (text) => text, now = Date.now() } = {}) => {
|
|
184
|
+
const main = lines.filter((line) => line.isSidechain !== true);
|
|
185
|
+
const sessionId = main.find((line) => typeof line.sessionId === "string")?.sessionId ?? null;
|
|
186
|
+
if (!sessionId) return null;
|
|
187
|
+
let customTitle = null;
|
|
188
|
+
let aiTitle = null;
|
|
189
|
+
let cwd = null;
|
|
190
|
+
let branch = null;
|
|
191
|
+
let started = null;
|
|
192
|
+
let last = null;
|
|
193
|
+
let lastEntry = null;
|
|
194
|
+
const prompts = [];
|
|
195
|
+
const tools = {};
|
|
196
|
+
const files = [];
|
|
197
|
+
let result = null;
|
|
198
|
+
let lastAction = null;
|
|
199
|
+
for (const line of main) {
|
|
200
|
+
if (line.type === "custom-title" && typeof line.customTitle === "string") customTitle = line.customTitle;
|
|
201
|
+
if (line.type === "ai-title" && typeof line.aiTitle === "string") aiTitle = line.aiTitle;
|
|
202
|
+
if (typeof line.cwd === "string") cwd ??= line.cwd;
|
|
203
|
+
if (typeof line.gitBranch === "string" && line.gitBranch) branch = line.gitBranch;
|
|
204
|
+
const at = Date.parse(line.timestamp);
|
|
205
|
+
if (Number.isFinite(at)) {
|
|
206
|
+
started = started === null ? at : Math.min(started, at);
|
|
207
|
+
last = last === null ? at : Math.max(last, at);
|
|
208
|
+
}
|
|
209
|
+
if (line.type === "user" && line.isMeta !== true && line.isCompactSummary !== true && !isToolResult(line.message?.content)) {
|
|
210
|
+
const text = slashPrompt(textOf(line.message?.content).trim());
|
|
211
|
+
if (text && !/^<(?:command-|local-command|system-reminder|task-notification)/u.test(text)) {
|
|
212
|
+
prompts.push(text);
|
|
213
|
+
lastEntry = { role: "user", text };
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if (line.type === "assistant" && Array.isArray(line.message?.content)) {
|
|
217
|
+
for (const part of line.message.content) {
|
|
218
|
+
if (part?.type === "tool_use" && typeof part.name === "string") {
|
|
219
|
+
tools[part.name] = (tools[part.name] ?? 0) + 1;
|
|
220
|
+
const path = part.input?.file_path ?? part.input?.notebook_path;
|
|
221
|
+
if (FILE_TOOLS.has(part.name) && typeof path === "string") files.push(path);
|
|
222
|
+
const target = actionTarget(part.name, part.input);
|
|
223
|
+
lastAction = { tool: part.name, ...(target ? { target } : {}) };
|
|
224
|
+
lastEntry = { role: "tool" };
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
const text = textOf(line.message.content).trim();
|
|
228
|
+
if (text) {
|
|
229
|
+
result = text;
|
|
230
|
+
lastEntry = { role: "assistant", text };
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
const relativeFile = (path) => {
|
|
235
|
+
const inside = cwd ? relative(cwd, path) : path;
|
|
236
|
+
return inside && !inside.startsWith("..") ? inside : path;
|
|
237
|
+
};
|
|
238
|
+
const changed = [...new Set(files.reverse())].slice(0, 5).map((path) => redact(relativeFile(path)));
|
|
239
|
+
const asked = [...new Set([prompts[0], prompts.at(-1)].filter(Boolean))].slice(0, 2).map((text) => redact(clip(text, 160)));
|
|
240
|
+
const waiting = lastEntry?.role === "assistant" && WAITING_TEXT.test(lastEntry.text.slice(-400));
|
|
241
|
+
const status = last === null ? "unknown" : waiting ? "waiting-on-user" : now - last < ACTIVE_MS ? "active" : "ended";
|
|
242
|
+
return {
|
|
243
|
+
sessionId,
|
|
244
|
+
id8: sessionId.slice(0, 8),
|
|
245
|
+
worktree: cwd ? redact(cwd) : "unknown",
|
|
246
|
+
cwd,
|
|
247
|
+
branch: branch ?? "unknown",
|
|
248
|
+
started: started === null ? "unknown" : new Date(started).toISOString(),
|
|
249
|
+
last: last === null ? "unknown" : new Date(last).toISOString(),
|
|
250
|
+
lastMs: last,
|
|
251
|
+
title: redact(clip(customTitle ?? aiTitle ?? prompts[0] ?? "unknown", 80)),
|
|
252
|
+
asked: asked.length ? asked : ["unknown"],
|
|
253
|
+
done: { tools, files: changed, commits: [] },
|
|
254
|
+
lastAction: lastAction ? { tool: lastAction.tool, ...(lastAction.target ? { target: redact(clip(lastAction.target, 60)) } : {}) } : null,
|
|
255
|
+
result: result ? redact(clip(result, 240)) : "unknown",
|
|
256
|
+
status,
|
|
257
|
+
...(waiting ? { waitingReason: "asked the user" } : {}),
|
|
258
|
+
};
|
|
259
|
+
};
|