@litfamily/litcodex 1.0.30 → 1.0.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (394) hide show
  1. package/README-Ko-KR.md +13 -12
  2. package/README.md +13 -12
  3. package/TRADEMARK.md +12 -0
  4. package/dist/install/generated-skill-payload-hashes.d.ts +188 -82
  5. package/dist/install/generated-skill-payload-hashes.js +188 -82
  6. package/dist/install/skill-catalog.d.ts +1 -1
  7. package/dist/install/skill-catalog.js +12 -1
  8. package/dist/install/skill-resource-hashes.d.ts +1 -1
  9. package/dist/install/skill-resource-hashes.js +1 -1
  10. package/marketplace/plugins/litcodex/.codex-plugin/plugin.json +1 -1
  11. package/marketplace/plugins/litcodex/components/auto-update/package.json +1 -1
  12. package/marketplace/plugins/litcodex/components/comment-checker/package.json +1 -1
  13. package/marketplace/plugins/litcodex/components/git-bash/package.json +1 -1
  14. package/marketplace/plugins/litcodex/components/lit-loop/directive.md +10 -4
  15. package/marketplace/plugins/litcodex/components/lit-loop/directives/lit-adhd.md +194 -0
  16. package/marketplace/plugins/litcodex/components/lit-loop/directives/lit-handoff.md +2 -0
  17. package/marketplace/plugins/litcodex/components/lit-loop/directives/lit-hijack.md +219 -0
  18. package/marketplace/plugins/litcodex/components/lit-loop/directives/lit-plan.md +2 -1
  19. package/marketplace/plugins/litcodex/components/lit-loop/directives/lit-recap.md +2 -0
  20. package/marketplace/plugins/litcodex/components/lit-loop/directives/lit-schematic.md +199 -0
  21. package/marketplace/plugins/litcodex/components/lit-loop/directives/litwork.md +2 -1
  22. package/marketplace/plugins/litcodex/components/lit-loop/dist/adhd-suggest.d.ts +10 -0
  23. package/marketplace/plugins/litcodex/components/lit-loop/dist/adhd-suggest.js +67 -0
  24. package/marketplace/plugins/litcodex/components/lit-loop/dist/card-html.d.ts +1 -1
  25. package/marketplace/plugins/litcodex/components/lit-loop/dist/card-html.js +128 -8
  26. package/marketplace/plugins/litcodex/components/lit-loop/dist/card-looks.d.ts +19 -0
  27. package/marketplace/plugins/litcodex/components/lit-loop/dist/card-looks.js +58 -0
  28. package/marketplace/plugins/litcodex/components/lit-loop/dist/card-status.d.ts +30 -0
  29. package/marketplace/plugins/litcodex/components/lit-loop/dist/card-status.js +97 -7
  30. package/marketplace/plugins/litcodex/components/lit-loop/dist/cli.js +13 -3
  31. package/marketplace/plugins/litcodex/components/lit-loop/dist/codex-hook.d.ts +2 -0
  32. package/marketplace/plugins/litcodex/components/lit-loop/dist/codex-hook.js +8 -9
  33. package/marketplace/plugins/litcodex/components/lit-loop/dist/control-chars.d.ts +5 -0
  34. package/marketplace/plugins/litcodex/components/lit-loop/dist/control-chars.js +23 -0
  35. package/marketplace/plugins/litcodex/components/lit-loop/dist/hook-cli.d.ts +8 -0
  36. package/marketplace/plugins/litcodex/components/lit-loop/dist/hook-cli.js +126 -13
  37. package/marketplace/plugins/litcodex/components/lit-loop/dist/hud.d.ts +1 -1
  38. package/marketplace/plugins/litcodex/components/lit-loop/dist/hud.js +29 -13
  39. package/marketplace/plugins/litcodex/components/lit-loop/dist/lane-events.d.ts +13 -0
  40. package/marketplace/plugins/litcodex/components/lit-loop/dist/lane-events.js +85 -0
  41. package/marketplace/plugins/litcodex/components/lit-loop/dist/lane-state.d.ts +55 -0
  42. package/marketplace/plugins/litcodex/components/lit-loop/dist/lane-state.js +227 -0
  43. package/marketplace/plugins/litcodex/components/lit-loop/dist/live-step.d.ts +5 -1
  44. package/marketplace/plugins/litcodex/components/lit-loop/dist/live-step.js +17 -1
  45. package/marketplace/plugins/litcodex/components/lit-loop/dist/markers.d.ts +6 -0
  46. package/marketplace/plugins/litcodex/components/lit-loop/dist/markers.js +6 -0
  47. package/marketplace/plugins/litcodex/components/lit-loop/dist/modes.d.ts +1 -1
  48. package/marketplace/plugins/litcodex/components/lit-loop/dist/modes.js +25 -1
  49. package/marketplace/plugins/litcodex/components/lit-loop/dist/motion-gate.d.ts +79 -0
  50. package/marketplace/plugins/litcodex/components/lit-loop/dist/motion-gate.js +310 -0
  51. package/marketplace/plugins/litcodex/components/lit-loop/dist/motion-route.js +5 -1
  52. package/marketplace/plugins/litcodex/components/lit-loop/dist/plan-persistence.d.ts +1 -1
  53. package/marketplace/plugins/litcodex/components/lit-loop/dist/plan-persistence.js +38 -2
  54. package/marketplace/plugins/litcodex/components/lit-loop/dist/plan-scope-roots.d.ts +7 -0
  55. package/marketplace/plugins/litcodex/components/lit-loop/dist/plan-scope-roots.js +76 -0
  56. package/marketplace/plugins/litcodex/components/lit-loop/dist/redaction.js +18 -0
  57. package/marketplace/plugins/litcodex/components/lit-loop/dist/reentry.d.ts +15 -0
  58. package/marketplace/plugins/litcodex/components/lit-loop/dist/reentry.js +46 -9
  59. package/marketplace/plugins/litcodex/components/lit-loop/dist/restart-chip.d.ts +6 -0
  60. package/marketplace/plugins/litcodex/components/lit-loop/dist/restart-chip.js +59 -0
  61. package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-cli.d.ts +10 -0
  62. package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-cli.js +88 -0
  63. package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-go.d.ts +20 -0
  64. package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-go.js +94 -0
  65. package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-look.d.ts +6 -0
  66. package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-look.js +41 -0
  67. package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-redact.d.ts +3 -0
  68. package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-redact.js +40 -0
  69. package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-rollout.d.ts +48 -0
  70. package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind-rollout.js +292 -0
  71. package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind.d.ts +168 -0
  72. package/marketplace/plugins/litcodex/components/lit-loop/dist/rewind.js +867 -0
  73. package/marketplace/plugins/litcodex/components/lit-loop/dist/route-heads.js +45 -3
  74. package/marketplace/plugins/litcodex/components/lit-loop/dist/run-panel.js +1 -0
  75. package/marketplace/plugins/litcodex/components/lit-loop/dist/schematic-route.d.ts +6 -0
  76. package/marketplace/plugins/litcodex/components/lit-loop/dist/schematic-route.js +35 -0
  77. package/marketplace/plugins/litcodex/components/lit-loop/dist/screen-card.d.ts +3 -0
  78. package/marketplace/plugins/litcodex/components/lit-loop/dist/screen-card.js +15 -5
  79. package/marketplace/plugins/litcodex/components/lit-loop/dist/session-liveness.d.ts +16 -0
  80. package/marketplace/plugins/litcodex/components/lit-loop/dist/session-liveness.js +90 -0
  81. package/marketplace/plugins/litcodex/components/lit-loop/dist/skill-mention-scope.js +6 -0
  82. package/marketplace/plugins/litcodex/components/lit-loop/dist/stack-hook.d.ts +8 -0
  83. package/marketplace/plugins/litcodex/components/lit-loop/dist/stack-hook.js +57 -0
  84. package/marketplace/plugins/litcodex/components/lit-loop/dist/statusline.js +8 -3
  85. package/marketplace/plugins/litcodex/components/lit-loop/dist/threads.d.ts +50 -0
  86. package/marketplace/plugins/litcodex/components/lit-loop/dist/threads.js +183 -0
  87. package/marketplace/plugins/litcodex/components/lit-loop/dist/trigger.d.ts +1 -1
  88. package/marketplace/plugins/litcodex/components/lit-loop/dist/trigger.js +29 -5
  89. package/marketplace/plugins/litcodex/components/lit-loop/dist/workflow-map.d.ts +10 -0
  90. package/marketplace/plugins/litcodex/components/lit-loop/dist/workflow-map.js +11 -1
  91. package/marketplace/plugins/litcodex/components/lit-loop/dist/workflow-stack.d.ts +139 -0
  92. package/marketplace/plugins/litcodex/components/lit-loop/dist/workflow-stack.js +518 -0
  93. package/marketplace/plugins/litcodex/components/lit-loop/package.json +1 -1
  94. package/marketplace/plugins/litcodex/components/lsp/package.json +1 -1
  95. package/marketplace/plugins/litcodex/components/rules/package.json +1 -1
  96. package/marketplace/plugins/litcodex/components/start-work-continuation/dist/codex-hook.d.ts +6 -0
  97. package/marketplace/plugins/litcodex/components/start-work-continuation/dist/codex-hook.js +65 -0
  98. package/marketplace/plugins/litcodex/components/start-work-continuation/package.json +1 -1
  99. package/marketplace/plugins/litcodex/components/telemetry/package.json +1 -1
  100. package/marketplace/plugins/litcodex/components/wikify-knowledge/package.json +1 -1
  101. package/marketplace/plugins/litcodex/hooks/hooks.json +24 -0
  102. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/SKILL.md +6 -0
  103. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/components.css +414 -0
  104. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/fonts.json +22 -0
  105. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/layouts/landing.html +164 -0
  106. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/layouts/settings.html +114 -0
  107. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/layouts/workspace.html +115 -0
  108. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/styles/computational-brutalism.json +227 -0
  109. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/styles/field-notes.json +205 -0
  110. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/styles/graphite.json +200 -0
  111. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/styles/meadow.json +199 -0
  112. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/styles/neo-brutalism.json +222 -0
  113. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/kit/ui.js +228 -0
  114. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/brand-and-imagery.md +1 -1
  115. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/complete-contract.md +1 -0
  116. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/craft-floor.md +2 -2
  117. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/default-editorial-pixel.json +15 -8
  118. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/design-choice.md +19 -0
  119. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/house-styles.md +235 -0
  120. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/motion-guide.md +2 -2
  121. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/probe-and-review.md +6 -0
  122. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/production-interview.md +2 -0
  123. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/references/slop-register.md +4 -4
  124. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/design-lock.mjs +400 -0
  125. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/lock-probe.mjs +196 -0
  126. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/page-probe.mjs +22 -4
  127. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/pixel-art.mjs +60 -0
  128. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/probe.mjs +59 -13
  129. package/marketplace/plugins/litcodex/skills/frontend-ui-ux/scripts/rule-data.mjs +38 -4
  130. package/marketplace/plugins/litcodex/skills/lit-adhd/SKILL.md +185 -0
  131. package/marketplace/plugins/litcodex/skills/lit-adhd/agents/openai.yaml +6 -0
  132. package/marketplace/plugins/litcodex/skills/lit-adhd/references/card-examples.md +163 -0
  133. package/marketplace/plugins/litcodex/skills/lit-adhd/references/status-taxonomy.md +45 -0
  134. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/SKILL.md +18 -7
  135. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/style-guide.md +20 -11
  136. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-architecture.md +3 -3
  137. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-dependency.md +1 -1
  138. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-swimlane.md +1 -1
  139. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-tree-block-decomposition.md +1 -1
  140. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-tree.md +3 -3
  141. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/type-wardley.md +1 -1
  142. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/references/verifier-guide.md +1 -0
  143. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/diagram-craft-rules.mjs +1 -2
  144. package/marketplace/plugins/litcodex/skills/lit-diagram-drawer/scripts/visual-quality.mjs +1 -2
  145. package/marketplace/plugins/litcodex/skills/lit-docx/SKILL.md +12 -3
  146. package/marketplace/plugins/litcodex/skills/lit-docx/references/direction-step.md +6 -3
  147. package/marketplace/plugins/litcodex/skills/lit-hijack/SKILL.md +449 -0
  148. package/marketplace/plugins/litcodex/skills/lit-hijack/agents/openai.yaml +6 -0
  149. package/marketplace/plugins/litcodex/skills/lit-hijack/references/capture-and-provenance.md +100 -0
  150. package/marketplace/plugins/litcodex/skills/lit-hijack/references/clean-room-build.md +111 -0
  151. package/marketplace/plugins/litcodex/skills/lit-hijack/references/distil-and-licence.md +102 -0
  152. package/marketplace/plugins/litcodex/skills/lit-hijack/references/gap-and-port-design.md +125 -0
  153. package/marketplace/plugins/litcodex/skills/lit-hijack/references/parity-and-report.md +108 -0
  154. package/marketplace/plugins/litcodex/skills/lit-hijack/scripts/hijack.mjs +1050 -0
  155. package/marketplace/plugins/litcodex/skills/lit-loop/SKILL.md +13 -4
  156. package/marketplace/plugins/litcodex/skills/lit-plan/SKILL.md +9 -2
  157. package/marketplace/plugins/litcodex/skills/lit-plan/references/full-workflow.md +2 -1
  158. package/marketplace/plugins/litcodex/skills/lit-pptx/NOTICE +1 -0
  159. package/marketplace/plugins/litcodex/skills/lit-pptx/SKILL.md +35 -8
  160. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Bold.ttf +0 -0
  161. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Regular.ttf +0 -0
  162. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/jetbrains-mono/OFL.txt +93 -0
  163. package/marketplace/plugins/litcodex/skills/lit-pptx/fonts/jetbrains-mono/SOURCE.md +21 -0
  164. package/marketplace/plugins/litcodex/skills/lit-pptx/references/anti-slop-checklist.md +5 -2
  165. package/marketplace/plugins/litcodex/skills/lit-pptx/references/authoring-guide.md +3 -4
  166. package/marketplace/plugins/litcodex/skills/lit-pptx/references/density-and-fill.md +20 -6
  167. package/marketplace/plugins/litcodex/skills/lit-pptx/references/direction-step.md +26 -8
  168. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/14-engineering-review-computational-brutalism-ko.md +173 -0
  169. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/15-launch-pitch-neo-brutalism-ko.md +154 -0
  170. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/16-design-lecture-bauhaus-ko.md +139 -0
  171. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/17-community-programme-riso-ko.md +158 -0
  172. package/marketplace/plugins/litcodex/skills/lit-pptx/references/examples/18-public-data-briefing-newsroom-ko.md +179 -0
  173. package/marketplace/plugins/litcodex/skills/lit-pptx/references/layout-families.md +42 -27
  174. package/marketplace/plugins/litcodex/skills/lit-pptx/references/title-treatments.md +31 -27
  175. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/bauhaus.md +136 -0
  176. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/chalk.md +1 -1
  177. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/computational-brutalism.md +145 -0
  178. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/neo-brutalism.md +155 -0
  179. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/newsroom.md +141 -0
  180. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/riso.md +133 -0
  181. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/signal.md +1 -1
  182. package/marketplace/plugins/litcodex/skills/lit-pptx/references/tonalities/studio.md +1 -1
  183. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/compile-deck.js +1 -1
  184. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/craft_extras.py +136 -94
  185. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/embed_fonts.py +13 -1
  186. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/grid-resolver.js +101 -110
  187. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/layout-resolver.js +9 -15
  188. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/render-pack.js +386 -579
  189. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/slide-grid.js +104 -0
  190. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/lib/template-registry.js +57 -6
  191. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/office-run.mjs +2 -1
  192. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/qa_deck.py +7 -13
  193. package/marketplace/plugins/litcodex/skills/lit-pptx/scripts/render_pages.py +124 -0
  194. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/atlas/pack.yaml +1 -1
  195. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/bauhaus/pack.yaml +98 -0
  196. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/chalk/pack.yaml +1 -1
  197. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/computational-brutalism/pack.yaml +100 -0
  198. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/gazette/pack.yaml +1 -1
  199. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/ledger/pack.yaml +1 -1
  200. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/neo-brutalism/pack.yaml +107 -0
  201. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/newsroom/pack.yaml +99 -0
  202. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/night/pack.yaml +1 -1
  203. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/paper/pack.yaml +1 -1
  204. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/riso/pack.yaml +99 -0
  205. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/signal/pack.yaml +2 -2
  206. package/marketplace/plugins/litcodex/skills/lit-pptx/templates/tonalities/studio/pack.yaml +1 -1
  207. package/marketplace/plugins/litcodex/skills/lit-recap/SKILL.md +2 -0
  208. package/marketplace/plugins/litcodex/skills/lit-schematic/SKILL.md +198 -0
  209. package/marketplace/plugins/litcodex/skills/lit-schematic/agents/openai.yaml +6 -0
  210. package/marketplace/plugins/litcodex/skills/lit-schematic/examples/iso-heat-exchanger/build.mjs +38 -0
  211. package/marketplace/plugins/litcodex/skills/lit-schematic/examples/iso-heat-exchanger/scene.mjs +133 -0
  212. package/marketplace/plugins/litcodex/skills/lit-schematic/examples/journal-adsorption-rig/build.mjs +87 -0
  213. package/marketplace/plugins/litcodex/skills/lit-schematic/examples/pid-dosing-skid/build.mjs +85 -0
  214. package/marketplace/plugins/litcodex/skills/lit-schematic/references/cutaway-outputs.md +70 -0
  215. package/marketplace/plugins/litcodex/skills/lit-schematic/references/isometric-craft.md +101 -0
  216. package/marketplace/plugins/litcodex/skills/lit-schematic/references/journal-figures.md +72 -0
  217. package/marketplace/plugins/litcodex/skills/lit-schematic/references/kit-api.md +134 -0
  218. package/marketplace/plugins/litcodex/skills/lit-schematic/references/pfd-and-layout.md +53 -0
  219. package/marketplace/plugins/litcodex/skills/lit-schematic/references/pid-drafting.md +103 -0
  220. package/marketplace/plugins/litcodex/skills/lit-schematic/references/pid-symbols.md +163 -0
  221. package/marketplace/plugins/litcodex/skills/lit-schematic/references/verification.md +100 -0
  222. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/doctor.mjs +57 -0
  223. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/figure.mjs +81 -0
  224. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/fonts.mjs +28 -0
  225. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/geom.mjs +113 -0
  226. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/interactive.mjs +292 -0
  227. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/isa.mjs +115 -0
  228. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/iso.mjs +719 -0
  229. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/legend-sheet.mjs +162 -0
  230. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/pid.mjs +937 -0
  231. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/png.mjs +132 -0
  232. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/qa-core.mjs +658 -0
  233. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/route.mjs +218 -0
  234. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/sheet.mjs +890 -0
  235. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/svg.mjs +82 -0
  236. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/lib/theme.mjs +115 -0
  237. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/motion.mjs +129 -0
  238. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/qa.mjs +92 -0
  239. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/render.mjs +233 -0
  240. package/marketplace/plugins/litcodex/skills/lit-schematic/scripts/scaffold.mjs +60 -0
  241. package/marketplace/plugins/litcodex/skills/lit-scientific-visualization/SKILL.md +34 -8
  242. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/SKILL.md +18 -14
  243. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/THIRD_PARTY_NOTICES +12 -0
  244. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/assets.mjs +388 -0
  245. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/blender/runner.py +221 -0
  246. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/blender.mjs +132 -0
  247. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/board.mjs +142 -0
  248. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/constants.mjs +6 -0
  249. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/cover-assets.mjs +7 -4
  250. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/cover-capture.mjs +8 -7
  251. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/cover-init.js +14 -2
  252. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/cover-treatment.mjs +38 -3
  253. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/cover.mjs +19 -4
  254. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/driver.mjs +8 -8
  255. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/gallery.mjs +147 -0
  256. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/house.mjs +45 -0
  257. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/image.mjs +89 -0
  258. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/look.mjs +58 -25
  259. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/runtime.mjs +59 -14
  260. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/safe-read.mjs +32 -0
  261. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/scaffold.mjs +208 -0
  262. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/score.mjs +668 -0
  263. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/sound.mjs +174 -31
  264. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-gate.mjs +45 -3
  265. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-kit.js +99 -1
  266. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-qa.js +8 -1
  267. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-qa.mjs +180 -11
  268. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-render.mjs +42 -12
  269. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage-worker.mjs +7 -4
  270. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/stage.mjs +96 -10
  271. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/styles.mjs +233 -0
  272. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/treatment.mjs +291 -14
  273. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/vendor/three/LICENSE +21 -0
  274. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/vendor/three/addons/environments/RoomEnvironment.js +144 -0
  275. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/vendor/three/addons/geometries/RoundedBoxGeometry.js +155 -0
  276. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/engine/vendor/three/three.module.js +54571 -0
  277. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/recipes/hero-3d/expected.json +33 -0
  278. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/recipes/hero-3d/index.html +139 -0
  279. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/cover.md +44 -7
  280. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/depth.md +156 -0
  281. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/design-choice.md +22 -0
  282. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/quality-gate.md +29 -7
  283. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/runtime.md +1 -1
  284. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/sound.md +87 -0
  285. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/stage.md +19 -7
  286. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/studio.md +246 -0
  287. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/style-bibles.md +2 -2
  288. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/references/treatment.md +41 -21
  289. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/scripts/render.mjs +51 -4
  290. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/styles/paper.json +185 -0
  291. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/styles/swiss-signal.json +188 -0
  292. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/styles/terminalcore.json +182 -0
  293. package/marketplace/plugins/litcodex/skills/lit-typographic-motion/styles/tidal.json +187 -0
  294. package/marketplace/plugins/litcodex/skills/litresearch/SKILL.md +7 -0
  295. package/marketplace/plugins/litcodex/skills/litwork/SKILL.md +2 -1
  296. package/marketplace/plugins/litcodex/skills/readme-studio/SKILL.md +10 -0
  297. package/marketplace/plugins/litcodex/skills/review-work/SKILL.md +7 -1
  298. package/marketplace/plugins/litcodex/skills/start-work/SKILL.md +11 -1
  299. package/node_modules/@litcodex/lit-loop/directive.md +10 -4
  300. package/node_modules/@litcodex/lit-loop/directives/lit-adhd.md +194 -0
  301. package/node_modules/@litcodex/lit-loop/directives/lit-handoff.md +2 -0
  302. package/node_modules/@litcodex/lit-loop/directives/lit-hijack.md +219 -0
  303. package/node_modules/@litcodex/lit-loop/directives/lit-plan.md +2 -1
  304. package/node_modules/@litcodex/lit-loop/directives/lit-recap.md +2 -0
  305. package/node_modules/@litcodex/lit-loop/directives/lit-schematic.md +199 -0
  306. package/node_modules/@litcodex/lit-loop/directives/litwork.md +2 -1
  307. package/node_modules/@litcodex/lit-loop/dist/adhd-suggest.d.ts +10 -0
  308. package/node_modules/@litcodex/lit-loop/dist/adhd-suggest.js +67 -0
  309. package/node_modules/@litcodex/lit-loop/dist/card-html.d.ts +1 -1
  310. package/node_modules/@litcodex/lit-loop/dist/card-html.js +128 -8
  311. package/node_modules/@litcodex/lit-loop/dist/card-looks.d.ts +19 -0
  312. package/node_modules/@litcodex/lit-loop/dist/card-looks.js +58 -0
  313. package/node_modules/@litcodex/lit-loop/dist/card-status.d.ts +30 -0
  314. package/node_modules/@litcodex/lit-loop/dist/card-status.js +97 -7
  315. package/node_modules/@litcodex/lit-loop/dist/cli.js +13 -3
  316. package/node_modules/@litcodex/lit-loop/dist/codex-hook.d.ts +2 -0
  317. package/node_modules/@litcodex/lit-loop/dist/codex-hook.js +8 -9
  318. package/node_modules/@litcodex/lit-loop/dist/control-chars.d.ts +5 -0
  319. package/node_modules/@litcodex/lit-loop/dist/control-chars.js +23 -0
  320. package/node_modules/@litcodex/lit-loop/dist/hook-cli.d.ts +8 -0
  321. package/node_modules/@litcodex/lit-loop/dist/hook-cli.js +126 -13
  322. package/node_modules/@litcodex/lit-loop/dist/hud.d.ts +1 -1
  323. package/node_modules/@litcodex/lit-loop/dist/hud.js +29 -13
  324. package/node_modules/@litcodex/lit-loop/dist/lane-events.d.ts +13 -0
  325. package/node_modules/@litcodex/lit-loop/dist/lane-events.js +85 -0
  326. package/node_modules/@litcodex/lit-loop/dist/lane-state.d.ts +55 -0
  327. package/node_modules/@litcodex/lit-loop/dist/lane-state.js +227 -0
  328. package/node_modules/@litcodex/lit-loop/dist/live-step.d.ts +5 -1
  329. package/node_modules/@litcodex/lit-loop/dist/live-step.js +17 -1
  330. package/node_modules/@litcodex/lit-loop/dist/markers.d.ts +6 -0
  331. package/node_modules/@litcodex/lit-loop/dist/markers.js +6 -0
  332. package/node_modules/@litcodex/lit-loop/dist/modes.d.ts +1 -1
  333. package/node_modules/@litcodex/lit-loop/dist/modes.js +25 -1
  334. package/node_modules/@litcodex/lit-loop/dist/motion-gate.d.ts +79 -0
  335. package/node_modules/@litcodex/lit-loop/dist/motion-gate.js +310 -0
  336. package/node_modules/@litcodex/lit-loop/dist/motion-route.js +5 -1
  337. package/node_modules/@litcodex/lit-loop/dist/plan-persistence.d.ts +1 -1
  338. package/node_modules/@litcodex/lit-loop/dist/plan-persistence.js +38 -2
  339. package/node_modules/@litcodex/lit-loop/dist/plan-scope-roots.d.ts +7 -0
  340. package/node_modules/@litcodex/lit-loop/dist/plan-scope-roots.js +76 -0
  341. package/node_modules/@litcodex/lit-loop/dist/redaction.js +18 -0
  342. package/node_modules/@litcodex/lit-loop/dist/reentry.d.ts +15 -0
  343. package/node_modules/@litcodex/lit-loop/dist/reentry.js +46 -9
  344. package/node_modules/@litcodex/lit-loop/dist/restart-chip.d.ts +6 -0
  345. package/node_modules/@litcodex/lit-loop/dist/restart-chip.js +59 -0
  346. package/node_modules/@litcodex/lit-loop/dist/rewind-cli.d.ts +10 -0
  347. package/node_modules/@litcodex/lit-loop/dist/rewind-cli.js +88 -0
  348. package/node_modules/@litcodex/lit-loop/dist/rewind-go.d.ts +20 -0
  349. package/node_modules/@litcodex/lit-loop/dist/rewind-go.js +94 -0
  350. package/node_modules/@litcodex/lit-loop/dist/rewind-look.d.ts +6 -0
  351. package/node_modules/@litcodex/lit-loop/dist/rewind-look.js +41 -0
  352. package/node_modules/@litcodex/lit-loop/dist/rewind-redact.d.ts +3 -0
  353. package/node_modules/@litcodex/lit-loop/dist/rewind-redact.js +40 -0
  354. package/node_modules/@litcodex/lit-loop/dist/rewind-rollout.d.ts +48 -0
  355. package/node_modules/@litcodex/lit-loop/dist/rewind-rollout.js +292 -0
  356. package/node_modules/@litcodex/lit-loop/dist/rewind.d.ts +168 -0
  357. package/node_modules/@litcodex/lit-loop/dist/rewind.js +867 -0
  358. package/node_modules/@litcodex/lit-loop/dist/route-heads.js +45 -3
  359. package/node_modules/@litcodex/lit-loop/dist/run-panel.js +1 -0
  360. package/node_modules/@litcodex/lit-loop/dist/schematic-route.d.ts +6 -0
  361. package/node_modules/@litcodex/lit-loop/dist/schematic-route.js +35 -0
  362. package/node_modules/@litcodex/lit-loop/dist/screen-card.d.ts +3 -0
  363. package/node_modules/@litcodex/lit-loop/dist/screen-card.js +15 -5
  364. package/node_modules/@litcodex/lit-loop/dist/session-liveness.d.ts +16 -0
  365. package/node_modules/@litcodex/lit-loop/dist/session-liveness.js +90 -0
  366. package/node_modules/@litcodex/lit-loop/dist/skill-mention-scope.js +6 -0
  367. package/node_modules/@litcodex/lit-loop/dist/stack-hook.d.ts +8 -0
  368. package/node_modules/@litcodex/lit-loop/dist/stack-hook.js +57 -0
  369. package/node_modules/@litcodex/lit-loop/dist/statusline.js +8 -3
  370. package/node_modules/@litcodex/lit-loop/dist/threads.d.ts +50 -0
  371. package/node_modules/@litcodex/lit-loop/dist/threads.js +183 -0
  372. package/node_modules/@litcodex/lit-loop/dist/trigger.d.ts +1 -1
  373. package/node_modules/@litcodex/lit-loop/dist/trigger.js +29 -5
  374. package/node_modules/@litcodex/lit-loop/dist/workflow-map.d.ts +10 -0
  375. package/node_modules/@litcodex/lit-loop/dist/workflow-map.js +11 -1
  376. package/node_modules/@litcodex/lit-loop/dist/workflow-stack.d.ts +139 -0
  377. package/node_modules/@litcodex/lit-loop/dist/workflow-stack.js +518 -0
  378. package/node_modules/@litcodex/lit-loop/package.json +1 -1
  379. package/node_modules/@litcodex/lit-loop/skills/lit-adhd/SKILL.md +185 -0
  380. package/node_modules/@litcodex/lit-loop/skills/lit-hijack/SKILL.md +449 -0
  381. package/node_modules/@litcodex/lit-loop/skills/lit-loop/SKILL.md +13 -4
  382. package/node_modules/@litcodex/lit-loop/skills/lit-plan/SKILL.md +9 -2
  383. package/node_modules/@litcodex/lit-loop/skills/lit-recap/SKILL.md +2 -0
  384. package/node_modules/@litcodex/lit-loop/skills/lit-schematic/SKILL.md +198 -0
  385. package/node_modules/@litcodex/lit-loop/skills/lit-scientific-visualization/SKILL.md +34 -8
  386. package/node_modules/@litcodex/lit-loop/skills/litresearch/SKILL.md +7 -0
  387. package/node_modules/@litcodex/lit-loop/skills/litwork/SKILL.md +2 -1
  388. package/node_modules/@litcodex/lit-loop/skills/review-work/SKILL.md +7 -1
  389. package/node_modules/@litcodex/lit-loop/skills/start-work/SKILL.md +11 -1
  390. package/package.json +3 -2
  391. package/readme-assets/badge-version.svg +1 -1
  392. package/readme-assets/skills/lit-adhd.webp +0 -0
  393. package/readme-assets/skills/lit-hijack.webp +0 -0
  394. package/readme-assets/skills/lit-schematic.webp +0 -0
