storyink 0.3.5 → 0.4.0

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 (39) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +32 -4
  3. package/dist/chunks/index-e919a5xm.js +10375 -0
  4. package/dist/chunks/{index-hh8dgmx2.js → index-p76hjvyg.js} +5 -3
  5. package/dist/cli.js +3487 -223
  6. package/dist/core/index.js +25 -1
  7. package/dist/index.js +29 -3
  8. package/dist/node/index.js +2 -2
  9. package/dist/types/core/anchor.d.ts +20 -0
  10. package/dist/types/core/index.d.ts +2 -2
  11. package/dist/types/core/layout/panels.d.ts +19 -0
  12. package/dist/types/core/layout/tokenize.d.ts +6 -0
  13. package/dist/types/core/render/App.d.ts +21 -2
  14. package/dist/types/core/render/Diagram.d.ts +14 -2
  15. package/dist/types/core/render/Story.d.ts +2 -0
  16. package/dist/types/core/render/css.d.ts +4 -2
  17. package/dist/types/core/render/icons.d.ts +8 -0
  18. package/dist/types/core/render/index.d.ts +2 -0
  19. package/dist/types/core/render/smil.d.ts +1 -1
  20. package/dist/types/core/scene.d.ts +69 -2
  21. package/dist/types/core/spec.d.ts +117 -5
  22. package/dist/types/core/story/compile.d.ts +11 -1
  23. package/dist/types/core/story/content-state.d.ts +28 -0
  24. package/dist/types/core/story/content.d.ts +150 -0
  25. package/dist/types/core/story/state.d.ts +43 -0
  26. package/dist/types/core/story/types.d.ts +161 -1
  27. package/dist/types/generated/meta.d.ts +1 -1
  28. package/dist/types/generated/viewer.d.ts +1 -1
  29. package/dist/types/node/snapshot.d.ts +2 -0
  30. package/dist/types/theme/tokens.d.ts +51 -4
  31. package/docs/spec.md +164 -22
  32. package/examples/agent-session.architecture.json +33 -0
  33. package/examples/code-mode.architecture.json +89 -0
  34. package/examples/failover.dataflow.json +38 -0
  35. package/examples/retry-helper.architecture.json +56 -0
  36. package/package.json +1 -1
  37. package/schema/storyink.schema.json +484 -55
  38. package/skill/SKILL.md +48 -6
  39. package/dist/chunks/index-54aprc45.js +0 -7112
