@litfamily/litgravity 0.1.1 → 0.1.3

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 (251) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/README.md +19 -3
  3. package/README_ko-KR.md +19 -3
  4. package/TRADEMARK.md +12 -0
  5. package/package.json +3 -2
  6. package/plugin/hooks/lib/lanes.mjs +65 -0
  7. package/plugin/hooks/lib/liveness.mjs +81 -0
  8. package/plugin/hooks/lib/motion.mjs +34 -5
  9. package/plugin/hooks/lib/reentry.mjs +7 -0
  10. package/plugin/hooks/lib/rewind/brief.mjs +364 -0
  11. package/plugin/hooks/lib/rewind/collect.mjs +359 -0
  12. package/plugin/hooks/lib/rewind/gauge.mjs +55 -0
  13. package/plugin/hooks/lib/rewind/next-step.mjs +77 -0
  14. package/plugin/hooks/lib/rewind/redact.mjs +60 -0
  15. package/plugin/hooks/lib/rewind/transcripts.mjs +214 -0
  16. package/plugin/hooks/lib/routes.mjs +79 -5
  17. package/plugin/hooks/lib/workflow-stack.mjs +213 -0
  18. package/plugin/hooks/post-tool-use.mjs +39 -1
  19. package/plugin/hooks/pre-invocation.mjs +93 -2
  20. package/plugin/hooks/session-start.mjs +26 -3
  21. package/plugin/hooks/stop.mjs +55 -6
  22. package/plugin/hud/looks.mjs +29 -0
  23. package/plugin/hud/render.mjs +277 -12
  24. package/plugin/plugin.json +1 -1
  25. package/plugin/skills/frontend-ui-ux/SKILL.md +12 -1
  26. package/plugin/skills/frontend-ui-ux/kit/components.css +417 -0
  27. package/plugin/skills/frontend-ui-ux/kit/fonts.json +22 -0
  28. package/plugin/skills/frontend-ui-ux/kit/layouts/landing.html +164 -0
  29. package/plugin/skills/frontend-ui-ux/kit/layouts/settings.html +114 -0
  30. package/plugin/skills/frontend-ui-ux/kit/layouts/workspace.html +115 -0
  31. package/plugin/skills/frontend-ui-ux/kit/styles/computational-brutalism.json +227 -0
  32. package/plugin/skills/frontend-ui-ux/kit/styles/field-notes.json +205 -0
  33. package/plugin/skills/frontend-ui-ux/kit/styles/graphite.json +200 -0
  34. package/plugin/skills/frontend-ui-ux/kit/styles/meadow.json +199 -0
  35. package/plugin/skills/frontend-ui-ux/kit/styles/neo-brutalism.json +222 -0
  36. package/plugin/skills/frontend-ui-ux/kit/ui.js +226 -0
  37. package/plugin/skills/frontend-ui-ux/references/house-styles.md +234 -0
  38. package/plugin/skills/frontend-ui-ux/scripts/design-lock.mjs +400 -0
  39. package/plugin/skills/frontend-ui-ux/scripts/interface-probe-lock.mjs +196 -0
  40. package/plugin/skills/frontend-ui-ux/scripts/interface-probe-page.mjs +30 -9
  41. package/plugin/skills/frontend-ui-ux/scripts/interface-probe-rules.mjs +20 -8
  42. package/plugin/skills/frontend-ui-ux/scripts/interface-probe.mjs +42 -9
  43. package/plugin/skills/frontend-ui-ux/scripts/pixel-art.mjs +60 -0
  44. package/plugin/skills/lit-adhd/SKILL.md +160 -0
  45. package/plugin/skills/lit-adhd/references/card-examples.md +107 -0
  46. package/plugin/skills/lit-adhd/references/status-taxonomy.md +34 -0
  47. package/plugin/skills/lit-adhd/scripts/rewind.mjs +5 -0
  48. package/plugin/skills/lit-diagram-drawer/SKILL.md +5 -3
  49. package/plugin/skills/lit-diagram-drawer/references/drawing-rules.md +1 -1
  50. package/plugin/skills/lit-diagram-drawer/references/style-guide.md +21 -12
  51. package/plugin/skills/lit-diagram-drawer/references/type-architecture.md +3 -3
  52. package/plugin/skills/lit-diagram-drawer/references/type-dependency.md +1 -1
  53. package/plugin/skills/lit-diagram-drawer/references/type-tree.md +3 -3
  54. package/plugin/skills/lit-diagram-drawer/references/type-wardley.md +1 -1
  55. package/plugin/skills/lit-diagram-drawer/scripts/diagram-craft-rules.mjs +1 -2
  56. package/plugin/skills/lit-diagram-drawer/scripts/visual-quality.mjs +1 -2
  57. package/plugin/skills/lit-docx/SKILL.md +3 -3
  58. package/plugin/skills/lit-handoff/SKILL.md +1 -0
  59. package/plugin/skills/lit-hijack/SKILL.md +263 -0
  60. package/plugin/skills/lit-hijack/references/capture-and-provenance.md +100 -0
  61. package/plugin/skills/lit-hijack/references/clean-room-build.md +75 -0
  62. package/plugin/skills/lit-hijack/references/distil-and-licence.md +67 -0
  63. package/plugin/skills/lit-hijack/references/gap-and-port-design.md +100 -0
  64. package/plugin/skills/lit-hijack/references/parity-and-report.md +85 -0
  65. package/plugin/skills/lit-hijack/scripts/hijack.mjs +953 -0
  66. package/plugin/skills/lit-plan/SKILL.md +3 -2
  67. package/plugin/skills/lit-plan/references/plan-contract.md +12 -1
  68. package/plugin/skills/lit-plan/scripts/check-plan.mjs +39 -3
  69. package/plugin/skills/lit-plan/templates/plan.md +3 -0
  70. package/plugin/skills/lit-pptx/SKILL.md +8 -8
  71. package/plugin/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Bold.ttf +0 -0
  72. package/plugin/skills/lit-pptx/fonts/jetbrains-mono/JetBrainsMono-Regular.ttf +0 -0
  73. package/plugin/skills/lit-pptx/fonts/jetbrains-mono/OFL.txt +93 -0
  74. package/plugin/skills/lit-pptx/fonts/provenance.json +32 -1
  75. package/plugin/skills/lit-pptx/references/agents/analyst.md +34 -56
  76. package/plugin/skills/lit-pptx/references/agents/antithesis.md +49 -67
  77. package/plugin/skills/lit-pptx/references/agents/architect.md +38 -51
  78. package/plugin/skills/lit-pptx/references/agents/critic.md +25 -41
  79. package/plugin/skills/lit-pptx/references/agents/synthesizer.md +37 -46
  80. package/plugin/skills/lit-pptx/references/agents/thesis.md +29 -49
  81. package/plugin/skills/lit-pptx/references/anti-slop-checklist.md +119 -145
  82. package/plugin/skills/lit-pptx/references/authoring-guide.md +187 -278
  83. package/plugin/skills/lit-pptx/references/consensus-protocol.md +99 -97
  84. package/plugin/skills/lit-pptx/references/data-display-cookbook.md +36 -137
  85. package/plugin/skills/lit-pptx/references/density-and-fill.md +147 -216
  86. package/plugin/skills/lit-pptx/references/design-system-azure.md +56 -85
  87. package/plugin/skills/lit-pptx/references/direction-step.md +134 -176
  88. package/plugin/skills/lit-pptx/references/examples/01-pitch-signal-ko.md +114 -115
  89. package/plugin/skills/lit-pptx/references/examples/02-pitch-studio-ko.md +66 -66
  90. package/plugin/skills/lit-pptx/references/examples/03-business-review-ledger-ko.md +63 -63
  91. package/plugin/skills/lit-pptx/references/examples/04-business-review-night-en.md +96 -96
  92. package/plugin/skills/lit-pptx/references/examples/05-research-talk-paper-en.md +81 -81
  93. package/plugin/skills/lit-pptx/references/examples/06-lecture-chalk-ko.md +103 -103
  94. package/plugin/skills/lit-pptx/references/examples/07-data-review-night-en.md +100 -98
  95. package/plugin/skills/lit-pptx/references/examples/08-image-led-atlas-ko.md +76 -76
  96. package/plugin/skills/lit-pptx/references/examples/09-briefing-gazette-ko.md +96 -96
  97. package/plugin/skills/lit-pptx/references/examples/10-status-update-ledger-ko.md +80 -80
  98. package/plugin/skills/lit-pptx/references/examples/11-portfolio-studio-en.md +72 -72
  99. package/plugin/skills/lit-pptx/references/examples/12-research-tutorial-chalk-en.md +95 -95
  100. package/plugin/skills/lit-pptx/references/examples/13-engineering-review-computational-brutalism-ko.md +173 -0
  101. package/plugin/skills/lit-pptx/references/examples/14-launch-pitch-neo-brutalism-ko.md +154 -0
  102. package/plugin/skills/lit-pptx/references/examples/15-design-lecture-bauhaus-ko.md +139 -0
  103. package/plugin/skills/lit-pptx/references/examples/16-community-programme-riso-ko.md +158 -0
  104. package/plugin/skills/lit-pptx/references/examples/17-public-data-briefing-newsroom-ko.md +179 -0
  105. package/plugin/skills/lit-pptx/references/interview-protocol.md +83 -102
  106. package/plugin/skills/lit-pptx/references/layout-families.md +161 -265
  107. package/plugin/skills/lit-pptx/references/stages/autopilot.md +30 -70
  108. package/plugin/skills/lit-pptx/references/stages/interview.md +36 -68
  109. package/plugin/skills/lit-pptx/references/stages/plan.md +26 -67
  110. package/plugin/skills/lit-pptx/references/title-treatments.md +93 -145
  111. package/plugin/skills/lit-pptx/references/tonalities/atlas.md +95 -108
  112. package/plugin/skills/lit-pptx/references/tonalities/bauhaus.md +140 -0
  113. package/plugin/skills/lit-pptx/references/tonalities/chalk.md +107 -122
  114. package/plugin/skills/lit-pptx/references/tonalities/computational-brutalism.md +150 -0
  115. package/plugin/skills/lit-pptx/references/tonalities/gazette.md +87 -111
  116. package/plugin/skills/lit-pptx/references/tonalities/ledger.md +96 -125
  117. package/plugin/skills/lit-pptx/references/tonalities/neo-brutalism.md +161 -0
  118. package/plugin/skills/lit-pptx/references/tonalities/newsroom.md +144 -0
  119. package/plugin/skills/lit-pptx/references/tonalities/night.md +104 -131
  120. package/plugin/skills/lit-pptx/references/tonalities/paper.md +114 -130
  121. package/plugin/skills/lit-pptx/references/tonalities/riso.md +137 -0
  122. package/plugin/skills/lit-pptx/references/tonalities/signal.md +96 -103
  123. package/plugin/skills/lit-pptx/references/tonalities/studio.md +81 -112
  124. package/plugin/skills/lit-pptx/scripts/compile-deck.js +4 -6
  125. package/plugin/skills/lit-pptx/scripts/craft_extras.py +135 -91
  126. package/plugin/skills/lit-pptx/scripts/deck_craft.py +1 -1
  127. package/plugin/skills/lit-pptx/scripts/embed_fonts.py +13 -1
  128. package/plugin/skills/lit-pptx/scripts/layout_inventory.py +1 -1
  129. package/plugin/skills/lit-pptx/scripts/learn_template.py +1 -1
  130. package/plugin/skills/lit-pptx/scripts/lib/grid-resolver.js +101 -110
  131. package/plugin/skills/lit-pptx/scripts/lib/layout-resolver.js +9 -15
  132. package/plugin/skills/lit-pptx/scripts/lib/render-pack.js +370 -563
  133. package/plugin/skills/lit-pptx/scripts/lib/slide-grid.js +104 -0
  134. package/plugin/skills/lit-pptx/scripts/lib/template-registry.js +57 -6
  135. package/plugin/skills/lit-pptx/scripts/qa_deck.py +6 -6
  136. package/plugin/skills/lit-pptx/scripts/render_pages.py +31 -0
  137. package/plugin/skills/lit-pptx/scripts/validate_pptx.py +1 -1
  138. package/plugin/skills/lit-pptx/specs/markdown-slide-spec-v1.md +167 -191
  139. package/plugin/skills/lit-pptx/specs/markdown-slide-spec-v2.md +117 -166
  140. package/plugin/skills/lit-pptx/specs/template-enrollment-contract.md +307 -330
  141. package/plugin/skills/lit-pptx/templates/tonalities/atlas/pack.yaml +1 -1
  142. package/plugin/skills/lit-pptx/templates/tonalities/bauhaus/pack.yaml +98 -0
  143. package/plugin/skills/lit-pptx/templates/tonalities/chalk/pack.yaml +1 -1
  144. package/plugin/skills/lit-pptx/templates/tonalities/computational-brutalism/pack.yaml +99 -0
  145. package/plugin/skills/lit-pptx/templates/tonalities/gazette/pack.yaml +1 -1
  146. package/plugin/skills/lit-pptx/templates/tonalities/ledger/pack.yaml +1 -1
  147. package/plugin/skills/lit-pptx/templates/tonalities/neo-brutalism/pack.yaml +107 -0
  148. package/plugin/skills/lit-pptx/templates/tonalities/newsroom/pack.yaml +99 -0
  149. package/plugin/skills/lit-pptx/templates/tonalities/night/pack.yaml +1 -1
  150. package/plugin/skills/lit-pptx/templates/tonalities/paper/pack.yaml +1 -1
  151. package/plugin/skills/lit-pptx/templates/tonalities/riso/pack.yaml +99 -0
  152. package/plugin/skills/lit-pptx/templates/tonalities/signal/pack.yaml +2 -2
  153. package/plugin/skills/lit-pptx/templates/tonalities/studio/pack.yaml +1 -1
  154. package/plugin/skills/lit-schematic/SKILL.md +114 -0
  155. package/plugin/skills/lit-schematic/examples/iso-heat-exchanger/build.mjs +38 -0
  156. package/plugin/skills/lit-schematic/examples/iso-heat-exchanger/scene.mjs +133 -0
  157. package/plugin/skills/lit-schematic/examples/journal-adsorption-rig/build.mjs +87 -0
  158. package/plugin/skills/lit-schematic/examples/pid-dosing-skid/build.mjs +85 -0
  159. package/plugin/skills/lit-schematic/references/cutaway-outputs.md +70 -0
  160. package/plugin/skills/lit-schematic/references/isometric-craft.md +101 -0
  161. package/plugin/skills/lit-schematic/references/journal-figures.md +72 -0
  162. package/plugin/skills/lit-schematic/references/kit-api.md +134 -0
  163. package/plugin/skills/lit-schematic/references/pfd-and-layout.md +53 -0
  164. package/plugin/skills/lit-schematic/references/pid-drafting.md +103 -0
  165. package/plugin/skills/lit-schematic/references/pid-symbols.md +163 -0
  166. package/plugin/skills/lit-schematic/references/verification.md +100 -0
  167. package/plugin/skills/lit-schematic/scripts/doctor.mjs +57 -0
  168. package/plugin/skills/lit-schematic/scripts/lib/figure.mjs +81 -0
  169. package/plugin/skills/lit-schematic/scripts/lib/fonts.mjs +27 -0
  170. package/plugin/skills/lit-schematic/scripts/lib/geom.mjs +113 -0
  171. package/plugin/skills/lit-schematic/scripts/lib/interactive.mjs +292 -0
  172. package/plugin/skills/lit-schematic/scripts/lib/isa.mjs +115 -0
  173. package/plugin/skills/lit-schematic/scripts/lib/iso.mjs +719 -0
  174. package/plugin/skills/lit-schematic/scripts/lib/legend-sheet.mjs +162 -0
  175. package/plugin/skills/lit-schematic/scripts/lib/pid.mjs +937 -0
  176. package/plugin/skills/lit-schematic/scripts/lib/png.mjs +132 -0
  177. package/plugin/skills/lit-schematic/scripts/lib/qa-core.mjs +658 -0
  178. package/plugin/skills/lit-schematic/scripts/lib/route.mjs +218 -0
  179. package/plugin/skills/lit-schematic/scripts/lib/sheet.mjs +890 -0
  180. package/plugin/skills/lit-schematic/scripts/lib/svg.mjs +82 -0
  181. package/plugin/skills/lit-schematic/scripts/lib/theme.mjs +115 -0
  182. package/plugin/skills/lit-schematic/scripts/motion.mjs +129 -0
  183. package/plugin/skills/lit-schematic/scripts/qa.mjs +92 -0
  184. package/plugin/skills/lit-schematic/scripts/render.mjs +233 -0
  185. package/plugin/skills/lit-schematic/scripts/scaffold.mjs +60 -0
  186. package/plugin/skills/lit-scientific-visualization/SKILL.md +17 -6
  187. package/plugin/skills/lit-typographic-motion/SKILL.md +58 -48
  188. package/plugin/skills/lit-typographic-motion/engine/THIRD_PARTY_NOTICES +13 -2
  189. package/plugin/skills/lit-typographic-motion/engine/blender/runner.py +218 -0
  190. package/plugin/skills/lit-typographic-motion/engine/core/presets.mjs +1 -1
  191. package/plugin/skills/lit-typographic-motion/engine/node/analysis.mjs +65 -1
  192. package/plugin/skills/lit-typographic-motion/engine/node/assets.mjs +298 -0
  193. package/plugin/skills/lit-typographic-motion/engine/node/blender.mjs +143 -0
  194. package/plugin/skills/lit-typographic-motion/engine/node/board.mjs +136 -0
  195. package/plugin/skills/lit-typographic-motion/engine/node/brief.mjs +7 -1
  196. package/plugin/skills/lit-typographic-motion/engine/node/chrome.mjs +9 -12
  197. package/plugin/skills/lit-typographic-motion/engine/node/cover-assets.mjs +5 -3
  198. package/plugin/skills/lit-typographic-motion/engine/node/cover-capture.mjs +7 -6
  199. package/plugin/skills/lit-typographic-motion/engine/node/cover-treatment.mjs +37 -4
  200. package/plugin/skills/lit-typographic-motion/engine/node/cover.mjs +19 -8
  201. package/plugin/skills/lit-typographic-motion/engine/node/done.mjs +45 -6
  202. package/plugin/skills/lit-typographic-motion/engine/node/frame-worker.mjs +7 -5
  203. package/plugin/skills/lit-typographic-motion/engine/node/gallery.mjs +121 -0
  204. package/plugin/skills/lit-typographic-motion/engine/node/host.mjs +34 -0
  205. package/plugin/skills/lit-typographic-motion/engine/node/house.mjs +44 -0
  206. package/plugin/skills/lit-typographic-motion/engine/node/look.mjs +34 -20
  207. package/plugin/skills/lit-typographic-motion/engine/node/pipeline.mjs +19 -9
  208. package/plugin/skills/lit-typographic-motion/engine/node/scaffold.mjs +210 -0
  209. package/plugin/skills/lit-typographic-motion/engine/node/score.mjs +639 -0
  210. package/plugin/skills/lit-typographic-motion/engine/node/sound-cli.mjs +21 -4
  211. package/plugin/skills/lit-typographic-motion/engine/node/sound.mjs +127 -29
  212. package/plugin/skills/lit-typographic-motion/engine/node/stage-capture.mjs +7 -6
  213. package/plugin/skills/lit-typographic-motion/engine/node/stage-gate.mjs +59 -5
  214. package/plugin/skills/lit-typographic-motion/engine/node/stage-qa.mjs +141 -9
  215. package/plugin/skills/lit-typographic-motion/engine/node/stage-serve.mjs +28 -5
  216. package/plugin/skills/lit-typographic-motion/engine/node/stage.mjs +82 -14
  217. package/plugin/skills/lit-typographic-motion/engine/node/styles.mjs +213 -0
  218. package/plugin/skills/lit-typographic-motion/engine/node/treatment.mjs +311 -10
  219. package/plugin/skills/lit-typographic-motion/engine/stage/cover-init.js +14 -2
  220. package/plugin/skills/lit-typographic-motion/engine/stage/init.js +11 -1
  221. package/plugin/skills/lit-typographic-motion/engine/stage/qa.js +6 -1
  222. package/plugin/skills/lit-typographic-motion/engine/stage/stage-kit.js +83 -0
  223. package/plugin/skills/lit-typographic-motion/engine/vendor/three/LICENSE +21 -0
  224. package/plugin/skills/lit-typographic-motion/engine/vendor/three/addons/environments/RoomEnvironment.js +144 -0
  225. package/plugin/skills/lit-typographic-motion/engine/vendor/three/addons/geometries/RoundedBoxGeometry.js +155 -0
  226. package/plugin/skills/lit-typographic-motion/engine/vendor/three/three.module.js +54571 -0
  227. package/plugin/skills/lit-typographic-motion/recipes/hero-3d/expected.json +69 -0
  228. package/plugin/skills/lit-typographic-motion/recipes/hero-3d/index.html +139 -0
  229. package/plugin/skills/lit-typographic-motion/recipes/orbit-loop/expected.json +6 -4
  230. package/plugin/skills/lit-typographic-motion/recipes/painted-light/expected.json +4 -2
  231. package/plugin/skills/lit-typographic-motion/recipes/weight-tide/expected.json +7 -5
  232. package/plugin/skills/lit-typographic-motion/references/cover.md +394 -443
  233. package/plugin/skills/lit-typographic-motion/references/craft-loop.md +57 -87
  234. package/plugin/skills/lit-typographic-motion/references/depth.md +122 -0
  235. package/plugin/skills/lit-typographic-motion/references/look.md +94 -129
  236. package/plugin/skills/lit-typographic-motion/references/runtime.md +58 -91
  237. package/plugin/skills/lit-typographic-motion/references/sound.md +130 -99
  238. package/plugin/skills/lit-typographic-motion/references/stage.md +190 -215
  239. package/plugin/skills/lit-typographic-motion/references/studio.md +245 -0
  240. package/plugin/skills/lit-typographic-motion/references/style-bibles.md +108 -97
  241. package/plugin/skills/lit-typographic-motion/references/treatment.md +191 -143
  242. package/plugin/skills/lit-typographic-motion/scripts/motion-doctor.mjs +17 -5
  243. package/plugin/skills/lit-typographic-motion/scripts/motion.mjs +47 -7
  244. package/plugin/skills/lit-typographic-motion/styles/paper.json +41 -0
  245. package/plugin/skills/lit-typographic-motion/styles/swiss-signal.json +41 -0
  246. package/plugin/skills/lit-typographic-motion/styles/terminalcore.json +42 -0
  247. package/plugin/skills/lit-typographic-motion/styles/tidal.json +41 -0
  248. package/plugin/skills/litresearch/SKILL.md +1 -0
  249. package/plugin/skills/readme-studio/SKILL.md +2 -0
  250. package/plugin/skills/review-work/SKILL.md +1 -1
  251. package/plugin/skills/start-work/SKILL.md +2 -2
