@nexart/codemode-sdk 1.4.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/CHANGELOG.md +289 -0
  2. package/CODE_MODE_PROTOCOL.md +471 -0
  3. package/README.md +237 -50
  4. package/dist/builder-manifest.d.ts +79 -0
  5. package/dist/builder-manifest.d.ts.map +1 -0
  6. package/dist/builder-manifest.js +97 -0
  7. package/dist/core-index.d.ts +21 -0
  8. package/dist/core-index.d.ts.map +1 -0
  9. package/dist/core-index.js +26 -0
  10. package/dist/engine.d.ts +1 -1
  11. package/dist/engine.js +1 -1
  12. package/dist/execute.d.ts +46 -0
  13. package/dist/execute.d.ts.map +1 -0
  14. package/dist/execute.js +282 -0
  15. package/dist/index.d.ts +27 -19
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +34 -19
  18. package/dist/loop-engine.d.ts +5 -1
  19. package/dist/loop-engine.d.ts.map +1 -1
  20. package/dist/loop-engine.js +25 -14
  21. package/dist/noise-bridge.d.ts +44 -0
  22. package/dist/noise-bridge.d.ts.map +1 -0
  23. package/dist/noise-bridge.js +68 -0
  24. package/dist/noise-engine.d.ts +74 -0
  25. package/dist/noise-engine.d.ts.map +1 -0
  26. package/dist/noise-engine.js +132 -0
  27. package/dist/noise-sketches/fractalNoise.d.ts +11 -0
  28. package/dist/noise-sketches/fractalNoise.d.ts.map +1 -0
  29. package/dist/noise-sketches/fractalNoise.js +121 -0
  30. package/dist/noise-sketches/index.d.ts +21 -0
  31. package/dist/noise-sketches/index.d.ts.map +1 -0
  32. package/dist/noise-sketches/index.js +28 -0
  33. package/dist/p5-runtime.d.ts +56 -4
  34. package/dist/p5-runtime.d.ts.map +1 -1
  35. package/dist/p5-runtime.js +743 -32
  36. package/dist/sound-bridge.d.ts +89 -0
  37. package/dist/sound-bridge.d.ts.map +1 -0
  38. package/dist/sound-bridge.js +128 -0
  39. package/dist/soundart-engine.d.ts +87 -0
  40. package/dist/soundart-engine.d.ts.map +1 -0
  41. package/dist/soundart-engine.js +173 -0
  42. package/dist/soundart-sketches/chladniBloom.d.ts +3 -0
  43. package/dist/soundart-sketches/chladniBloom.d.ts.map +1 -0
  44. package/dist/soundart-sketches/chladniBloom.js +53 -0
  45. package/dist/soundart-sketches/dualVortex.d.ts +3 -0
  46. package/dist/soundart-sketches/dualVortex.d.ts.map +1 -0
  47. package/dist/soundart-sketches/dualVortex.js +67 -0
  48. package/dist/soundart-sketches/geometryIllusion.d.ts +3 -0
  49. package/dist/soundart-sketches/geometryIllusion.d.ts.map +1 -0
  50. package/dist/soundart-sketches/geometryIllusion.js +89 -0
  51. package/dist/soundart-sketches/index.d.ts +39 -0
  52. package/dist/soundart-sketches/index.d.ts.map +1 -0
  53. package/dist/soundart-sketches/index.js +72 -0
  54. package/dist/soundart-sketches/isoflow.d.ts +3 -0
  55. package/dist/soundart-sketches/isoflow.d.ts.map +1 -0
  56. package/dist/soundart-sketches/isoflow.js +60 -0
  57. package/dist/soundart-sketches/loomWeave.d.ts +3 -0
  58. package/dist/soundart-sketches/loomWeave.d.ts.map +1 -0
  59. package/dist/soundart-sketches/loomWeave.js +59 -0
  60. package/dist/soundart-sketches/noiseTerraces.d.ts +3 -0
  61. package/dist/soundart-sketches/noiseTerraces.d.ts.map +1 -0
  62. package/dist/soundart-sketches/noiseTerraces.js +53 -0
  63. package/dist/soundart-sketches/orb.d.ts +3 -0
  64. package/dist/soundart-sketches/orb.d.ts.map +1 -0
  65. package/dist/soundart-sketches/orb.js +50 -0
  66. package/dist/soundart-sketches/pixelGlyphs.d.ts +3 -0
  67. package/dist/soundart-sketches/pixelGlyphs.d.ts.map +1 -0
  68. package/dist/soundart-sketches/pixelGlyphs.js +72 -0
  69. package/dist/soundart-sketches/prismFlowFields.d.ts +3 -0
  70. package/dist/soundart-sketches/prismFlowFields.d.ts.map +1 -0
  71. package/dist/soundart-sketches/prismFlowFields.js +51 -0
  72. package/dist/soundart-sketches/radialBurst.d.ts +3 -0
  73. package/dist/soundart-sketches/radialBurst.d.ts.map +1 -0
  74. package/dist/soundart-sketches/radialBurst.js +60 -0
  75. package/dist/soundart-sketches/resonantSoundBodies.d.ts +3 -0
  76. package/dist/soundart-sketches/resonantSoundBodies.d.ts.map +1 -0
  77. package/dist/soundart-sketches/resonantSoundBodies.js +89 -0
  78. package/dist/soundart-sketches/rings.d.ts +11 -0
  79. package/dist/soundart-sketches/rings.d.ts.map +1 -0
  80. package/dist/soundart-sketches/rings.js +89 -0
  81. package/dist/soundart-sketches/squares.d.ts +3 -0
  82. package/dist/soundart-sketches/squares.d.ts.map +1 -0
  83. package/dist/soundart-sketches/squares.js +52 -0
  84. package/dist/soundart-sketches/waveStripes.d.ts +3 -0
  85. package/dist/soundart-sketches/waveStripes.d.ts.map +1 -0
  86. package/dist/soundart-sketches/waveStripes.js +44 -0
  87. package/dist/static-engine.d.ts +4 -1
  88. package/dist/static-engine.d.ts.map +1 -1
  89. package/dist/static-engine.js +13 -8
  90. package/dist/types.d.ts +43 -2
  91. package/dist/types.d.ts.map +1 -1
  92. package/dist/types.js +1 -1
  93. package/package.json +24 -15
