storyink 0.1.0 → 0.2.1

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 (52) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +33 -4
  3. package/THIRD_PARTY_NOTICES.md +12 -0
  4. package/dist/chunks/index-1x789mr9.js +5800 -0
  5. package/dist/chunks/{index-3y6t38gc.js → index-cbjmgtv7.js} +148 -16
  6. package/dist/cli.js +4830 -2900
  7. package/dist/core/index.js +18 -2
  8. package/dist/index.js +66 -25
  9. package/dist/node/index.js +2 -2
  10. package/dist/types/core/index.d.ts +4 -0
  11. package/dist/types/core/layout/nodes.d.ts +8 -0
  12. package/dist/types/core/render/App.d.ts +12 -0
  13. package/dist/types/core/render/Diagram.d.ts +4 -2
  14. package/dist/types/core/render/Story.d.ts +56 -0
  15. package/dist/types/core/render/index.d.ts +2 -0
  16. package/dist/types/core/scene.d.ts +13 -0
  17. package/dist/types/core/spec.d.ts +48 -2
  18. package/dist/types/core/story/auto.d.ts +12 -0
  19. package/dist/types/core/story/compile.d.ts +24 -0
  20. package/dist/types/core/story/ease.d.ts +22 -0
  21. package/dist/types/core/story/state.d.ts +36 -0
  22. package/dist/types/core/story/types.d.ts +142 -0
  23. package/dist/types/generated/meta.d.ts +1 -1
  24. package/dist/types/generated/rolling.d.ts +2 -0
  25. package/dist/types/generated/viewer.d.ts +1 -1
  26. package/dist/types/node/snapshot.d.ts +38 -4
  27. package/dist/types/plugin.d.ts +21 -0
  28. package/dist/types/theme/tokens.d.ts +71 -0
  29. package/docs/spec.md +46 -0
  30. package/examples/checkout.architecture.json +78 -2
  31. package/examples/oauth.sequence.json +197 -22
  32. package/package.json +6 -4
  33. package/schema/storyink.schema.json +226 -1
  34. package/skill/SKILL.md +40 -0
  35. package/dist/chunks/index-sd10277m.js +0 -4017
  36. package/docs/gallery/agent-run.lifecycle.dark.png +0 -0
  37. package/docs/gallery/agent-run.lifecycle.light.png +0 -0
  38. package/docs/gallery/analytics.dataflow.dark.png +0 -0
  39. package/docs/gallery/analytics.dataflow.light.png +0 -0
  40. package/docs/gallery/cache.sequence.dark.png +0 -0
  41. package/docs/gallery/cache.sequence.light.png +0 -0
  42. package/docs/gallery/checkout.architecture.dark.png +0 -0
  43. package/docs/gallery/checkout.architecture.light.png +0 -0
  44. package/docs/gallery/incident.flowchart.dark.png +0 -0
  45. package/docs/gallery/incident.flowchart.light.png +0 -0
  46. package/docs/gallery/oauth.sequence.dark.png +0 -0
  47. package/docs/gallery/oauth.sequence.light.png +0 -0
  48. package/docs/gallery/order.state.dark.png +0 -0
  49. package/docs/gallery/order.state.light.png +0 -0
  50. package/docs/gallery/release.workflow.dark.png +0 -0
  51. package/docs/gallery/release.workflow.light.png +0 -0
  52. /package/dist/chunks/{index-6hdgvcdm.js → index-90zf42zn.js} +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,27 @@
1
+ # Changelog
2
+
3
+ ## 0.2.1
4
+
5
+ - **Fix:** `storyink_snapshot` no longer inlines the full-resolution contact sheet. Tall beat
6
+ sheets (1440 px wide, thousands of px tall) could stall the next model request and bloat
7
+ session context. It now returns **one compact JPEG preview**, with its longest side at most
8
+ 1024 px and a 300 KB budget. Beat sheets are reflowed into 3–8 columns so they fit in one
9
+ image.
10
+ - New tool options: `image: "overview" | "full" | "none"` (default `overview`; `full` returns
11
+ at most 3 parts) and `maxImageSize` (default 1024).
12
+ - Full-resolution PNGs stay on disk and are listed in the text result.
13
+ - CLI: `storyink snapshot … --preview out.jpg [--preview-size 1024]` writes the same preview.
14
+ - Snapshot receipts include `previews` (path, size, bytes, what the image shows).
15
+ - The beat-sheet page accepts `#cols=N`, `#range=a-b` and `#zoom=z`.
16
+ - SKILL.md: guidance on keeping image reads few and on using `at` frames for detail.
17
+
18
+ ## 0.2.0
19
+
20
+ - Storyboard mode: `story` steps and `"story": "auto"`, the pure `storyState(t)`, the viewer
21
+ transport and counters. Snapshot gets `--at`, `--sheet beats` and the static gates.
22
+ - Fixes: captions belong to their own step, humanised beat titles, warm light-theme glow,
23
+ beat sheets sized to their content.
24
+
25
+ ## 0.1.0
26
+
27
+ - First release: spec, validation, Mermaid import, layout, SSR/viewer, CLI, OpenCode plugin.
package/README.md CHANGED
@@ -34,10 +34,11 @@ both and has the OpenCode plugin as its default export. Runs on Node ≥ 20 and
34
34
  ## 2. CLI
35
35
 
