synabun 2.2.0 → 2.2.2

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 (166) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +1 -1
  3. package/hooks/claude-code/pre-websearch.mjs +4 -1
  4. package/hooks/claude-code/prompt-submit.mjs +7 -0
  5. package/lib/release-scan.mjs +23 -10
  6. package/lib/virustotal.mjs +143 -39
  7. package/mcp-server/dist/http.d.ts +19 -0
  8. package/mcp-server/dist/http.d.ts.map +1 -1
  9. package/mcp-server/dist/http.js +55 -13
  10. package/mcp-server/dist/http.js.map +1 -1
  11. package/mcp-server/dist/index.d.ts.map +1 -1
  12. package/mcp-server/dist/index.js +14 -9
  13. package/mcp-server/dist/index.js.map +1 -1
  14. package/mcp-server/dist/services/browser-route-flow.d.ts +118 -0
  15. package/mcp-server/dist/services/browser-route-flow.d.ts.map +1 -0
  16. package/mcp-server/dist/services/browser-route-flow.js +339 -0
  17. package/mcp-server/dist/services/browser-route-flow.js.map +1 -0
  18. package/mcp-server/dist/services/desktop-client.js +2 -2
  19. package/mcp-server/dist/services/desktop-client.js.map +1 -1
  20. package/mcp-server/dist/services/identity.d.ts +66 -3
  21. package/mcp-server/dist/services/identity.d.ts.map +1 -1
  22. package/mcp-server/dist/services/identity.js +61 -4
  23. package/mcp-server/dist/services/identity.js.map +1 -1
  24. package/mcp-server/dist/services/neural-interface.d.ts +112 -1
  25. package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
  26. package/mcp-server/dist/services/neural-interface.js +555 -61
  27. package/mcp-server/dist/services/neural-interface.js.map +1 -1
  28. package/mcp-server/dist/tools/bluesky.d.ts +20 -7
  29. package/mcp-server/dist/tools/bluesky.d.ts.map +1 -1
  30. package/mcp-server/dist/tools/bluesky.js +147 -45
  31. package/mcp-server/dist/tools/bluesky.js.map +1 -1
  32. package/mcp-server/dist/tools/browser-advanced.d.ts +11 -2
  33. package/mcp-server/dist/tools/browser-advanced.d.ts.map +1 -1
  34. package/mcp-server/dist/tools/browser-advanced.js +131 -18
  35. package/mcp-server/dist/tools/browser-advanced.js.map +1 -1
  36. package/mcp-server/dist/tools/browser-cheatsheet.d.ts +2 -0
  37. package/mcp-server/dist/tools/browser-cheatsheet.d.ts.map +1 -1
  38. package/mcp-server/dist/tools/browser-cheatsheet.js +3 -0
  39. package/mcp-server/dist/tools/browser-cheatsheet.js.map +1 -1
  40. package/mcp-server/dist/tools/morelogin.d.ts.map +1 -1
  41. package/mcp-server/dist/tools/morelogin.js +4 -2
  42. package/mcp-server/dist/tools/morelogin.js.map +1 -1
  43. package/mcp-server/dist/tools/skill-tools.d.ts +4 -4
  44. package/mcp-server/dist/tools/youtube/helpers.d.ts +1 -0
  45. package/mcp-server/dist/tools/youtube/helpers.d.ts.map +1 -1
  46. package/mcp-server/dist/tools/youtube/helpers.js +1 -1
  47. package/mcp-server/dist/tools/youtube/helpers.js.map +1 -1
  48. package/mcp-server/package-lock.json +2 -2
  49. package/mcp-server/package.json +1 -1
  50. package/mcp-server/src/http.ts +58 -12
  51. package/mcp-server/src/index.ts +15 -9
  52. package/mcp-server/src/services/browser-route-flow.ts +402 -0
  53. package/mcp-server/src/services/desktop-client.ts +2 -2
  54. package/mcp-server/src/services/identity.ts +80 -4
  55. package/mcp-server/src/services/neural-interface.ts +572 -70
  56. package/mcp-server/src/tools/bluesky.ts +164 -51
  57. package/mcp-server/src/tools/browser-advanced.ts +121 -17
  58. package/mcp-server/src/tools/browser-cheatsheet.ts +3 -0
  59. package/mcp-server/src/tools/morelogin.ts +4 -2
  60. package/mcp-server/src/tools/youtube/helpers.ts +2 -2
  61. package/neural-interface/i18n/en.json +27 -0
  62. package/neural-interface/i18n/pt-BR.json +27 -0
  63. package/neural-interface/lib/assistant-api.js +64 -23
  64. package/neural-interface/lib/assistant-brains/codex.js +6 -1
  65. package/neural-interface/lib/assistant-catalog.js +20 -2
  66. package/neural-interface/lib/assistant-dispatch.js +31 -2
  67. package/neural-interface/lib/assistant-persona.js +1 -0
  68. package/neural-interface/lib/assistant-runtime.js +15 -1
  69. package/neural-interface/lib/assistant-tools.js +10 -1
  70. package/neural-interface/lib/browser-automation-routes.js +84 -0
  71. package/neural-interface/lib/browser-execution.js +16 -3
  72. package/neural-interface/lib/browser-owner.js +48 -0
  73. package/neural-interface/lib/browser-session-close.js +84 -0
  74. package/neural-interface/lib/browser-start-handoff.js +202 -0
  75. package/neural-interface/lib/browser-tool-policy.js +21 -4
  76. package/neural-interface/lib/browser-wedge-retire.js +64 -0
  77. package/neural-interface/lib/claude-agent-bridge.js +36 -1
  78. package/neural-interface/lib/claude-background-hold.js +239 -0
  79. package/neural-interface/lib/exec-loop-command.js +8 -0
  80. package/neural-interface/lib/http-guards.js +11 -6
  81. package/neural-interface/lib/loop-logger.js +6 -1
  82. package/neural-interface/lib/mcp-external-servers.js +64 -13
  83. package/neural-interface/lib/native-loop-providers.js +122 -10
  84. package/neural-interface/lib/native-loop-runtime.js +112 -11
  85. package/neural-interface/lib/opencode-native-boundary.js +155 -21
  86. package/neural-interface/lib/owner-authority.js +113 -37
  87. package/neural-interface/lib/page-session.js +81 -23
  88. package/neural-interface/lib/peer-identity.js +311 -47
  89. package/neural-interface/lib/provider-panel-api-key-auth.js +7 -2
  90. package/neural-interface/lib/pty-host/core.js +36 -0
  91. package/neural-interface/lib/pty-host/protocol.js +2 -0
  92. package/neural-interface/lib/skills/api-v2.js +13 -2
  93. package/neural-interface/lib/skills/creation-api.js +3 -1
  94. package/neural-interface/lib/skills/evals-api.js +5 -1
  95. package/neural-interface/lib/social-write-pacing.js +151 -0
  96. package/neural-interface/lib/terminal-token-redaction.js +293 -0
  97. package/neural-interface/lib/terminal-tokens.js +359 -0
  98. package/neural-interface/lib/worker-mcp-channel.js +45 -10
  99. package/neural-interface/package-lock.json +2 -2
  100. package/neural-interface/package.json +1 -1
  101. package/neural-interface/public/shared/agy/agy-render.js +41 -1
  102. package/neural-interface/public/shared/agy/agy-styles.js +5 -0
  103. package/neural-interface/public/shared/api.js +1 -0
  104. package/neural-interface/public/shared/assistant/asst-api.js +14 -2
  105. package/neural-interface/public/shared/assistant/asst-computer.js +73 -4
  106. package/neural-interface/public/shared/assistant/asst-limit-wait.js +3 -1
  107. package/neural-interface/public/shared/assistant/asst-motion-gate.js +80 -0
  108. package/neural-interface/public/shared/assistant/asst-panel.js +8 -4
  109. package/neural-interface/public/shared/assistant/asst-render.js +72 -11
  110. package/neural-interface/public/shared/assistant/asst-scene-styles.js +55 -23
  111. package/neural-interface/public/shared/assistant/asst-scenes.js +225 -79
  112. package/neural-interface/public/shared/assistant/asst-sidepanel-styles.js +4 -4
  113. package/neural-interface/public/shared/assistant/asst-style-cache.js +44 -0
  114. package/neural-interface/public/shared/assistant/asst-styles.js +26 -5
  115. package/neural-interface/public/shared/cdx/cdx-render.js +73 -7
  116. package/neural-interface/public/shared/cdx/cdx-tabs.js +3 -3
  117. package/neural-interface/public/shared/cp/cp-agents.js +8 -0
  118. package/neural-interface/public/shared/cp/cp-permissions.js +18 -2
  119. package/neural-interface/public/shared/cp/cp-rehydrate.js +25 -1
  120. package/neural-interface/public/shared/cp/cp-tasks-model.js +33 -0
  121. package/neural-interface/public/shared/judgments-log-origins.js +29 -0
  122. package/neural-interface/public/shared/loading-teardown.js +34 -0
  123. package/neural-interface/public/shared/ocp-v2/ocp-v2-automation-ownership.js +23 -0
  124. package/neural-interface/public/shared/ocp-v2/ocp-v2-childpanel.js +6 -1
  125. package/neural-interface/public/shared/ocp-v2/ocp-v2-events.js +13 -0
  126. package/neural-interface/public/shared/ocp-v2/ocp-v2-icons.js +3 -1
  127. package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +5 -2
  128. package/neural-interface/public/shared/ocp-v2/ocp-v2-render.js +16 -86
  129. package/neural-interface/public/shared/ocp-v2/ocp-v2-send.js +6 -0
  130. package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +88 -72
  131. package/neural-interface/public/shared/ocp-v2/ocp-v2-ws.js +5 -2
  132. package/neural-interface/public/shared/owner-access.js +134 -0
  133. package/neural-interface/public/shared/owner-authority-view.js +92 -0
  134. package/neural-interface/public/shared/page-session.js +143 -14
  135. package/neural-interface/public/shared/poll-backoff.js +59 -0
  136. package/neural-interface/public/shared/settings/settings-data.js +6 -1
  137. package/neural-interface/public/shared/settings/settings-kit.js +11 -3
  138. package/neural-interface/public/shared/settings/settings-shell.js +7 -0
  139. package/neural-interface/public/shared/shown-children.js +72 -0
  140. package/neural-interface/public/shared/static-bg-state.js +22 -0
  141. package/neural-interface/public/shared/storage-retry.js +47 -0
  142. package/neural-interface/public/shared/storage.js +25 -4
  143. package/neural-interface/public/shared/styles.css +109 -8
  144. package/neural-interface/public/shared/synabun-mascot.js +27 -8
  145. package/neural-interface/public/shared/synabun-ticker.js +147 -12
  146. package/neural-interface/public/shared/synabun-tools.js +173 -0
  147. package/neural-interface/public/shared/tool-heartbeat.js +43 -0
  148. package/neural-interface/public/shared/tool-list-picker.js +3 -1
  149. package/neural-interface/public/shared/tool-list-view.js +23 -4
  150. package/neural-interface/public/shared/ui-automation-studio.js +8 -1
  151. package/neural-interface/public/shared/ui-claude-panel.js +238 -90
  152. package/neural-interface/public/shared/ui-judgments.js +37 -10
  153. package/neural-interface/public/shared/ui-loading.js +5 -4
  154. package/neural-interface/public/shared/ui-navbar.js +6 -0
  155. package/neural-interface/public/shared/ui-owner-access.js +191 -0
  156. package/neural-interface/public/shared/ui-owner-authority.js +162 -0
  157. package/neural-interface/public/shared/ui-sessions.js +45 -16
  158. package/neural-interface/public/shared/ui-settings.js +86 -15
  159. package/neural-interface/public/shared/ui-terminal.js +15 -7
  160. package/neural-interface/public/shared/ui-tutorial-preview.js +4 -0
  161. package/neural-interface/public/shared/ui-update.js +3 -0
  162. package/neural-interface/public/shared/ui-whiteboard.js +4 -0
  163. package/neural-interface/public/shared/window-keys.js +38 -0
  164. package/neural-interface/server.js +1240 -238
  165. package/npm-shrinkwrap.json +2 -2
  166. package/package.json +1 -1