package/CHANGELOG.md CHANGED
@@ -1,5 +1,57 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0
4
+
5
+ - **Rich nodes** (architecture, dataflow, workflow): `panel` (window with rows: `tag`, `icon`,
6
+ `text`, `detail`, `status`, `indent`, `muted`), `code` (syntax-coloured program, `lang`
7
+ ts|js|json|text) and `chip` (icon + label, `stack` 1..3); `size: { cols, lines }` reserves body
8
+ space; `icon` set (wrench plug file terminal search globe bolt user spark); `muted` nodes; bare
9
+ groups (`bare: true`, heading only).
10
+ - **Anchors**: edges and story targets may name a panel row (`node#row`) or a code line
11
+ (`node#3`); wires attach at that row/line.
12
+ - **Content steps**: `type` (char typing with caret for code, `cps` / `duration`; word typing for
13
+ rows), `set` / `clear` (crossfade), `line` (active-line bar), `status` (spinner + shimmer, check,
14
+ cross), `dim` / `undim` (levels, independent of `hide` / `show`), `wire` / `unwire`, `glow` /
15
+ `unglow`, `focus`. Pulses gain `reverse` and `delay`. Story options `spotlight` and
16
+ `rewind: "glitch"` (HTML only). Typing speed is not scaled by `pace`. Warnings when the end state
17
+ still shows a spinner or a glow.
18
+ - **Animated SVG** covers the new content (typing clips, caret, crossfades, line bar, status,
19
+ shimmer, levels, wire/unwire, glows, spotlight) with the final frame still the static diagram.
20
+ Checked in headless Chrome (frame parity, `<img>` playback, loop return); Firefox plays it;
21
+ Safari untested.
22
+ - Four examples: `code-mode.architecture`, `retry-helper.architecture`,
23
+ `agent-session.architecture`, `failover.dataflow`; animated SVGs in `docs/gallery/`.
24
+ - Fix: with reading holds (pace > 0), a step with an absolute `at` inside a beat stayed at its
25
+ authored time while its beat was pushed later, so it ran out of order and → / ← could stop with
26
+ pulses mid-wire. It now keeps its authored offset from the previous step.
27
+ - Docs: `story` is no longer described as reserved; `#t=` documented as a seek.
28
+
29
+ ## 0.3.6
30
+
31
+ - **Default `story.pace` is 0.6** (was 1): shorter reading holds after each beat. `pace: 1` gives
32
+ the 0.3.5 holds, `pace: 0` the pre-0.3.5 timing. Applies to the viewer, `render` (and
33
+ `--pace`), the plugin and animated SVGs (built with their pace). Durations: OpenWick
34
+ architecture 176 s → 135 s, data flow 95 s → 78 s, checkout 30 s → 26 s, OAuth 57 s → 47 s.
35
+ - **Pauses in the viewer**, changeable after the build: a toolbar button (`Pauses: Normal`)
36
+ cycles None (0) · Short (0.3) · Normal (0.6) · Long (1.0) · Longer (1.5); `[` / `]` step down /
37
+ up; the choice is remembered (`localStorage["storyink-pace"]`); `#pace=<n>` wins. The HTML
38
+ embeds a small `timeline.source` and the viewer recompiles the timeline in the browser with the
39
+ same compiler (`recompilePace`, byte-identical to `render --pace`). The reader keeps their place
40
+ (same beat, same progress; `mapStoryTime`) and playback continues; duration, ticks, → / ← stops,
41
+ stepped holds and the follow camera follow the new timeline. Page contract: `pace()`,
42
+ `setPace(n)`. Viewer bundle +16.5 KiB (388.5 → 405.0 KiB).
43
+ - `storyink snapshot --pace N` (tool `storyink_snapshot` `pace`) pins the pace for every capture;
44
+ by default snapshots use the author pace.
45
+ - **→ / ← no longer wait for the text.** Step moves animate the graph only: → plays to the end
46
+ of the next beat's graph motion (pulses arrived, reveals and draw-ons done; not caption typing,
47
+ glows, trail cooling, rings or the reading hold; `beatMotionEnds`) and pauses; pressed during a
48
+ reading hold (or right after a stop) it starts the next beat at once. ← rewinds the graph at 2×
49
+ to the previous beat's motion end. The beat's caption shows whole and instantly as the move
50
+ starts (← shows the target beat's) and stays at the stop (`storyState(…, { captionBeat })`).
51
+ Continuous play, stepped playback, the scrubber and the default `storyState` are unchanged.
52
+ - Stepped (reduced-motion) stops last at least 0.8 s (the bare-beat hold).
53
+ - Fix: clicking a toolbar button while the play gate showed also started the story.
54
+
3
55
  ## 0.3.5
4
56
 
5
57
  - **Fix: the diagram showed a hover tooltip** (the diagram title) wherever the cursor rested. The
package/README.md CHANGED
@@ -128,8 +128,10 @@ previous one (Shift: by chapter; repeated presses extend the move).
128
128
 
129
129
  Playback **pauses to read after each beat**: about 1 s + 0.3 s per word of its caption (1.5–6 s;
130
130
  0.8 s without one) once the beat is still, before the next beat starts. The animation speed is
131
- unchanged. Set `"story": { "pace": 1.5 }` (or `--pace`) to slow it further, `0` for none, or
132
- `"hold": 3` on a step for its beat.
131
+ unchanged. The default `pace` is 0.6; set `"story": { "pace": 1.5 }` (or `--pace`) to slow it,
132
+ `0` for none, or `"hold": 3` on a step for its beat. Readers change it on the page with
133
+ **Pauses** in the toolbar (None · Short · Normal · Long · Longer, `[` / `]`, remembered;
134
+ `#pace=` in the URL); the viewer recompiles the timeline in the browser and keeps their place.
133
135
 
134
136
  Motion is **full by default, even when the reader's system asks for reduced motion**. Authors can
135
137
  set `"story": { "motion": "reduced" }` (always step by step) or `"motion": "system"` (follow
@@ -146,7 +148,26 @@ and a drag pauses following until the next step that is out of view. Toggle it w
146
148
  (`F`, remembered), `#camera=fit`, or `"story": { "camera": "fit" }` / `--camera fit`.
147
149
  `storyink snapshot --camera follow --at …` captures the followed view.
148
150
 
149
- The final frame is always the static diagram. Every frame is a pure function of time
151
+ ### Rich nodes and content steps (0.4.0)
152
+
153
+ For agent sessions, generated code and tool servers, graph diagrams take `panel` (a window of
154
+ rows), `code` (a syntax-coloured program) and `chip` nodes, with wires anchored to a row
155
+ (`session#exec`) or a code line (`code#1`). Stories can then `type` code and rows, swap content
156
+ (`set` / `clear`), move an active-line bar (`line`), show row `status` (spinner and shimmer,
157
+ check, cross), `dim` / `hide` / `show`, draw or retract wires (`wire` / `unwire`), keep nodes lit
158
+ (`glow`), follow the action with a `spotlight`, send reverse and staggered pulses, and reset with
159
+ a `glitch` rewind (HTML only). Examples:
160
+ [code-mode](examples/code-mode.architecture.json),
161
+ [retry-helper](examples/retry-helper.architecture.json),
162
+ [agent-session](examples/agent-session.architecture.json),
163
+ [failover](examples/failover.dataflow.json). Details: [docs/spec.md](docs/spec.md#rich-nodes-panel-code-chip).
164
+
165
+ <picture>
166
+ <source media="(prefers-color-scheme: dark)" srcset="docs/gallery/code-mode.architecture.animated.dark.svg">
167
+ <img alt="Code mode: a session runs a program that calls MCP servers (animated)" src="docs/gallery/code-mode.architecture.animated.light.svg">
168
+ </picture>
169
+
170
+ The final frame is the static diagram (with content steps: the story's end state). Every frame is a pure function of time
150
171
  (`storyState(scene, timeline, t)`), so `#t=2.5` seeks exactly and
151
172
  `storyink snapshot --at 1,2.5,end --sheet beats` renders stills and a beat contact sheet. The
152
173
  receipt gates check that the end frame and the reduced-motion page match the static diagram. See
@@ -182,12 +203,19 @@ storyink render examples/checkout.architecture.json --animated-svg docs/checkout
182
203
  - Library: `renderAnimatedSvg(spec, { theme, once, font })` from `storyink/core`; plugin:
183
204
  `storyink_render` with `animatedSvg: true | "both"`, `once`, `font`.
184
205
  - GitHub's image proxy caches by URL: when a diagram changes, give it a new file name (or URL).
206
+ - Rich content (typing, status glyphs, line bars, spotlight) animates too. Frame parity is checked
207
+ in headless Chrome; Firefox plays it in `<img>`; Safari is untested. The glitch rewind and the
208
+ follow camera are HTML-only.
185
209
 
186
210
  ## Gallery
187
211
 
188
212
  `bun run gallery` renders every example and Mermaid sample and writes one light and one dark PNG per
189
213
  example to `docs/gallery/`. `bun run gallery:animated` writes the animated SVGs of the story
190
- examples (`*.animated.light.svg` / `*.animated.dark.svg`); `bun run verify:smil` checks them in
214
+ examples (`*.animated.light.svg` / `*.animated.dark.svg`; `--only name,…` writes just those);
215
+ animated: [code-mode](docs/gallery/code-mode.architecture.animated.light.svg),
216
+ [failover](docs/gallery/failover.dataflow.animated.light.svg),
217
+ [retry-helper](docs/gallery/retry-helper.architecture.animated.light.svg),
218
+ [agent-session](docs/gallery/agent-session.architecture.animated.light.svg). `bun run verify:smil` checks them in
191
219
  headless Chrome (frame parity with the viewer's frames, `<img>` playback, embedded font).
192
220
 
193
221
  | | |