@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
@@ -0,0 +1,85 @@
1
+ // src/lane-events.ts — reads Codex hook payloads into lane events, failing open.
2
+ //
3
+ // Shapes seen on codex-cli 0.164.0 (probed against a fake Responses provider, 2026-10-26):
4
+ // SubagentStart { session_id (the parent's), turn_id, cwd, agent_id, agent_type }
5
+ // SubagentStop the same plus agent_transcript_path, stop_hook_active, last_assistant_message
6
+ // PostToolUse from a child: the usual fields plus agent_id and agent_type
7
+ // spawn_agent PostToolUse of the parent: tool_response is the JSON text {"agent_id","nickname"}
8
+ // A payload that does not look like this yields no event: no row is drawn and nothing is printed.
9
+ // Only ids, a plain display name, the agent type and plan counts leave a payload; a prompt, a command,
10
+ // a tool input or a model message never does.
11
+ import { isAbsolute } from "node:path";
12
+ import { laneKind, laneName } from "./lane-state.js";
13
+ function isRecord(value) {
14
+ return typeof value === "object" && value !== null && !Array.isArray(value);
15
+ }
16
+ function text(value, max = 128) {
17
+ return typeof value === "string" && value !== "" && value.length <= max ? value : null;
18
+ }
19
+ /** The session and workspace a payload names; null unless both are present and the workspace is absolute. */
20
+ export function laneScope(parsed) {
21
+ if (!isRecord(parsed))
22
+ return null;
23
+ const sessionId = text(parsed["session_id"]);
24
+ const cwd = text(parsed["cwd"], 4096);
25
+ return sessionId === null || cwd === null || !isAbsolute(cwd) ? null : { sessionId, cwd };
26
+ }
27
+ /** The lane event a `SubagentStart` or `SubagentStop` payload carries, or null. */
28
+ export function subagentEvent(parsed, kind) {
29
+ if (!isRecord(parsed))
30
+ return null;
31
+ const agentId = text(parsed["agent_id"]);
32
+ if (agentId === null)
33
+ return null;
34
+ return kind === "stop"
35
+ ? { type: "stopped", agentId }
36
+ : { type: "started", agentId, kind: laneKind(parsed["agent_type"]) };
37
+ }
38
+ function parseJson(value) {
39
+ if (typeof value !== "string" || value.length > 4096)
40
+ return value;
41
+ try {
42
+ return JSON.parse(value);
43
+ }
44
+ catch {
45
+ return null;
46
+ }
47
+ }
48
+ /** Done and total of an `update_plan` list (`plan: [{ step, status }]`); null for an empty or odd one. */
49
+ export function planCounts(toolInput) {
50
+ const plan = isRecord(toolInput) ? toolInput["plan"] : null;
51
+ if (!Array.isArray(plan) || plan.length === 0 || plan.length > 200)
52
+ return null;
53
+ let done = 0;
54
+ for (const item of plan) {
55
+ const status = isRecord(item) ? item["status"] : null;
56
+ if (status !== "pending" && status !== "in_progress" && status !== "completed")
57
+ return null;
58
+ if (status === "completed")
59
+ done += 1;
60
+ }
61
+ return { done, total: plan.length };
62
+ }
63
+ /** The lane events one `PostToolUse` payload carries: a spawn's name, an `update_plan` count, a child's step. */
64
+ export function toolLaneEvents(parsed) {
65
+ if (!isRecord(parsed))
66
+ return [];
67
+ const tool = text(parsed["tool_name"], 128);
68
+ const agentId = text(parsed["agent_id"]);
69
+ const events = [];
70
+ if (tool === "spawn_agent") {
71
+ const reply = parseJson(parsed["tool_response"]);
72
+ const spawned = isRecord(reply) ? text(reply["agent_id"]) : null;
73
+ if (spawned !== null)
74
+ events.push({ type: "spawned", agentId: spawned, name: laneName(isRecord(reply) ? reply["nickname"] : null) });
75
+ return events;
76
+ }
77
+ if (tool === "update_plan") {
78
+ const counts = planCounts(parsed["tool_input"]);
79
+ if (counts !== null)
80
+ events.push({ type: "plan", agentId, counts });
81
+ }
82
+ if (agentId !== null && tool !== null)
83
+ events.push({ type: "tool", agentId });
84
+ return events;
85
+ }
@@ -0,0 +1,55 @@
1
+ export declare const LANE_DIR = ".litcodex/lane-state";
2
+ export declare const MAX_LANES = 12;
3
+ /** A lane nobody touched for this long lost its stop event (a killed child); it is no longer shown. */
4
+ export declare const LANE_STALE_MS: number;
5
+ /** A lane quiet for this long reads `idle` instead of `running`. */
6
+ export declare const LANE_IDLE_MS: number;
7
+ export interface LaneCounts {
8
+ readonly done: number;
9
+ readonly total: number;
10
+ }
11
+ export interface LaneRecord {
12
+ readonly agentId: string;
13
+ readonly name: string | null;
14
+ readonly kind: string | null;
15
+ readonly started: boolean;
16
+ readonly startedAt: number | null;
17
+ readonly at: number;
18
+ readonly steps: number;
19
+ readonly plan: LaneCounts | null;
20
+ }
21
+ export type LaneEvent = {
22
+ readonly type: "spawned";
23
+ readonly agentId: string;
24
+ readonly name: string | null;
25
+ } | {
26
+ readonly type: "started";
27
+ readonly agentId: string;
28
+ readonly kind: string | null;
29
+ } | {
30
+ readonly type: "stopped";
31
+ readonly agentId: string;
32
+ } | {
33
+ readonly type: "tool";
34
+ readonly agentId: string;
35
+ } | {
36
+ readonly type: "plan";
37
+ readonly agentId: string | null;
38
+ readonly counts: LaneCounts;
39
+ };
40
+ /** A display name that is plain letters, digits, spaces and `._-`, at most 24 characters; else null. */
41
+ export declare function laneName(value: unknown): string | null;
42
+ /** An agent type such as `default` or `explorer`; anything else is not shown. */
43
+ export declare function laneKind(value: unknown): string | null;
44
+ /**
45
+ * Apply one event to a lane record and return the next one, or null when the lane is gone. Pure.
46
+ * `started` and `spawned` open a record; `tool` and `plan` only update a record whose child already
47
+ * started, so a stray event never draws a lane that has no end.
48
+ */
49
+ export declare function applyLaneEvent(lane: LaneRecord | null, event: LaneEvent, now: number): LaneRecord | null;
50
+ /** Read, apply one event and write back. Never throws. */
51
+ export declare function recordLaneEvent(cwd: string, sessionId: string, event: LaneEvent, now?: number): void;
52
+ /** The lanes to draw: started, not stale, oldest first; a spawn that never started is not one. */
53
+ export declare function readLanes(cwd: string, sessionId: string, now?: number): LaneRecord[];
54
+ /** The main thread's last `update_plan` counts, or null when it kept none. */
55
+ export declare function readMainPlan(cwd: string, sessionId: string): LaneCounts | null;
@@ -0,0 +1,227 @@
1
+ // src/lane-state.ts — the child agents (lanes) of a session and the main thread's own to-do count.
2
+ //
3
+ // Codex 0.164.0 fires `SubagentStart` and `SubagentStop` around each child agent and tags every tool
4
+ // event of a child with its `agent_id`. The hooks fold those into one small record per child under
5
+ // `.litcodex/lane-state/<session>/`, so parallel children never write the same file. A record keeps a
6
+ // display name, the agent type, when it started, how many tool calls it finished and the counts of its
7
+ // last `update_plan`; never a prompt, a command or a tool input. The main thread's own plan count lives
8
+ // in `main.json` beside them. A lane starts at `SubagentStart` and leaves at `SubagentStop`; one nobody
9
+ // touched for LANE_STALE_MS is no longer shown. Every read and write fails open.
10
+ import { closeSync, fstatSync, lstatSync, mkdirSync, readdirSync, readSync, rmSync } from "node:fs";
11
+ import { isAbsolute, join } from "node:path";
12
+ import { openRegularFile, plainDirs, plainDirsOrMissing, writeFileAtomic } from "./live-step.js";
13
+ import { normalizeSessionId } from "./state-paths.js";
14
+ export const LANE_DIR = ".litcodex/lane-state";
15
+ export const MAX_LANES = 12;
16
+ /** A lane nobody touched for this long lost its stop event (a killed child); it is no longer shown. */
17
+ export const LANE_STALE_MS = 30 * 60 * 1000;
18
+ /** A lane quiet for this long reads `idle` instead of `running`. */
19
+ export const LANE_IDLE_MS = 10 * 60 * 1000;
20
+ const MAX_RECORD_BYTES = 2_048;
21
+ const MAX_COUNT = 9_999;
22
+ const NAME = /^[\p{L}\p{N}][\p{L}\p{N} ._-]{0,23}$/u;
23
+ const KIND = /^[a-z][a-z0-9_-]{0,19}$/u;
24
+ function isRecord(value) {
25
+ return typeof value === "object" && value !== null && !Array.isArray(value);
26
+ }
27
+ function count(value) {
28
+ return typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= MAX_COUNT ? value : null;
29
+ }
30
+ function counts(value) {
31
+ if (!isRecord(value))
32
+ return null;
33
+ const done = count(value["done"]);
34
+ const total = count(value["total"]);
35
+ return done === null || total === null || total === 0 || done > total ? null : { done, total };
36
+ }
37
+ /** A display name that is plain letters, digits, spaces and `._-`, at most 24 characters; else null. */
38
+ export function laneName(value) {
39
+ return typeof value === "string" && NAME.test(value.trim()) ? value.trim() : null;
40
+ }
41
+ /** An agent type such as `default` or `explorer`; anything else is not shown. */
42
+ export function laneKind(value) {
43
+ return typeof value === "string" && KIND.test(value) ? value : null;
44
+ }
45
+ function laneDir(cwd, sessionId) {
46
+ const id = normalizeSessionId(sessionId);
47
+ if (id === null || !isAbsolute(cwd))
48
+ return null;
49
+ const rel = `${LANE_DIR}/${id}`;
50
+ return { rel, dir: join(cwd, rel) };
51
+ }
52
+ function readRecordFile(path) {
53
+ let fd = null;
54
+ try {
55
+ fd = openRegularFile(path);
56
+ if (fd === null)
57
+ return null;
58
+ const stat = fstatSync(fd);
59
+ if (!stat.isFile() || stat.size > MAX_RECORD_BYTES)
60
+ return null;
61
+ const buffer = Buffer.alloc(stat.size);
62
+ const read = readSync(fd, buffer, 0, stat.size, 0);
63
+ return JSON.parse(buffer.subarray(0, read).toString("utf8"));
64
+ }
65
+ catch {
66
+ return null;
67
+ }
68
+ finally {
69
+ if (fd !== null)
70
+ closeSync(fd);
71
+ }
72
+ }
73
+ function toLane(value, agentId) {
74
+ if (!isRecord(value) || value["agentId"] !== agentId)
75
+ return null;
76
+ const at = value["at"];
77
+ if (typeof at !== "number" || !Number.isFinite(at))
78
+ return null;
79
+ const startedAt = value["startedAt"];
80
+ return {
81
+ agentId,
82
+ name: laneName(value["name"]),
83
+ kind: laneKind(value["kind"]),
84
+ started: value["started"] === true,
85
+ startedAt: typeof startedAt === "number" && Number.isFinite(startedAt) ? startedAt : null,
86
+ at,
87
+ steps: count(value["steps"]) ?? 0,
88
+ plan: counts(value["plan"]),
89
+ };
90
+ }
91
+ function laneFile(agentId) {
92
+ const id = normalizeSessionId(agentId);
93
+ return id === null ? null : `lane-${id}.json`;
94
+ }
95
+ function readLane(cwd, sessionId, agentId) {
96
+ const where = laneDir(cwd, sessionId);
97
+ const file = laneFile(agentId);
98
+ if (where === null || file === null || !plainDirs(cwd, where.rel))
99
+ return null;
100
+ return toLane(readRecordFile(join(where.dir, file)), agentId);
101
+ }
102
+ function writeJson(cwd, sessionId, file, value) {
103
+ const where = laneDir(cwd, sessionId);
104
+ if (where === null || !plainDirsOrMissing(cwd, where.rel))
105
+ return;
106
+ mkdirSync(where.dir, { recursive: true });
107
+ if (!lstatSync(where.dir).isDirectory())
108
+ return;
109
+ writeFileAtomic(join(where.dir, file), `${JSON.stringify(value)}\n`);
110
+ }
111
+ /**
112
+ * Apply one event to a lane record and return the next one, or null when the lane is gone. Pure.
113
+ * `started` and `spawned` open a record; `tool` and `plan` only update a record whose child already
114
+ * started, so a stray event never draws a lane that has no end.
115
+ */
116
+ export function applyLaneEvent(lane, event, now) {
117
+ switch (event.type) {
118
+ case "stopped":
119
+ return null;
120
+ case "spawned": {
121
+ const base = lane ?? {
122
+ agentId: event.agentId,
123
+ name: null,
124
+ kind: null,
125
+ started: false,
126
+ startedAt: null,
127
+ at: now,
128
+ steps: 0,
129
+ plan: null,
130
+ };
131
+ return { ...base, name: event.name ?? base.name, at: lane === null ? now : base.at };
132
+ }
133
+ case "started": {
134
+ const base = lane ?? {
135
+ agentId: event.agentId,
136
+ name: null,
137
+ kind: null,
138
+ started: false,
139
+ startedAt: null,
140
+ at: now,
141
+ steps: 0,
142
+ plan: null,
143
+ };
144
+ return { ...base, kind: event.kind ?? base.kind, started: true, startedAt: base.startedAt ?? now, at: now };
145
+ }
146
+ case "tool":
147
+ return lane?.started ? { ...lane, steps: Math.min(MAX_COUNT, lane.steps + 1), at: now } : lane;
148
+ case "plan":
149
+ return lane?.started ? { ...lane, plan: event.counts, at: now } : lane;
150
+ }
151
+ }
152
+ /** Remove lane files whose last event is a day old, spawns that never started among them. */
153
+ function pruneOld(cwd, sessionId, now) {
154
+ const where = laneDir(cwd, sessionId);
155
+ if (where === null)
156
+ return;
157
+ for (const name of readdirSync(where.dir)) {
158
+ const match = /^lane-(.+)\.json$/u.exec(name);
159
+ if (match?.[1] === undefined)
160
+ continue;
161
+ const lane = toLane(readRecordFile(join(where.dir, name)), match[1]);
162
+ if (lane !== null && now - lane.at > 24 * 60 * 60 * 1000)
163
+ rmSync(join(where.dir, name), { force: true });
164
+ }
165
+ }
166
+ /** Read, apply one event and write back. Never throws. */
167
+ export function recordLaneEvent(cwd, sessionId, event, now = Date.now()) {
168
+ try {
169
+ if (event.type === "plan" && event.agentId === null) {
170
+ writeJson(cwd, sessionId, "main.json", { version: 1, plan: event.counts, at: now });
171
+ return;
172
+ }
173
+ const agentId = event.agentId;
174
+ const file = agentId === null ? null : laneFile(agentId);
175
+ if (agentId === null || file === null)
176
+ return;
177
+ const next = applyLaneEvent(readLane(cwd, sessionId, agentId), event, now);
178
+ if (next === null) {
179
+ const where = laneDir(cwd, sessionId);
180
+ if (where !== null && plainDirs(cwd, where.rel))
181
+ rmSync(join(where.dir, file), { force: true });
182
+ return;
183
+ }
184
+ writeJson(cwd, sessionId, file, { version: 1, ...next });
185
+ if (event.type === "started")
186
+ pruneOld(cwd, sessionId, now);
187
+ }
188
+ catch {
189
+ // The card shows the last good record; a hook never fails because of it.
190
+ }
191
+ }
192
+ /** The lanes to draw: started, not stale, oldest first; a spawn that never started is not one. */
193
+ export function readLanes(cwd, sessionId, now = Date.now()) {
194
+ try {
195
+ const where = laneDir(cwd, sessionId);
196
+ if (where === null || !plainDirs(cwd, where.rel))
197
+ return [];
198
+ const lanes = [];
199
+ for (const name of readdirSync(where.dir)) {
200
+ const match = /^lane-(.+)\.json$/u.exec(name);
201
+ if (match?.[1] === undefined)
202
+ continue;
203
+ const lane = toLane(readRecordFile(join(where.dir, name)), match[1]);
204
+ if (lane === null || !lane.started || now - lane.at > LANE_STALE_MS)
205
+ continue;
206
+ lanes.push(lane);
207
+ }
208
+ lanes.sort((a, b) => (a.startedAt ?? a.at) - (b.startedAt ?? b.at) || a.agentId.localeCompare(b.agentId));
209
+ return lanes.slice(0, MAX_LANES);
210
+ }
211
+ catch {
212
+ return [];
213
+ }
214
+ }
215
+ /** The main thread's last `update_plan` counts, or null when it kept none. */
216
+ export function readMainPlan(cwd, sessionId) {
217
+ try {
218
+ const where = laneDir(cwd, sessionId);
219
+ if (where === null || !plainDirs(cwd, where.rel))
220
+ return null;
221
+ const record = readRecordFile(join(where.dir, "main.json"));
222
+ return isRecord(record) ? counts(record["plan"]) : null;
223
+ }
224
+ catch {
225
+ return null;
226
+ }
227
+ }
@@ -7,6 +7,8 @@ export interface LiveStep {
7
7
  readonly turnEndedAt: number | null;
8
8
  /** The tool that finished last in this turn; most steps end between two card polls. */
9
9
  readonly lastTool: string | null;
10
+ /** Why the session waits on the user: "question", "blocked", or null (no reason detected). */
11
+ readonly waitReason?: string | null;
10
12
  }