@@ -0,0 +1,60 @@
1
+ export const RADIAL_BURST_SKETCH = `
2
+ function setup() {
3
+ const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';
4
+ if (bgMode === 'white') background(245, 245, 245);
5
+ else if (bgMode === 'black') background(10, 10, 10);
6
+ else {
7
+ const r = Math.floor((S.brightness / 100) * 255);
8
+ const g = Math.floor((S.rhythmicity / 100) * 255);
9
+ const b = Math.floor((S.harmonicity / 100) * 255);
10
+ background(r, g, b);
11
+ }
12
+
13
+ const centerX = width / 2;
14
+ const centerY = height / 2;
15
+ const baseN = Math.floor(map(S.rhythmicity, 0, 100, 90, 320));
16
+ const rhythmMask = 0.4 + (S.rhythmicity / 100) * 0.6;
17
+
18
+ const palette = [];
19
+ const mainHue = (S.brightness * 3.6) % 360;
20
+ for (let i = 0; i < 16; i++) {
21
+ const h = (mainHue + i * 22.5) % 360;
22
+ const sat = map(S.treble, 0, 100, 60, 90);
23
+ const bri = map(S.bass, 0, 100, 70, 95);
24
+ palette.push('hsl(' + h + ',' + sat + '%,' + bri + '%)');
25
+ }
26
+
27
+ noFill();
28
+
29
+ for (let i = 0; i < baseN; i++) {
30
+ if ((i % 3) && random() > rhythmMask) continue;
31
+
32
+ const angle = (i / baseN) * PI * 2;
33
+ const col = palette[i % palette.length];
34
+
35
+ const lenJit = map(S.dynamicRange, 0, 100, 0, height * 2.45);
36
+ const rayLength = (S.amplitude / 100) * (height * 1.65) + random() * lenJit;
37
+
38
+ const waveAmp = map(S.harmonicity, 0, 100, 0, 42);
39
+ const waveFreq = map(S.treble, 0, 100, 1, 48);
40
+ const segments = 28;
41
+
42
+ const thickness = 1.2 + (S.attack / 100) * 7 + (S.aggression / 100) * 5 + sin(i * 0.9) * 1.4;
43
+
44
+ stroke(col);
45
+ strokeWeight(thickness);
46
+
47
+ beginShape();
48
+ for (let s = 0; s <= segments; s++) {
49
+ const t = s / segments;
50
+ const radius = t * rayLength;
51
+ const wobble = sin(t * PI * waveFreq + i * 0.2) * waveAmp * (1 - t);
52
+ const wx = centerX + cos(angle + wobble * 0.01) * radius;
53
+ const wy = centerY + sin(angle + wobble * 0.01) * radius;
54
+ vertex(wx, wy);
55
+ }
56
+ endShape();
57
+ }
58
+ }
59
+ `;
60
+ export default RADIAL_BURST_SKETCH;
@@ -0,0 +1,3 @@
1
+ export declare const RESONANT_SOUND_BODIES_SKETCH = "\nfunction setup() {\n const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';\n if (bgMode === 'white') background(245, 245, 245);\n else if (bgMode === 'black') background(10, 10, 10);\n else {\n const r = Math.floor((S.brightness / 100) * 255);\n const g = Math.floor((S.rhythmicity / 100) * 255);\n const b = Math.floor((S.harmonicity / 100) * 255);\n background(r, g, b);\n }\n\n const cx = width / 2;\n const cy = height / 2;\n const maxR = min(width, height) * 0.45;\n const shapeSeed = S.bass * 17.3 + S.treble * 23.7 + S.rhythmicity * 11.1;\n\n const numBodies = Math.floor(8 + (S.volume / 100) * 12 + (S.bass / 100) * 8);\n \n noFill();\n\n for (let i = 0; i < numBodies; i++) {\n const t = i / numBodies;\n const radius = maxR * (0.15 + t * 0.85);\n \n const hue = (((S.hue / 100) + t * 0.3 + (S.harmonicity / 100) * 0.2) % 1) * 360;\n const sat = lerp(50, 80, S.brightness / 100);\n const lum = lerp(30, 60, S.brightness / 100);\n \n const alpha = lerp(0.4, 0.15, t) * (0.5 + (S.volume / 100) * 0.5);\n stroke('hsla(' + hue + ',' + sat + '%,' + lum + '%,' + alpha + ')');\n strokeWeight(lerp(3, 1, t) * (1 + (S.aggression / 100) * 2));\n \n beginShape();\n const points = Math.floor(64 + (S.aggression / 100) * 64);\n \n for (let j = 0; j <= points; j++) {\n const angle = (j / points) * PI * 2;\n \n const wobble = noise(\n cos(angle) * 3 + i * 0.5 + shapeSeed * 0.001,\n sin(angle) * 3 + i * 0.5\n );\n \n const bassWobble = sin(angle * (2 + Math.floor((S.bass / 100) * 6))) * (S.bass / 100) * 0.15;\n const trebleWobble = sin(angle * (8 + Math.floor((S.treble / 100) * 12))) * (S.treble / 100) * 0.08;\n \n const r = radius * (1 + (wobble - 0.5) * 0.3 * (S.aggression / 100) + bassWobble + trebleWobble);\n \n const x = cx + cos(angle) * r;\n const y = cy + sin(angle) * r;\n \n vertex(x, y);\n }\n endShape(CLOSE);\n \n if (i % 3 === 0) {\n const fillAlpha = alpha * 0.1;\n fill('hsla(' + hue + ',' + sat + '%,' + lum + '%,' + fillAlpha + ')');\n beginShape();\n for (let j = 0; j <= points; j++) {\n const angle = (j / points) * PI * 2;\n const wobble = noise(cos(angle) * 3 + i * 0.5 + shapeSeed * 0.001, sin(angle) * 3 + i * 0.5);\n const bodyR = radius * (1 + (wobble - 0.5) * 0.3 * (S.aggression / 100));\n vertex(cx + cos(angle) * bodyR, cy + sin(angle) * bodyR);\n }\n endShape(CLOSE);\n noFill();\n }\n }\n\n const numNodes = Math.floor(12 + (S.rhythmicity / 100) * 20);\n for (let i = 0; i < numNodes; i++) {\n const angle = (i / numNodes) * PI * 2 + shapeSeed * 0.001;\n const dist = maxR * (0.3 + noise(i * 0.1, shapeSeed * 0.001) * 0.6);\n \n const x = cx + cos(angle) * dist;\n const y = cy + sin(angle) * dist;\n \n const nodeSize = lerp(2, 8, S.volume / 100) * (1 + (S.bass / 100) * 2);\n const hue = ((((S.hue / 100) + i * 0.05 + (S.treble / 100) * 0.3) % 1)) * 360;\n \n fill('hsla(' + hue + ',70%,' + lerp(40, 70, S.brightness / 100) + '%,' + lerp(0.3, 0.7, S.harmonicity / 100) + ')');\n noStroke();\n ellipse(x, y, nodeSize * 2, nodeSize * 2);\n }\n}\n";
2
+ export default RESONANT_SOUND_BODIES_SKETCH;
3
+ //# sourceMappingURL=resonantSoundBodies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resonantSoundBodies.d.ts","sourceRoot":"","sources":["../../soundart-sketches/resonantSoundBodies.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,wtGAuFxC,CAAC;AAEF,eAAe,4BAA4B,CAAC"}
@@ -0,0 +1,89 @@
1
+ export const RESONANT_SOUND_BODIES_SKETCH = `
2
+ function setup() {
3
+ const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';
4
+ if (bgMode === 'white') background(245, 245, 245);
5
+ else if (bgMode === 'black') background(10, 10, 10);
6
+ else {
7
+ const r = Math.floor((S.brightness / 100) * 255);
8
+ const g = Math.floor((S.rhythmicity / 100) * 255);
9
+ const b = Math.floor((S.harmonicity / 100) * 255);
10
+ background(r, g, b);
11
+ }
12
+
13
+ const cx = width / 2;
14
+ const cy = height / 2;
15
+ const maxR = min(width, height) * 0.45;
16
+ const shapeSeed = S.bass * 17.3 + S.treble * 23.7 + S.rhythmicity * 11.1;
17
+
18
+ const numBodies = Math.floor(8 + (S.volume / 100) * 12 + (S.bass / 100) * 8);
19
+
20
+ noFill();
21
+
22
+ for (let i = 0; i < numBodies; i++) {
23
+ const t = i / numBodies;
24
+ const radius = maxR * (0.15 + t * 0.85);
25
+
26
+ const hue = (((S.hue / 100) + t * 0.3 + (S.harmonicity / 100) * 0.2) % 1) * 360;
27
+ const sat = lerp(50, 80, S.brightness / 100);
28
+ const lum = lerp(30, 60, S.brightness / 100);
29
+
30
+ const alpha = lerp(0.4, 0.15, t) * (0.5 + (S.volume / 100) * 0.5);
31
+ stroke('hsla(' + hue + ',' + sat + '%,' + lum + '%,' + alpha + ')');
32
+ strokeWeight(lerp(3, 1, t) * (1 + (S.aggression / 100) * 2));
33
+
34
+ beginShape();
35
+ const points = Math.floor(64 + (S.aggression / 100) * 64);
36
+
37
+ for (let j = 0; j <= points; j++) {
38
+ const angle = (j / points) * PI * 2;
39
+
40
+ const wobble = noise(
41
+ cos(angle) * 3 + i * 0.5 + shapeSeed * 0.001,
42
+ sin(angle) * 3 + i * 0.5
43
+ );
44
+
45
+ const bassWobble = sin(angle * (2 + Math.floor((S.bass / 100) * 6))) * (S.bass / 100) * 0.15;
46
+ const trebleWobble = sin(angle * (8 + Math.floor((S.treble / 100) * 12))) * (S.treble / 100) * 0.08;
47
+
48
+ const r = radius * (1 + (wobble - 0.5) * 0.3 * (S.aggression / 100) + bassWobble + trebleWobble);
49
+
50
+ const x = cx + cos(angle) * r;
51
+ const y = cy + sin(angle) * r;
52
+
53
+ vertex(x, y);
54
+ }
55
+ endShape(CLOSE);
56
+
57
+ if (i % 3 === 0) {
58
+ const fillAlpha = alpha * 0.1;
59
+ fill('hsla(' + hue + ',' + sat + '%,' + lum + '%,' + fillAlpha + ')');
60
+ beginShape();
61
+ for (let j = 0; j <= points; j++) {
62
+ const angle = (j / points) * PI * 2;
63
+ const wobble = noise(cos(angle) * 3 + i * 0.5 + shapeSeed * 0.001, sin(angle) * 3 + i * 0.5);
64
+ const bodyR = radius * (1 + (wobble - 0.5) * 0.3 * (S.aggression / 100));
65
+ vertex(cx + cos(angle) * bodyR, cy + sin(angle) * bodyR);
66
+ }
67
+ endShape(CLOSE);
68
+ noFill();
69
+ }
70
+ }
71
+
72
+ const numNodes = Math.floor(12 + (S.rhythmicity / 100) * 20);
73
+ for (let i = 0; i < numNodes; i++) {
74
+ const angle = (i / numNodes) * PI * 2 + shapeSeed * 0.001;
75
+ const dist = maxR * (0.3 + noise(i * 0.1, shapeSeed * 0.001) * 0.6);
76
+
77
+ const x = cx + cos(angle) * dist;
78
+ const y = cy + sin(angle) * dist;
79
+
80
+ const nodeSize = lerp(2, 8, S.volume / 100) * (1 + (S.bass / 100) * 2);
81
+ const hue = ((((S.hue / 100) + i * 0.05 + (S.treble / 100) * 0.3) % 1)) * 360;
82
+
83
+ fill('hsla(' + hue + ',70%,' + lerp(40, 70, S.brightness / 100) + '%,' + lerp(0.3, 0.7, S.harmonicity / 100) + ')');
84
+ noStroke();
85
+ ellipse(x, y, nodeSize * 2, nodeSize * 2);
86
+ }
87
+ }
88
+ `;
89
+ export default RESONANT_SOUND_BODIES_SKETCH;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Flow Grid Rings - SoundArt Style as Code Mode Sketch
3
+ *
4
+ * This is the first SoundArt style converted to a Code Mode sketch.
5
+ * It uses S.* globals (sound snapshot) instead of direct sound data.
6
+ *
7
+ * Original: client/src/pages/soundart/engine/styles_impl.ts - drawFlowGridRings
8
+ */
9
+ export declare const RINGS_SKETCH = "\n// Flow Grid Rings - SoundArt Style\n// Uses S.* sound globals and standard p5-like functions\n\nfunction setup() {\n // Set background based on mode (rgb derived from sound, black, or white)\n const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';\n \n if (bgMode === 'white') {\n background(245, 245, 245);\n } else if (bgMode === 'black') {\n background(10, 10, 10);\n } else {\n // Deterministic RGB background derived from sound snapshot\n // Previously used clock time, now uses sound parameters for reproducibility\n const r = Math.floor((S.brightness / 100) * 255);\n const g = Math.floor((S.rhythmicity / 100) * 255);\n const b = Math.floor((S.harmonicity / 100) * 255);\n background(r, g, b);\n }\n \n // Grid dimensions based on sound volume\n const cols = Math.floor(map(S.volume, 0, 100, 2, 32));\n const rows = Math.floor(cols * 1.5);\n const margin = map(S.length, 0, 100, width * 0.05, width * 0.1);\n const innerW = width - margin * 2;\n const innerH = height - margin * 2;\n const cellW = innerW / cols;\n const cellH = innerH / rows;\n const gap = Math.min(cellW, cellH) * 0.25;\n const maxRadius = (Math.min(cellW, cellH) - gap) / 2;\n \n // Palette Harmony based on sound\n const mainHue = (S.brightness * 3.6) % 360;\n const hueShift = map(S.harmonicity, 0, 100, 20, 60);\n const sat = map(S.treble, 0, 100, 60, 90);\n const bri = map(S.bass, 0, 100, 70, 95);\n \n // Generate palette\n const palette = [\n hslColor(mainHue, sat, bri),\n hslColor((mainHue + hueShift) % 360, sat - 10, bri + 5),\n hslColor((mainHue - hueShift + 360) % 360, sat - 10, bri + 5),\n hslColor((mainHue + 180) % 360, sat - 20, bri - 10),\n hslColor((mainHue + 120) % 360, sat, bri - 5),\n hslColor((mainHue + 240) % 360, sat, bri - 5),\n ];\n \n // Flow field parameters\n const noiseScale = 0.15;\n const noiseStrength = map(S.aggression, 0, 100, 0.5, 4.0);\n const jitter = map(S.rhythmicity, 0, 100, 0, 0.15);\n const ringBias = map(S.attack, 0, 100, 0.85, 1.15);\n \n noStroke();\n \n // Render Grid\n for (let gx = 0; gx < cols; gx++) {\n for (let gy = 0; gy < rows; gy++) {\n const cx = margin + gx * cellW + cellW / 2 + (random() - 0.5) * jitter * cellW;\n const cy = margin + gy * cellH + cellH / 2 + (random() - 0.5) * jitter * cellH;\n \n const n = noise(gx * noiseScale, gy * noiseScale);\n const angle = n * PI * 2 * noiseStrength;\n const rings = Math.max(1, Math.floor(map(sin(angle), -1, 1, 1, 6)));\n const step = (maxRadius / rings) * ringBias * 0.9;\n \n for (let i = rings; i > 0; i--) {\n fill(palette[(rings - i) % palette.length]);\n ellipse(cx, cy, i * step * 2, i * step * 2);\n }\n }\n }\n}\n\n// Helper function for HSL colors\nfunction hslColor(h, s, l) {\n return 'hsl(' + h + ',' + s + '%,' + l + '%)';\n}\n";
10
+ export default RINGS_SKETCH;
11
+ //# sourceMappingURL=rings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rings.d.ts","sourceRoot":"","sources":["../../soundart-sketches/rings.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAO,MAAM,YAAY,u2FA+ExB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Flow Grid Rings - SoundArt Style as Code Mode Sketch
3
+ *
4
+ * This is the first SoundArt style converted to a Code Mode sketch.
5
+ * It uses S.* globals (sound snapshot) instead of direct sound data.
6
+ *
7
+ * Original: client/src/pages/soundart/engine/styles_impl.ts - drawFlowGridRings
8
+ */
9
+ export const RINGS_SKETCH = `
10
+ // Flow Grid Rings - SoundArt Style
11
+ // Uses S.* sound globals and standard p5-like functions
12
+
13
+ function setup() {
14
+ // Set background based on mode (rgb derived from sound, black, or white)
15
+ const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';
16
+
17
+ if (bgMode === 'white') {
18
+ background(245, 245, 245);
19
+ } else if (bgMode === 'black') {
20
+ background(10, 10, 10);
21
+ } else {
22
+ // Deterministic RGB background derived from sound snapshot
23
+ // Previously used clock time, now uses sound parameters for reproducibility
24
+ const r = Math.floor((S.brightness / 100) * 255);
25
+ const g = Math.floor((S.rhythmicity / 100) * 255);
26
+ const b = Math.floor((S.harmonicity / 100) * 255);
27
+ background(r, g, b);
28
+ }
29
+
30
+ // Grid dimensions based on sound volume
31
+ const cols = Math.floor(map(S.volume, 0, 100, 2, 32));
32
+ const rows = Math.floor(cols * 1.5);
33
+ const margin = map(S.length, 0, 100, width * 0.05, width * 0.1);
34
+ const innerW = width - margin * 2;
35
+ const innerH = height - margin * 2;
36
+ const cellW = innerW / cols;
37
+ const cellH = innerH / rows;
38
+ const gap = Math.min(cellW, cellH) * 0.25;
39
+ const maxRadius = (Math.min(cellW, cellH) - gap) / 2;
40
+
41
+ // Palette Harmony based on sound
42
+ const mainHue = (S.brightness * 3.6) % 360;
43
+ const hueShift = map(S.harmonicity, 0, 100, 20, 60);
44
+ const sat = map(S.treble, 0, 100, 60, 90);
45
+ const bri = map(S.bass, 0, 100, 70, 95);
46
+
47
+ // Generate palette
48
+ const palette = [
49
+ hslColor(mainHue, sat, bri),
50
+ hslColor((mainHue + hueShift) % 360, sat - 10, bri + 5),
51
+ hslColor((mainHue - hueShift + 360) % 360, sat - 10, bri + 5),
52
+ hslColor((mainHue + 180) % 360, sat - 20, bri - 10),
53
+ hslColor((mainHue + 120) % 360, sat, bri - 5),
54
+ hslColor((mainHue + 240) % 360, sat, bri - 5),
55
+ ];
56
+
57
+ // Flow field parameters
58
+ const noiseScale = 0.15;
59
+ const noiseStrength = map(S.aggression, 0, 100, 0.5, 4.0);
60
+ const jitter = map(S.rhythmicity, 0, 100, 0, 0.15);
61
+ const ringBias = map(S.attack, 0, 100, 0.85, 1.15);
62
+
63
+ noStroke();
64
+
65
+ // Render Grid
66
+ for (let gx = 0; gx < cols; gx++) {
67
+ for (let gy = 0; gy < rows; gy++) {
68
+ const cx = margin + gx * cellW + cellW / 2 + (random() - 0.5) * jitter * cellW;
69
+ const cy = margin + gy * cellH + cellH / 2 + (random() - 0.5) * jitter * cellH;
70
+
71
+ const n = noise(gx * noiseScale, gy * noiseScale);
72
+ const angle = n * PI * 2 * noiseStrength;
73
+ const rings = Math.max(1, Math.floor(map(sin(angle), -1, 1, 1, 6)));
74
+ const step = (maxRadius / rings) * ringBias * 0.9;
75
+
76
+ for (let i = rings; i > 0; i--) {
77
+ fill(palette[(rings - i) % palette.length]);
78
+ ellipse(cx, cy, i * step * 2, i * step * 2);
79
+ }
80
+ }
81
+ }
82
+ }
83
+
84
+ // Helper function for HSL colors
85
+ function hslColor(h, s, l) {
86
+ return 'hsl(' + h + ',' + s + '%,' + l + '%)';
87
+ }
88
+ `;
89
+ export default RINGS_SKETCH;
@@ -0,0 +1,3 @@
1
+ export declare const SQUARES_SKETCH = "\nfunction setup() {\n const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';\n if (bgMode === 'white') background(245, 245, 245);\n else if (bgMode === 'black') background(10, 10, 10);\n else {\n const r = Math.floor((S.brightness / 100) * 255);\n const g = Math.floor((S.rhythmicity / 100) * 255);\n const b = Math.floor((S.harmonicity / 100) * 255);\n background(r, g, b);\n }\n\n const numSquares = Math.floor(map(S.length, 0, 100, 40, 300));\n let size = Math.min(width, height) * 0.9;\n const shrinkFactor = map(S.dynamicRange, 0, 100, 0.92, 1.08);\n const rotationStep = map(S.aggression, 0, 100, 0.01, 0.07);\n const strokeMin = map(S.volume, 0, 100, 1.0, 6.0);\n const strokeMax = map(S.bass, 0, 100, 2.0, 8.0);\n\n const colors = [];\n for (let i = 0; i < 5; i++) {\n const baseHue = (S.hue + i * 60 + random() * 20) % 360;\n const sat = constrain(map(S.treble, 0, 100, 60, 95), 50, 100);\n const bri = constrain(map(S.brightness, 0, 100, 40, 85), 30, 90);\n colors.push(hslColor(baseHue, sat, bri));\n }\n\n noFill();\n translate(width / 2, height / 2);\n\n let angle = 0;\n for (let i = 0; i < numSquares; i++) {\n const strokeW = strokeMin + (i / numSquares) * (strokeMax - strokeMin);\n strokeWeight(strokeW);\n stroke(colors[i % colors.length]);\n\n push();\n rotate(angle);\n rect(-size / 2, -size / 2, size, size);\n pop();\n\n angle += rotationStep;\n size *= shrinkFactor;\n if (size < 4) break;\n }\n}\n\nfunction hslColor(h, s, l) {\n return 'hsl(' + h + ',' + s + '%,' + l + '%)';\n}\n";
2
+ export default SQUARES_SKETCH;
3
+ //# sourceMappingURL=squares.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"squares.d.ts","sourceRoot":"","sources":["../../soundart-sketches/squares.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,0kDAkD1B,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,52 @@
1
+ export const SQUARES_SKETCH = `
2
+ function setup() {
3
+ const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';
4
+ if (bgMode === 'white') background(245, 245, 245);
5
+ else if (bgMode === 'black') background(10, 10, 10);
6
+ else {
7
+ const r = Math.floor((S.brightness / 100) * 255);
8
+ const g = Math.floor((S.rhythmicity / 100) * 255);
9
+ const b = Math.floor((S.harmonicity / 100) * 255);
10
+ background(r, g, b);
11
+ }
12
+
13
+ const numSquares = Math.floor(map(S.length, 0, 100, 40, 300));
14
+ let size = Math.min(width, height) * 0.9;
15
+ const shrinkFactor = map(S.dynamicRange, 0, 100, 0.92, 1.08);
16
+ const rotationStep = map(S.aggression, 0, 100, 0.01, 0.07);
17
+ const strokeMin = map(S.volume, 0, 100, 1.0, 6.0);
18
+ const strokeMax = map(S.bass, 0, 100, 2.0, 8.0);
19
+
20
+ const colors = [];
21
+ for (let i = 0; i < 5; i++) {
22
+ const baseHue = (S.hue + i * 60 + random() * 20) % 360;
23
+ const sat = constrain(map(S.treble, 0, 100, 60, 95), 50, 100);
24
+ const bri = constrain(map(S.brightness, 0, 100, 40, 85), 30, 90);
25
+ colors.push(hslColor(baseHue, sat, bri));
26
+ }
27
+
28
+ noFill();
29
+ translate(width / 2, height / 2);
30
+
31
+ let angle = 0;
32
+ for (let i = 0; i < numSquares; i++) {
33
+ const strokeW = strokeMin + (i / numSquares) * (strokeMax - strokeMin);
34
+ strokeWeight(strokeW);
35
+ stroke(colors[i % colors.length]);
36
+
37
+ push();
38
+ rotate(angle);
39
+ rect(-size / 2, -size / 2, size, size);
40
+ pop();
41
+
42
+ angle += rotationStep;
43
+ size *= shrinkFactor;
44
+ if (size < 4) break;
45
+ }
46
+ }
47
+
48
+ function hslColor(h, s, l) {
49
+ return 'hsl(' + h + ',' + s + '%,' + l + '%)';
50
+ }
51
+ `;
52
+ export default SQUARES_SKETCH;
@@ -0,0 +1,3 @@
1
+ export declare const WAVE_STRIPES_SKETCH = "\nfunction setup() {\n const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';\n if (bgMode === 'white') background(245, 245, 245);\n else if (bgMode === 'black') background(10, 10, 10);\n else {\n const r = Math.floor((S.brightness / 100) * 255);\n const g = Math.floor((S.rhythmicity / 100) * 255);\n const b = Math.floor((S.harmonicity / 100) * 255);\n background(r, g, b);\n }\n\n const numLines = Math.floor(map(S.length, 0, 100, 5, 100));\n const amp = map(S.volume, 0, 100, 0.012, 0.09);\n const lineNoise = map(S.harmonicity, 0, 100, 0.1, 0.8);\n const freqNoise = map(S.aggression, 0, 100, 0.004, 0.02);\n const waveFreq = map(S.rhythmicity, 0, 100, 0.0003, 0.003);\n const strokeW = map(S.bass, 0, 100, 2, 6.0);\n const vividBoost = constrain(map(S.brightness, 0, 100, 0.6, 1.2), 0.6, 1.4);\n\n noFill();\n strokeWeight(strokeW);\n\n for (let j = 0; j < numLines; j++) {\n const yBase = map(j, 0, numLines - 1, 0.05 * height, 0.95 * height);\n const lineTreble = constrain(S.treble + noise(j, 99) * 20 - 10, 0, 100);\n const hue = ((map(lineTreble, 60, 100, 0, 360) + map(S.attack, 0, 100, 0, 120) + noise(j, 100) * 20 - 10) % 360 + 360) % 360;\n \n stroke('hsl(' + hue + ',85%,' + constrain(vividBoost * 55, 40, 70) + '%)');\n \n beginShape();\n const pointSpacing = constrain(map(S.harmonicity, 0, 100, 20, 4), 4, 20);\n for (let i = 0; i <= width; i += pointSpacing) {\n const shimmer = sin(i * 0.05 + j * 0.1) * 0.05;\n const offsetY = sin(i * waveFreq + j * 0.2 + shimmer) * amp * height;\n const localNoiseVal = (noise(i * freqNoise, j * lineNoise) - 0.5) * amp * height;\n const y = yBase + offsetY + localNoiseVal;\n vertex(i, y);\n }\n endShape();\n }\n}\n";
2
+ export default WAVE_STRIPES_SKETCH;
3
+ //# sourceMappingURL=waveStripes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waveStripes.d.ts","sourceRoot":"","sources":["../../soundart-sketches/waveStripes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,6vDA0C/B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,44 @@
1
+ export const WAVE_STRIPES_SKETCH = `
2
+ function setup() {
3
+ const bgMode = typeof backgroundMode !== 'undefined' ? backgroundMode : 'rgb';
4
+ if (bgMode === 'white') background(245, 245, 245);
5
+ else if (bgMode === 'black') background(10, 10, 10);
6
+ else {
7
+ const r = Math.floor((S.brightness / 100) * 255);
8
+ const g = Math.floor((S.rhythmicity / 100) * 255);
9
+ const b = Math.floor((S.harmonicity / 100) * 255);
10
+ background(r, g, b);
11
+ }
12
+
13
+ const numLines = Math.floor(map(S.length, 0, 100, 5, 100));
14
+ const amp = map(S.volume, 0, 100, 0.012, 0.09);
15
+ const lineNoise = map(S.harmonicity, 0, 100, 0.1, 0.8);
16
+ const freqNoise = map(S.aggression, 0, 100, 0.004, 0.02);
17
+ const waveFreq = map(S.rhythmicity, 0, 100, 0.0003, 0.003);
18
+ const strokeW = map(S.bass, 0, 100, 2, 6.0);
19
+ const vividBoost = constrain(map(S.brightness, 0, 100, 0.6, 1.2), 0.6, 1.4);
20
+
21
+ noFill();
22
+ strokeWeight(strokeW);
23
+
24
+ for (let j = 0; j < numLines; j++) {
25
+ const yBase = map(j, 0, numLines - 1, 0.05 * height, 0.95 * height);
26
+ const lineTreble = constrain(S.treble + noise(j, 99) * 20 - 10, 0, 100);
27
+ const hue = ((map(lineTreble, 60, 100, 0, 360) + map(S.attack, 0, 100, 0, 120) + noise(j, 100) * 20 - 10) % 360 + 360) % 360;
28
+
29
+ stroke('hsl(' + hue + ',85%,' + constrain(vividBoost * 55, 40, 70) + '%)');
30
+
31
+ beginShape();
32
+ const pointSpacing = constrain(map(S.harmonicity, 0, 100, 20, 4), 4, 20);
33
+ for (let i = 0; i <= width; i += pointSpacing) {
34
+ const shimmer = sin(i * 0.05 + j * 0.1) * 0.05;
35
+ const offsetY = sin(i * waveFreq + j * 0.2 + shimmer) * amp * height;
36
+ const localNoiseVal = (noise(i * freqNoise, j * lineNoise) - 0.5) * amp * height;
37
+ const y = yBase + offsetY + localNoiseVal;
38
+ vertex(i, y);
39
+ }
40
+ endShape();
41
+ }
42
+ }
43
+ `;
44
+ export default WAVE_STRIPES_SKETCH;
@@ -1,9 +1,12 @@
1
1
  /**
2
2
  * NexArt Code Mode Runtime SDK - Static Engine
3
- * Version: 1.4.0 (Protocol v1.2.0)
3
+ * Protocol: v1.2.0 (Phase 3) — HARD ENFORCEMENT
4
4
  *
5
5
  * Static mode renderer: executes setup() only, captures single PNG.
6
6
  * Does NOT execute draw() - per NexArt Execution Specification v1.
7
+ *
8
+ * Determinism Guarantee:
9
+ * Same code + same seed + same VARs = identical PNG output
7
10
  */
