claude-exode-mcp 7.5.7 → 7.5.8

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 (173) hide show
  1. package/MCP_DOCUMENTATION.md +1 -0
  2. package/SKILL.md +10 -0
  3. package/examples/aurum-product-page.exode +3208 -0
  4. package/examples/bell-ring-icon.exode +1 -0
  5. package/examples/drift-kinetic-type.exode +770 -0
  6. package/examples/earbuds-product.exode +214 -0
  7. package/examples/energy-flow.exode +1736 -0
  8. package/examples/flux-hero.exode +223 -0
  9. package/examples/gooey-toggle.exode +214 -0
  10. package/examples/gravity-well.exode +3113 -0
  11. package/examples/heart-icon.exode +1 -0
  12. package/examples/hologram-temple.exode +8100 -0
  13. package/examples/jarful-app.exode +1 -0
  14. package/examples/kip-character-rig.exode +1 -0
  15. package/examples/low-tide-tilt.exode +2216 -0
  16. package/examples/manifest.json +352 -0
  17. package/examples/swipe-stack-carousel.exode +4048 -0
  18. package/examples/tokyo-neon-weather.exode +470 -0
  19. package/examples/typographic-collapse.exode +1578 -0
  20. package/examples/void-product-ad.exode +1269 -0
  21. package/examples/wire-globe-card.exode +580 -0
  22. package/index.d.ts +41 -1
  23. package/index.js +2553 -2407
  24. package/package.json +4 -2
  25. package/render-runtime/exode-runtime.js +20 -20
  26. package/skills/creative-motion/SKILL.md +10 -0
  27. package/skills/creative-motion/recipes/character-rig.js +104 -0
  28. package/skills/creative-motion/recipes/dashboard.js +120 -0
  29. package/skills/creative-motion/recipes/game-arcade.js +203 -0
  30. package/skills/creative-motion/recipes/hero-physics.js +65 -0
  31. package/skills/creative-motion/recipes/pricing.js +88 -0
  32. package/skills/creative-motion/recipes/title-sequence.js +62 -0
  33. package/skills/creative-motion/references/apps.md +37 -0
  34. package/skills/creative-motion/references/gotchas.md +80 -0
  35. package/skills/creative-motion/references/native-layers.md +60 -0
  36. package/skills/creative-motion/references/quality.md +54 -0
  37. package/src/__tests__/buildKit.test.ts +127 -0
  38. package/src/__tests__/effectKnobs.test.ts +162 -0
  39. package/src/__tests__/nativeLayers.test.ts +178 -0
  40. package/src/buildKit.d.ts +301 -0
  41. package/src/buildKit.d.ts.map +1 -0
  42. package/src/buildKit.js +559 -0
  43. package/src/buildKit.js.map +1 -0
  44. package/src/buildKit.ts +520 -0
  45. package/src/compiler.d.ts +4 -0
  46. package/src/compiler.d.ts.map +1 -1
  47. package/src/compiler.js +21 -45
  48. package/src/compiler.js.map +1 -1
  49. package/src/compiler.ts +22 -51
  50. package/src/critique.d.ts +8 -0
  51. package/src/critique.d.ts.map +1 -0
  52. package/src/critique.js +348 -0
  53. package/src/critique.js.map +1 -0
  54. package/src/critique.ts +239 -0
  55. package/src/effectKnobs.d.ts +72 -0
  56. package/src/effectKnobs.d.ts.map +1 -0
  57. package/src/effectKnobs.js +541 -0
  58. package/src/effectKnobs.js.map +1 -0
  59. package/src/effectKnobs.ts +445 -0
  60. package/src/effectOptimizer.d.ts +18 -0
  61. package/src/effectOptimizer.d.ts.map +1 -0
  62. package/src/effectOptimizer.js +125 -0
  63. package/src/effectOptimizer.js.map +1 -0
  64. package/src/effectOptimizer.ts +104 -0
  65. package/src/engine/layout.js +1 -1
  66. package/src/engine/layout.js.map +1 -1
  67. package/src/engine/layout.ts +1 -1
  68. package/src/examples.d.ts +30 -0
  69. package/src/examples.d.ts.map +1 -0
  70. package/src/examples.js +168 -0
  71. package/src/examples.js.map +1 -0
  72. package/src/examples.ts +151 -0
  73. package/src/handlers/artboardHandlers.d.ts.map +1 -1
  74. package/src/handlers/artboardHandlers.js +45 -10
  75. package/src/handlers/artboardHandlers.js.map +1 -1
  76. package/src/handlers/artboardHandlers.ts +43 -12
  77. package/src/handlers/buildHandlers.d.ts +2 -0
  78. package/src/handlers/buildHandlers.d.ts.map +1 -0
  79. package/src/handlers/buildHandlers.js +86 -0
  80. package/src/handlers/buildHandlers.js.map +1 -0
  81. package/src/handlers/buildHandlers.ts +76 -0
  82. package/src/handlers/compilerHandlers.d.ts.map +1 -1
  83. package/src/handlers/compilerHandlers.js +32 -2
  84. package/src/handlers/compilerHandlers.js.map +1 -1
  85. package/src/handlers/compilerHandlers.ts +31 -2
  86. package/src/handlers/exampleHandlers.d.ts +2 -0
  87. package/src/handlers/exampleHandlers.d.ts.map +1 -0
  88. package/src/handlers/exampleHandlers.js +81 -0
  89. package/src/handlers/exampleHandlers.js.map +1 -0
  90. package/src/handlers/exampleHandlers.ts +76 -0
  91. package/src/handlers/renderHandlers.d.ts.map +1 -1
  92. package/src/handlers/renderHandlers.js +100 -2
  93. package/src/handlers/renderHandlers.js.map +1 -1
  94. package/src/handlers/renderHandlers.ts +90 -2
  95. package/src/handlers/scaffoldHandlers.d.ts.map +1 -1
  96. package/src/handlers/scaffoldHandlers.js +3 -0
  97. package/src/handlers/scaffoldHandlers.js.map +1 -1
  98. package/src/handlers/scaffoldHandlers.ts +2 -0
  99. package/src/handlers/widgetHandlers.js +1 -1
  100. package/src/handlers/widgetHandlers.js.map +1 -1
  101. package/src/handlers/widgetHandlers.ts +1 -1
  102. package/src/lottie/convert.d.ts +16 -0
  103. package/src/lottie/convert.d.ts.map +1 -0
  104. package/src/lottie/convert.js +1225 -0
  105. package/src/lottie/convert.js.map +1 -0
  106. package/src/lottie/convert.ts +1134 -0
  107. package/src/lottie/evaluate.d.ts +48 -0
  108. package/src/lottie/evaluate.d.ts.map +1 -0
  109. package/src/lottie/evaluate.js +174 -0
  110. package/src/lottie/evaluate.js.map +1 -0
  111. package/src/lottie/evaluate.ts +184 -0
  112. package/src/nativeLayers.d.ts +76 -0
  113. package/src/nativeLayers.d.ts.map +1 -0
  114. package/src/nativeLayers.js +404 -0
  115. package/src/nativeLayers.js.map +1 -0
  116. package/src/nativeLayers.ts +339 -0
  117. package/src/render/motionBrief.d.ts.map +1 -1
  118. package/src/render/motionBrief.js +4 -0
  119. package/src/render/motionBrief.js.map +1 -1
  120. package/src/render/motionBrief.ts +4 -0
  121. package/src/render/videoRenderer.d.ts.map +1 -1
  122. package/src/render/videoRenderer.js +5 -2
  123. package/src/render/videoRenderer.js.map +1 -1
  124. package/src/render/videoRenderer.ts +5 -2
  125. package/src/rive/convert.d.ts +17 -0
  126. package/src/rive/convert.d.ts.map +1 -0
  127. package/src/rive/convert.js +1779 -0
  128. package/src/rive/convert.js.map +1 -0
  129. package/src/rive/convert.ts +1492 -0
  130. package/src/rive/font.d.ts +13 -0
  131. package/src/rive/font.d.ts.map +1 -0
  132. package/src/rive/font.js +154 -0
  133. package/src/rive/font.js.map +1 -0
  134. package/src/rive/font.ts +132 -0
  135. package/src/rive/layout.d.ts +20 -0
  136. package/src/rive/layout.d.ts.map +1 -0
  137. package/src/rive/layout.js +145 -0
  138. package/src/rive/layout.js.map +1 -0
  139. package/src/rive/layout.ts +140 -0
  140. package/src/rive/reader.d.ts +32 -0
  141. package/src/rive/reader.d.ts.map +1 -0
  142. package/src/rive/reader.js +172 -0
  143. package/src/rive/reader.js.map +1 -0
  144. package/src/rive/reader.ts +160 -0
  145. package/src/rive/schema.generated.d.ts +9 -0
  146. package/src/rive/schema.generated.d.ts.map +1 -0
  147. package/src/rive/schema.generated.js +13 -0
  148. package/src/rive/schema.generated.js.map +1 -0
  149. package/src/rive/schema.generated.ts +13 -0
  150. package/src/schema.d.ts +5 -0
  151. package/src/schema.d.ts.map +1 -1
  152. package/src/schema.js +5 -0
  153. package/src/schema.js.map +1 -1
  154. package/src/schema.ts +6 -0
  155. package/src/serverInstructions.d.ts +2 -0
  156. package/src/serverInstructions.d.ts.map +1 -0
  157. package/src/serverInstructions.js +22 -0
  158. package/src/serverInstructions.js.map +1 -0
  159. package/src/serverInstructions.ts +21 -0
  160. package/src/sseServer.d.ts +2 -0
  161. package/src/sseServer.d.ts.map +1 -0
  162. package/src/sseServer.js +165 -0
  163. package/src/sseServer.js.map +1 -0
  164. package/src/sseServer.ts +189 -0
  165. package/src/utils.d.ts.map +1 -1
  166. package/src/utils.js +23 -1
  167. package/src/utils.js.map +1 -1
  168. package/src/utils.ts +13 -1
  169. package/src/widgets.d.ts +26 -0
  170. package/src/widgets.d.ts.map +1 -1
  171. package/src/widgets.js +89 -45
  172. package/src/widgets.js.map +1 -1
  173. package/src/widgets.ts +88 -45