@@ -15,31 +15,52 @@
15
15
  // - the agents tray's mini scenes and lanes (asst-agents-dock.js).
16
16
  //
17
17
  // Rules as the rack's: gold only means live; infinite loops pause while the
18
- // UI is dragged (body.ui-interacting) and stop under prefers-reduced-motion,
18
+ // UI is dragged (body.ui-interacting), off screen (data-offscreen on a holder,
19
+ // a closed side panel: asst-styles.js) and stop under prefers-reduced-motion,
19
20
  // where every scene is its still frame and the sweep is not drawn. Tokens
20
21
  // come from asst-styles.js, always with a fallback. No backdrop blur and no
21
- // standing layer hints.
22
+ // standing layer hints: a moving layer is promoted (will-change) only while
23
+ // its scene is live and on screen.
24
+ //
25
+ // A scene's moving parts are HTML layers (asst-scenes.js), so every motion is
26
+ // a box's transform or opacity, run by the compositor. Lengths are written in
27
+ // the scene's own units (the SVG's px) and turned into percentages of the box
28
+ // here (sc() below): a scene is drawn at several sizes, and a percentage of
29
+ // the box is the same distance in units at every one of them.
22
30
 
23
- import { CODE_LINES, CODE_STEP, codeCaretX } from './asst-scenes.js';
31
+ import { CODE_LINES, CODE_STEP, CODE_WINDOW, FILM_MINI_WINDOW, FILM_WINDOW, SCENE_BOX, boxPct, codeCaretX } from './asst-scenes.js';
24
32
 
25
33
  export const SCENE_STYLE_ID = 'asst-scene-styles';
26
34
 
27
- /** The code scene's stepped scroll (one line per step) and its caret, which lands on each new bottom line's end. */
35
+ const FULL = SCENE_BOX.full;
36
+ const MINI = SCENE_BOX.mini;
37
+ const win = ([, , w, h]) => ({ w, h });
38
+
39
+ /** A move of (x, y) scene units in a box: `translate(…%, …%)`, plus any scale or rotation after it. */
40
+ function sc(box, x, y, more = '') {
41
+ return `transform: translate(${boxPct(x, box.w)}, ${boxPct(y, box.h)})${more ? ` ${more}` : ''};`;
42
+ }
43
+
44
+ /** The code scene's stepped scroll (one line per step, inside its window) and its caret, which lands on each new bottom line's end. */
28
45
  function codeFrames() {
29
46
  const n = CODE_LINES.length;
30
47
  const at = (s) => Math.round((s * 100000) / n) / 1000;
31
48
  const hold = (s) => Math.round(((s * 100) / n + (100 / n) * 0.72) * 1000) / 1000;
49
+ const view = win(CODE_WINDOW);
32
50
  let scroll = '';
33
51
  let caret = '';
34
52
  for (let s = 0; s < n; s += 1) {
35
- scroll += ` ${at(s)}%, ${hold(s)}% { transform: translateY(${-CODE_STEP * s}px); }`;
36
- caret += ` ${at(s)}%, ${hold(s)}% { transform: translateX(${codeCaretX(s)}px); }`;
53
+ scroll += ` ${at(s)}%, ${hold(s)}% { ${sc(view, 0, -CODE_STEP * s)} }`;
54
+ caret += ` ${at(s)}%, ${hold(s)}% { ${sc(FULL, codeCaretX(s), 0)} }`;
37
55
  }
38
- scroll += ` 100% { transform: translateY(${-CODE_STEP * n}px); }`;
39
- caret += ` 100% { transform: translateX(${codeCaretX(n)}px); }`;
56
+ scroll += ` 100% { ${sc(view, 0, -CODE_STEP * n)} }`;
57
+ caret += ` 100% { ${sc(FULL, codeCaretX(n), 0)} }`;
40
58
  return `@keyframes asst-sc-code {${scroll} }\n @keyframes asst-sc-code-caret {${caret} }`;
41
59
  }
42
60
 
61
+ /** The pointer scenes: rest on the button, travel to the page, back (units of their own box). */
62
+ const pointFrames = (name, box, [x0, y0], [x1, y1], more = '', [a, b, c, d] = [22, 46, 72, 96]) => `@keyframes ${name} { 0%, ${a}% { ${sc(box, x0, y0, more)} } ${b}%, ${c}% { ${sc(box, x1, y1, more)} } ${d}%, 100% { ${sc(box, x0, y0, more)} } }`;
63
+
43
64
  export const SCENE_CSS = `
44
65
  /* ── The stage in a run card ──────────────────────────────────────── */
45
66
  .asst-run-stage-wrap {
@@ -110,8 +131,15 @@ export const SCENE_CSS = `
110
131
  .asst-run.is-revealed { background: var(--asst-fill-1, rgba(255,255,255,.04)); box-shadow: 0 0 0 1px var(--asst-line-2, rgba(255,255,255,.12)); }