8
11
  import type { EngineConfig, RunOptions } from './types';
9
12
  export declare function runStaticMode(config: EngineConfig, options: RunOptions): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"static-engine.d.ts","sourceRoot":"","sources":["../static-engine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAgB,MAAM,SAAS,CAAC;AAItE,wBAAsB,aAAa,CACjC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,IAAI,CAAC,CAgGf"}
1
+ {"version":3,"file":"static-engine.d.ts","sourceRoot":"","sources":["../static-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAgB,MAAM,SAAS,CAAC;AAItE,wBAAsB,aAAa,CACjC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,IAAI,CAAC,CAmGf"}
@@ -1,14 +1,17 @@
1
1
  /**
2
2
  * NexArt Code Mode Runtime SDK - Static Engine
3
- * Version: 1.4.0 (Protocol v1.2.0)
3
+ * Protocol: v1.2.0 (Phase 3) — HARD ENFORCEMENT
4
4
  *
5
5
  * Static mode renderer: executes setup() only, captures single PNG.
6
6
  * Does NOT execute draw() - per NexArt Execution Specification v1.
7
+ *
8
+ * Determinism Guarantee:
9
+ * Same code + same seed + same VARs = identical PNG output
7
10
  */
8
11
  import { DEFAULT_CONFIG } from './types';
9
- import { createP5Runtime, injectTimeVariables } from './p5-runtime';
12
+ import { createP5Runtime, injectTimeVariables, injectProtocolVariables } from './p5-runtime';
10
13
  export async function runStaticMode(config, options) {
11
- const { code, onPreview, onProgress, onComplete, onError } = options;
14
+ const { code, seed, vars, onPreview, onProgress, onComplete, onError } = options;
12
15
  const width = config.width ?? DEFAULT_CONFIG.width;
13
16
  const height = config.height ?? DEFAULT_CONFIG.height;
14
17
  try {
@@ -21,8 +24,8 @@ export async function runStaticMode(config, options) {
21
24
  const canvas = document.createElement('canvas');
22
25
  canvas.width = width;
23
26
  canvas.height = height;
24
- // Create p5 runtime
25
- const p = createP5Runtime(canvas, width, height);
27
+ // Create p5 runtime with optional seed for determinism
28
+ const p = createP5Runtime(canvas, width, height, { seed });
26
29
  // Inject time variables (static = frame 0, t = 0, totalFrames = 1)
27
30
  injectTimeVariables(p, {
28
31
  frameCount: 0,
@@ -31,6 +34,8 @@ export async function runStaticMode(config, options) {
31
34
  tGlobal: 0,
32
35
  totalFrames: 1, // Static mode has 1 frame
33
36
  });
37
+ // Inject protocol variables (VAR[0..9])
38
+ injectProtocolVariables(p, vars);
34
39
  onProgress?.({
35
40
  phase: 'setup',
36
41
  percent: 10,
@@ -51,10 +56,10 @@ export async function runStaticMode(config, options) {
51
56
  percent: 30,
52
57
  message: 'Executing setup()...',
53
58
  });
54
- // Create wrapped setup function with p5 context
55
- const wrappedSetup = new Function('p', 'frameCount', 't', 'time', 'tGlobal', `with(p) { ${setupCode} }`);
59
+ // Create wrapped setup function with p5 context and VAR
60
+ const wrappedSetup = new Function('p', 'frameCount', 't', 'time', 'tGlobal', 'VAR', `with(p) { ${setupCode} }`);
56
61
  // Execute setup() only
57
- wrappedSetup(p, 0, 0, 0, 0);
62
+ wrappedSetup(p, 0, 0, 0, 0, p.VAR);
58
63
  // Provide preview callback
59
64
  onPreview?.(canvas);
60
65
  onProgress?.({
package/dist/types.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * NexArt Code Mode Runtime SDK - Types
3
- * Version: 1.4.0 (Protocol v1.2.0)
3
+ * Version: 1.5.1 (Protocol v1.2.0)
4
4
  *
5
5
  * Type definitions for the Code Mode runtime engine.
6
6
  * This is the canonical type surface for @nexart/codemode-sdk.
@@ -61,8 +61,9 @@ export interface TimeVariables {
61
61
  /**
62
62
  * Protocol Variables (VAR[0..9])
63
63
  * First-class protocol inputs for deterministic rendering.
64
+ * Used by SoundArt, Shapes, Noise, and ByX collections.
64
65
  *
65
- * Rules (SDK v1.4.0, Protocol v1.2.0):
66
+ * Rules (SDK v1.0.2, Protocol v1.0.0):
66
67
  * - Input array can have 0-10 elements (protocol error if > 10)
67
68
  * - All values MUST be finite numbers (protocol error if not)
68
69
  * - Values MUST be in range 0-100 (protocol error if out of range, NO clamping)
@@ -125,4 +126,44 @@ export interface ExecuteCodeModeResult {
125
126
  frames?: ImageData[];
126
127
  metadata: ProtocolMetadata;
127
128
  }
129
+ /**
130
+ * Builder Manifest (v1.5.1)
131
+ *
132
+ * Passive, declarative metadata for builder attribution.
133
+ * This is data-only with no logic, rewards, or enforcement attached.
134
+ *
135
+ * Rules:
136
+ * - Registration is optional
137
+ * - Missing or invalid manifest does NOT throw
138
+ * - No network calls, no telemetry, no analytics
139
+ * - Does NOT affect execution behavior or determinism
140
+ * - Used for future attribution and ecosystem discovery
141
+ */
142
+ export interface NexArtBuilderManifest {
143
+ protocol: 'nexart';
144
+ manifestVersion: string;
145
+ app?: {
146
+ name?: string;
147
+ url?: string;
148
+ description?: string;
149
+ contact?: string;
150
+ };
151
+ sdk?: {
152
+ package?: string;
153
+ version?: string;
154
+ execution?: string;
155
+ };
156
+ renderer?: {
157
+ package?: string;
158
+ version?: string;
159
+ mode?: 'preview' | 'canonical';
160
+ };
161
+ features?: Record<string, boolean>;
162
+ declaration?: {
163
+ usesOfficialSdk?: boolean;
164
+ noRuntimeModification?: boolean;
165
+ noProtocolBypass?: boolean;
166
+ };
167
+ timestamp?: string;
168
+ }
128
169
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;CAMpB,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IACxB,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAChD,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAC;IAC9C,UAAU,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAC3C,OAAO,CAAC,EAAE,CAAC,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QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;KAChC,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,WAAW,CAAC,EAAE;QACZ,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAC;QAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;KAC5B,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * NexArt Code Mode Runtime SDK - Types
3
- * Version: 1.4.0 (Protocol v1.2.0)
3
+ * Version: 1.5.1 (Protocol v1.2.0)
4
4
  *
5
5
  * Type definitions for the Code Mode runtime engine.
6
6
  * This is the canonical type surface for @nexart/codemode-sdk.
package/package.json CHANGED
@@ -1,36 +1,45 @@
1
1
  {
2
2
  "name": "@nexart/codemode-sdk",
3
- "version": "1.4.0",
4
- "description": "NexArt Code Mode Runtime SDK - Deterministic generative art rendering engine (Protocol v1.2.0)",
5
- "license": "MIT",
6
- "main": "dist/index.js",
7
- "types": "dist/index.d.ts",
3
+ "version": "1.5.1",
4
+ "description": "NexArt Code Mode SDK - Canonical execution engine for deterministic generative art",
8
5
  "type": "module",
6
+ "main": "./dist/core-index.js",
7
+ "types": "./dist/core-index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/core-index.d.ts",
11
+ "import": "./dist/core-index.js"
12
+ }
13
+ },
9
14
  "files": [
10
- "dist"
15
+ "dist",
16
+ "README.md",
17
+ "CHANGELOG.md",
18
+ "CODE_MODE_PROTOCOL.md"
11
19
  ],
12
20
  "scripts": {
13
21
  "build": "tsc",
14
- "prepublishOnly": "npm run build"
15
- },
16
- "devDependencies": {
17
- "typescript": "^5.0.0"
22
+ "test": "npx tsx smoke-test.ts",
23
+ "prepublishOnly": "npm run build && npm run test"
18
24
  },
19
25
  "keywords": [
26
+ "nexart",
20
27
  "generative-art",
28
+ "nft",
21
29
  "p5js",
22
- "canvas",
23
- "rendering",
24
30
  "deterministic",
25
- "nft",
26
- "creative-coding"
31
+ "codemode"
27
32
  ],
33
+ "author": "NexArt",
34
+ "license": "MIT",
28
35
  "repository": {
29
36
  "type": "git",
30
37
  "url": "https://github.com/artnames/nexart-codemode-sdk.git"
31
38
  },
32
- "author": "NexArt",
33
39
  "publishConfig": {
34
40
  "access": "public"
41
+ },
42
+ "devDependencies": {
43
+ "typescript": "^5.0.0"
35
44
  }
36
45
  }