@@ -0,0 +1,364 @@
1
+ // The lit-adhd brief, drawn by code from the collector's data so the model only copies it and a
2
+ // tired reader finds every part in the same place each time. Markdown, because agy's chat pane
3
+ // renders headings, bold, quotes, tables and code blocks: a headline, a card per live session grouped
4
+ // by folder and branch, a table of ended sessions, the roadmap timeline and one boxed next step.
5
+ // Every string in `data` is already redacted and clipped; this file adds layout and words, never a
6
+ // number the data does not hold, and never a question-mark gauge.
7
+
8
+ import { basename } from 'node:path';
9
+
10
+ import { clipToWidth, displayWidth } from './gauge.mjs';
11
+
12
+ const WORDS = {
13
+ en: {
14
+ sessions: (n) => `${n} ${n === 1 ? 'session' : 'sessions'}`,
15
+ waiting: (n) => `${n} ${n === 1 ? 'waits' : 'wait'} on you`,
16
+ active: (n) => `${n} active`,
17
+ window: (since, trees) => `last ${since} · ${trees} ${trees === 1 ? 'folder' : 'folders'} read`,
18
+ badge: { 'waiting-on-user': '🟠 **WAITING ON YOU**', active: '🟢 **ACTIVE**', idle: '💤 idle', done: '✅ **DONE**', ended: '⚪ ended', unknown: '⚫ unknown' },
19
+ doneSoFar: 'Done so far',
20
+ doingNow: 'Doing now',
21
+ plansFinished: (n) => `${n} ${n === 1 ? 'plan' : 'plans'} finished`,
22
+ sessionsDone: (n) => `${n} ${n === 1 ? 'session' : 'sessions'} done`,
23
+ nothingDone: 'nothing finished in this window',
24
+ nothingRunning: 'nothing running',
25
+ plansSkipped: (n) => `${n} plan ${n === 1 ? 'file' : 'files'} skipped (no task rows or an unfilled scaffold).`,
26
+ reason: { 'asked the user': 'it asked you something', 'paused workflow': 'a paused route' },
27
+ ago: (text) => `${text} ago`,
28
+ justNow: 'just now',
29
+ self: 'this conversation',
30
+ worked: (d) => `${d} of work`,
31
+ lastAsk: (text) => `last ask: “${text}”`,
32
+ done: 'Done',
33
+ nextLabel: 'Next',
34
+ noneDone: 'no file writes or commits on record',
35
+ toolsUsed: (list) => `no writes yet; used ${list}`,
36
+ files: 'wrote',
37
+ commits: (n) => `${n} ${n === 1 ? 'commit' : 'commits'}`,
38
+ answer: (q) => (q ? `answer: “${q}”` : 'answer its question'),
39
+ resume: (skill, stage) => `resume ${skill} at ${stage} (\`lit continue\`)`,
40
+ doing: (what) => `now: ${what}`,
41
+ working: 'working',
42
+ nothing: 'nothing open',
43
+ endedTitle: (n) => `Ended · ${n}`,
44
+ endedHead: ['id', 'where', 'goal', 'ago', 'done'],
45
+ moreEnded: (n) => `…and ${n} more ended`,
46
+ roadmap: 'Roadmap',
47
+ now: 'now',
48
+ later: 'later',
49
+ plansOmitted: (n) => `…${n} more open ${n === 1 ? 'plan' : 'plans'}`,
50
+ noRoadmap: 'no open plan, goal or commit in this window',
51
+ recommended: 'RECOMMENDED NEXT STEP',
52
+ type: 'type',
53
+ step: {
54
+ 'resume-frame': ({ skill, stage }) => `Resume ${skill} at ${stage}`,
55
+ 'continue-work': ({ plan }) => `Keep going on ${plan}`,
56
+ 'start-plan': ({ plan }) => `Start ${plan} with start-work`,
57
+ },
58
+ suggest: {
59
+ answer: ({ id8, where, question }) => `Answer ${id8} in ${where}${question ? `: “${question}”` : ''}`,
60
+ resume: ({ id8, skill, stage, where }) => `Resume ${skill} at ${stage} in ${id8} (${where})`,
61
+ plan: ({ plan, item }) => `Next in ${plan}: ${item}`,
62
+ check: ({ id8, goal, where, doing }) => `Check on ${id8} in ${where} (${goal})${doing ? `, now ${doing}` : ''}`,
63
+ pickUp: ({ id8, goal, where }) => `Pick up ${id8} in ${where}: ${goal}`,
64
+ handoff: ({ file, next }) => `From ${file}: ${next}`,
65
+ start: () => 'No conversation or plan in this window: say what to start',
66
+ },
67
+ goLine: (say) => `Type **\`${say}\`** to continue.`,
68
+ noGo: 'Nothing runs on its own here: open that conversation, or say what to do.',
69
+ unknownSources: (list) => `Not read: ${list}.`,
70
+ older: 'Older conversations were not read (read budget used up).',
71
+ noSessions: 'No agy conversation of this workspace in this window.',
72
+ units: { d: 'd', h: 'h', m: 'm' },
73
+ },
74
+ ko: {
75
+ sessions: (n) => `세션 ${n}개`,
76
+ waiting: (n) => `나를 기다리는 것 ${n}`,
77
+ active: (n) => `진행 중 ${n}`,
78
+ window: (since, trees) => `최근 ${since} · 폴더 ${trees}곳 읽음`,
79
+ badge: { 'waiting-on-user': '🟠 **나를 기다림**', active: '🟢 **진행 중**', idle: '💤 쉬는 중', done: '✅ **완료**', ended: '⚪ 끝남', unknown: '⚫ 알 수 없음' },
80
+ doneSoFar: '지금까지 한 일',
81
+ doingNow: '지금 하는 일',
82
+ plansFinished: (n) => `끝난 계획 ${n}개`,
83
+ sessionsDone: (n) => `끝난 세션 ${n}개`,
84
+ nothingDone: '이 기간에 끝난 일 없음',
85
+ nothingRunning: '진행 중인 일 없음',
86
+ plansSkipped: (n) => `계획 파일 ${n}개는 건너뜀(작업 행이 없거나 채우지 않은 틀).`,
87
+ reason: { 'asked the user': '질문하고 기다림', 'paused workflow': '멈춘 라우트' },
88
+ ago: (text) => `${text} 전`,
89
+ justNow: '방금',
90
+ self: '이 대화',
91
+ worked: (d) => `${d} 작업`,
92
+ lastAsk: (text) => `마지막 요청: “${text}”`,
93
+ done: '한 일',
94
+ nextLabel: '다음',
95
+ noneDone: '기록된 파일 쓰기·커밋 없음',
96
+ toolsUsed: (list) => `아직 쓰기 없음, 쓴 도구 ${list}`,
97
+ files: '씀',
98
+ commits: (n) => `커밋 ${n}개`,
99
+ answer: (q) => (q ? `답하기: “${q}”` : '질문에 답하기'),
100
+ resume: (skill, stage) => `${skill}(${stage}) 이어가기 (\`lit continue\`)`,
101
+ doing: (what) => `지금: ${what}`,
102
+ working: '작업 중',
103
+ nothing: '열린 일 없음',
104
+ endedTitle: (n) => `끝난 세션 · ${n}`,
105
+ endedHead: ['id', '위치', '목표', '경과', '한 일'],
106
+ moreEnded: (n) => `…끝난 세션 ${n}개 더`,
107
+ roadmap: '로드맵',
108
+ now: '지금',
109
+ later: '나중',
110
+ plansOmitted: (n) => `…열린 계획 ${n}개 더`,
111
+ noRoadmap: '이 기간에 열린 계획·목표·커밋 없음',
112
+ recommended: '추천 다음 단계',
113
+ type: '입력',
114
+ step: {
115
+ 'resume-frame': ({ skill, stage }) => `${skill}(${stage}) 이어가기`,
116
+ 'continue-work': ({ plan }) => `${plan} 계속 진행`,
117
+ 'start-plan': ({ plan }) => `${plan}을 start-work로 시작`,
118
+ },
119
+ suggest: {
120
+ answer: ({ id8, where, question }) => `${where}의 ${id8}에 답하기${question ? `: “${question}”` : ''}`,
121
+ resume: ({ id8, skill, stage, where }) => `${where}의 ${id8}에서 ${skill}(${stage}) 이어가기`,
122
+ plan: ({ plan, item }) => `${plan} 다음 항목: ${item}`,
123
+ check: ({ id8, goal, where, doing }) => `${where}의 ${id8} 확인 (${goal})${doing ? `, 지금 ${doing}` : ''}`,
124
+ pickUp: ({ id8, goal, where }) => `${where}의 ${id8} 이어받기: ${goal}`,
125
+ handoff: ({ file, next }) => `${file}에서: ${next}`,
126
+ start: () => '이 기간에 대화·계획이 없습니다. 시작할 일을 말해 주세요',
127
+ },
128
+ goLine: (say) => `**\`${say}\`** 라고 입력하면 이어갑니다.`,
129
+ noGo: '저절로 실행되는 단계는 아닙니다. 그 대화를 열거나 할 일을 말해 주세요.',
130
+ unknownSources: (list) => `읽지 못함: ${list}.`,
131
+ older: '오래된 대화는 읽지 않았습니다(읽기 예산 소진).',
132
+ noSessions: '이 기간에 이 작업 공간의 agy 대화가 없습니다.',
133
+ units: { d: '일', h: '시간', m: '분' },
134
+ },
135
+ };
136
+
137
+ const bare = (text) => String(text ?? '').replace(/\s+/gu, ' ').trim();
138
+ // Inline text from the records: no HTML, no code ticks, no table or emphasis syntax.
139
+ const plain = (text) => bare(text).replace(/[<>`]/gu, (ch) => ({ '<': '‹', '>': '›', '`': "'" }[ch])).replace(/[*_|[\]\\]/gu, (ch) => `\\${ch}`);
140
+ const code = (text) => `\`${bare(text).replace(/`/gu, "'")}\``;
141
+ const placeOf = (session) => (session.worktree && session.worktree !== 'unknown' ? basename(String(session.worktree)) : 'unknown');
142
+ const goalOf = (session) => (session.title && session.title !== 'unknown' ? session.title : session.asked?.[0] ?? 'unknown');
143
+
144
+ // The largest unit only, so a table cell never wraps: `14h`, `3d`, `20m`.
145
+ const age = (iso, now, w) => {
146
+ const ms = now - Date.parse(iso);
147
+ if (!Number.isFinite(ms)) return null;
148
+ const minutes = Math.floor(ms / 60_000);
149
+ if (minutes < 1) return w.justNow;
150
+ if (minutes < 60) return `${minutes}${w.units.m}`;
151
+ if (minutes < 48 * 60) return `${Math.floor(minutes / 60)}${w.units.h}`;
152
+ return `${Math.floor(minutes / 1440)}${w.units.d}`;
153
+ };
154
+ const span = (session, w) => {
155
+ const ms = Date.parse(session.last) - Date.parse(session.started);
156
+ if (!Number.isFinite(ms) || ms <= 0) return null;
157
+ const minutes = Math.max(1, Math.round(ms / 60_000));
158
+ return minutes >= 60 ? `${Math.floor(minutes / 60)}${w.units.h} ${minutes % 60}${w.units.m}` : `${minutes}${w.units.m}`;
159
+ };
160
+ const stamp = (iso) => (typeof iso === 'string' && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/u.test(iso) ? `${iso.slice(5, 10)} ${iso.slice(11, 16)}` : '·');
161
+
162
+ // The last question a conversation asked, from its last model words.
163
+ const lastQuestion = (result, escape = plain) => {
164
+ const found = [...String(result ?? '').matchAll(/[^.!?。?\n]{4,}[??]/gu)].at(-1)?.[0];
165
+ return found ? escape(clipToWidth(bare(found), 90)) : null;
166
+ };
167
+
168
+ // What the last tool call was about: `run_command`, `write_file “app.mjs”`. Never a command line.
169
+ const actionOf = (session, escape = plain) => {
170
+ const action = session.lastAction;
171
+ if (!action?.tool) return null;
172
+ const tool = escape === plain ? code(action.tool) : escape(action.tool);
173
+ return action.target ? `${tool} “${escape(clipToWidth(bare(action.target), 50))}”` : tool;
174
+ };
175
+
176
+ const framesOf = (session, data) => (data.workflows ?? []).filter((f) => f.id8 === session.id8);
177
+
178
+ const progressLine = (session, w) => {
179
+ const progress = session.progress;
180
+ if (progress?.gauge) {
181
+ const rest = (progress.remaining ?? []).slice(0, 2).map(plain).join(', ');
182
+ return `📊 ${code(progress.gauge)}${rest ? ` → ${rest}` : ''}`;
183
+ }
184
+ const facts = [span(session, w) ? w.worked(span(session, w)) : null, session.asked?.at(-1) && session.asked.at(-1) !== 'unknown' ? w.lastAsk(plain(clipToWidth(session.asked.at(-1), 70))) : null].filter(Boolean);
185
+ return facts.length ? `⏳ ${facts.join(' · ')}` : null;
186
+ };
187
+
188
+ const doneLine = (session, w) => {
189
+ const files = (session.done?.files ?? []).slice(0, 3).map((file) => code(basename(String(file))));
190
+ const commits = (session.done?.commits ?? []).slice(0, 2).map(({ hash, subject }) => `${code(hash)} ${plain(clipToWidth(subject, 60))}`);
191
+ const parts = [files.length ? `${w.files} ${files.join(', ')}` : null, commits.length ? `${w.commits(session.done.commits.length)}: ${commits.join('; ')}` : null].filter(Boolean);
192
+ if (parts.length) return parts.join(' · ');
193
+ // The transcript is read head and tail only, so tools are named, never counted.
194
+ const tools = Object.entries(session.done?.tools ?? {}).sort((a, b) => b[1] - a[1]).slice(0, 3).map(([name]) => code(name));
195
+ return tools.length ? w.toolsUsed(tools.join(', ')) : w.noneDone;
196
+ };
197
+
198
+ const nextOf = (session, data, w) => {
199
+ if (session.status === 'waiting-on-user') {
200
+ const paused = framesOf(session, data).find((f) => f.status === 'paused');
201
+ if (paused) return w.resume(plain(paused.skill), plain(paused.stage));
202
+ return w.answer(lastQuestion(session.result));
203
+ }
204
+ if (session.status === 'active') {
205
+ // A route that recorded no stage says what its last tool call was instead of `unknown`.
206
+ const top = framesOf(session, data).at(-1);
207
+ const stage = top && top.stage !== 'unknown' ? `${plain(top.skill)} · ${plain(top.stage)}` : null;
208
+ const doing = actionOf(session);
209
+ return stage ?? (doing ? w.doing(doing) : w.working);
210
+ }
211
+ return w.nothing;
212
+ };
213
+
214
+ const sessionCard = (session, data, now, w) => {
215
+ const head = [w.badge[session.status] ?? w.badge.unknown];
216
+ if (session.waitingReason && w.reason[session.waitingReason]) head.push(w.reason[session.waitingReason]);
217
+ head.push(code(session.id8));
218
+ const skill = framesOf(session, data).at(-1)?.skill;
219
+ if (skill) head.push(code(skill));
220
+ const when = age(session.last, now, w);
221
+ if (when) head.push(when === w.justNow ? when : w.ago(when));
222
+ if (session.self) head.push(`**${w.self}**`);
223
+ const lines = [head.join(' · '), `**${plain(clipToWidth(goalOf(session), 80))}**`];
224
+ const progress = progressLine(session, w);
225
+ if (progress) lines.push(progress);
226
+ lines.push(`✅ ${w.done}: ${doneLine(session, w)}`, `▶ ${w.nextLabel}: ${nextOf(session, data, w)}`);
227
+ return lines.map((line) => `> ${line}`).join(' \n');
228
+ };
229
+
230
+ // Ended conversations are history: one table row each, newest first, at most eight.
231
+ const ENDED_ROWS = 8;
232
+ const endedTable = (sessions, now, w) => {
233
+ const cell = (text) => plain(text) || '·';
234
+ const rows = sessions.slice(0, ENDED_ROWS).map((session) => {
235
+ const commits = session.done?.commits?.length ?? 0;
236
+ const files = session.done?.files?.length ?? 0;
237
+ const done = commits ? w.commits(commits) : files ? `${w.files} ${files}` : '·';
238
+ return `| ${code(session.id8)} | ${cell(clipToWidth(placeOf(session), 20))} | ${cell(clipToWidth(goalOf(session), 40))} | ${cell(age(session.last, now, w) ?? '·')} | ${cell(done)} |`;
239
+ });
240
+ const more = sessions.length > ENDED_ROWS ? ['', `*${w.moreEnded(sessions.length - ENDED_ROWS)}*`] : [];
241
+ return [`| ${w.endedHead.join(' | ')} |`, `|${w.endedHead.map(() => '---').join('|')}|`, ...rows, ...more];
242
+ };
243
+
244
+ // When nothing can run on `go`, the box still recommends one step from what was read: a conversation
245
+ // that waits on the user, a paused route, an open plan item (a live conversation's folder first), the
246
+ // newest other active conversation, the newest ended one. It is shown, never recorded for `go`.
247
+ const suggestion = (data, w) => {
248
+ const sessions = data.sessions ?? [];
249
+ const where = (session) => bare(placeOf(session));
250
+ const goal = (session) => clipToWidth(bare(goalOf(session)), 50);
251
+ const waiting = sessions.find((s) => s.status === 'waiting-on-user' && !s.self);
252
+ if (waiting) return w.suggest.answer({ id8: waiting.id8, where: where(waiting), question: lastQuestion(waiting.result, bare) });
253
+ const paused = (data.workflows ?? []).find((f) => f.status === 'paused');
254
+ if (paused) {
255
+ const owner = sessions.find((s) => s.id8 === paused.id8);
256
+ return w.suggest.resume({ id8: paused.id8, skill: paused.skill, stage: paused.stage, where: owner ? where(owner) : 'unknown' });
257
+ }
258
+ const live = new Set(sessions.filter((s) => s.status !== 'ended').map((s) => s.worktree));
259
+ const open = (data.roadmap?.plans ?? []).filter((p) => p.current);
260
+ const plan = open.find((p) => live.has(p.worktree)) ?? open.find((p) => p.local) ?? open[0];
261
+ if (plan) return w.suggest.plan({ plan: plan.local ? plan.plan : `${basename(String(plan.worktree))}/${plan.plan}`, item: clipToWidth(bare(plan.current), 60) });
262
+ const active = sessions.find((s) => s.status === 'active' && !s.self);
263
+ if (active) return w.suggest.check({ id8: active.id8, goal: goal(active), where: where(active), doing: actionOf(active, bare) });
264
+ const ended = sessions.find((s) => s.status === 'ended' && !s.self);
265
+ if (ended) return w.suggest.pickUp({ id8: ended.id8, goal: goal(ended), where: where(ended) });
266
+ const handoff = (data.handoffs ?? []).find((h) => h.local && h.next);
267
+ if (handoff) return w.suggest.handoff({ file: bare(handoff.file), next: bare(handoff.next) });
268
+ return w.suggest.start();
269
+ };
270
+
271
+ const ROADMAP_COMMITS = 5;
272
+ const roadmapLines = (data, w) => {
273
+ const lines = [];
274
+ for (const commit of (data.commits ?? []).slice(0, ROADMAP_COMMITS).reverse()) {
275
+ lines.push(`- ✓ ${stamp(commit.at)} · ${code(commit.branch)} ${plain(clipToWidth(commit.subject, 70))}`);
276
+ }
277
+ for (const plan of data.roadmap?.plans ?? []) {
278
+ if (!plan.current) continue;
279
+ const where = plan.local ? '' : `${code(basename(String(plan.worktree)))} `;
280
+ const gauge = plan.progress?.gauge ? ` ${code(plan.progress.gauge)}` : '';
281
+ lines.push(`- ▶ ${w.now} · ${where}${code(plan.plan)}${gauge} → ${plain(plan.current)}`);
282
+ for (const item of (plan.progress?.remaining ?? []).slice(1, 3)) lines.push(` - ○ ${w.later} · ${plain(item)}`);
283
+ }
284
+ if (data.roadmap?.plansOmitted) lines.push(`- *${w.plansOmitted(data.roadmap.plansOmitted)}*`);
285
+ for (const goal of data.roadmap?.litgoal ?? []) {
286
+ const gauge = goal.progress?.gauge ? ` ${code(goal.progress.gauge)}` : '';
287
+ lines.push(`- ${goal.status === 'complete' ? '✓' : '▶'} litgoal${gauge} ${plain(clipToWidth(goal.objective, 70))}`);
288
+ }
289
+ return lines.length ? lines : [`- ${w.noRoadmap}`];
290
+ };
291
+
292
+ // Wraps the step at word breaks to the box, three lines at most, the last one clipped.
293
+ const wrap = (text, width, max = 3) => {
294
+ const out = [''];
295
+ for (const word of bare(text).split(' ')) {
296
+ const joined = out.at(-1) ? `${out.at(-1)} ${word}` : word;
297
+ if (displayWidth(joined) <= width || !out.at(-1)) out[out.length - 1] = joined;
298
+ else out.push(word);
299
+ }
300
+ const kept = out.slice(0, max);
301
+ if (out.length > max) kept[max - 1] = `${kept[max - 1]} ${out.slice(max).join(' ')}`;
302
+ return kept.map((line) => clipToWidth(line, width));
303
+ };
304
+
305
+ // Open on the right: agy's chat font draws Hangul narrower than two cells, so a right edge would wander.
306
+ const box = (title, body) => {
307
+ const inner = Math.max(displayWidth(title) + 4, ...body.map(displayWidth)) + 2;
308
+ return ['```', `╭─ ${title} ${'─'.repeat(Math.max(1, inner - displayWidth(title) - 3))}`, ...body.map((line) => `│ ${line}`), `╰${'─'.repeat(inner)}`, '```'].join('\n');
309
+ };
310
+
311
+ // Three lines under the headline, for a reader who reads nothing else: what is finished, what runs now, the step.
312
+ const opener = (data, step, w) => {
313
+ const sessions = data.sessions ?? [];
314
+ const finished = (data.roadmap?.plans ?? []).filter((p) => p.finished).length;
315
+ const doneSessions = sessions.filter((s) => s.status === 'done').length;
316
+ const commits = (data.commits ?? []).length;
317
+ const done = [finished ? w.plansFinished(finished) : null, doneSessions ? w.sessionsDone(doneSessions) : null, commits ? w.commits(commits) : null].filter(Boolean);
318
+ const running = sessions.filter((s) => s.status === 'active').slice(0, 2).map((s) => `${code(s.id8)} ${plain(clipToWidth(goalOf(s), 50))}`);
319
+ return [
320
+ `**${w.doneSoFar}:** ${done.length ? done.join(' · ') : w.nothingDone}`,
321
+ `**${w.doingNow}:** ${running.length ? running.join(' · ') : w.nothingRunning}`,
322
+ `**${w.nextLabel}:** ${plain(step)}`,
323
+ ];
324
+ };
325
+
326
+ export const renderBrief = (data, { lang = 'en', width = 72, now = Date.parse(data.generatedAt) || Date.now() } = {}) => {
327
+ const w = WORDS[lang] ?? WORDS.en;
328
+ const sessions = data.sessions ?? [];
329
+ const summary = data.summary ?? { sessions: sessions.length, waitingOnUser: 0, active: 0 };
330
+ const runs = data.next?.kind && data.next.kind !== 'none';
331
+ const step = runs ? w.step[data.next.kind](Object.fromEntries(Object.entries(data.next.target ?? {}).map(([k, v]) => [k, bare(v)]))) : bare(suggestion(data, w));
332
+ const out = [`## 🧭 ${[w.sessions(summary.sessions), w.waiting(summary.waitingOnUser), w.active(summary.active)].join(' · ')}`];
333
+ out.push(...opener(data, step, w));
334
+ out.push(`*${w.window(data.scope?.since ?? '7d', (data.scope?.worktrees ?? []).length || 1)}*`);
335
+ if (!sessions.length) out.push('', w.noSessions);
336
+
337
+ const live = sessions.filter((s) => s.status !== 'ended');
338
+ const ended = sessions.filter((s) => s.status === 'ended');
339
+ const groups = new Map();
340
+ for (const session of live) {
341
+ const key = `${session.worktree}\u0000${session.branch ?? ''}`;
342
+ if (!groups.has(key)) groups.set(key, []);
343
+ groups.get(key).push(session);
344
+ }
345
+ for (const list of groups.values()) {
346
+ const first = list[0];
347
+ out.push('', `### 🌿 ${code(first.branch ?? 'no branch')} · ${plain(placeOf(first))}`);
348
+ for (const session of list) out.push('', sessionCard(session, data, now, w));
349
+ }
350
+ if (ended.length) out.push('', `### ⚪ ${w.endedTitle(ended.length)}`, '', ...endedTable(ended, now, w));
351
+ const roadGauge = data.roadmap?.progress?.gauge ? ` ${code(data.roadmap.progress.gauge)}` : '';
352
+ out.push('', `### 🗺️ ${w.roadmap}${roadGauge}`, '', ...roadmapLines(data, w));
353
+
354
+ const body = wrap(step, width - 4);
355
+ if (runs && data.next.command) body.push(clipToWidth(data.next.command, width - 4));
356
+ if (runs && data.next.say) body.push(`${w.type}: ${data.next.say}`);
357
+ out.push('', box(w.recommended, body));
358
+ out.push('', runs && data.next.say ? w.goLine(data.next.say) : w.noGo);
359
+
360
+ const unread = Object.entries(data.sources ?? {}).filter(([, v]) => v === 'unknown').map(([k]) => k);
361
+ const tail = [unread.length ? w.unknownSources(unread.join(', ')) : null, data.roadmap?.plansSkipped ? w.plansSkipped(data.roadmap.plansSkipped) : null, data.budget?.exhausted ? w.older : null].filter(Boolean);
362
+ if (tail.length) out.push('', `*${tail.join(' ')}*`);
363
+ return `${out.join('\n')}\n`;
364
+ };