@@ -97,10 +97,18 @@ export function readResumeWork(cwd, sessionId) {
97
97
  const BARE = /^\s*(?:lit|lit-loop|litcodex)\s*[.!?]*\s*$/iu;
98
98
  const BARE_CONTINUE = /^\s*(?:lit|lit-loop|litcodex)\s+continue\s*[.!?]*\s*$/iu;
99
99
  const RESTART = /(?:^|[^\p{L}\p{N}_])(?:lit|lit-loop|litcodex)[ \t]+(?:new|restart)(?![\p{L}\p{N}_-])/iu;
100
+ /** True for exactly `lit continue`: the way back from a side discipline to the work it paused. */
101
+ export function isLitContinue(prompt) {
102
+ return BARE_CONTINUE.test(prompt);
103
+ }
100
104
  /** True for a bare `lit` or `lit continue`: the prompt carries no task and no route of its own. */
101
105
  export function isBareLit(prompt) {
102
106
  return BARE.test(prompt) || BARE_CONTINUE.test(prompt);
103
107
  }
108
+ /** True for `lit new …` or `lit restart …`: the work starts again instead of continuing. */
109
+ export function isRestartPrompt(prompt) {
110
+ return RESTART.test(maskMarkdownCode(prompt));
111
+ }
104
112
  /** Routes whose contract a bare `lit` can carry on: every lit-family route except start-work. */
105
113
  const CARRIED_ON = new Set(Object.values(MODE_BY_TOKEN)
106
114
  .map((spec) => spec.mode)
@@ -119,10 +127,11 @@ export function enterRoute(prompt, mode, context) {
119
127
  const held = context.active !== null && CARRIED_ON.has(context.active) ? context.active : null;
120
128
  if (mode === "lit-loop" && isBareLit(prompt)) {
121
129
  const route = held ?? mode;
130
+ const frame = context.frame ? { frame: context.frame } : {};
122
131
  if (context.resume !== null)
123
- return { kind: "resume", work: context.resume, active: held !== null, route };
132
+ return { kind: "resume", work: context.resume, active: held !== null, route, ...frame };
124
133
  if (held !== null)
125
- return { kind: "continue", confirm: false, route };
134
+ return { kind: "continue", confirm: false, route, ...frame };
126
135
  }
127
136
  const active = context.active === mode;
128
137
  return active
@@ -134,9 +143,25 @@ const CONFIRM_LINE = "The prompt is only `lit`, with no task and no work in flig
134
143
  /** Lines a resume or confirmation adds to a full activation. */
135
144
  export function entryNotes(entry) {
136
145
  if (entry.kind === "resume")
137
- return [resumeLine(entry.work)];
146
+ return [resumeLine(entry.work), ...frameLines(entry.frame)];
147
+ if (entry.kind === "continue")
148
+ return frameLines(entry.frame);
138
149
  return entry.confirm ? [CONFIRM_LINE] : [];
139
150
  }
151
+ /** The paused frame `lit continue` returns to, worded so the model keeps its stage and count. */
152
+ function frameLines(frame) {
153
+ if (frame === undefined)
154
+ return [];
155
+ const where = frame.stage === null ? "" : ` at ${frame.stage}`;
156
+ const count = frame.n !== undefined && frame.total !== undefined
157
+ ? ` ${frame.n}/${frame.total}`
158
+ : frame.n !== undefined
159
+ ? ` step ${frame.n}`
160
+ : "";
161
+ return [
162
+ `Back from the side discipline: resuming the paused ${frame.skill}${where}${count}. Keep that stage and count; do not restart it.`,
163
+ ];
164
+ }
140
165
  function resumeLine(work) {
141
166
  return `Existing work is resuming: ${work.text}. Pick it up where it stopped; do not create a new plan or restart it.`;
142
167
  }
@@ -146,12 +171,14 @@ function resumeLine(work) {
146
171
  */
147
172
  export function continueContext(mode, entry) {
148
173
  const body = entry.kind === "resume"
149
- ? [resumeLine(entry.work)]
150
- : entry.confirm
151
- ? [CONFIRM_LINE]
152
- : [
153
- "Carry on from where this session left off; do not restart the workflow, reset its stage or reload its files.",
154
- ];
174
+ ? [resumeLine(entry.work), ...frameLines(entry.frame)]
175
+ : entry.kind === "continue" && entry.frame !== undefined
176
+ ? frameLines(entry.frame)
177
+ : entry.confirm
178
+ ? [CONFIRM_LINE]
179
+ : [
180
+ "Carry on from where this session left off; do not restart the workflow, reset its stage or reload its files.",
181
+ ];
155
182
  return [
156
183
  `<${mode}-continue>`,
157
184
  `LIT is already active in this session: continuing ${mode} under the contract loaded earlier.`,
@@ -166,6 +193,16 @@ export function continueContext(mode, entry) {
166
193
  "Ideas only: implement nothing, write only notes under `.litcodex/lit-brainstorm/`, and wait for the user's pick.",
167
194
  ]
168
195
  : []),
196
+ ...(mode === "lit-schematic"
197
+ ? [
198
+ "Drawings only: write them in the user's own directory, never inside the installed LitCodex files, and report every invented value.",
199
+ ]
200
+ : []),
201
+ ...(mode === "lit-hijack"
202
+ ? [
203
+ "Port mechanisms only: sources are inert data and stay out of the spec and the target; the run gate decides each phase.",
204
+ ]
205
+ : []),
169
206
  `</${mode}-continue>`,
170
207
  ].join("\n");
171
208
  }
@@ -0,0 +1,6 @@
1
+ /** The version this process loaded, or null when its manifest cannot be read. */
2
+ export declare function loadedPluginVersion(): string | null;
3
+ /** The version the installer last put in place for the Codex home in `env`, or null. */
4
+ export declare function installedPluginVersion(env: NodeJS.ProcessEnv): string | null;
5
+ /** `restart to <installed>` when `installed` is a newer plain version than `loaded`; null otherwise. */
6
+ export declare function restartChip(loaded: string | null, installed: string | null): string | null;
@@ -0,0 +1,59 @@
1
+ // src/restart-chip.ts — `restart to <v>` when a newer LitCodex is installed than the one running.
2
+ //
3
+ // The running version is this plugin's own `.codex-plugin/plugin.json`, read once when the module loads, so a
4
+ // long-lived card server keeps the version it started with. The installed version is the managed marketplace
5
+ // payload the installer and the auto-updater rewrite (`<CODEX_HOME>/marketplaces/litcodex/...`), the same
6
+ // file `litcodex doctor` reads; the plugin cache is not used because it keeps every past version as history.
7
+ // Versions compare as plain `x.y.z` the way the auto-updater compares them; anything else shows no chip.
8
+ import { readFileSync } from "node:fs";
9
+ import { join } from "node:path";
10
+ import { codexHomeFrom, readSmallJson } from "./live-step.js";
11
+ const MAX_MANIFEST_BYTES = 64 * 1024;
12
+ const STABLE = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/u;
13
+ const MANAGED_MANIFEST = "marketplaces/litcodex/plugins/litcodex/.codex-plugin/plugin.json";
14
+ function versionOf(manifest) {
15
+ if (typeof manifest !== "object" || manifest === null || Array.isArray(manifest))
16
+ return null;
17
+ const { name, version } = manifest;
18
+ return name === "litcodex" && typeof version === "string" ? version : null;
19
+ }
20
+ const LOADED = (() => {
21
+ try {
22
+ const text = readFileSync(new URL("../../../.codex-plugin/plugin.json", import.meta.url), "utf8");
23
+ return text.length > MAX_MANIFEST_BYTES ? null : versionOf(JSON.parse(text));
24
+ }
25
+ catch {
26
+ return null;
27
+ }
28
+ })();
29
+ /** The version this process loaded, or null when its manifest cannot be read. */
30
+ export function loadedPluginVersion() {
31
+ return LOADED;
32
+ }
33
+ /** The version the installer last put in place for the Codex home in `env`, or null. */
34
+ export function installedPluginVersion(env) {
35
+ const home = codexHomeFrom(env);
36
+ return home === null ? null : versionOf(readSmallJson(join(home, MANAGED_MANIFEST), MAX_MANIFEST_BYTES));
37
+ }
38
+ function parts(version) {
39
+ const match = version === null ? null : STABLE.exec(version);
40
+ if (match?.[1] === undefined || match[2] === undefined || match[3] === undefined)
41
+ return null;
42
+ return [BigInt(match[1]), BigInt(match[2]), BigInt(match[3])];
43
+ }
44
+ /** `restart to <installed>` when `installed` is a newer plain version than `loaded`; null otherwise. */
45
+ export function restartChip(loaded, installed) {
46
+ const a = parts(loaded);
47
+ const b = parts(installed);
48
+ if (a === null || b === null)
49
+ return null;
50
+ for (let index = 0; index < 3; index += 1) {
51
+ const left = a[index];
52
+ const right = b[index];
53
+ if (right > left)
54
+ return `restart to ${installed}`;
55
+ if (right < left)
56
+ return null;
57
+ }
58
+ return null;
59
+ }
@@ -0,0 +1,10 @@
1
+ export interface RewindIo {
2
+ readonly stdout: NodeJS.WritableStream;
3
+ readonly stderr: NodeJS.WritableStream;
4
+ readonly cwd?: string;
5
+ readonly env?: NodeJS.ProcessEnv;
6
+ readonly now?: number;
7
+ }
8
+ export declare function rewindCommand(argv: readonly string[], io: RewindIo): number;
9
+ /** Record the stage and counts of the top frame: `stage --family loop --stage RED --n 2 --total 5`. */
10
+ export declare function stageCommand(argv: readonly string[], io: RewindIo): number;
@@ -0,0 +1,88 @@
1
+ // src/rewind-cli.ts — `cli.js rewind` and `cli.js stage`, the two commands the lit-adhd skill and a running
2
+ // loop call. `rewind` prints the cross-session brief data (JSON for the model, text for a person) and writes
3
+ // the next-step note and the session's rewind look; `stage` records the stage and k/n of the work on top of the session's stack.
4
+ import { collectRewind, DEFAULT_MAX, DEFAULT_SINCE_MS, parseSince, renderBrief } from "./rewind.js";
5
+ import { markRewindLook } from "./rewind-look.js";
6
+ import { resolveLoopScope } from "./state-paths.js";
7
+ import { frameLabel, normalizeStage, recordStackEvent } from "./workflow-stack.js";
8
+ function flagValue(argv, name) {
9
+ const index = argv.indexOf(name);
10
+ const next = index === -1 ? undefined : argv[index + 1];
11
+ if (next !== undefined && !next.startsWith("--"))
12
+ return next;
13
+ const inline = argv.find((arg) => arg.startsWith(`${name}=`));
14
+ return inline === undefined ? null : inline.slice(name.length + 1);
15
+ }
16
+ function intFlag(argv, name) {
17
+ const raw = flagValue(argv, name);
18
+ return raw !== null && /^\d{1,4}$/u.test(raw) ? Number(raw) : null;
19
+ }
20
+ export function rewindCommand(argv, io) {
21
+ const env = io.env ?? process.env;
22
+ const cwd = io.cwd ?? process.cwd();
23
+ const since = flagValue(argv, "--since");
24
+ const sinceMs = since === null ? DEFAULT_SINCE_MS : parseSince(since);
25
+ if (sinceMs === null) {
26
+ io.stderr.write("[lit-adhd] --since takes a number and d, h or m, for example 7d\n");
27
+ return 2;
28
+ }
29
+ const max = intFlag(argv, "--max") ?? DEFAULT_MAX;
30
+ const width = intFlag(argv, "--width") ?? 96;
31
+ const sessionId = resolveLoopScope({ argv, env })?.sessionId ?? null;
32
+ const result = collectRewind({
33
+ env,
34
+ cwd,
35
+ here: argv.includes("--here"),
36
+ sinceMs,
37
+ max,
38
+ sessionId,
39
+ ...(io.now === undefined ? {} : { now: io.now }),
40
+ });
41
+ // Whichever route ran the brief, the session that ran it gets the rewind look.
42
+ if (sessionId !== null)
43
+ markRewindLook(cwd, sessionId, env, io.now);
44
+ const brief = renderBrief(result, width);
45
+ io.stdout.write(argv.includes("--json") ? `${JSON.stringify({ ok: true, ...result, brief })}\n` : `${brief}\n`);
46
+ return 0;
47
+ }
48
+ /** Record the stage and counts of the top frame: `stage --family loop --stage RED --n 2 --total 5`. */
49
+ export function stageCommand(argv, io) {
50
+ const env = io.env ?? process.env;
51
+ const cwd = io.cwd ?? process.cwd();
52
+ const sessionId = resolveLoopScope({ argv, env })?.sessionId ?? null;
53
+ const family = flagValue(argv, "--family");
54
+ const stage = flagValue(argv, "--stage");
55
+ if (sessionId === null) {
56
+ io.stderr.write("[lit-loop] stage: no session id (pass --session or run inside a Codex session)\n");
57
+ return 2;
58
+ }
59
+ if (family === null || stage === null || normalizeStage(family, stage) === null) {
60
+ io.stderr.write("[lit-loop] stage: --family main|research|loop and a stage of that family are required\n");
61
+ return 2;
62
+ }
63
+ const verdicts = {};
64
+ argv.forEach((arg, index) => {
65
+ const pair = arg === "--verdict"
66
+ ? argv[index + 1]
67
+ : arg.startsWith("--verdict=")
68
+ ? arg.slice("--verdict=".length)
69
+ : undefined;
70
+ const match = pair === undefined ? null : /^([a-z][a-z0-9-]{0,23})=(pass|fail|pending|running)$/u.exec(pair);
71
+ if (match?.[1] !== undefined && match[2] !== undefined)
72
+ verdicts[match[1]] = match[2];
73
+ });
74
+ const event = {
75
+ type: "record",
76
+ family,
77
+ stage,
78
+ ...(intFlag(argv, "--n") === null ? {} : { n: intFlag(argv, "--n") }),
79
+ ...(intFlag(argv, "--total") === null ? {} : { total: intFlag(argv, "--total") }),
80
+ ...(flagValue(argv, "--unit") === null ? {} : { unit: flagValue(argv, "--unit") }),
81
+ ...(argv.includes("--done") ? { done: true } : {}),
82
+ ...(Object.keys(verdicts).length === 0 ? {} : { verdicts }),
83
+ };
84
+ const { stack } = recordStackEvent(cwd, sessionId, event, io.now === undefined ? undefined : new Date(io.now));
85
+ const top = stack.frames.at(-1);
86
+ io.stdout.write(`${top === undefined ? "stack: empty" : `stack: ${frameLabel(top)}`}\n`);
87
+ return 0;
88
+ }
@@ -0,0 +1,20 @@
1
+ /** True for the whole prompt being a go word; `go ahead and fix it` is an ordinary request. */
2
+ export declare function isGoPrompt(prompt: string): boolean;
3
+ export type GoDecision = {
4
+ readonly kind: "run";
5
+ readonly prompt: string;
6
+ readonly note: string;
7
+ } | {
8
+ readonly kind: "hint";
9
+ readonly text: string;
10
+ };
11
+ /**
12
+ * What a go-word prompt means in this session. Null when the session has no note (the prompt is then an
13
+ * ordinary one); a hint when a note existed but cannot run; otherwise the prompt to route in its place.
14
+ */
15
+ export declare function takeGo(cwd: string, sessionId: string, now: number): GoDecision | null;
16
+ /**
17
+ * True for the whole prompt `lit approve`, `lit deny`, `lit 승인` or `lit 거절`. The start-work lifecycle hook
18
+ * owns these words; this hook stays silent for them so a bare `lit` never starts a loop on top of an answer.
19
+ */
20
+ export declare function isBoundaryAnswer(prompt: string): boolean;
@@ -0,0 +1,94 @@
1
+ // src/rewind-go.ts — `go` after a lit-adhd brief runs the one step the brief named.
2
+ //
3
+ // The whole prompt `go`, `lit go`, `ㄱㄱ`, `고` or `진행` is read only when this session has a next-step note
4
+ // (`.litcodex/adhd/next-<session>.json`, written by the brief) and it is at most 30 minutes old. The note is
5
+ // bound to the session by its file name and deleted as soon as it is read, so one brief buys one `go`. The
6
+ // step is checked again against the saved state before it runs, and a boundary waiting for an answer is
7
+ // never started this way. A `go` that fits becomes the ordinary prompt of that step (`lit continue` or
8
+ // `start-work <plan>`), so it goes through the same routes, stack and contracts as if the user had typed it.
9
+ import { rmSync } from "node:fs";
10
+ import { isAbsolute, join } from "node:path";
11
+ import { clean } from "./control-chars.js";
12
+ import { plainDirsOrMissing, readSmallJson } from "./live-step.js";
13
+ import { ADHD_DIR, chooseNext, GO_WINDOW_MS, openPlanNamed } from "./rewind.js";
14
+ import { normalizeSessionId } from "./state-paths.js";
15
+ const GO_PROMPT = /^\s*(?:(?:lit\s+)?go|ㄱㄱ|고|진행)[\s.!?]*$/iu;
16
+ const MAX_NOTE_BYTES = 8 * 1024;
17
+ /** True for the whole prompt being a go word; `go ahead and fix it` is an ordinary request. */
18
+ export function isGoPrompt(prompt) {
19
+ return GO_PROMPT.test(prompt);
20
+ }
21
+ const KINDS = ["resume-frame", "approve-boundary", "continue-work", "start-plan"];
22
+ function readNote(cwd, sessionId) {
23
+ const id = normalizeSessionId(sessionId);
24
+ if (id === null || !isAbsolute(cwd) || !plainDirsOrMissing(cwd, ADHD_DIR))
25
+ return null;
26
+ const path = join(cwd, ADHD_DIR, `next-${id}.json`);
27
+ const record = readSmallJson(path, MAX_NOTE_BYTES);
28
+ if (record === null)
29
+ return null;
30
+ // Read once: the note is gone before it is judged, whatever the outcome.
31
+ try {
32
+ rmSync(path, { force: true });
33
+ }
34
+ catch {
35
+ // A note that cannot be removed still expires on its own.
36
+ }
37
+ if (typeof record !== "object" || Array.isArray(record))
38
+ return null;
39
+ const fields = record;
40
+ if (fields["sessionId"] !== sessionId && normalizeSessionId(String(fields["sessionId"])) !== id)
41
+ return null;
42
+ const kind = fields["kind"];
43
+ const at = fields["at"];
44
+ if (typeof kind !== "string" || !KINDS.includes(kind) || typeof at !== "number")
45
+ return null;
46
+ return {
47
+ kind: kind,
48
+ at,
49
+ plan: typeof fields["plan"] === "string" ? fields["plan"] : null,
50
+ text: typeof fields["text"] === "string" ? clean(fields["text"]) : "",
51
+ };
52
+ }
53
+ const EXPIRED = "The user said `go`, but the briefed next step is older than 30 minutes, so nothing was started. Tell the user that in one sentence and offer `lit adhd` for a fresh brief; start no other work.";
54
+ const STALE = "The user said `go`, but the briefed next step no longer holds, so nothing was started. Tell the user that in one sentence and offer `lit adhd` for a fresh brief; start no other work.";
55
+ const BOUNDARY = "The user said `go`, but the briefed step is a start-work boundary waiting for an answer. `go` never approves it: tell the user in one sentence to answer `lit approve` or `lit deny` themselves; start nothing.";
56
+ /**
57
+ * What a go-word prompt means in this session. Null when the session has no note (the prompt is then an
58
+ * ordinary one); a hint when a note existed but cannot run; otherwise the prompt to route in its place.
59
+ */
60
+ export function takeGo(cwd, sessionId, now) {
61
+ const note = readNote(cwd, sessionId);
62
+ if (note === null)
63
+ return null;
64
+ if (now - note.at > GO_WINDOW_MS || note.at > now + 60_000)
65
+ return { kind: "hint", text: EXPIRED };
66
+ if (note.kind === "approve-boundary")
67
+ return { kind: "hint", text: BOUNDARY };
68
+ const fresh = chooseNext(cwd, sessionId);
69
+ // A note naming its plan (a saved lit-plan, or a brief) holds while that plan is open and nothing outranks it,
70
+ // even when a second open plan means the brief alone would name none.
71
+ const named = note.kind === "start-plan" && note.plan !== null ? openPlanNamed(cwd, note.plan) : null;
72
+ if (named !== null && (fresh.kind === "none" || fresh.kind === "handoff" || fresh.kind === "start-plan")) {
73
+ return {
74
+ kind: "run",
75
+ prompt: `start-work ${named.name.replace(/\.md$/u, "")}`,
76
+ note: `go: start work on ${named.name}, ${named.done} of ${named.total} tasks done`,
77
+ };
78
+ }
79
+ if (fresh.kind !== note.kind || (note.kind === "start-plan" && fresh.plan !== note.plan)) {
80
+ return { kind: "hint", text: STALE };
81
+ }
82
+ if (note.kind === "start-plan" && fresh.plan !== undefined) {
83
+ return { kind: "run", prompt: `start-work ${fresh.plan.replace(/\.md$/u, "")}`, note: `go: ${fresh.text}` };
84
+ }
85
+ return { kind: "run", prompt: "lit continue", note: `go: ${fresh.text}` };
86
+ }
87
+ const BOUNDARY_ANSWER = /^lit[ \t]+(?:approve|승인|deny|거절)$/u;
88
+ /**
89
+ * True for the whole prompt `lit approve`, `lit deny`, `lit 승인` or `lit 거절`. The start-work lifecycle hook
90
+ * owns these words; this hook stays silent for them so a bare `lit` never starts a loop on top of an answer.
91
+ */
92
+ export function isBoundaryAnswer(prompt) {
93
+ return prompt.length <= 512 && BOUNDARY_ANSWER.test(prompt.trim());
94
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Mark `sessionId` as running lit-adhd. The workspace is the one the session's pointer already names, so a run from a
3
+ * subfolder cannot leave state beside the wrong folder; with no pointer it is the run's own folder. A turn the hook
4
+ * already recorded as lit-adhd is left as it is, so that turn's Stop card still matches. Never throws.
5
+ */
6
+ export declare function markRewindLook(cwd: string, sessionId: string, env: NodeJS.ProcessEnv, now?: number): void;
@@ -0,0 +1,41 @@
1
+ // src/rewind-look.ts — turns the rewind look (rainbow card, tinted HUD line) on for the session that runs the lit-adhd
2
+ // brief. The UserPromptSubmit hook marks a typed `lit adhd`; every other route (a scoped `$litcodex:lit-adhd` mention,
3
+ // Codex loading the skill by itself, a collector run by hand) never reaches that hook, so the collector marks the look
4
+ // when it runs. The mark is the same turn record the hook writes, in the same session folder, so it ends the same way:
5
+ // the session's next LIT activation replaces it.
6
+ import { statSync } from "node:fs";
7
+ import { isAbsolute } from "node:path";
8
+ import { readThreadPointer, recordTurnStart, writeThreadPointer } from "./live-step.js";
9
+ import { recordWorkflowTurn, workflowTurn } from "./workflow-map.js";
10
+ const MODE = "lit-adhd";
11
+ function isFolder(path) {
12
+ try {
13
+ return statSync(path).isDirectory();
14
+ }
15
+ catch {
16
+ return false;
17
+ }
18
+ }
19
+ /**
20
+ * Mark `sessionId` as running lit-adhd. The workspace is the one the session's pointer already names, so a run from a
21
+ * subfolder cannot leave state beside the wrong folder; with no pointer it is the run's own folder. A turn the hook
22
+ * already recorded as lit-adhd is left as it is, so that turn's Stop card still matches. Never throws.
23
+ */
24
+ export function markRewindLook(cwd, sessionId, env, now = Date.now()) {
25
+ try {
26
+ const pointed = readThreadPointer(env, sessionId)?.cwd;
27
+ const root = pointed !== undefined && isFolder(pointed) ? pointed : cwd;
28
+ if (!isAbsolute(root) || !isFolder(root))
29
+ return;
30
+ if (workflowTurn(root, sessionId)?.mode !== MODE) {
31
+ recordWorkflowTurn(root, sessionId, `rewind-${now}`, MODE, now);
32
+ if (workflowTurn(root, sessionId)?.mode !== MODE)
33
+ return;
34
+ recordTurnStart(root, sessionId, now);
35
+ }
36
+ writeThreadPointer(env, sessionId, root, now);
37
+ }
38
+ catch {
39
+ // The brief is what the person asked for; the look only decorates it.
40
+ }
41
+ }
@@ -0,0 +1,3 @@
1
+ export declare const REWIND_MASK = "[redacted]";
2
+ /** A redactor bound to one environment and home, so the environment scan happens once per run. */
3
+ export declare function makeRedactor(env: NodeJS.ProcessEnv, home: string | null): (input: string) => string;
@@ -0,0 +1,40 @@
1
+ // src/rewind-redact.ts — redaction for every string the lit-adhd collector emits.
2
+ //
3
+ // Credential shapes and URI userinfo come from the shared set in redaction.ts; `NAME=value` pairs with a
4
+ // secret-like name lose their value; any substring equal to a current environment value of eight or more
5
+ // characters is replaced (compared here, never printed); the home directory becomes `~`. Path-shaped and
6
+ // locale or terminal values are not credentials and stay, or every path in the brief would be blanked.
7
+ import { REDACTED_SECRET, redactSecrets } from "./redaction.js";
8
+ export const REWIND_MASK = "[redacted]";
9
+ const SECRET_NAME = /KEY|TOKEN|SECRET|PASS|AUTH|COOKIE/iu;
10
+ const ASSIGNMENT = /\b([A-Za-z_][A-Za-z0-9_]*)=("[^"]*"|'[^']*'|[^\s"'`]+)/gu;
11
+ const PLAIN_ENV_NAMES = /^(?:PATH|HOME|PWD|OLDPWD|SHELL|USER|LOGNAME|LANG|LANGUAGE|TERM|TERM_PROGRAM|TERM_PROGRAM_VERSION|COLORTERM|EDITOR|VISUAL|PAGER|TMPDIR|SHLVL|LC_[A-Z]+|XPC_[A-Z_]+|__CF[A-Z_]*|COMMAND_MODE|_)$/u;
12
+ /** Environment values that could be credentials, longest first so a value inside another is not split. */
13
+ function envSecrets(env) {
14
+ return Object.entries(env)
15
+ .filter(([name, value]) => typeof value === "string" &&
16
+ value.length >= 8 &&
17
+ !PLAIN_ENV_NAMES.test(name) &&
18
+ !/^[~/]/u.test(value) &&
19
+ !value.includes(":/") &&
20
+ !/^(?:true|false|\d+)$/iu.test(value))
21
+ .map(([, value]) => value)
22
+ .sort((a, b) => b.length - a.length);
23
+ }
24
+ /** A redactor bound to one environment and home, so the environment scan happens once per run. */
25
+ export function makeRedactor(env, home) {
26
+ const values = envSecrets(env);
27
+ return (input) => {
28
+ if (input === "")
29
+ return input;
30
+ let text = input;
31
+ for (const value of values)
32
+ if (text.includes(value))
33
+ text = text.split(value).join(REWIND_MASK);
34
+ text = text.replace(ASSIGNMENT, (match, name) => SECRET_NAME.test(name) ? `${name}=${REWIND_MASK}` : match);
35
+ text = redactSecrets(text).split(REDACTED_SECRET).join(REWIND_MASK);
36
+ if (home !== null && home.length > 1)
37
+ text = text.split(home).join("~");
38
+ return text;
39
+ };
40
+ }
@@ -0,0 +1,48 @@
1
+ export declare const HEAD_BYTES: number;
2
+ export declare const TAIL_BYTES: number;
3
+ export declare const TOTAL_BYTES: number;
4
+ export interface RolloutFile {
5
+ readonly path: string;
6
+ readonly id: string;
7
+ readonly mtimeMs: number;
8
+ readonly size: number;
9
+ }
10
+ export type LastEvent = "user" | "agent" | "complete" | "tool" | "aborted" | null;
11
+ export interface RolloutFacts {
12
+ readonly id: string;
13
+ readonly cwd: string | null;
14
+ readonly startedAt: number | null;
15
+ readonly lastAt: number | null;
16
+ readonly firstUser: string | null;
17
+ readonly lastUser: string | null;
18
+ readonly lastAgent: string | null;
19
+ readonly last: LastEvent;
20
+ readonly subagent: boolean;
21
+ /** Tool calls seen in the window read; a floor, not a total, when `stepsPartial`. */
22
+ readonly steps: number;
23
+ readonly stepsPartial: boolean;
24
+ /** Name of the last tool the session called, as Codex records it. */
25
+ readonly lastTool: string | null;
26
+ /** What that last call was about, in a word or two: a patched file's base name or the program a shell call ran. */
27
+ readonly lastTarget: string | null;
28
+ /** Tool names with the number of calls seen in the window read, most used first. */
29
+ readonly tools: readonly (readonly [string, number])[];
30
+ /** Base names of the files `apply_patch` touched in the window read, in order, without repeats. */
31
+ readonly edited: readonly string[];
32
+ }
33
+ /** A byte allowance shared by every read of one run. */
34
+ export interface ByteBudget {
35
+ remaining: number;
36
+ exhausted: boolean;
37
+ }
38
+ export declare function newBudget(total?: number): ByteBudget;
39
+ /** Rollout files under `<home>/sessions`, newest first. Symlinks, other file types and deep trees are skipped. */
40
+ export declare function listRollouts(codexHome: string): RolloutFile[];
41
+ /** Facts from the head and tail records of one rollout. */
42
+ export declare function parseRollout(fileId: string, window: {
43
+ head: string;
44
+ tail: string | null;
45
+ headCut: boolean;
46
+ }): RolloutFacts;
47
+ /** Facts for one rollout, or null when it cannot be read (refused type, budget spent, unreadable). */
48
+ export declare function readRollout(file: RolloutFile, budget: ByteBudget): RolloutFacts | null;