11
13
  export interface ThreadPointer {
12
14
  readonly cwd: string;
@@ -50,7 +52,9 @@ export declare function recordLiveStepEnd(repoRoot: string, sessionId: string, r
50
52
  * End whatever step this session still shows, since no tool runs once Stop fires, and close the turn
51
53
  * unless a Stop guard is sending the model back to work (`closeTurn` false).
52
54
  */
53
- export declare function endLiveStep(repoRoot: string, sessionId: string, now?: number, closeTurn?: boolean): void;
55
+ export declare function endLiveStep(repoRoot: string, sessionId: string, now?: number, closeTurn?: boolean, waitReason?: string | null): void;
56
+ /** Detect why the session waits on the user from the last assistant message, or null. */
57
+ export declare function detectWaitReason(lastMessage: string | null): string | null;
54
58
  /** `$CODEX_HOME`, else `$HOME/.codex`, read from the given environment only; null when neither is set. */
55
59
  export declare function codexHomeFrom(env: NodeJS.ProcessEnv): string | null;
56
60
  export declare function threadPointerPath(env: NodeJS.ProcessEnv, threadId: string): string | null;
@@ -142,6 +142,7 @@ export function readLiveStep(repoRoot, sessionId) {
142
142
  return null;
143
143
  const text = (value) => (typeof value === "string" && value !== "" ? value : null);
144
144
  const time = (value) => (typeof value === "number" && Number.isFinite(value) ? value : null);
145
+ const waitReason = text(record["waitReason"]);
145
146
  return {
146
147
  tool: text(record["tool"]),
147
148
  toolUseId: text(record["toolUseId"]),
@@ -150,6 +151,7 @@ export function readLiveStep(repoRoot, sessionId) {
150
151
  turnStartedAt: time(record["turnStartedAt"]),
151
152
  turnEndedAt: time(record["turnEndedAt"]),
152
153
  lastTool: text(record["lastTool"]),
154
+ ...(waitReason !== null ? { waitReason } : {}),
153
155
  };
154
156
  }
155
157
  function writeLiveStep(repoRoot, path, step) {
@@ -224,7 +226,7 @@ export function recordLiveStepEnd(repoRoot, sessionId, ref, now = Date.now()) {
224
226
  * End whatever step this session still shows, since no tool runs once Stop fires, and close the turn
225
227
  * unless a Stop guard is sending the model back to work (`closeTurn` false).
226
228
  */
227
- export function endLiveStep(repoRoot, sessionId, now = Date.now(), closeTurn = true) {
229
+ export function endLiveStep(repoRoot, sessionId, now = Date.now(), closeTurn = true, waitReason) {
228
230
  const path = liveStepPath(repoRoot, sessionId);
229
231
  const current = path === null ? null : readLiveStep(repoRoot, sessionId);
230
232
  if (path === null || current === null)
@@ -239,8 +241,22 @@ export function endLiveStep(repoRoot, sessionId, now = Date.now(), closeTurn = t
239
241
  turnStartedAt: current.turnStartedAt,
240
242
  turnEndedAt: closeTurn ? now : current.turnEndedAt,
241
243
  lastTool: current.tool ?? current.lastTool,
244
+ ...(closeTurn && waitReason != null ? { waitReason } : {}),
242
245
  });
243
246
  }
247
+ /** The last words ask the person something: a closing question, or a request to approve, confirm or deny. */
248
+ const ASKS = /[??]\s*$|`?lit approve`?|`?lit deny`?|승인해\s*주|확인해\s*주|괜찮을까요|할까요/iu;
249
+ const BLOCKED_RE = /^BLOCKED:/mu;
250
+ /** Detect why the session waits on the user from the last assistant message, or null. */
251
+ export function detectWaitReason(lastMessage) {
252
+ if (lastMessage === null || lastMessage === "")
253
+ return null;
254
+ if (BLOCKED_RE.test(lastMessage))
255
+ return "blocked";
256
+ if (ASKS.test(lastMessage))
257
+ return "question";
258
+ return null;
259
+ }
244
260
  /** `$CODEX_HOME`, else `$HOME/.codex`, read from the given environment only; null when neither is set. */
245
261
  export function codexHomeFrom(env) {
246
262
  const fromEnv = env["CODEX_HOME"]?.trim() ?? "";
@@ -30,4 +30,10 @@ export declare const LIT_COMPREHEND_DIRECTIVE_MARKER: "<lit-comprehend-mode>";
30
30
  export declare const LIT_COMPREHEND_DIRECTIVE_CLOSE: "</lit-comprehend-mode>";
31
31
  export declare const LIT_BRAINSTORM_DIRECTIVE_MARKER: "<lit-brainstorm-mode>";
32
32
  export declare const LIT_BRAINSTORM_DIRECTIVE_CLOSE: "</lit-brainstorm-mode>";
33
+ export declare const LIT_SCHEMATIC_DIRECTIVE_MARKER: "<lit-schematic-mode>";
34
+ export declare const LIT_SCHEMATIC_DIRECTIVE_CLOSE: "</lit-schematic-mode>";
35
+ export declare const LIT_HIJACK_DIRECTIVE_MARKER: "<lit-hijack-mode>";
36
+ export declare const LIT_HIJACK_DIRECTIVE_CLOSE: "</lit-hijack-mode>";
37
+ export declare const LIT_ADHD_DIRECTIVE_MARKER: "<lit-adhd-mode>";
38
+ export declare const LIT_ADHD_DIRECTIVE_CLOSE: "</lit-adhd-mode>";
33
39
  export type LitLoopDirectiveMarker = typeof LIT_LOOP_DIRECTIVE_MARKER;
@@ -36,3 +36,9 @@ export const LIT_COMPREHEND_DIRECTIVE_MARKER = "<lit-comprehend-mode>";
36
36
  export const LIT_COMPREHEND_DIRECTIVE_CLOSE = "</lit-comprehend-mode>";
37
37
  export const LIT_BRAINSTORM_DIRECTIVE_MARKER = "<lit-brainstorm-mode>";
38
38
  export const LIT_BRAINSTORM_DIRECTIVE_CLOSE = "</lit-brainstorm-mode>";
39
+ export const LIT_SCHEMATIC_DIRECTIVE_MARKER = "<lit-schematic-mode>";
40
+ export const LIT_SCHEMATIC_DIRECTIVE_CLOSE = "</lit-schematic-mode>";
41
+ export const LIT_HIJACK_DIRECTIVE_MARKER = "<lit-hijack-mode>";
42
+ export const LIT_HIJACK_DIRECTIVE_CLOSE = "</lit-hijack-mode>";
43
+ export const LIT_ADHD_DIRECTIVE_MARKER = "<lit-adhd-mode>";
44
+ export const LIT_ADHD_DIRECTIVE_CLOSE = "</lit-adhd-mode>";
@@ -1,7 +1,7 @@
1
1
  import type { RenamedSkillId } from "./skill-renames.js";
2
2
  import type { LitTriggerToken } from "./trigger.js";
3
3
  /** Lit-family modes. Multiple tokens may map to one mode (lit/litcodex/lit-loop → lit-loop). */
4
- export type LitMode = RenamedSkillId | "browser-drive" | "lit-handoff" | "lit-scientific-visualization" | "deep-interview" | "lit-crucible" | "lit-init" | "lit-loop" | "litwork" | "lit-plan" | "litgoal" | "review-work" | "litresearch" | "start-work" | "lit-recap" | "lit-comprehend" | "lit-brainstorm";
4
+ export type LitMode = RenamedSkillId | "browser-drive" | "lit-handoff" | "lit-scientific-visualization" | "deep-interview" | "lit-crucible" | "lit-init" | "lit-loop" | "litwork" | "lit-plan" | "litgoal" | "review-work" | "litresearch" | "start-work" | "lit-recap" | "lit-comprehend" | "lit-brainstorm" | "lit-schematic" | "lit-hijack" | "lit-adhd";
5
5
  /** Per-mode routing spec: its marker pair (guard) + resolved directive path (loader). */
6
6
  export interface LitModeSpec {
7
7
  readonly mode: LitMode;
@@ -15,7 +15,7 @@
15
15
  // Imports markers + the trigger token type only (no cycle: hook → modes → {markers, trigger}).
16
16
  import { existsSync } from "node:fs";
17
17
  import { fileURLToPath } from "node:url";
18
- import { BROWSER_DRIVE_DIRECTIVE_CLOSE, BROWSER_DRIVE_DIRECTIVE_MARKER, DEEP_INTERVIEW_DIRECTIVE_CLOSE, DEEP_INTERVIEW_DIRECTIVE_MARKER, HANDOFF_DIRECTIVE_CLOSE, HANDOFF_DIRECTIVE_MARKER, LIT_BRAINSTORM_DIRECTIVE_CLOSE, LIT_BRAINSTORM_DIRECTIVE_MARKER, LIT_COMPREHEND_DIRECTIVE_CLOSE, LIT_COMPREHEND_DIRECTIVE_MARKER, LIT_CRUCIBLE_DIRECTIVE_CLOSE, LIT_CRUCIBLE_DIRECTIVE_MARKER, LIT_INIT_DIRECTIVE_CLOSE, LIT_INIT_DIRECTIVE_MARKER, LIT_LOOP_DIRECTIVE_CLOSE, LIT_LOOP_DIRECTIVE_MARKER, LIT_PLAN_DIRECTIVE_CLOSE, LIT_PLAN_DIRECTIVE_MARKER, LIT_RECAP_DIRECTIVE_CLOSE, LIT_RECAP_DIRECTIVE_MARKER, LITGOAL_DIRECTIVE_CLOSE, LITGOAL_DIRECTIVE_MARKER, LITRESEARCH_DIRECTIVE_CLOSE, LITRESEARCH_DIRECTIVE_MARKER, LITWORK_DIRECTIVE_CLOSE, LITWORK_DIRECTIVE_MARKER, REVIEW_WORK_DIRECTIVE_CLOSE, REVIEW_WORK_DIRECTIVE_MARKER, SCIENTIFIC_VISUALIZATION_DIRECTIVE_CLOSE, SCIENTIFIC_VISUALIZATION_DIRECTIVE_MARKER, START_WORK_DIRECTIVE_CLOSE, START_WORK_DIRECTIVE_MARKER, } from "./markers.js";
18
+ import { BROWSER_DRIVE_DIRECTIVE_CLOSE, BROWSER_DRIVE_DIRECTIVE_MARKER, DEEP_INTERVIEW_DIRECTIVE_CLOSE, DEEP_INTERVIEW_DIRECTIVE_MARKER, HANDOFF_DIRECTIVE_CLOSE, HANDOFF_DIRECTIVE_MARKER, LIT_ADHD_DIRECTIVE_CLOSE, LIT_ADHD_DIRECTIVE_MARKER, LIT_BRAINSTORM_DIRECTIVE_CLOSE, LIT_BRAINSTORM_DIRECTIVE_MARKER, LIT_COMPREHEND_DIRECTIVE_CLOSE, LIT_COMPREHEND_DIRECTIVE_MARKER, LIT_CRUCIBLE_DIRECTIVE_CLOSE, LIT_CRUCIBLE_DIRECTIVE_MARKER, LIT_HIJACK_DIRECTIVE_CLOSE, LIT_HIJACK_DIRECTIVE_MARKER, LIT_INIT_DIRECTIVE_CLOSE, LIT_INIT_DIRECTIVE_MARKER, LIT_LOOP_DIRECTIVE_CLOSE, LIT_LOOP_DIRECTIVE_MARKER, LIT_PLAN_DIRECTIVE_CLOSE, LIT_PLAN_DIRECTIVE_MARKER, LIT_RECAP_DIRECTIVE_CLOSE, LIT_RECAP_DIRECTIVE_MARKER, LIT_SCHEMATIC_DIRECTIVE_CLOSE, LIT_SCHEMATIC_DIRECTIVE_MARKER, LITGOAL_DIRECTIVE_CLOSE, LITGOAL_DIRECTIVE_MARKER, LITRESEARCH_DIRECTIVE_CLOSE, LITRESEARCH_DIRECTIVE_MARKER, LITWORK_DIRECTIVE_CLOSE, LITWORK_DIRECTIVE_MARKER, REVIEW_WORK_DIRECTIVE_CLOSE, REVIEW_WORK_DIRECTIVE_MARKER, SCIENTIFIC_VISUALIZATION_DIRECTIVE_CLOSE, SCIENTIFIC_VISUALIZATION_DIRECTIVE_MARKER, START_WORK_DIRECTIVE_CLOSE, START_WORK_DIRECTIVE_MARKER, } from "./markers.js";
19
19
  /** Resolve a path relative to this module (percent-decoding, space/#/Hangul-safe). */
20
20
  function resolveFromHere(rel) {
21
21
  return fileURLToPath(new URL(rel, import.meta.url));
@@ -168,6 +168,30 @@ export const MODE_BY_TOKEN = Object.freeze({
168
168
  skillName: "lit-brainstorm",
169
169
  skillPath: resolveSkillPath("lit-brainstorm"),
170
170
  }),
171
+ "lit-schematic": Object.freeze({
172
+ mode: "lit-schematic",
173
+ openMarker: LIT_SCHEMATIC_DIRECTIVE_MARKER,
174
+ closeMarker: LIT_SCHEMATIC_DIRECTIVE_CLOSE,
175
+ directivePath: resolveFromHere("../directives/lit-schematic.md"),
176
+ skillName: "lit-schematic",
177
+ skillPath: resolveSkillPath("lit-schematic"),
178
+ }),
179
+ "lit-hijack": Object.freeze({
180
+ mode: "lit-hijack",
181
+ openMarker: LIT_HIJACK_DIRECTIVE_MARKER,
182
+ closeMarker: LIT_HIJACK_DIRECTIVE_CLOSE,
183
+ directivePath: resolveFromHere("../directives/lit-hijack.md"),
184
+ skillName: "lit-hijack",
185
+ skillPath: resolveSkillPath("lit-hijack"),
186
+ }),
187
+ "lit-adhd": Object.freeze({
188
+ mode: "lit-adhd",
189
+ openMarker: LIT_ADHD_DIRECTIVE_MARKER,
190
+ closeMarker: LIT_ADHD_DIRECTIVE_CLOSE,
191
+ directivePath: resolveFromHere("../directives/lit-adhd.md"),
192
+ skillName: "lit-adhd",
193
+ skillPath: resolveSkillPath("lit-adhd"),
194
+ }),
171
195
  });
172
196
  /** The mode spec for a matched token. Total over the token union (every token has a spec). */
173
197
  export function modeForToken(token) {
@@ -0,0 +1,79 @@
1
+ export declare const MOTION_MAX_BLOCKS = 2;
2
+ export interface MotionRun {
3
+ readonly mode: string;
4
+ readonly out: string | null;
5
+ readonly round: number | null;
6
+ readonly stillsOnly: boolean;
7
+ readonly exitCode: number | null;
8
+ readonly at: number;
9
+ }
10
+ export interface MotionTurn {
11
+ readonly sessionId: string;
12
+ readonly promptAt: number;
13
+ readonly runs: readonly MotionRun[];
14
+ readonly blockCount: number;
15
+ readonly warned: boolean;
16
+ readonly notified: boolean;
17
+ }
18
+ /** What the film skill's done-check returns (`engine/completion.mjs`). */
19
+ export interface MotionVerdict {
20
+ readonly status: string;
21
+ readonly reason: string;
22
+ readonly downgraded?: readonly string[];
23
+ readonly openItems?: readonly string[];
24
+ readonly labels?: readonly string[];
25
+ readonly mode?: string;
26
+ }
27
+ export type MotionEvaluator = (outDir: string) => Promise<MotionVerdict | null> | MotionVerdict | null;
28
+ export type MotionStopDecision = {
29
+ readonly action: "allow";
30
+ readonly why: string;
31
+ } | {
32
+ readonly action: "block";
33
+ readonly why: string;
34
+ readonly reason: string;
35
+ };
36
+ export declare function motionTurnPath(root: string): string;
37
+ /**
38
+ * The nearest folder up the tree from `cwd` whose record belongs to `sessionId`. The model often works
39
+ * inside the film folder, and that folder is not the one the prompt armed. A record of another session is
40
+ * not this turn's; an unreadable one of this folder ends the search as "bad" so the caller fails open.
41
+ */
42
+ export declare function findMotionTurnRoot(cwd: string, sessionId: string): {
43
+ readonly root: string;
44
+ readonly turn: MotionTurn;
45
+ } | "bad" | null;
46
+ /** Arm the turn for a film prompt: a fresh record, no runs, no reminders yet. */
47
+ export declare function armMotionTurn(cwd: string, sessionId: string, now?: number): boolean;
48
+ /** A prompt that is not a film prompt ends the gate for this session; nothing else is touched. */
49
+ export declare function disarmMotionTurn(cwd: string, sessionId: string): void;
50
+ export interface ParsedMotionCommand {
51
+ readonly mode: string;
52
+ readonly out: string | null;
53
+ readonly round: number | null;
54
+ readonly stillsOnly: boolean;
55
+ }
56
+ /**
57
+ * Parse one shell call that runs `render.mjs <subcommand> ...`. Variables the same command set earlier
58
+ * (`D=/x/film && node "$R" stage --out "$D"`, also `${D}`) are expanded first. An output path that still
59
+ * holds a `$` after that, or a command substitution, is unknown (`out: null`), never guessed.
60
+ */
61
+ export declare function parseMotionCommand(command: string, workdir: string): ParsedMotionCommand | null;
62
+ /** The run's exit: a numeric field the host sends, else an `exit <code>` line, else a blocked name the renderer printed. */
63
+ export declare function exitCodeOf(response: unknown): number | null;
64
+ /** Record a finished shell call that ran `render.mjs`. Silent for anything else, and never throws. */
65
+ export declare function recordMotionTool(input: unknown, now?: number): MotionTurn | null;
66
+ /**
67
+ * The installed film skill's done-check, imported by absolute path. Null when the skill or its module is
68
+ * missing (the gate cannot judge, so it fails open); a check that throws on a render folder it cannot read
69
+ * is a not-complete verdict that names the cause.
70
+ */
71
+ export declare const installedEvaluator: MotionEvaluator;
72
+ export interface MotionStopInput {
73
+ readonly cwd: string;
74
+ readonly sessionId: string;
75
+ readonly now?: number;
76
+ readonly evaluate?: MotionEvaluator;
77
+ }
78
+ /** Decide whether the Stop event may end a film turn. Allows when there is no armed turn or this gate cannot judge. */
79
+ export declare function evaluateMotionStop(input: MotionStopInput): Promise<MotionStopDecision>;