111
132
 
112
133
  /* ── Scenes ─────────────────────────────────────────────────────────── */
113
- /* --sc-gold is set by a holder that neutralizes it (waiting, settled); unset, it is the brand gold. */
114
- .asst-scene { display: block; overflow: visible; }
134
+ /* --sc-gold is set by a holder that neutralizes it (waiting, settled); unset, it is the brand gold.
135
+ The box takes its holder's size (120×40 and 40×20 by default); its still SVG and every layer cover
136
+ it, in the same viewBox; strokes are 1.5 units unless the holder says otherwise (they inherit). */
137
+ .asst-scene { position: relative; display: block; overflow: visible; stroke-width: 1.5; }
138
+ :where(.asst-scene) { width: 120px; height: 40px; }
139
+ :where(.asst-scene.is-mini) { width: 40px; height: 20px; }
140
+ .asst-scene svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
141
+ .asst-scene .sc-layer { position: absolute; inset: 0; display: block; transform-origin: 0 0; pointer-events: none; }
142
+ .asst-scene .sc-clip { position: absolute; display: block; overflow: hidden; pointer-events: none; }
115
143
  .asst-scene .sc-dim { stroke-opacity: .5; }
116
144
  .asst-scene .sc-mid { stroke-opacity: .72; }
117
145
  .asst-scene .sc-gold { stroke: var(--sc-gold, var(--asst-brand, rgba(255,215,0,.85))); }
@@ -120,9 +148,13 @@ export const SCENE_CSS = `
120
148
  .asst-scene .sc-fill.sc-mid { fill-opacity: .55; }
121
149
  .asst-scene .sc-fill.sc-gold { fill: var(--sc-gold, var(--asst-brand, rgba(255,215,0,.85))); }
122
150
  .asst-scene .sc-shade { fill: var(--sc-shade, #131316); }
123
- .asst-scene .sc-ring { fill: none; opacity: 0; }
124
- .asst-scene .sc-box { transform-box: fill-box; transform-origin: center; }
125
- .asst-scene .sc-vb { transform-box: view-box; }
151
+ .asst-scene .sc-ring { opacity: 0; }
152
+ /* A layer that only turns or travels gets its compositor layer up front, and only while its scene is
153
+ live and on screen and motion is allowed (no standing hints). Layers that scale are left to the
154
+ browser, which rasterises them at the largest scale they reach (a hint would fix it at rest). */
155
+ @media (prefers-reduced-motion: no-preference) {
156
+ .asst-scene[data-live]:not([data-offscreen] *) :is(.sc-gear-big, .sc-gear-small, .sc-hand, .sc-wrench, .sc-code-scroll, .sc-code-caret, .sc-lens, .sc-lens-mini, .sc-point-browser, .sc-point-computer, .sc-point-mini, .sc-run-dot, .sc-pen, .sc-film, .sc-film-mini, .sc-slide) { will-change: transform; }
157
+ }
126
158
  .asst-scene[data-live] .sc-code-scroll { animation: asst-sc-code 6.6s cubic-bezier(.45, 0, .55, 1) infinite; }
127
159
  .asst-scene[data-live] .sc-code-caret { animation: asst-sc-code-caret 6.6s cubic-bezier(.45, 0, .55, 1) infinite; }
128
160
  .asst-scene[data-live] .sc-caret { animation: asst-rk-caret 1.06s steps(1) infinite; }
@@ -229,23 +261,23 @@ export const SCENE_CSS = `
229
261
  ${codeFrames()}
230
262
  @keyframes asst-sc-spin { to { transform: rotate(360deg); } }
231
263
  @keyframes asst-sc-tick { 0%, 8% { opacity: 0; transform: scale(.4); } 16%, 80% { opacity: 1; transform: scale(1); } 92%, 100% { opacity: 0; transform: scale(1); } }
232
- @keyframes asst-sc-lens { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(14px, 4px); } 50% { transform: translate(48px, 0); } 75% { transform: translate(34px, 5px); } }
233
- @keyframes asst-sc-lens-mini { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(12px, 2px); } }
234
- @keyframes asst-sc-point-browser { 0%, 22% { transform: translate(92px, 29px); } 46%, 72% { transform: translate(26px, 16px); } 96%, 100% { transform: translate(92px, 29px); } }
235
- @keyframes asst-sc-point-computer { 0%, 22% { transform: translate(90px, 22.5px); } 46%, 72% { transform: translate(32px, 9px); } 96%, 100% { transform: translate(90px, 22.5px); } }
236
- @keyframes asst-sc-point-mini { 0%, 24% { transform: translate(29px, 13px) scale(.6); } 48%, 74% { transform: translate(12px, 8px) scale(.6); } 98%, 100% { transform: translate(29px, 13px) scale(.6); } }
264
+ @keyframes asst-sc-lens { 0%, 100% { ${sc(FULL, 0, 0)} } 25% { ${sc(FULL, 14, 4)} } 50% { ${sc(FULL, 48, 0)} } 75% { ${sc(FULL, 34, 5)} } }
265
+ @keyframes asst-sc-lens-mini { 0%, 100% { ${sc(MINI, 0, 0)} } 50% { ${sc(MINI, 12, 2)} } }
266
+ ${pointFrames('asst-sc-point-browser', FULL, [92, 29], [26, 16])}
267
+ ${pointFrames('asst-sc-point-computer', FULL, [90, 22.5], [32, 9])}
268
+ ${pointFrames('asst-sc-point-mini', MINI, [29, 13], [12, 8], 'scale(.6)', [24, 48, 74, 98])}
237
269
  @keyframes asst-sc-ripple { 0% { opacity: .9; transform: scale(.3); } 16% { opacity: 0; transform: scale(1.5); } 100% { opacity: 0; transform: scale(1.5); } }
238
- @keyframes asst-sc-run { 0% { opacity: 0; transform: translateX(0); } 8%, 12% { opacity: 1; transform: translateX(0); } 45%, 55% { transform: translateX(23px); } 88% { opacity: 1; transform: translateX(46px); } 100% { opacity: 0; transform: translateX(46px); } }
270
+ @keyframes asst-sc-run { 0% { opacity: 0; ${sc(FULL, 0, 0)} } 8%, 12% { opacity: 1; ${sc(FULL, 0, 0)} } 45%, 55% { ${sc(FULL, 23, 0)} } 88% { opacity: 1; ${sc(FULL, 46, 0)} } 100% { opacity: 0; ${sc(FULL, 46, 0)} } }
239
271
  @keyframes asst-sc-shape { 0%, 6% { opacity: 0; transform: scale(.4); } 16%, 84% { opacity: 1; transform: scale(1); } 94%, 100% { opacity: 0; transform: scale(.9); } }
240
- @keyframes asst-sc-pen { 0%, 8% { transform: translate(47px, 13px); } 18%, 24% { transform: translate(73px, 13px); } 32%, 84% { transform: translate(100px, 20px); } 100% { transform: translate(47px, 13px); } }
272
+ @keyframes asst-sc-pen { 0%, 8% { ${sc(FULL, 47, 13)} } 18%, 24% { ${sc(FULL, 73, 13)} } 32%, 84% { ${sc(FULL, 100, 20)} } 100% { ${sc(FULL, 47, 13)} } }
241
273
  @keyframes asst-sc-develop { 0% { opacity: .08; } 30%, 82% { opacity: 1; } 100% { opacity: .08; } }
242
274
  @keyframes asst-sc-twinkle { 0%, 100% { opacity: .35; transform: scale(.7) rotate(0deg); } 50% { opacity: 1; transform: scale(1.1) rotate(45deg); } }
243
275
  @keyframes asst-sc-zap { 0%, 100% { opacity: .45; transform: scale(.92); } 40% { opacity: 1; transform: scale(1.06); } }
244
- @keyframes asst-sc-film { to { transform: translateX(-24px); } }
245
- @keyframes asst-sc-film-mini { to { transform: translateX(-12px); } }
276
+ @keyframes asst-sc-film { to { ${sc(win(FILM_WINDOW), -24, 0)} } }
277
+ @keyframes asst-sc-film-mini { to { ${sc(win(FILM_MINI_WINDOW), -12, 0)} } }
246
278
  @keyframes asst-sc-wrench { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(16deg); } }
