@nexart/codemode-sdk 1.8.4 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,11 +8,11 @@
8
8
  * See package.json for the canonical npm version.
9
9
  */
10
10
  /** SDK version - must match package.json version */
11
- export declare const SDK_VERSION = "1.8.4";
11
+ export declare const SDK_VERSION = "1.9.0";
12
12
  /** Protocol version - defines runtime semantics and determinism guarantees */
13
13
  export declare const PROTOCOL_VERSION = "1.2.0";
14
14
  /** Protocol phase - phase 3 = stable, production-ready */
15
15
  export declare const PROTOCOL_PHASE = 3;
16
16
  /** Combined version string for display */
17
- export declare const VERSION_STRING = "v1.8.4 (Protocol v1.2.0)";
17
+ export declare const VERSION_STRING = "v1.9.0 (Protocol v1.2.0)";
18
18
  //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Minimal NexArt Code Mode Sketch
3
+ *
4
+ * A simple sketch demonstrating basic canvas operations.
5
+ * No randomness - produces identical output every run.
6
+ *
7
+ * Canonical size: 1950x2400 (enforced by canonical renderer)
8
+ */
9
+
10
+ createCanvas(1950, 2400);
11
+ background(20, 20, 30);
12
+
13
+ noStroke();
14
+
15
+ fill(255, 100, 100);
16
+ ellipse(width / 2, height / 3, 600, 600);
17
+
18
+ fill(100, 255, 100);
19
+ ellipse(width / 3, height * 2 / 3, 400, 400);
20
+
21
+ fill(100, 100, 255);
22
+ ellipse(width * 2 / 3, height * 2 / 3, 400, 400);
23
+
24
+ stroke(255);
25
+ strokeWeight(4);
26
+ noFill();
27
+ rect(100, 100, width - 200, height - 200, 50);
@@ -0,0 +1,59 @@
1
+ /**
2
+ * VAR + Random Sketch - Demonstrates Determinism
3
+ *
4
+ * This sketch uses VAR parameters and random() to show that
5
+ * NexArt Code Mode produces identical output for the same seed.
6
+ *
7
+ * VAR[0]: Number of circles (0-100 maps to 10-50)
8
+ * VAR[1]: Circle size multiplier (0-100 maps to 0.5-2.0)
9
+ * VAR[2]: Color hue shift (0-100 maps to 0-360)
10
+ *
11
+ * Canonical size: 1950x2400 (enforced by canonical renderer)
12
+ *
13
+ * Usage:
14
+ * nexart run sketch-vars.js --seed 12345 --vars 50,75,25
15
+ */
16
+
17
+ createCanvas(1950, 2400);
18
+ background(10, 10, 20);
19
+
20
+ const numCircles = Math.floor(map(VAR[0], 0, 100, 10, 50));
21
+ const sizeMultiplier = map(VAR[1], 0, 100, 0.5, 2.0);
22
+ const hueShift = map(VAR[2], 0, 100, 0, 360);
23
+
24
+ colorMode(HSB, 360, 100, 100, 100);
25
+
26
+ noStroke();
27
+
28
+ for (let i = 0; i < numCircles; i++) {
29
+ const x = random(100, width - 100);
30
+ const y = random(100, height - 100);
31
+ const baseSize = random(50, 200) * sizeMultiplier;
32
+ const hue = (random(360) + hueShift) % 360;
33
+ const sat = random(60, 100);
34
+ const bright = random(70, 100);
35
+ const alpha = random(40, 80);
36
+
37
+ fill(hue, sat, bright, alpha);
38
+ ellipse(x, y, baseSize, baseSize);
39
+ }
40
+
41
+ stroke(0, 0, 100, 50);
42
+ strokeWeight(2);
43
+ noFill();
44
+
45
+ for (let i = 0; i < 20; i++) {
46
+ const x1 = random(width);
47
+ const y1 = random(height);
48
+ const x2 = random(width);
49
+ const y2 = random(height);
50
+ line(x1, y1, x2, y2);
51
+ }
52
+
53
+ colorMode(RGB, 255);
54
+ fill(255);
55
+ noStroke();
56
+ textSize(48);
57
+ textAlign(CENTER, TOP);
58
+ text(`Seed: ${SEED}`, width / 2, 50);
59
+ text(`VAR: [${VAR[0]}, ${VAR[1]}, ${VAR[2]}]`, width / 2, 120);
@@ -0,0 +1,24 @@
1
+ function setup() {
2
+ const brightness = map(VAR[0], 0, 100, 20, 245);
3
+ background(brightness);
4
+
5
+ const diameter = map(VAR[1], 0, 100, 200, 1400);
6
+
7
+ // Deterministic palette choice (no random dependency)
8
+ const paletteIndex = floor(map(VAR[2], 0, 100, 0, 2.9999));
9
+
10
+ const palettes = [
11
+ { main: [255, 100, 120], accent: [100, 200, 255] },
12
+ { main: [100, 220, 180], accent: [255, 180, 100] },
13
+ { main: [180, 120, 255], accent: [255, 220, 100] }
14
+ ];
15
+ const palette = palettes[paletteIndex];
16
+
17
+ noStroke();
18
+
19
+ fill(palette.main[0], palette.main[1], palette.main[2]);
20
+ ellipse(width / 2, height / 2, diameter, diameter);
21
+
22
+ fill(palette.accent[0], palette.accent[1], palette.accent[2]);
23
+ ellipse(width / 2, height / 2, diameter * 0.4, diameter * 0.4);
24
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexart/codemode-sdk",
3
- "version": "1.8.4",
3
+ "version": "1.9.0",
4
4
  "description": "NexArt Code Mode SDK - Deterministic, reproducible, verifiable generative art runtime. Agent-first design for AI coding assistants.",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/browser.cjs",
@@ -43,7 +43,8 @@
43
43
  "build:types": "tsc -p tsconfig.types.json",
44
44
  "build:esm": "tsup --config tsup.config.ts --format esm",
45
45
  "build:cjs": "tsup --config tsup.config.ts --format cjs",
46
- "test": "npx tsx smoke-test.ts",
46
+ "test": "npx tsx smoke-test.ts && npx tsx tests/attestation.test.ts",
47
+ "test:attestation": "npx tsx tests/attestation.test.ts",
47
48
  "test:node": "node scripts/smoke-node.mjs && node scripts/smoke-node.cjs",
48
49
  "example:basic": "npx tsx examples/basic.ts",
49
50
  "example:verify": "npx tsx examples/verify.ts",
@@ -82,7 +83,12 @@
82
83
  "publishConfig": {
83
84
  "access": "public"
84
85
  },
86
+ "dependencies": {
87
+ "@noble/ed25519": "^3.0.0",
88
+ "@noble/hashes": "^1.7.0"
89
+ },
85
90
  "devDependencies": {
91
+ "@types/node": "^20.0.0",
86
92
  "tsup": "^8.0.0",
87
93
  "typescript": "^5.0.0"
88
94
  }