36
36
  ```
37
- storyink render <in.json|in.mmd|-> [-o out.html] [--svg out.svg] [--theme light|dark]
37
+ storyink render <in.json|in.mmd|-> [-o out.html] [--svg out.svg] [--theme light|dark] [--story auto]
38
38
  storyink mermaid <in.mmd> [-o out.json]
39
39
  storyink validate <in> [--json]
40
- storyink snapshot <out.html> [--theme light,dark] [--width N] [--no-sheet] [--scale 2] [-o dir] [--json]
40
+ storyink snapshot <out.html> [--theme light,dark] [--width N] [--sheet [themes|beats]|--no-sheet] [--at 0.5,1.2,end] [--scale 2] [-o dir] [--json]
41
+ [--preview out.jpg [--preview-size 1024]]
41
42
  storyink skill
42
43
  ```
43
44
 
@@ -74,8 +75,14 @@ read `package.json` `main`, which is why the repo ships a root `server.js` that
74
75
  Rebuild after changes, then restart the server (or touch the config) to reload.
75
76
 
76
77
  This adds the tools `storyink_render`, `storyink_from_mermaid`, `storyink_validate` and
77
- `storyink_snapshot`. `storyink_snapshot` returns the contact sheet as an image, so the model can
78
- see its own render. The plugin also adds the `storyink` skill (`skill/SKILL.md`), which covers
78
+ `storyink_snapshot`. `storyink_snapshot` returns **one compact preview image** so the model can see its
79
+ own render: a JPEG no larger than `maxImageSize` (1024 px by default) on its longest side, and
80
+ usually well under 300 KB.
81
+ - Beat sheets are reflowed into more columns so they fit in that single image.
82
+ - Set `image: "full"` to get the normal sheet layout instead, split into at most 3 parts, or
83
+ `image: "none"` to get paths only.
84
+ - Full-resolution PNGs are never inlined; they stay on disk and their paths are listed. The CLI
85
+ equivalent is `--preview out.jpg`. The plugin also adds the `storyink` skill (`skill/SKILL.md`), which covers
79
86
  choosing a diagram type, writing the spec, and the render → look → fix loop. If you already have
80
87
  a skill with the id `storyink`, yours is kept. Relative paths resolve against the project
81
88
  directory.
@@ -90,6 +97,27 @@ npx storyink skill # prints the SKILL.md path and its content
90
97
 
91
98
  An MCP server is planned.
92
99
 
100
+ ## Storyboards (opt-in)
101
+
102
+ Add a `story` to play a diagram as a sequence of beats in the HTML viewer:
103
+ - nodes reveal;
104
+ - wires draw on under a travelling pulse;
105
+ - arrivals glow;
106
+ - captions type in;
107
+ - counters roll (via [@kitlangton/rolling-number](https://github.com/kitlangton/rolling-number)).
108
+
109
+ `"story": "auto"` (or `--story auto`) derives the beats from the graph or message order. Playback
110
+ has a click-to-play gate, play/pause, a tape-rewind replay and a scrubber with step and chapter
111
+ ticks. Space, ←/→ and R control it. When reduced motion is on, the viewer jumps to the final frame.
112
+
113
+ The final frame is always the static diagram. Every frame is a pure function of time
114
+ (`storyState(scene, timeline, t)`), so `#t=2.5` seeks exactly and
115
+ `storyink snapshot --at 1,2.5,end --sheet beats` renders stills and a beat contact sheet. The
116
+ receipt gates check that the end frame and the reduced-motion page match the static diagram. See
117
+ [docs/spec.md](docs/spec.md#storyboard-story-opt-in).
118
+
119
+ ![Checkout beats](docs/gallery/checkout.architecture.beats.light.png)
120
+
93
121
  ## Gallery
94
122
 
95
123
  `bun run gallery` renders every example and Mermaid sample and writes one light and one dark PNG per
@@ -100,6 +128,7 @@ example to `docs/gallery/`.
100
128
  | ![Checkout platform](docs/gallery/checkout.architecture.light.png) | ![Agent run lifecycle](docs/gallery/agent-run.lifecycle.dark.png) |
101
129
  | ![Release pipeline](docs/gallery/release.workflow.light.png) | ![OAuth sequence](docs/gallery/oauth.sequence.dark.png) |
102
130
  | ![Analytics pipeline](docs/gallery/analytics.dataflow.dark.png) | ![Order state machine (Mermaid)](docs/gallery/order.state.light.png) |
131
+ | ![OAuth beats](docs/gallery/oauth.sequence.beats.dark.png) | ![Order state machine, auto story](docs/gallery/order.state.beats.light.png) |
103
132
 
104
133
  ## Spec
105
134
 
@@ -20,6 +20,18 @@ MIT License. Copyright (c) 2024 Motion B.V.; Copyright (c) 2018 Framer B.V. <htt
20
20
  The viewer bundle inlined into each HTML file starts with a comment banner that carries
21
21
  these notices and the MIT permission text.
22
22
 
23
+ ## @kitlangton/rolling-number (bundled into the HTML viewer)
24
+
25
+ MIT License. Copyright (c) 2026 Kit Langton. <https://github.com/kitlangton/rolling-number>
26
+ Used unmodified from npm for live counter reels; its stylesheet is inlined when a story has
27
+ counters. The notice is also in the viewer bundle banner.
28
+
29
+ ## Storyboard design
30
+
31
+ Timings and curves (beats, springs, pulse phases, rewind, gate) follow the numbers documented in
32
+ our own style study of the "OpenCode Reloaded" figures; the runtime is an independent
33
+ implementation. No code, shaders or figure content from anoma.ly are included.
34
+
23
35
  ## archify (design reference)
24
36
 
25
37
  The spec's overall shape (one JSON document per diagram with `type`, `nodes`/`edges`/`groups`,