@@ -0,0 +1,162 @@
1
+ import { liftEffectKnobs, liftKnobsInDoc, bindKnobInputs, topLevelSettings } from '../effectKnobs';
2
+
3
+ const GLOW = `var LIB_ID = 'x';
4
+ /* EXODE_KEEP_LIVE · Glow */
5
+ var BUF = [];
6
+ function render(ctx, env) {
7
+ var t = env.time || 0;
8
+ /* no logic running: light the still */
9
+ ctx.fillStyle = 'rgba(94,234,255,' + (0.07 + 0.03 * Math.sin(t * 2)).toFixed(3) + ')';
10
+ /* bloom under the edges */
11
+ for (var i = 1; i < 6; i++) {
12
+ ctx.strokeStyle = 'rgba(94,234,255,' + (i / 5 * 0.16).toFixed(3) + ')';
13
+ ctx.lineWidth = 3.4;
14
+ ctx.stroke();
15
+ }
16
+ /* temple tank ripples */
17
+ var rq = (t * 0.35) % 1;
18
+ ctx.strokeStyle = rgba(BUF, 0.5 * (1 - rq));
19
+ ctx.lineWidth = 1;
20
+ ctx.fillStyle = '#ffb048';
21
+ ctx.arc(0, 0, 4 + rq * 6, 0, 6.283);
22
+ }
23
+ function rgba(c, a) { return 'rgba(0,0,0,' + a + ')'; }`;
24
+
25
+ describe('liftEffectKnobs', () => {
26
+ it('lifts style values, time rates and colour opacity into named top-level settings', () => {
27
+ const r = liftEffectKnobs(GLOW);
28
+ const byName = Object.fromEntries(r.knobs.map((k) => [k.name, k.value]));
29
+ expect(byName).toEqual({
30
+ ALPHA: 0.03, SPEED: 2,
31
+ BLOOM_ALPHA: 0.16, BLOOM_WIDTH: 3.4,
32
+ TEMPLE_TANK_RIPPLES_SPEED: 0.35, TEMPLE_TANK_RIPPLES_ALPHA: 0.5, TEMPLE_TANK_RIPPLES_WIDTH: 1, TEMPLE_TANK_RIPPLES_FILL: '#ffb048',
33
+ });
34
+ expect(r.code).toContain('ctx.lineWidth = BLOOM_WIDTH;');
35
+ expect(r.code).toContain('(t * TEMPLE_TANK_RIPPLES_SPEED) % 1');
36
+ /* structural numbers stay: loop bounds, divisors, geometry */
37
+ expect(r.code).toContain('i < 6');
38
+ expect(r.code).toContain('i / 5 * BLOOM_ALPHA');
39
+ expect(r.code).toContain('4 + rq * 6');
40
+ /* declarations sit above the first function, after the existing top-level vars */
41
+ expect(r.code.indexOf('var BLOOM_ALPHA')).toBeGreaterThan(r.code.indexOf('var BUF'));
42
+ expect(r.code.indexOf('var BLOOM_ALPHA')).toBeLessThan(r.code.indexOf('function render'));
43
+ });
44
+
45
+ it('draws exactly the same as the original', () => {
46
+ const log = (code: string) => {
47
+ const out: string[] = [];
48
+ const ctx = new Proxy({}, { get: (_t, k) => (...a: any[]) => { out.push(`${String(k)}(${a.join(',')})`); }, set: (_t, k, v) => { out.push(`${String(k)}=${v}`); return true; } });
49
+ const render = new Function(`${code}\nreturn render;`)();
50
+ for (const time of [0, 0.4, 1.7]) render(ctx, { time });
51
+ return out;
52
+ };
53
+ expect(log(liftEffectKnobs(GLOW).code)).toEqual(log(GLOW));
54
+ });
55
+
56
+ it('lifts colours written anywhere as text, but not colours compared or used as keys', () => {
57
+ const code = `function render(ctx, env) {
58
+ /* halo */
59
+ var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 40);
60
+ g.addColorStop(0, '#ffb048');
61
+ g.addColorStop(1, 'rgba(255,176,72,0)');
62
+ if (env.tint === '#000000') return;
63
+ var map = { '#123456': 1 };
64
+ }`;
65
+ const r = liftEffectKnobs(code);
66
+ expect(r.knobs.map((k) => [k.name, k.value])).toEqual([['HALO_COLOR', '#ffb048'], ['HALO_COLOR_2', 'rgba(255,176,72,0)']]);
67
+ expect(r.code).toContain("env.tint === '#000000'");
68
+ expect(r.code).toContain("'#123456': 1");
69
+ });
70
+
71
+ it('names state colours in a ternary after their condition', () => {
72
+ const code = `function update(env, dt) {
73
+ for (var i = 0; i < 8; i++) set('row_' + i, i === T.sel ? '#ffb048' : (i === T.hov ? '#ffffff' : 'rgba(225,246,255,0.78)'));
74
+ }`;
75
+ const r = liftEffectKnobs(code);
76
+ expect(r.knobs.map((k) => [k.name, k.value])).toEqual([['SELECTED_COLOR', '#ffb048'], ['HOVER_COLOR', '#ffffff'], ['COLOR', 'rgba(225,246,255,0.78)']]);
77
+ expect(r.code).toContain('i === T.sel ? SELECTED_COLOR : (i === T.hov ? HOVER_COLOR : COLOR)');
78
+ });
79
+
80
+ it('names logic rates after what they change and shares one knob between both directions', () => {
81
+ const code = `function update(env, dt) {
82
+ if (held.Equal) T.zoom = clamp(T.zoom - dt * 0.6, 0.45, 1.6);
83
+ if (held.Minus) T.zoom = clamp(T.zoom + dt * 0.6, 0.45, 1.6);
84
+ if (held.ArrowLeft) { T.cam.yaw -= dt * 1.2; }
85
+ }`;
86
+ const r = liftEffectKnobs(code);
87
+ expect(r.knobs).toEqual([{ name: 'ZOOM_SPEED', value: 0.6, count: 2 }, { name: 'YAW_SPEED', value: 1.2, count: 1 }]);
88
+ expect(r.code).toContain('T.cam.yaw -= dt * YAW_SPEED;');
89
+ });
90
+
91
+ it('is idempotent and leaves shared libraries, mirrors and already-tuned code alone', () => {
92
+ const once = liftEffectKnobs(GLOW).code;
93
+ expect(liftEffectKnobs(once).changed).toBe(false);
94
+ expect(liftEffectKnobs(`(globalThis.__exodeLibs || (globalThis.__exodeLibs = {}))[LIB_ID] = {};\nfunction render(ctx, env) { ctx.lineWidth = 2; }`).reason).toBe('shared library');
95
+ expect(liftEffectKnobs('var SPEED = 2;\nfunction render(ctx, env) { ctx.rotate(env.time * SPEED); }').changed).toBe(false);
96
+ const doc = { objects: [{ id: 'g', style: { effects: [{ type: 'CustomEffect', groupMirror: true, code: GLOW }] } }] };
97
+ expect(liftKnobsInDoc(doc).changed).toBe(0);
98
+ });
99
+
100
+ it('does not lift numbers inside strings, comments or native-kit helpers', () => {
101
+ const code = `function NK_at(a) { a.lineWidth = 2; }
102
+ function render(ctx, env) {
103
+ // ctx.lineWidth = 9;
104
+ ctx.font = '600 11px Inter';
105
+ ctx.setLineDash([6, 7]);
106
+ }`;
107
+ expect(liftEffectKnobs(code).changed).toBe(false);
108
+ });
109
+ });
110
+
111
+ describe('runtime inputs for effect settings', () => {
112
+ const board = () => ({
113
+ objects: [
114
+ { id: 'holo_glow', name: 'Glow', style: { effects: [{ type: 'CustomEffect', code: "var BLOOM_WIDTH = 3.4, TINT = '#5eeaff';\nfunction render(ctx, env) { ctx.lineWidth = BLOOM_WIDTH; ctx.strokeStyle = TINT; }" }] } },
115
+ { id: 'lg_cam_motion', name: 'Cam', style: { effects: [{ type: 'CustomEffect', code: 'var YAW_SPEED = 0.085;\nfunction update(env, dt) { T.yaw += dt * YAW_SPEED; }' }] } },
116
+ { id: 'lg_keys', name: 'Keys', style: { effects: [{ type: 'CustomEffect', code: 'var YAW_SPEED = 1.2;\nfunction update(env, dt) { T.yaw -= dt * YAW_SPEED; }' }] } },
117
+ ],
118
+ stateMachine: { inputs: [{ id: 'orbit', name: 'orbit', value: { type: 'Boolean', value: true, defaultValue: true } }] },
119
+ });
120
+ const draw = (code: string, inputs: Record<string, any>) => {
121
+ const out: string[] = [];
122
+ const ctx = new Proxy({}, { set: (_t, k, v) => { out.push(`${String(k)}=${v}`); return true; }, get: () => () => {} });
123
+ new Function(`${code}\nreturn render;`)()(ctx, { input: (n: string) => inputs[n] });
124
+ return out;
125
+ };
126
+
127
+ it('declares one input per setting, prefixing clashes with the layer id', () => {
128
+ const b: any = board();
129
+ const r = bindKnobInputs(b);
130
+ expect(r.inputs).toBe(4);
131
+ expect(b.stateMachine.inputs.map((i: any) => [i.name, i.value.type, i.value.defaultValue])).toEqual([
132
+ ['orbit', 'Boolean', true], ['bloomWidth', 'Number', 3.4], ['tint', 'Color', '#5eeaff'], ['yawSpeed', 'Number', 0.085], ['keysYawSpeed', 'Number', 1.2],
133
+ ]);
134
+ /* the editor still sees only the settings as parameters */
135
+ expect(topLevelSettings(b.objects[0].style.effects[0].code).map((s) => s.name)).toEqual(['BLOOM_WIDTH', 'TINT']);
136
+ });
137
+
138
+ it('a host value wins; at its default the code value is used, so editor edits still show', () => {
139
+ const b: any = board();
140
+ bindKnobInputs(b);
141
+ const code = b.objects[0].style.effects[0].code;
142
+ expect(draw(code, {})).toEqual(['lineWidth=3.4', 'strokeStyle=#5eeaff']);
143
+ expect(draw(code, { bloomWidth: 3.4, tint: '#5eeaff' })).toEqual(['lineWidth=3.4', 'strokeStyle=#5eeaff']);
144
+ expect(draw(code, { bloomWidth: 8, tint: '#ff0000' })).toEqual(['lineWidth=8', 'strokeStyle=#ff0000']);
145
+ /* the editor rewrote the setting; the runtime input still sits at its old default */
146
+ const edited = code.replace('BLOOM_WIDTH = 3.4,', 'BLOOM_WIDTH = 6,');
147
+ expect(draw(edited, { bloomWidth: 3.4 })).toEqual(['lineWidth=6', 'strokeStyle=#5eeaff']);
148
+ });
149
+
150
+ it('is idempotent and follows the code on the next write', () => {
151
+ const b: any = board();
152
+ bindKnobInputs(b);
153
+ const once = JSON.stringify(b);
154
+ bindKnobInputs(b);
155
+ expect(JSON.stringify(b)).toBe(once);
156
+ expect(liftEffectKnobs(b.objects[0].style.effects[0].code).changed).toBe(false);
157
+ b.objects[0].style.effects[0].code = b.objects[0].style.effects[0].code.replace('BLOOM_WIDTH = 3.4,', 'BLOOM_WIDTH = 6,');
158
+ bindKnobInputs(b);
159
+ expect(b.stateMachine.inputs.find((i: any) => i.name === 'bloomWidth').value.defaultValue).toBe(6);
160
+ expect(b.objects[0].style.effects[0].code.match(/KNOB_apply\(env\)/g)).toHaveLength(1);
161
+ });
162
+ });
@@ -0,0 +1,178 @@
1
+ import vm from 'node:vm';
2
+ import { bakeNativeLayers, nativeLayerChecks, NATIVE_KIT_JS, pathGeometry } from '../nativeLayers';
3
+
4
+ /* a two-part wireframe scene written with the kit: a square ("Base") and a triangle ("Roof") */
5
+ const SCENE = `
6
+ function draw(st) {
7
+ if (!st.pools) st.pools = { base: NK_pool('p_base', 8), roof: NK_pool('p_roof', 6) };
8
+ var b = st.pools.base, r = st.pools.roof, lift = st.e * 100;
9
+ NK_begin(b); NK_move(b, 500, 400); NK_line(b, 700, 400); NK_line(b, 700, 600); NK_line(b, 500, 600); NK_close(b); NK_end(b);
10
+ NK_begin(r); NK_move(r, 500, 400 - lift); NK_line(r, 600, 300 - lift); NK_line(r, 700, 400 - lift); NK_end(r);
11
+ }
12
+ function nativeBake() {
13
+ var st = { e: 0 }; draw(st);
14
+ return { groups: [{ id: 'g_house', name: 'House' }],
15
+ layers: [{ id: 'p_base', name: 'Base', parent: 'g_house', pts: NK_pts(st.pools.base), stroke: '#0ff' },
16
+ { id: 'p_roof', name: 'Roof', parent: 'g_house', pts: NK_pts(st.pools.roof), stroke: '#0ff' }] };
17
+ }
18
+ function update(env, dt) {
19
+ if (APP.part !== 'logic') return;
20
+ var key = NK_engine(env), st = NK_state(key); NK_beat(key);
21
+ st.e = env.input('apart') ? 1 : 0; draw(st); NK_push(env, st.pools.base); NK_push(env, st.pools.roof);
22
+ }
23
+ function render(ctx, env) { }
24
+ `;
25
+ const code = (part: string) => `var APP = ${JSON.stringify({ part })};\n${NATIVE_KIT_JS}\n${SCENE}`;
26
+ const fx = (id: string, part: string, extra: any = {}) => ({
27
+ id, name: id, type: 'Shape', transform: { x: 640, y: 360 }, geometry: { type: 'Rectangle', width: 1280, height: 720 },
28
+ style: { effects: [{ id: `e_${id}`, type: 'CustomEffect', code: code(part) }] }, ...extra,
29
+ });
30
+ const board = () => ({
31
+ width: 1280, height: 720, stateMachine: { inputs: [], layers: [] },
32
+ objects: [fx('glow', 'glow'), { id: 'logic', name: 'Logic', type: 'Group', transform: { x: 0, y: 0 }, children: ['lg'] }, fx('lg', 'logic', { parentId: 'logic' })],
33
+ });
34
+
35
+ describe('bake_native_layers', () => {
36
+ it('creates one tight Path layer per part, once, below the first effect that shares the script', () => {
37
+ const ab: any = board();
38
+ const reports = bakeNativeLayers(ab);
39
+ expect(reports).toHaveLength(1);
40
+ expect(ab.objects.map((o: any) => o.id)).toEqual(['g_house', 'p_base', 'p_roof', 'glow', 'logic', 'lg']);
41
+ const base = ab.objects.find((o: any) => o.id === 'p_base');
42
+ expect(base.geometry.type).toBe('Path');
43
+ expect([base.transform.x, base.transform.y, base.geometry.width, base.geometry.height]).toEqual([600, 500, 200, 200]);
44
+ expect(base.parentId).toBe('g_house');
45
+ expect(ab.objects.find((o: any) => o.id === 'logic').children).toEqual(['lg']);
46
+ expect(ab.stateMachine.inputs.map((i: any) => i.name)).toContain('engineKey');
47
+ /* frame centres land on the line after the effect's own constant, so the optimiser still folds it */
48
+ const lines = ab.objects.find((o: any) => o.id === 'lg').style.effects[0].code.split('\n');
49
+ expect(lines[0]).toMatch(/^var APP = /);
50
+ expect(lines[1]).toBe('var NATIVE_ORG = {"p_base":[600,500],"p_roof":[600,350]};');
51
+ });
52
+
53
+ it('re-baking replaces the previous bake', () => {
54
+ const ab: any = board();
55
+ bakeNativeLayers(ab); bakeNativeLayers(ab);
56
+ expect(ab.objects.filter((o: any) => o.id === 'p_base')).toHaveLength(1);
57
+ expect(ab.objects.filter((o: any) => /^var NATIVE_ORG/m.test(o.style?.effects?.[0]?.code || '')).length).toBe(2);
58
+ });
59
+
60
+ it('clips to the artboard and pins the frame corners', () => {
61
+ const g = pathGeometry([[-100, 100, true], [200, 100]], 1280, 720);
62
+ expect(g.w).toBe(200);
63
+ expect(g.data.startsWith('M-100 -2 M100 2')).toBe(true);
64
+ });
65
+ });
66
+
67
+ /* run the kit like the engine does: two engines in one page share globalThis */
68
+ function runtime(page: any) {
69
+ const ctx = vm.createContext(page);
70
+ vm.runInContext(`var NATIVE_ORG = {"p_base":[600,500],"p_roof":[600,350]};\n${code('logic')}`, ctx);
71
+ return (inputs: Record<string, any>) => {
72
+ const sets: Record<string, any> = {};
73
+ const env = { input: (k: string) => inputs[k], setInput: (k: string, v: any) => { inputs[k] = v; }, scene: { set: (id: string, p: string, v: any) => { sets[`${id}.${p}`] = v.map ? v.map((q: any) => ({ ...q })) : v; } } };
74
+ (ctx as any).update(env, 1 / 60);
75
+ return sets;
76
+ };
77
+ }
78
+
79
+ describe('native kit at runtime', () => {
80
+ it('gives every engine its own key and state, and writes points relative to the layer frame', () => {
81
+ const page: any = { Math, Date, JSON }; page.globalThis = page;
82
+ const step = runtime(page);
83
+ const a: any = {}, b: any = { apart: true };
84
+ step(a); const sb = step(b);
85
+ expect(a.engineKey).toBeTruthy(); expect(b.engineKey).toBeTruthy(); expect(a.engineKey).not.toBe(b.engineKey);
86
+ const roof = sb['p_roof.geometry.points'];
87
+ expect(roof[2]).toMatchObject({ x: -100, y: -50, moveTo: true }); /* (500, 300) after the 100px lift, relative to (600, 350) */
88
+ expect(roof[0]).toMatchObject({ x: -1000000, y: -1000000, moveTo: true }); /* pins keep the engine from re-centring */
89
+ });
90
+
91
+ it('survives a stale global left by an older version of the effect', () => {
92
+ const page: any = { Math, Date, JSON, __exodeNativeV1: { old: null, broken: 3, stale: { beat: 1 } } }; page.globalThis = page;
93
+ const step = runtime(page);
94
+ const a: any = {};
95
+ expect(() => step(a)).not.toThrow();
96
+ expect(a.engineKey).toBeTruthy();
97
+ expect(page.__exodeNativeV1.stale).toBeUndefined();
98
+ });
99
+ });
100
+
101
+ describe('no scene-specific assumptions', () => {
102
+ it('defaults to normal blending; screen only when asked', () => {
103
+ const ab: any = board(); bakeNativeLayers(ab);
104
+ const base = ab.objects.find((o: any) => o.id === 'p_base');
105
+ expect(base.blendMode).toBe('Normal');
106
+ expect(base.style.compositeOperation).toBeUndefined();
107
+ });
108
+
109
+ it('keeps far-away points exact on large artboards (no clamping)', () => {
110
+ const page: any = { Math, Date, JSON }; page.globalThis = page;
111
+ const ctx = vm.createContext(page);
112
+ vm.runInContext(`var NATIVE_ORG = { big: [0, 0] };\n${NATIVE_KIT_JS}\nvar a = NK_pool('big', 2); NK_move(a, 9000, 7500); NK_line(a, 9100, 7600);`, ctx);
113
+ expect((ctx as any).a[2]).toMatchObject({ x: 9000, y: 7500 });
114
+ const g = pathGeometry([[0, 0, true], [7680, 4320]], 7680, 4320);
115
+ expect([g.w, g.h, g.cx, g.cy]).toEqual([7680, 4320, 3840, 2160]);
116
+ });
117
+ });
118
+
119
+ describe('nativeLayerChecks', () => {
120
+ it('flags one shared global state and full-artboard paths', () => {
121
+ const shared = { objects: [{ id: 'x', style: { effects: [{ type: 'CustomEffect', code: 'function update(env){ globalThis.__game.t++; }' }] } },
122
+ { id: 'p', name: 'Grid', geometry: { type: 'Path', width: 1280, height: 720, data: 'M0 0 L1 1 '.repeat(800) } }], width: 1280, height: 720 };
123
+ const out = nativeLayerChecks(shared);
124
+ expect(out.some((m) => /per engine/.test(m))).toBe(true);
125
+ expect(out.some((m) => /"Grid" is a full-artboard Path/.test(m))).toBe(true);
126
+ expect(nativeLayerChecks(board())).toEqual([]);
127
+ });
128
+ });
129
+
130
+ import { refreshGroupMirrors, logicLayoutChecks, buildGroupCode as mcpBuild, collectGroupEffects as mcpCollect } from '../nativeLayers';
131
+ import { readFileSync } from 'node:fs';
132
+ import { join } from 'node:path';
133
+ import { transformSync } from 'esbuild';
134
+ /* the editor's own helper, compiled on the fly, so both sides are checked against the same format */
135
+ const editorMirror: any = (() => {
136
+ const src = readFileSync(join(process.cwd(), '../editor/src/utils/groupEffectMirror.ts'), 'utf8');
137
+ const js = transformSync(src, { loader: 'ts', format: 'cjs' }).code;
138
+ const module = { exports: {} as any };
139
+ new Function('module', 'exports', js)(module, module.exports);
140
+ return module.exports;
141
+ })();
142
+ const editorBuild = editorMirror.buildGroupCode, editorCollect = editorMirror.collectGroupEffects;
143
+
144
+ const piece = (id: string, name: string, code: string) => ({ id, name, parentId: 'logic', type: 'Shape', style: { effects: [{ id: `e_${id}`, type: 'CustomEffect', name, code }] } });
145
+ const logicBoard = () => ({ width: 1280, height: 720, objects: [
146
+ { id: 'logic', name: 'Logic', type: 'Group', children: ['lib', 'cam', 'hud'], style: {} },
147
+ piece('lib', 'Shared library', 'var LIB_ID = "x";\nfunction update(env, dt) { }'),
148
+ piece('cam', 'Camera', 'function update(env, dt) { var k = 1; }'),
149
+ piece('hud', 'HUD', 'function update(env, dt) { var v = 2; }'),
150
+ ] });
151
+
152
+ describe('group effects (Logic group mirror)', () => {
153
+ it('builds exactly the same code as the editor', () => {
154
+ const ab: any = logicBoard();
155
+ const g = ab.objects[0];
156
+ expect(mcpBuild(mcpCollect(g, ab.objects))).toBe(editorBuild(editorCollect(g, ab.objects)));
157
+ });
158
+
159
+ it('adds a disabled mirror to the Logic group, keeps it in sync, and is idempotent', () => {
160
+ const ab: any = logicBoard();
161
+ expect(logicLayoutChecks(ab).some((m) => /no group effect/.test(m))).toBe(true);
162
+ expect(refreshGroupMirrors(ab, ['Logic'])).toEqual(['Logic']);
163
+ const m = ab.objects[0].style.effects[0];
164
+ expect([m.name, m.isEnabled, m.groupMirror]).toEqual(['Logic effect (all 3)', false, true]);
165
+ expect(m.code).toContain('/* ═════ Camera ═════ [cam#0] */');
166
+ expect(refreshGroupMirrors(ab)).toEqual([]);
167
+ ab.objects[2].style.effects[0].code = 'function update(env, dt) { var k = 9; }';
168
+ expect(refreshGroupMirrors(ab)).toEqual(['Logic']);
169
+ expect(ab.objects[0].style.effects[0].code).toContain('var k = 9');
170
+ expect(logicLayoutChecks(ab)).toEqual([]);
171
+ });
172
+
173
+ it('flags pieces that each carry one big copied script', () => {
174
+ const big = 'function update(env, dt) { }\n' + '/* shared model */ var a = 1;\n'.repeat(400);
175
+ const ab: any = { objects: ['a', 'b', 'c'].map((id) => ({ id, name: id, style: { effects: [{ type: 'CustomEffect', code: `var APP = {"part":"${id}"};\n${big}` }] } })) };
176
+ expect(logicLayoutChecks(ab).some((m) => /same large script/.test(m))).toBe(true);
177
+ });
178
+ });
@@ -0,0 +1,301 @@
1
+ type Frame = [number, any, string?];
2
+ export declare const EASE: {
3
+ out: string;
4
+ outQuart: string;
5
+ outExpo: string;
6
+ outBack: string;
7
+ inOut: string;
8
+ sine: string;
9
+ in: string;
10
+ inQuad: string;
11
+ linear: string;
12
+ };
13
+ /** Curated palettes: one neutral ramp plus a restrained accent each. */
14
+ export declare const PALETTES: Record<string, Record<string, string>>;
15
+ export declare const mix: (a: string, b: string, t: number) => string;
16
+ export declare const alpha: (c: string, a: number) => string;
17
+ /** Seeded random (mulberry32) so builds are deterministic. */
18
+ export declare function rng(seed?: number): (() => number) & {
19
+ range: (a: number, b: number) => number;
20
+ pick: <T>(arr: T[]) => NonNullable<T>;
21
+ };
22
+ /** Modular type scale: typeScale(16, 1.333) → { xs, sm, base, md, lg, xl, xxl, display }. */
23
+ export declare function typeScale(base?: number, ratio?: number): {
24
+ xs: number;
25
+ sm: number;
26
+ base: number;
27
+ md: number;
28
+ lg: number;
29
+ xl: number;
30
+ xxl: number;
31
+ display: number;
32
+ };
33
+ export declare function linear(stops: string[] | {
34
+ offset: number;
35
+ color: string;
36
+ opacity?: number;
37
+ }[], angle?: number): {
38
+ type: string;
39
+ opacity: number;
40
+ start: number[];
41
+ end: number[];
42
+ stops: any[];
43
+ };
44
+ export declare function radial(stops: string[] | {
45
+ offset: number;
46
+ color: string;
47
+ opacity?: number;
48
+ }[], center?: [number, number], radius?: number): {
49
+ type: string;
50
+ opacity: number;
51
+ center: [number, number];
52
+ radius: number;
53
+ stops: any[];
54
+ };
55
+ /** Width of the longest line, from per-character advance classes (close to Inter / Helvetica metrics). */
56
+ export declare function estimateTextWidth(str: string, size: number, letterSpacing?: number, weight?: number): number;
57
+ export declare class ArtboardBuilder {
58
+ doc: any;
59
+ ease: string;
60
+ private ids;
61
+ private n;
62
+ warnings: string[];
63
+ constructor(o?: {
64
+ name?: string;
65
+ width?: number;
66
+ height?: number;
67
+ background?: string;
68
+ palette?: string;
69
+ ease?: string;
70
+ });
71
+ private uid;
72
+ private ref;
73
+ get(idOrName: string): any;
74
+ private base;
75
+ private add;
76
+ private style;
77
+ rect(o?: any): any;
78
+ ellipse(o?: any): any;
79
+ /** Path data centred on (0,0) = the object's position (author it around its own bbox centre). */
80
+ path(data: string, o?: any): any;
81
+ text(str: string, o?: any): any;
82
+ image(src: string, o?: any): any;
83
+ svg(content: string, o?: any): any;
84
+ /** A Group: hugs its children; child x/y are relative to it. */
85
+ group(o?: any): any;
86
+ /** Invisible hit area (fill opacity 0.001). Add it last so it sits on top. */
87
+ hit(o?: any): any;
88
+ input(name: string, type: 'Number' | 'Boolean' | 'Text' | 'Color' | 'Trigger', value?: any): any;
89
+ /** frames: [[time, value, easing?], …]. Easing applies to the segment that STARTS at that frame. */
90
+ track(target: any, prop: string, frames: Frame[]): any;
91
+ anim(name: string, tracks: any[], o?: {
92
+ duration?: number | undefined;
93
+ loop?: boolean;
94
+ }): string;
95
+ /** layer('Name', [{ name, anim, loop, on: { inputName: 'Target state name' } }]) — first state is the entry. */
96
+ layer(name: string, states: {
97
+ name: string;
98
+ anim?: string;
99
+ loop?: boolean;
100
+ on?: Record<string, string | {
101
+ to: string;
102
+ op?: string;
103
+ value?: any;
104
+ }>;
105
+ }[]): string[];
106
+ /** One-shot layer that plays on load. */
107
+ intro(tracks: any[], name?: string): string;
108
+ /** Looping layer that plays forever. Make the last frame equal the first. */
109
+ ambient(tracks: any[], name?: string, duration?: number): string;
110
+ /** Staggered entrance tracks: each target fades in and travels `dy` px into place. */
111
+ reveal(targets: any[], o?: {
112
+ dy?: number;
113
+ dx?: number;
114
+ duration?: number;
115
+ step?: number;
116
+ delay?: number;
117
+ ease?: string;
118
+ scaleFrom?: number;
119
+ }): any[];
120
+ /** Same frames on every target, offset by `step` seconds each. */
121
+ stagger(targets: any[], prop: string, frames: Frame[], step?: number): any[];
122
+ /**
123
+ * Hover + press feel on one object, in its own layer (that layer owns the
124
+ * target's y, scale and shadow, so don't animate those elsewhere: put
125
+ * entrances on a parent group). Interactions go on `hit` or the target.
126
+ */
127
+ interactive(target: any, o?: {
128
+ lift?: number;
129
+ scale?: number;
130
+ press?: number;
131
+ duration?: number;
132
+ shadowBlur?: [number, number];
133
+ hit?: any;
134
+ onTap?: string;
135
+ }): {
136
+ enter: any;
137
+ leave: any;
138
+ press: any;
139
+ } | undefined;
140
+ /** Fire a trigger input when `target` is clicked. */
141
+ onTap(target: any, triggerName: string): any;
142
+ /** Soft light: a circle with a radial fade to 0 (scaleY makes it an oval without a hard edge). */
143
+ glow(o: {
144
+ name?: string;
145
+ x: number;
146
+ y: number;
147
+ size: number;
148
+ color: string;
149
+ strength?: number;
150
+ scaleY?: number;
151
+ parent?: any;
152
+ blendMode?: string;
153
+ }): any;
154
+ /** Looping track with a phase offset: f(u) for u in 0..1 over `duration`, started at `phase` (0..1). */
155
+ loopTrack(target: any, prop: string, f: (u: number) => any, duration: number, phase?: number, samples?: number[]): any;
156
+ /** Drifting particles (embers, dust, bubbles, stars) as native dots in a group, with their looping tracks.
157
+ * Pass the returned tracks to ambient(). rise < 0 sinks; spread sways sideways. */
158
+ particles(o: {
159
+ name?: string;
160
+ count?: number;
161
+ x: number;
162
+ y: number;
163
+ w: number;
164
+ h: number;
165
+ color: string;
166
+ size?: [number, number];
167
+ rise?: number;
168
+ spread?: number;
169
+ opacity?: number;
170
+ duration?: number;
171
+ seed?: number;
172
+ }): {
173
+ group: any;
174
+ tracks: any[];
175
+ };
176
+ /** Count a Text up to its value with proper formatting ("12,480", "$48.2k", "92%").
177
+ * Digit-leading strings interpolate as bare numbers (parseFloat): each step is prefixed with a
178
+ * zero-width space so the engine swaps formatted text instead. Returns the track for intro(). */
179
+ countUp(target: any, to: number, o?: {
180
+ from?: number;
181
+ delay?: number;
182
+ duration?: number;
183
+ steps?: number;
184
+ prefix?: string;
185
+ suffix?: string;
186
+ decimals?: number;
187
+ ease?: (u: number) => number;
188
+ }): any;
189
+ /** A complete button: pill + label as one unit (the label rides along), with hover and press built in.
190
+ * variant 'primary' (filled), 'secondary' (outlined) or 'ghost' (text only). */
191
+ button(label: string, o: {
192
+ name?: string;
193
+ x?: number;
194
+ y?: number;
195
+ left?: number;
196
+ top?: number;
197
+ parent?: any;
198
+ w?: number;
199
+ h?: number;
200
+ variant?: 'primary' | 'secondary' | 'ghost';
201
+ fill?: string;
202
+ color?: string;
203
+ line?: string;
204
+ size?: number;
205
+ font?: string;
206
+ radius?: number;
207
+ glow?: boolean;
208
+ onTap?: string;
209
+ }): any;
210
+ /** An FK bone. Shapes given parent: bone follow it rigidly (x/y relative to the bone). */
211
+ bone(o: {
212
+ name: string;
213
+ x?: number;
214
+ y?: number;
215
+ length?: number;
216
+ rotation?: number;
217
+ parent?: any;
218
+ id?: string;
219
+ }): any;
220
+ /**
221
+ * A character's action layer, built the way that works at runtime:
222
+ * - every action animates the SAME set of tracks (missing ones are held at rest), so no pose leaks;
223
+ * - one-shots always end on the rest pose; loops are welcome (loop: true);
224
+ * - each action gets a trigger (its name, lowercased) and alternating a/b states so it replays on every fire.
225
+ * actions: { Wave: { duration: 2, loop?: false, tracks: [[obj, 'rotation', frames], …] }, … }
226
+ * Keep breathing/blinking in their own layers on objects the actions never touch.
227
+ */
228
+ actions(layerName: string, actions: Record<string, {
229
+ duration: number;
230
+ loop?: boolean;
231
+ tracks: [any, string, Frame[]][];
232
+ }>): {
233
+ [k: string]: string;
234
+ };
235
+ /** World physics. gravity in m/s² (9.8 = earth). effects: { squash: { amount }, impact: { color, size, minSpeed }, shake: { amount } }. */
236
+ physics(o?: {
237
+ gravity?: [number, number];
238
+ effects?: any;
239
+ timeScale?: number;
240
+ }): void;
241
+ /** Static floor and side walls just outside the artboard (and a ceiling if asked). inset raises the floor. */
242
+ walls(o?: {
243
+ floor?: boolean;
244
+ sides?: boolean;
245
+ ceiling?: boolean;
246
+ inset?: number;
247
+ }): any[];
248
+ /** Make an object a physics body. Weighty defaults: low bounce, a little air friction. */
249
+ body(target: any, o?: {
250
+ type?: 'Dynamic' | 'Static' | 'Kinematic';
251
+ density?: number;
252
+ restitution?: number;
253
+ friction?: number;
254
+ air?: number;
255
+ mass?: number;
256
+ draggable?: boolean;
257
+ sensor?: boolean;
258
+ }): any;
259
+ /** Attach a CustomEffect: function render(ctx, env) and/or update(env, dt). */
260
+ effect(target: any, code: string, o?: {
261
+ name?: string;
262
+ params?: any;
263
+ }): any;
264
+ done(): any;
265
+ }
266
+ export declare function createKit(): {
267
+ artboard: (o?: any) => ArtboardBuilder;
268
+ palette: (name: string) => {
269
+ [x: string]: string;
270
+ };
271
+ palettes: string[];
272
+ typeScale: typeof typeScale;
273
+ ease: {
274
+ out: string;
275
+ outQuart: string;
276
+ outExpo: string;
277
+ outBack: string;
278
+ inOut: string;
279
+ sine: string;
280
+ in: string;
281
+ inQuad: string;
282
+ linear: string;
283
+ };
284
+ rng: typeof rng;
285
+ mix: (a: string, b: string, t: number) => string;
286
+ alpha: (c: string, a: number) => string;
287
+ linear: typeof linear;
288
+ radial: typeof radial;
289
+ measure: typeof estimateTextWidth;
290
+ };
291
+ export declare const KIT_REFERENCE: string;
292
+ /** Run an agent's build script in an isolated context. */
293
+ export declare function runBuildScript(script: string, opts?: {
294
+ timeoutMs?: number;
295
+ }): {
296
+ doc: any;
297
+ logs: string[];
298
+ warnings: any;
299
+ };
300
+ export {};
301
+ //# sourceMappingURL=buildKit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildKit.d.ts","sourceRoot":"","sources":["buildKit.ts"],"names":[],"mappings":"AAOA,KAAK,KAAK,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;AAGpC,eAAO,MAAM,IAAI;;;;;;;;;;CAGhB,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAU3D,CAAC;AAKF,eAAO,MAAM,GAAG,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,WAA0F,CAAC;AAC9I,eAAO,MAAM,KAAK,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,WAAmG,CAAC;AAE9I,8DAA8D;AAC9D,wBAAgB,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