247
279
  @keyframes asst-sc-spark { 0%, 38% { opacity: 0; } 50% { opacity: 1; } 72%, 100% { opacity: 0; } }
248
- @keyframes asst-sc-slide { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(68px); } }
280
+ @keyframes asst-sc-slide { 0%, 100% { ${sc(FULL, 0, 0)} } 50% { ${sc(FULL, 68, 0)} } }
249
281
  @keyframes asst-sc-dot { 0%, 100% { opacity: .3; } 40% { opacity: 1; } }
250
282
  body.ui-interacting .asst-scene *,
251
283
  body.ui-interacting .asst-run-stage-sweep::after { animation-play-state: paused !important; }
@@ -400,12 +400,77 @@ export function stageLabel({ scene = 'generic', phase = 'working', title = '', m
400
400
  // currentColor (the container's muted text); `sc-gold` is the one live part
401
401
  // (gold only means live). Every part sits where its still frame wants it:
402
402
  // with no animation (reduced motion, waiting, settled) the scene still reads.
403
+ //
404
+ // A scene is an HTML box (`.asst-scene`, sized by its holder) holding one SVG
405
+ // of everything that stands still (`.sc-base`) and, for every part that
406
+ // moves, an HTML layer of its own (`.sc-layer`: a box over the whole scene
407
+ // with an SVG of that part alone in the same viewBox, so the part sits
408
+ // exactly where it did). The CSS moves the layer box, transform and opacity
409
+ // only, never an SVG element: a box's animation runs on the compositor, and a
410
+ // frame the page draws anyway (a rig's) restyles one span and lays nothing
411
+ // out, where a moving SVG part re-lays its whole SVG out on every frame.
412
+ // Lengths are percentages of the box, since a scene is drawn at several sizes
413
+ // (boxPct); a part that turned round its own centre (the SVG's fill-box)
414
+ // turns round the same point here (`transform-origin`). Parts on the same
415
+ // beat share a layer (the image's tiles); a part that stood above a moving
416
+ // one stays above it in a still layer of its own (`.sc-top`: the playhead).
403
417
 
404
418
  /** The code scene's six lines, repeated twice so its stepped scroll loops seamlessly: [indent, keyword, rest]. */
405
419
  export const CODE_LINES = Object.freeze([[6, 8, 26], [12, 10, 42], [12, 6, 22], [18, 9, 35], [12, 12, 48], [6, 7, 14]]);
406
420
  export const CODE_STEP = 6; // one line, in viewBox units
421
+ /** The code scene's scrolling window and the video scene's film window (full) and the mini film's: [x, y, w, h]. */
422
+ export const CODE_WINDOW = Object.freeze([4, 4, 112, 32]);
423
+ export const FILM_WINDOW = Object.freeze([4, 4, 112, 32]);
424
+ export const FILM_MINI_WINDOW = Object.freeze([2, 2, 36, 16]);
425
+
426
+ /** The viewBox of a full scene and of a mini, in units. */
427
+ export const SCENE_BOX = Object.freeze({ full: Object.freeze({ w: 120, h: 40 }), mini: Object.freeze({ w: 40, h: 20 }) });
407
428
 
408
429
  const r1 = (v) => Math.round(v * 100) / 100;
430
+ const r3 = (v) => Math.round(v * 1000) / 1000;
431
+
432
+ /** A length in viewBox units as a percentage of the box's width or height: boxPct(14, 120) → '11.667%'. */
433
+ export function boxPct(v, of) {
434
+ return `${r3((Number(v) / of) * 100)}%`;
435
+ }
436
+
437
+ /**
438
+ * The centre of a polyline path's box (M L H V Z, absolute or relative):
439
+ * where an SVG part with transform-box: fill-box turned round (a tick, the
440
+ * zap, a triangle). Curves are not read (no moving part has one).
441
+ */
442
+ export function pathCentre(d) {
443
+ const tokens = String(d).match(/[MLHVZmlhvz]|-?\d*\.?\d+/g) || [];
444
+ const xs = [];
445
+ const ys = [];
446
+ let x = 0;
447
+ let y = 0;
448
+ let sx = 0;
449
+ let sy = 0;
450
+ let cmd = 'M';
451
+ let i = 0;
452
+ const num = () => Number(tokens[i++]);
453
+ while (i < tokens.length) {
454
+ if (/^[A-Za-z]$/.test(tokens[i])) {
455
+ cmd = tokens[i];
456
+ i += 1;
457
+ if (cmd === 'Z' || cmd === 'z') { x = sx; y = sy; continue; }
458
+ }
459
+ if (cmd === 'M') { x = num(); y = num(); sx = x; sy = y; cmd = 'L'; }
460
+ else if (cmd === 'm') { x += num(); y += num(); sx = x; sy = y; cmd = 'l'; }
461
+ else if (cmd === 'L') { x = num(); y = num(); }
462
+ else if (cmd === 'l') { x += num(); y += num(); }
463
+ else if (cmd === 'H') x = num();
464
+ else if (cmd === 'h') x += num();
465
+ else if (cmd === 'V') y = num();
466
+ else if (cmd === 'v') y += num();
467
+ else { i += 1; continue; }
468
+ xs.push(x);
469
+ ys.push(y);
470
+ }
471
+ if (!xs.length) return [0, 0];
472
+ return [r3((Math.min(...xs) + Math.max(...xs)) / 2), r3((Math.min(...ys) + Math.max(...ys)) / 2)];
473
+ }
409
474
 
410
475
  /** A gear outline: n trapezoid teeth between radius r and R round (cx, cy). */
411
476
  export function gearPath(cx, cy, r, R, n) {
@@ -426,93 +491,149 @@ export function codeCaretX(s) {
426
491
  return 4 + indent + key + 3 + rest + 2;
427
492
  }
428
493
 
429
- function codeFull() {
494
+ const SVG_ATTRS = 'fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" focusable="false"';
495
+ const svgOf = (viewBox, body) => `<svg viewBox="${viewBox}" ${SVG_ATTRS}>${body}</svg>`;
496
+
497
+ /** Everything of a scene that stands still: one SVG under the layers. */
498
+ function base(box, body) {
499
+ return `<svg class="sc-base" viewBox="0 0 ${box.w} ${box.h}" width="${box.w}" height="${box.h}" ${SVG_ATTRS}>${body}</svg>`;
500
+ }
501
+
502
+ /**
503
+ * One moving part's layer, over the whole box (or over a window: clipOf).
504
+ * `cls` names its motion (the CSS animates it); `body` is the part's SVG
505
+ * markup in the box's units, or `html` another layer inside it (a caret that
506
+ * blinks inside a caret that steps). `origin` [x, y]: what rotation and scale
507
+ * turn round (the old fill-box centre, or a view-box point); `still` [x, y,
508
+ * more]: the resting transform of a part drawn at 0,0; `i`: its beat.
509
+ */
510
+ function layerOf(box, cls, body, { origin = null, still = null, i = null, html = null } = {}) {
511
+ const style = [];
512
+ if (i != null) style.push(`--i:${i}`);
513
+ if (origin) style.push(`transform-origin:${boxPct(origin[0], box.w)} ${boxPct(origin[1], box.h)}`);
514
+ if (still) style.push(`transform:translate(${boxPct(still[0], box.w)},${boxPct(still[1], box.h)})${still[2] ? ` ${still[2]}` : ''}`);
515
+ const inner = html != null ? html : svgOf(`0 0 ${box.w} ${box.h}`, body);
516
+ return `<span class="sc-layer${cls ? ` ${cls}` : ''}"${style.length ? ` style="${style.join(';')}"` : ''}>${inner}</span>`;
517
+ }
518
+
519
+ /** A still part that stood above a moving one: it stays above it. */
520
+ const topOf = (box, body) => layerOf(box, 'sc-top', body);
521
+
522
+ /** A clipped window of the scene ([x, y, w, h] in units): what scrolls inside it is cut at its edges. */
523
+ function clipOf(box, [x, y, w, h], inner) {
524
+ return `<span class="sc-clip" style="left:${boxPct(x, box.w)};top:${boxPct(y, box.h)};width:${boxPct(w, box.w)};height:${boxPct(h, box.h)}">${inner}</span>`;
525
+ }
526
+
527
+ /** Parts that share a beat (`--i`) share one layer: [{ i, body }] → one layer per beat, in first-seen order. */
528
+ function beatLayers(box, cls, parts) {
529
+ const beats = new Map();
530
+ for (const { i, body } of parts) beats.set(i, (beats.get(i) || '') + body);
531
+ return [...beats].map(([i, body]) => layerOf(box, cls, body, { i })).join('');
532
+ }
533
+
534
+ function codeFull(box) {
430
535
  let lines = '';
431
536
  for (let i = 0; i < CODE_LINES.length * 2; i += 1) {
432
537
  const [indent, key, rest] = CODE_LINES[i % CODE_LINES.length];
433
538
  const y = 5 + CODE_STEP * i;
434
539
  lines += `<path class="sc-mid" d="M${indent} ${y}h${key}"/><path class="sc-dim" d="M${indent + key + 3} ${y}h${rest}"/>`;
435
540
  }
436
- return '<rect class="sc-dim" x="1" y="1.5" width="118" height="37" rx="5"/>'
437
- + `<svg x="4" y="4" width="112" height="32" overflow="hidden"><g class="sc-code-scroll">${lines}</g></svg>`
438
- + `<g class="sc-code-caret" style="transform:translateX(${codeCaretX(0)}px)"><rect class="sc-gold sc-fill sc-caret" x="0" y="30.5" width="2" height="5" rx="1"/></g>`;
541
+ const [, , w, h] = CODE_WINDOW;
542
+ const caret = layerOf(box, 'sc-caret', '<rect class="sc-gold sc-fill" x="0" y="30.5" width="2" height="5" rx="1"/>');
543
+ return base(box, '<rect class="sc-dim" x="1" y="1.5" width="118" height="37" rx="5"/>')
544
+ + clipOf(box, CODE_WINDOW, layerOf({ w, h }, 'sc-code-scroll', lines))
545
+ + layerOf(box, 'sc-code-caret', null, { still: [codeCaretX(0), 0], html: caret });
439
546
  }
440
547
 
441
548
  const GEAR_BIG = gearPath(66, 20, 9, 12.5, 8);
442
549
  const GEAR_SMALL = gearPath(86.5, 12.5, 5.5, 8, 6);
443
550
 
444
- function complexFull() {
445
- return '<path class="sc-dim" d="M14 7h13l5 5v21H14z"/><path class="sc-mid" d="M8 11h13l5 5v21H8zM21 11v5h5M12 23h9M12 28h11"/>'
446
- + `<g class="sc-gear-big sc-box"><path class="sc-mid" d="${GEAR_BIG}"/><circle class="sc-dim" cx="66" cy="20" r="3.2"/></g>`
447
- + `<g class="sc-gear-small sc-box"><path class="sc-gold" d="${GEAR_SMALL}"/><circle class="sc-gold" cx="86.5" cy="12.5" r="2"/></g>`
448
- + '<path class="sc-dim" d="M98 30h14M102 25h10"/>';
551
+ function complexFull(box) {
552
+ return base(box, '<path class="sc-dim" d="M14 7h13l5 5v21H14z"/><path class="sc-mid" d="M8 11h13l5 5v21H8zM21 11v5h5M12 23h9M12 28h11"/><path class="sc-dim" d="M98 30h14M102 25h10"/>')
553
+ + layerOf(box, 'sc-gear-big', `<path class="sc-mid" d="${GEAR_BIG}"/><circle class="sc-dim" cx="66" cy="20" r="3.2"/>`, { origin: [66, 20] })
554
+ + layerOf(box, 'sc-gear-small', `<path class="sc-gold" d="${GEAR_SMALL}"/><circle class="sc-gold" cx="86.5" cy="12.5" r="2"/>`, { origin: [86.5, 12.5] });
555
+ }
556
+
557
+ /** A review tick, its own layer (it pops round its own centre). */
558
+ function tickLayer(box, d, i) {
559
+ return layerOf(box, 'sc-tick', `<path class="sc-gold" d="${d}"/>`, { origin: pathCentre(d), i });
449
560
  }
450
561
 
451
- function reviewFull() {
562
+ function reviewFull(box) {
452
563
  const rows = [[9, '+', 52], [16, '-', 64], [23, '+', 40], [30, '+', 58]];
453
- let out = '<rect class="sc-dim" x="1" y="1.5" width="118" height="37" rx="5"/>';
564
+ let still = '<rect class="sc-dim" x="1" y="1.5" width="118" height="37" rx="5"/>';
565
+ let ticks = '';
454
566
  rows.forEach(([y, sign, len], i) => {
455
- out += sign === '+' ? `<path class="sc-mid" d="M6 ${y}h4M8 ${y - 2}v4"/>` : `<path class="sc-mid" d="M6 ${y}h4"/>`;
456
- out += `<path class="sc-dim" d="M15 ${y}h${len}"/>`;
457
- out += `<path class="sc-gold sc-tick sc-box" style="--i:${i}" d="M${95} ${y}l2.2 2.2 4.4-4.6"/>`;
567
+ still += sign === '+' ? `<path class="sc-mid" d="M6 ${y}h4M8 ${y - 2}v4"/>` : `<path class="sc-mid" d="M6 ${y}h4"/>`;
568
+ still += `<path class="sc-dim" d="M15 ${y}h${len}"/>`;
569
+ ticks += tickLayer(box, `M95 ${y}l2.2 2.2 4.4-4.6`, i);
458
570
  });
459
- return out;
571
+ return base(box, still) + ticks;
460
572
  }
461
573
 
462
- function researchFull() {
574
+ function researchFull(box) {
463
575
  const page = (x) => `<rect class="sc-dim" x="${x}" y="4" width="40" height="32" rx="3"/><path class="sc-dim" d="M${x + 6} 11h26M${x + 6} 17h22M${x + 6} 23h28M${x + 6} 29h16"/>`;
464
- return page(8) + page(56)
465
- + '<g class="sc-lens"><circle class="sc-gold" cx="24" cy="17" r="7"/><path class="sc-gold" d="M29.2 22.2l5 5"/></g>';
576
+ return base(box, page(8) + page(56))
577
+ + layerOf(box, 'sc-lens', '<circle class="sc-gold" cx="24" cy="17" r="7"/><path class="sc-gold" d="M29.2 22.2l5 5"/>');
466
578
  }
467
579
 
468
580
  const POINTER = 'M0 0v10.5l2.8-2.6 2 4.4 2-.9-2-4.3h3.9z';
469
581
 
470
- function browserFull() {
471
- return '<rect class="sc-dim" x="1" y="1.5" width="118" height="37" rx="5"/><path class="sc-dim" d="M1 9.5h118"/>'
582
+ /** A click's ring (a layer that starts invisible: .sc-ring) and the pointer that clicks there (drawn at 0,0, placed by its layer). */
583
+ function pointerLayers(box, kind, [cx, cy], r) {
584
+ return layerOf(box, `sc-ring sc-ripple-${kind}`, `<circle class="sc-gold" cx="${cx}" cy="${cy}" r="${r}"/>`, { origin: [cx, cy] })
585
+ + layerOf(box, `sc-point-${kind}`, `<path class="sc-gold sc-fill" d="${POINTER}"/>`, { still: [cx, cy] });
586
+ }
587
+
588
+ function browserFull(box) {
589
+ return base(box, '<rect class="sc-dim" x="1" y="1.5" width="118" height="37" rx="5"/><path class="sc-dim" d="M1 9.5h118"/>'
472
590
  + '<circle class="sc-mid sc-fill" cx="6" cy="5.5" r="1"/><circle class="sc-mid sc-fill" cx="10" cy="5.5" r="1"/><circle class="sc-mid sc-fill" cx="14" cy="5.5" r="1"/>'
473
591
  + '<rect class="sc-dim" x="22" y="3.5" width="56" height="4" rx="2"/>'
474
- + '<path class="sc-mid" d="M8 16h36"/><path class="sc-dim" d="M8 22h54M8 27h44M8 32h30"/><rect class="sc-mid" x="78" y="25" width="28" height="8" rx="2"/>'
475
- + '<circle class="sc-gold sc-ring sc-ripple-browser sc-box" cx="92" cy="29" r="5"/>'
476
- + `<g class="sc-point-browser" style="transform:translate(92px,29px)"><path class="sc-gold sc-fill" d="${POINTER}"/></g>`;
592
+ + '<path class="sc-mid" d="M8 16h36"/><path class="sc-dim" d="M8 22h54M8 27h44M8 32h30"/><rect class="sc-mid" x="78" y="25" width="28" height="8" rx="2"/>')
593
+ + pointerLayers(box, 'browser', [92, 29], 5);
477
594
  }
478
595
 
479
- function computerFull() {
480
- return '<rect class="sc-dim" x="10" y="1.5" width="100" height="30" rx="3"/><path class="sc-dim" d="M60 31.5v4M48 37.5h24"/>'
596
+ function computerFull(box) {
597
+ return base(box, '<rect class="sc-dim" x="10" y="1.5" width="100" height="30" rx="3"/><path class="sc-dim" d="M60 31.5v4M48 37.5h24"/>'
481
598
  + '<rect class="sc-mid sc-shade" x="16" y="6" width="44" height="20" rx="2"/><path class="sc-dim" d="M16 10h44M21 15h20M21 20h28"/>'
482
- + '<rect class="sc-mid sc-shade" x="52" y="11" width="50" height="17" rx="2"/><path class="sc-dim" d="M52 15h50"/><rect class="sc-mid" x="84" y="20" width="13" height="5" rx="1.5"/>'
483
- + '<circle class="sc-gold sc-ring sc-ripple-computer sc-box" cx="90" cy="22.5" r="4.5"/>'
484
- + `<g class="sc-point-computer" style="transform:translate(90px,22.5px)"><path class="sc-gold sc-fill" d="${POINTER}"/></g>`;
599
+ + '<rect class="sc-mid sc-shade" x="52" y="11" width="50" height="17" rx="2"/><path class="sc-dim" d="M52 15h50"/><rect class="sc-mid" x="84" y="20" width="13" height="5" rx="1.5"/>')
600
+ + pointerLayers(box, 'computer', [90, 22.5], 4.5);
485
601
  }
486
602
 
487
- function automationFull() {
488
- return '<circle class="sc-mid" cx="18" cy="20" r="13"/><path class="sc-dim" d="M18 9v2M18 29v2M7 20h2M27 20h2"/>'
489
- + '<path class="sc-mid" d="M18 20l5-4"/>'
490
- + '<g class="sc-hand sc-vb" style="transform-origin:18px 20px"><path class="sc-gold" d="M18 20v-9"/></g><circle class="sc-gold sc-fill" cx="18" cy="20" r="1.6"/>'
603
+ function automationFull(box) {
604
+ // The hub dot sits in the still SVG: hand and dot are the same gold, so which is on top shows nowhere.
605
+ return base(box, '<circle class="sc-mid" cx="18" cy="20" r="13"/><path class="sc-dim" d="M18 9v2M18 29v2M7 20h2M27 20h2"/>'
606
+ + '<path class="sc-mid" d="M18 20l5-4"/><circle class="sc-gold sc-fill" cx="18" cy="20" r="1.6"/>'
491
607
  + '<path class="sc-dim" d="M52 24h14M76 24h14"/><rect class="sc-mid" x="44" y="20" width="8" height="8" rx="2"/><rect class="sc-mid" x="66" y="20" width="10" height="8" rx="2"/><rect class="sc-mid" x="90" y="20" width="8" height="8" rx="2"/>'
492
- + '<path class="sc-dim" d="M94 17c0-9-46-9-46 0M48 17l-2.5-3M48 17l3-2"/>'
493
- + '<g class="sc-run-dot"><circle class="sc-gold sc-fill" cx="48" cy="24" r="2.2"/></g>';
608
+ + '<path class="sc-dim" d="M94 17c0-9-46-9-46 0M48 17l-2.5-3M48 17l3-2"/>')
609
+ + layerOf(box, 'sc-hand', '<path class="sc-gold" d="M18 20v-9"/>', { origin: [18, 20] })
610
+ + layerOf(box, 'sc-run-dot', '<circle class="sc-gold sc-fill" cx="48" cy="24" r="2.2"/>');
494
611
  }
495
612
 
496
- function designFull() {
497
- return '<rect class="sc-gold sc-fill sc-swatch" x="4" y="5" width="9" height="9" rx="2"/><rect class="sc-mid sc-fill sc-swatch-b" x="4" y="16" width="9" height="9" rx="2"/><rect class="sc-dim sc-fill sc-swatch-c" x="4" y="27" width="9" height="9" rx="2"/>'
498
- + '<rect class="sc-dim" x="20" y="2.5" width="96" height="35" rx="4"/>'
499
- + '<circle class="sc-mid sc-shape sc-box" style="--i:0" cx="40" cy="20" r="8"/>'
500
- + '<rect class="sc-mid sc-shape sc-box" style="--i:1" x="58" y="12" width="16" height="16" rx="3"/>'
501
- + '<path class="sc-mid sc-shape sc-box" style="--i:2" d="M86 28l9-16 9 16z"/>'
502
- + '<g class="sc-pen" style="transform:translate(40px,20px)"><path class="sc-gold" d="M0 0l6-6M6-6l2.5 2.5M0 0l-1.2 3.7L2.5 2.5z"/></g>';
613
+ const TRIANGLE = 'M86 28l9-16 9 16z';
614
+
615
+ function designFull(box) {
616
+ return base(box, '<rect class="sc-gold sc-fill sc-swatch" x="4" y="5" width="9" height="9" rx="2"/><rect class="sc-mid sc-fill sc-swatch-b" x="4" y="16" width="9" height="9" rx="2"/><rect class="sc-dim sc-fill sc-swatch-c" x="4" y="27" width="9" height="9" rx="2"/>'
617
+ + '<rect class="sc-dim" x="20" y="2.5" width="96" height="35" rx="4"/>')
618
+ + layerOf(box, 'sc-shape', '<circle class="sc-mid" cx="40" cy="20" r="8"/>', { origin: [40, 20], i: 0 })
619
+ + layerOf(box, 'sc-shape', '<rect class="sc-mid" x="58" y="12" width="16" height="16" rx="3"/>', { origin: [66, 20], i: 1 })
620
+ + layerOf(box, 'sc-shape', `<path class="sc-mid" d="${TRIANGLE}"/>`, { origin: pathCentre(TRIANGLE), i: 2 })
621
+ + layerOf(box, 'sc-pen', '<path class="sc-gold" d="M0 0l6-6M6-6l2.5 2.5M0 0l-1.2 3.7L2.5 2.5z"/>', { still: [40, 20] });
503
622
  }
504
623
 
505
- function imageFull() {
506
- let tiles = '';
624
+ const SPARKLE = 'M104 6l1.6 4.4L110 12l-4.4 1.6L104 18l-1.6-4.4L98 12l4.4-1.6z';
625
+
626
+ function imageFull(box) {
627
+ const tiles = [];
507
628
  for (let row = 0; row < 3; row += 1) {
508
629
  for (let col = 0; col < 4; col += 1) {
509
630
  const gold = (row === 1 && col === 2) || (row === 2 && col === 0);
510
- tiles += `<rect class="${gold ? 'sc-gold' : 'sc-mid'} sc-fill sc-tile" style="--i:${row + col}" x="${34 + col * 13.5}" y="${6 + row * 10}" width="11.5" height="8" rx="1.5"/>`;
631
+ tiles.push({ i: row + col, body: `<rect class="${gold ? 'sc-gold' : 'sc-mid'} sc-fill" x="${34 + col * 13.5}" y="${6 + row * 10}" width="11.5" height="8" rx="1.5"/>` });
511
632
  }
512
633
  }
513
- return `<rect class="sc-dim" x="30" y="2.5" width="61" height="35" rx="3"/>${tiles}`
514
- + '<g class="sc-sparkle sc-box"><path class="sc-gold sc-fill" d="M104 6l1.6 4.4L110 12l-4.4 1.6L104 18l-1.6-4.4L98 12l4.4-1.6z"/></g>'
515
- + '<path class="sc-dim" d="M100 26h12M100 31h8"/>';
634
+ return base(box, '<rect class="sc-dim" x="30" y="2.5" width="61" height="35" rx="3"/><path class="sc-dim" d="M100 26h12M100 31h8"/>')
635
+ + beatLayers(box, 'sc-tile', tiles)
636
+ + layerOf(box, 'sc-sparkle', `<path class="sc-gold sc-fill" d="${SPARKLE}"/>`, { origin: pathCentre(SPARKLE) });
516
637
  }
517
638
 
518
639
  function filmFrames(width, y, h, frameW, count) {
@@ -522,47 +643,71 @@ function filmFrames(width, y, h, frameW, count) {
522
643
  return out;
523
644
  }
524
645
 
525
- function videoFull() {
526
- return `<svg x="4" y="4" width="112" height="32" overflow="hidden"><g class="sc-film">${filmFrames(160, 2, 28, 24, 7)}</g></svg>`
527
- + '<path class="sc-gold" d="M58 2v36M55 2h6l-3 3z"/>';
646
+ function videoFull(box) {
647
+ const [, , w, h] = FILM_WINDOW;
648
+ return base(box, '')
649
+ + clipOf(box, FILM_WINDOW, layerOf({ w, h }, 'sc-film', filmFrames(160, 2, 28, 24, 7)))
650
+ + topOf(box, '<path class="sc-gold" d="M58 2v36M55 2h6l-3 3z"/>');
528
651
  }
529
652
 
530
653
  /** An open-end wrench, horizontal, its jaw round (0, 0): place it with translate(bolt) rotate(a) translate(3.5 0). */
531
654
  const WRENCH = 'M-4.6 -3.86L-1 -2V2L-4.6 3.86A6 6 0 0 0 5.5 2.4H24A2.4 2.4 0 0 0 24 -2.4H5.5A6 6 0 0 0 -4.6 -3.86Z';
532
655
  const hexagon = (cx, cy, r) => `M${[0, 1, 2, 3, 4, 5].map(i => `${r1(cx + r * Math.cos(i * Math.PI / 3))} ${r1(cy + r * Math.sin(i * Math.PI / 3))}`).join('L')}Z`;
656
+ const ZAP = 'M92 5l-8 15h7l-3 14 11-18h-7.5z';
657
+
658
+ /** Sparks off the bolt: one layer each (they flash one after another). */
659
+ const sparkLayers = (box, ds) => ds.map((d, i) => layerOf(box, 'sc-spark', `<path class="sc-gold" d="${d}"/>`, { i })).join('');
533
660
 
534
- function quickFull() {
535
- return `<path class="sc-mid" d="${hexagon(38, 24, 3.4)}"/>`
536
- + `<g class="sc-wrench sc-vb" style="transform-origin:38px 24px"><path class="sc-gold" transform="translate(38 24) rotate(-32) translate(3.5 0)" d="${WRENCH}"/></g>`
537
- + '<path class="sc-gold sc-spark" style="--i:0" d="M30.5 19.5l-3-2"/><path class="sc-gold sc-spark" style="--i:1" d="M29.5 24.5h-3.5"/><path class="sc-gold sc-spark" style="--i:2" d="M30.5 29.5l-3 2"/>'
538
- + '<g class="sc-zap sc-box"><path class="sc-gold" d="M92 5l-8 15h7l-3 14 11-18h-7.5z"/></g>';
661
+ function quickFull(box) {
662
+ return base(box, `<path class="sc-mid" d="${hexagon(38, 24, 3.4)}"/>`)
663
+ + layerOf(box, 'sc-wrench', `<path class="sc-gold" transform="translate(38 24) rotate(-32) translate(3.5 0)" d="${WRENCH}"/>`, { origin: [38, 24] })
664
+ + sparkLayers(box, ['M30.5 19.5l-3-2', 'M29.5 24.5h-3.5', 'M30.5 29.5l-3 2'])
665
+ + layerOf(box, 'sc-zap', `<path class="sc-gold" d="${ZAP}"/>`, { origin: pathCentre(ZAP) });
539
666
  }
540
667
 
541
- function genericFull() {
542
- return '<path class="sc-dim" d="M14 20h92"/><circle class="sc-mid" cx="14" cy="20" r="3"/><circle class="sc-mid" cx="60" cy="20" r="3"/><circle class="sc-mid" cx="106" cy="20" r="3"/>'
543
- + '<g class="sc-slide"><rect class="sc-gold sc-fill" x="14" y="18.5" width="24" height="3" rx="1.5"/></g>';
668
+ function genericFull(box) {
669
+ return base(box, '<path class="sc-dim" d="M14 20h92"/><circle class="sc-mid" cx="14" cy="20" r="3"/><circle class="sc-mid" cx="60" cy="20" r="3"/><circle class="sc-mid" cx="106" cy="20" r="3"/>')
670
+ + layerOf(box, 'sc-slide', '<rect class="sc-gold sc-fill" x="14" y="18.5" width="24" height="3" rx="1.5"/>');
544
671
  }
545
672
 
673
+ const MINI_TRIANGLE = 'M29 15l4.5-8 4.5 8z';
674
+
546
675
  // Minis (40×20, the tray at 32×16): one gesture each.
547
676
  const MINI = {
548
- code: () => '<path class="sc-mid" d="M5 5h20M9 10h24M5 15h14"/><rect class="sc-gold sc-fill sc-caret" x="21.5" y="12.5" width="1.8" height="5" rx=".9"/>',
549
- complex: () => `<g class="sc-gear-big sc-box"><path class="sc-mid" d="${gearPath(14, 11, 4.5, 6.6, 6)}"/></g><g class="sc-gear-small sc-box"><path class="sc-gold" d="${gearPath(26.5, 7.5, 3, 4.6, 6)}"/></g>`,
550
- review: () => '<path class="sc-dim" d="M4 5h20M4 10h24M4 15h18"/><path class="sc-gold sc-tick sc-box" style="--i:0" d="M30 5l1.6 1.6 3.2-3.4"/><path class="sc-gold sc-tick sc-box" style="--i:1" d="M32 10l1.6 1.6 3.2-3.4"/>',
551
- research: () => '<rect class="sc-dim" x="3" y="2.5" width="26" height="15" rx="2"/><path class="sc-dim" d="M7 7h16M7 11h12M7 15h14"/><g class="sc-lens-mini"><circle class="sc-gold" cx="12" cy="9" r="3.8"/><path class="sc-gold" d="M14.8 11.8l2.8 2.8"/></g>',
552
- browser: () => `<rect class="sc-dim" x="2" y="2" width="36" height="16" rx="2.5"/><path class="sc-dim" d="M2 6h36"/><rect class="sc-mid" x="24" y="11" width="10" height="4" rx="1.2"/><g class="sc-point-mini" style="transform:translate(29px,13px) scale(.6)"><path class="sc-gold sc-fill" d="${POINTER}"/></g>`,
553
- computer: () => `<rect class="sc-dim" x="5" y="1.5" width="30" height="14" rx="2"/><path class="sc-dim" d="M20 15.5v2M15 18.5h10"/><rect class="sc-mid" x="8" y="4.5" width="13" height="8" rx="1"/><g class="sc-point-mini" style="transform:translate(29px,13px) scale(.6)"><path class="sc-gold sc-fill" d="${POINTER}"/></g>`,
554
- automation: () => '<circle class="sc-mid" cx="11" cy="10" r="7.5"/><path class="sc-dim" d="M11 10l3-2.5"/><g class="sc-hand sc-vb" style="transform-origin:11px 10px"><path class="sc-gold" d="M11 10V4.5"/></g>'
555
- + '<path class="sc-mid" d="M33.5 10a5 5 0 1 1-1.5-3.6M32 3.6v2.8h-2.8"/>',
556
- design: () => '<rect class="sc-mid sc-fill" x="3" y="3" width="6" height="6" rx="1.5"/><rect class="sc-dim sc-fill" x="3" y="11" width="6" height="6" rx="1.5"/><circle class="sc-gold sc-shape sc-box" style="--i:0" cx="21" cy="10" r="5"/><path class="sc-mid sc-shape sc-box" style="--i:1" d="M29 15l4.5-8 4.5 8z"/>',
557
- image_gen: () => {
558
- let tiles = '';
559
- for (let row = 0; row < 2; row += 1) for (let col = 0; col < 3; col += 1) tiles += `<rect class="${row === 1 && col === 2 ? 'sc-gold' : 'sc-mid'} sc-fill sc-tile" style="--i:${row + col}" x="${11 + col * 6.4}" y="${5 + row * 5.6}" width="5" height="4.2" rx="1"/>`;
560
- return `<rect class="sc-dim" x="9" y="2.5" width="22" height="15" rx="2"/>${tiles}`;
677
+ code: box => base(box, '<path class="sc-mid" d="M5 5h20M9 10h24M5 15h14"/>')
678
+ + layerOf(box, 'sc-caret', '<rect class="sc-gold sc-fill" x="21.5" y="12.5" width="1.8" height="5" rx=".9"/>'),
679
+ complex: box => base(box, '')
680
+ + layerOf(box, 'sc-gear-big', `<path class="sc-mid" d="${gearPath(14, 11, 4.5, 6.6, 6)}"/>`, { origin: [14, 11] })
681
+ + layerOf(box, 'sc-gear-small', `<path class="sc-gold" d="${gearPath(26.5, 7.5, 3, 4.6, 6)}"/>`, { origin: [26.5, 7.5] }),
682
+ review: box => base(box, '<path class="sc-dim" d="M4 5h20M4 10h24M4 15h18"/>')
683
+ + tickLayer(box, 'M30 5l1.6 1.6 3.2-3.4', 0) + tickLayer(box, 'M32 10l1.6 1.6 3.2-3.4', 1),
684
+ research: box => base(box, '<rect class="sc-dim" x="3" y="2.5" width="26" height="15" rx="2"/><path class="sc-dim" d="M7 7h16M7 11h12M7 15h14"/>')
685
+ + layerOf(box, 'sc-lens-mini', '<circle class="sc-gold" cx="12" cy="9" r="3.8"/><path class="sc-gold" d="M14.8 11.8l2.8 2.8"/>'),
686
+ browser: box => base(box, '<rect class="sc-dim" x="2" y="2" width="36" height="16" rx="2.5"/><path class="sc-dim" d="M2 6h36"/><rect class="sc-mid" x="24" y="11" width="10" height="4" rx="1.2"/>')
687
+ + layerOf(box, 'sc-point-mini', `<path class="sc-gold sc-fill" d="${POINTER}"/>`, { still: [29, 13, 'scale(.6)'] }),
688
+ computer: box => base(box, '<rect class="sc-dim" x="5" y="1.5" width="30" height="14" rx="2"/><path class="sc-dim" d="M20 15.5v2M15 18.5h10"/><rect class="sc-mid" x="8" y="4.5" width="13" height="8" rx="1"/>')
689
+ + layerOf(box, 'sc-point-mini', `<path class="sc-gold sc-fill" d="${POINTER}"/>`, { still: [29, 13, 'scale(.6)'] }),
690
+ automation: box => base(box, '<circle class="sc-mid" cx="11" cy="10" r="7.5"/><path class="sc-dim" d="M11 10l3-2.5"/><path class="sc-mid" d="M33.5 10a5 5 0 1 1-1.5-3.6M32 3.6v2.8h-2.8"/>')
691
+ + layerOf(box, 'sc-hand', '<path class="sc-gold" d="M11 10V4.5"/>', { origin: [11, 10] }),
692
+ design: box => base(box, '<rect class="sc-mid sc-fill" x="3" y="3" width="6" height="6" rx="1.5"/><rect class="sc-dim sc-fill" x="3" y="11" width="6" height="6" rx="1.5"/>')
693
+ + layerOf(box, 'sc-shape', '<circle class="sc-gold" cx="21" cy="10" r="5"/>', { origin: [21, 10], i: 0 })
694
+ + layerOf(box, 'sc-shape', `<path class="sc-mid" d="${MINI_TRIANGLE}"/>`, { origin: pathCentre(MINI_TRIANGLE), i: 1 }),
695
+ image_gen: (box) => {
696
+ const tiles = [];
697
+ for (let row = 0; row < 2; row += 1) for (let col = 0; col < 3; col += 1) tiles.push({ i: row + col, body: `<rect class="${row === 1 && col === 2 ? 'sc-gold' : 'sc-mid'} sc-fill" x="${11 + col * 6.4}" y="${5 + row * 5.6}" width="5" height="4.2" rx="1"/>` });
698
+ return base(box, '<rect class="sc-dim" x="9" y="2.5" width="22" height="15" rx="2"/>') + beatLayers(box, 'sc-tile', tiles);
699
+ },
700
+ video_gen: (box) => {
701
+ const [, , w, h] = FILM_MINI_WINDOW;
702
+ return base(box, '')
703
+ + clipOf(box, FILM_MINI_WINDOW, layerOf({ w, h }, 'sc-film-mini', filmFrames(60, 1, 14, 12, 5)))
704
+ + topOf(box, '<path class="sc-gold" d="M20 1v18"/>');
561
705
  },
562
- video_gen: () => `<svg x="2" y="2" width="36" height="16" overflow="hidden"><g class="sc-film-mini">${filmFrames(60, 1, 14, 12, 5)}</g></svg><path class="sc-gold" d="M20 1v18"/>`,
563
- quick: () => `<path class="sc-mid" d="${hexagon(11, 11, 2.6)}"/><g class="sc-wrench sc-vb" style="transform-origin:11px 11px"><path class="sc-gold" stroke-width="2.4" transform="translate(11 11) rotate(-32) scale(.62) translate(3.5 0)" d="${WRENCH}"/></g>`
564
- + '<path class="sc-gold sc-spark" style="--i:0" d="M5.5 7.5l-2-1.3"/><path class="sc-gold sc-spark" style="--i:1" d="M5 11.5H2.6"/>',
565
- generic: () => '<circle class="sc-gold sc-fill sc-dot" style="--i:0" cx="11" cy="10" r="2.4"/><circle class="sc-gold sc-fill sc-dot" style="--i:1" cx="20" cy="10" r="2.4"/><circle class="sc-gold sc-fill sc-dot" style="--i:2" cx="29" cy="10" r="2.4"/>',
706
+ quick: box => base(box, `<path class="sc-mid" d="${hexagon(11, 11, 2.6)}"/>`)
707
+ + layerOf(box, 'sc-wrench', `<path class="sc-gold" stroke-width="2.4" transform="translate(11 11) rotate(-32) scale(.62) translate(3.5 0)" d="${WRENCH}"/>`, { origin: [11, 11] })
708
+ + sparkLayers(box, ['M5.5 7.5l-2-1.3', 'M5 11.5H2.6']),
709
+ generic: box => base(box, '')
710
+ + [11, 20, 29].map((cx, i) => layerOf(box, 'sc-dot', `<circle class="sc-gold sc-fill" cx="${cx}" cy="10" r="2.4"/>`, { i })).join(''),
566
711
  };
567
712
 
568
713
  const FULL = {
@@ -571,13 +716,14 @@ const FULL = {
571
716
  };
572
717
 
573
718
  /**
574
- * A scene's SVG (decorative: aria-hidden). `mini` draws the tray's 40×20
719
+ * A scene's markup (decorative: aria-hidden): an HTML box with its still SVG
720
+ * and one layer per moving part (see above). `mini` draws the tray's 40×20
575
721
  * version. `live` starts it moving (the stage and tray set data-live
576
722
  * themselves later; this is only the first state).
577
723
  */
578
724
  export function sceneSvg(scene, { mini = false, live = false, className = '' } = {}) {
579
725
  const id = Object.hasOwn(FULL, scene) ? scene : 'generic';
580
- const [w, h] = mini ? [40, 20] : [120, 40];
581
- const body = (mini ? MINI[id] : FULL[id])();
582
- return `<svg class="asst-scene${mini ? ' is-mini' : ''}${className ? ` ${className}` : ''}" data-scene="${id}"${live ? ' data-live=""' : ''} viewBox="0 0 ${w} ${h}" width="${w}" height="${h}" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${body}</svg>`;
726
+ const box = mini ? SCENE_BOX.mini : SCENE_BOX.full;
727
+ const body = (mini ? MINI[id] : FULL[id])(box);
728
+ return `<span class="asst-scene${mini ? ' is-mini' : ''}${className ? ` ${className}` : ''}" data-scene="${id}"${live ? ' data-live=""' : ''} aria-hidden="true">${body}</span>`;
583
729
  }
@@ -459,15 +459,15 @@ export function injectAssistantSidepanelStyles() {
459
459
 
460
460
  body.ui-interacting .asp-placeholder .asp-mark,
461
461
  body.ui-interacting .asp-placeholder-track::after,
462
- body.ui-interacting .asp-status .syna-cameo-eye,
463
- body.ui-interacting .asp-session-pill .syna-cameo-eye { animation-play-state: paused !important; }
462
+ body.ui-interacting .asp-status .syna-cameo-eyes,
463
+ body.ui-interacting .asp-session-pill .syna-cameo-eyes { animation-play-state: paused !important; }
464
464
 
465
465
  @media (prefers-reduced-motion: reduce) {
466
466
  .assistant-panel { transition: opacity 0.15s ease; }
467
467
  .asp-placeholder .asp-mark,
468
468
  .asp-placeholder-track::after,
469
- .asp-status .syna-cameo-eye,
470
- .asp-session-pill .syna-cameo-eye,
469
+ .asp-status .syna-cameo-eyes,
470
+ .asp-session-pill .syna-cameo-eyes,
471
471
  .assistant-panel .asst-send::before { animation: none !important; }
472
472
  .asp-placeholder-track::after { left: 31%; }
473
473
  }