@nexart/codemode-sdk 1.8.1 → 1.8.3

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 (144) hide show
  1. package/CHANGELOG.md +86 -1
  2. package/COMMERCIAL.md +25 -23
  3. package/LICENSE.md +10 -41
  4. package/README.md +82 -11
  5. package/dist/sdk/codemode/core-index.d.ts +6 -4
  6. package/dist/sdk/codemode/core-index.d.ts.map +1 -1
  7. package/dist/sdk/codemode/core-index.js +6 -4
  8. package/dist/{entry → sdk/codemode/entry}/browser.d.ts +5 -2
  9. package/dist/sdk/codemode/entry/browser.d.ts.map +1 -0
  10. package/dist/{entry → sdk/codemode/entry}/browser.js +10 -4
  11. package/dist/{entry → sdk/codemode/entry}/node.d.ts +2 -1
  12. package/dist/sdk/codemode/entry/node.d.ts.map +1 -0
  13. package/dist/{entry → sdk/codemode/entry}/node.js +2 -1
  14. package/dist/sdk/codemode/p5-runtime.d.ts +3 -2
  15. package/dist/sdk/codemode/p5-runtime.d.ts.map +1 -1
  16. package/dist/sdk/codemode/p5-runtime.js +6 -4
  17. package/dist/{runtime.d.ts → sdk/codemode/runtime.d.ts} +2 -2
  18. package/dist/sdk/codemode/runtime.d.ts.map +1 -0
  19. package/dist/{runtime.js → sdk/codemode/runtime.js} +3 -2
  20. package/dist/sdk/codemode/static-engine.d.ts.map +1 -1
  21. package/dist/sdk/codemode/static-engine.js +24 -11
  22. package/dist/sdk/codemode/types.d.ts +2 -1
  23. package/dist/sdk/codemode/types.d.ts.map +1 -1
  24. package/dist/sdk/codemode/types.js +5 -3
  25. package/dist/sdk/codemode/version.d.ts +18 -0
  26. package/dist/sdk/codemode/version.d.ts.map +1 -0
  27. package/dist/sdk/codemode/version.js +17 -0
  28. package/examples/agent-quickstart.ts +159 -0
  29. package/examples/preflight-test.ts +1 -1
  30. package/package.json +2 -1
  31. package/dist/builder-manifest.d.ts +0 -79
  32. package/dist/builder-manifest.d.ts.map +0 -1
  33. package/dist/builder-manifest.js +0 -97
  34. package/dist/core-index.d.ts +0 -21
  35. package/dist/core-index.d.ts.map +0 -1
  36. package/dist/core-index.js +0 -26
  37. package/dist/engine.d.ts +0 -24
  38. package/dist/engine.d.ts.map +0 -1
  39. package/dist/engine.js +0 -67
  40. package/dist/entry/browser.d.ts.map +0 -1
  41. package/dist/entry/node.d.ts.map +0 -1
  42. package/dist/execute.d.ts +0 -46
  43. package/dist/execute.d.ts.map +0 -1
  44. package/dist/execute.js +0 -283
  45. package/dist/execution-sandbox.d.ts +0 -107
  46. package/dist/execution-sandbox.d.ts.map +0 -1
  47. package/dist/execution-sandbox.js +0 -207
  48. package/dist/index.d.ts +0 -31
  49. package/dist/index.d.ts.map +0 -1
  50. package/dist/index.js +0 -63
  51. package/dist/loop-engine.d.ts +0 -22
  52. package/dist/loop-engine.d.ts.map +0 -1
  53. package/dist/loop-engine.js +0 -229
  54. package/dist/noise-bridge.d.ts +0 -44
  55. package/dist/noise-bridge.d.ts.map +0 -1
  56. package/dist/noise-bridge.js +0 -68
  57. package/dist/noise-engine.d.ts +0 -74
  58. package/dist/noise-engine.d.ts.map +0 -1
  59. package/dist/noise-engine.js +0 -132
  60. package/dist/noise-sketches/fractalNoise.d.ts +0 -11
  61. package/dist/noise-sketches/fractalNoise.d.ts.map +0 -1
  62. package/dist/noise-sketches/fractalNoise.js +0 -121
  63. package/dist/noise-sketches/index.d.ts +0 -21
  64. package/dist/noise-sketches/index.d.ts.map +0 -1
  65. package/dist/noise-sketches/index.js +0 -28
  66. package/dist/p5-runtime.d.ts +0 -75
  67. package/dist/p5-runtime.d.ts.map +0 -1
  68. package/dist/p5-runtime.js +0 -1031
  69. package/dist/runtime.d.ts.map +0 -1
  70. package/dist/sdk/codemode/index.d.ts +0 -31
  71. package/dist/sdk/codemode/index.d.ts.map +0 -1
  72. package/dist/sdk/codemode/index.js +0 -63
  73. package/dist/sdk/codemode/noise-bridge.d.ts +0 -44
  74. package/dist/sdk/codemode/noise-bridge.d.ts.map +0 -1
  75. package/dist/sdk/codemode/noise-bridge.js +0 -68
  76. package/dist/sdk/codemode/noise-engine.d.ts +0 -74
  77. package/dist/sdk/codemode/noise-engine.d.ts.map +0 -1
  78. package/dist/sdk/codemode/noise-engine.js +0 -132
  79. package/dist/sdk/codemode/noise-sketches/fractalNoise.d.ts +0 -11
  80. package/dist/sdk/codemode/noise-sketches/fractalNoise.d.ts.map +0 -1
  81. package/dist/sdk/codemode/noise-sketches/fractalNoise.js +0 -121
  82. package/dist/sdk/codemode/noise-sketches/index.d.ts +0 -21
  83. package/dist/sdk/codemode/noise-sketches/index.d.ts.map +0 -1
  84. package/dist/sdk/codemode/noise-sketches/index.js +0 -28
  85. package/dist/shared/noiseSnapshot.d.ts +0 -59
  86. package/dist/shared/noiseSnapshot.d.ts.map +0 -1
  87. package/dist/shared/noiseSnapshot.js +0 -72
  88. package/dist/sound-bridge.d.ts +0 -89
  89. package/dist/sound-bridge.d.ts.map +0 -1
  90. package/dist/sound-bridge.js +0 -128
  91. package/dist/soundart-engine.d.ts +0 -87
  92. package/dist/soundart-engine.d.ts.map +0 -1
  93. package/dist/soundart-engine.js +0 -173
  94. package/dist/soundart-sketches/chladniBloom.d.ts +0 -3
  95. package/dist/soundart-sketches/chladniBloom.d.ts.map +0 -1
  96. package/dist/soundart-sketches/chladniBloom.js +0 -53
  97. package/dist/soundart-sketches/dualVortex.d.ts +0 -3
  98. package/dist/soundart-sketches/dualVortex.d.ts.map +0 -1
  99. package/dist/soundart-sketches/dualVortex.js +0 -67
  100. package/dist/soundart-sketches/geometryIllusion.d.ts +0 -3
  101. package/dist/soundart-sketches/geometryIllusion.d.ts.map +0 -1
  102. package/dist/soundart-sketches/geometryIllusion.js +0 -89
  103. package/dist/soundart-sketches/index.d.ts +0 -39
  104. package/dist/soundart-sketches/index.d.ts.map +0 -1
  105. package/dist/soundart-sketches/index.js +0 -72
  106. package/dist/soundart-sketches/isoflow.d.ts +0 -3
  107. package/dist/soundart-sketches/isoflow.d.ts.map +0 -1
  108. package/dist/soundart-sketches/isoflow.js +0 -60
  109. package/dist/soundart-sketches/loomWeave.d.ts +0 -3
  110. package/dist/soundart-sketches/loomWeave.d.ts.map +0 -1
  111. package/dist/soundart-sketches/loomWeave.js +0 -59
  112. package/dist/soundart-sketches/noiseTerraces.d.ts +0 -3
  113. package/dist/soundart-sketches/noiseTerraces.d.ts.map +0 -1
  114. package/dist/soundart-sketches/noiseTerraces.js +0 -53
  115. package/dist/soundart-sketches/orb.d.ts +0 -3
  116. package/dist/soundart-sketches/orb.d.ts.map +0 -1
  117. package/dist/soundart-sketches/orb.js +0 -50
  118. package/dist/soundart-sketches/pixelGlyphs.d.ts +0 -3
  119. package/dist/soundart-sketches/pixelGlyphs.d.ts.map +0 -1
  120. package/dist/soundart-sketches/pixelGlyphs.js +0 -72
  121. package/dist/soundart-sketches/prismFlowFields.d.ts +0 -3
  122. package/dist/soundart-sketches/prismFlowFields.d.ts.map +0 -1
  123. package/dist/soundart-sketches/prismFlowFields.js +0 -51
  124. package/dist/soundart-sketches/radialBurst.d.ts +0 -3
  125. package/dist/soundart-sketches/radialBurst.d.ts.map +0 -1
  126. package/dist/soundart-sketches/radialBurst.js +0 -60
  127. package/dist/soundart-sketches/resonantSoundBodies.d.ts +0 -3
  128. package/dist/soundart-sketches/resonantSoundBodies.d.ts.map +0 -1
  129. package/dist/soundart-sketches/resonantSoundBodies.js +0 -89
  130. package/dist/soundart-sketches/rings.d.ts +0 -11
  131. package/dist/soundart-sketches/rings.d.ts.map +0 -1
  132. package/dist/soundart-sketches/rings.js +0 -89
  133. package/dist/soundart-sketches/squares.d.ts +0 -3
  134. package/dist/soundart-sketches/squares.d.ts.map +0 -1
  135. package/dist/soundart-sketches/squares.js +0 -52
  136. package/dist/soundart-sketches/waveStripes.d.ts +0 -3
  137. package/dist/soundart-sketches/waveStripes.d.ts.map +0 -1
  138. package/dist/soundart-sketches/waveStripes.js +0 -44
  139. package/dist/static-engine.d.ts +0 -20
  140. package/dist/static-engine.d.ts.map +0 -1
  141. package/dist/static-engine.js +0 -157
  142. package/dist/types.d.ts +0 -191
  143. package/dist/types.d.ts.map +0 -1
  144. package/dist/types.js +0 -32
package/CHANGELOG.md CHANGED
@@ -4,6 +4,91 @@ All notable changes to @nexart/codemode-sdk will be documented in this file.
4
4
 
5
5
  ---
6
6
 
7
+ ## [1.8.3] — 2026-01-25
8
+
9
+ ### Changed — CLI v0.2 Remote Renderer + Version Bump
10
+
11
+ **Non-Breaking Release**
12
+
13
+ This release adds CLI v0.2 with remote canonical renderer support and ensures all version references are synchronized.
14
+
15
+ #### CLI v0.2 Features
16
+ - **Remote renderer support** — `nexart run` now calls canonical Node renderer by default
17
+ - **`--renderer` flag** — Switch between `remote` (default) and `local` (placeholder)
18
+ - **`--endpoint` flag** — Custom renderer endpoint URL
19
+ - **`--include-code` flag** — Embed source code in snapshot for standalone verify/replay
20
+ - **`NEXART_RENDERER_ENDPOINT`** — Environment variable for default endpoint
21
+ - **Real PNG output** — When remote renderer available, produces actual rendered images
22
+
23
+ #### Snapshot v1 Updates
24
+ - `outputHash` = SHA-256 of PNG bytes (locked)
25
+ - `runtimeHash` sourced from renderer response when using remote mode
26
+ - Optional `code` field when `--include-code` is used
27
+
28
+ #### Documentation Updates
29
+ - Updated `docs/snapshot-v1.md` with runtimeHash sourcing and code embedding
30
+ - CLI README now documents remote renderer as default
31
+ - All version references updated from 1.8.2 to 1.8.3
32
+
33
+ #### Package Updates
34
+ - **SDK Version**: 1.8.3
35
+ - **CLI Version**: 0.2.0
36
+
37
+ ### Unchanged
38
+
39
+ - No changes to protocol semantics (v1.2.0)
40
+ - No changes to runtime APIs
41
+ - No changes to determinism guarantees
42
+ - Full backward compatibility with v1.8.2
43
+
44
+ ---
45
+
46
+ ## [1.8.2] — 2026-01-24
47
+
48
+ ### Changed — AI Agent Adoption Friction Reduction
49
+
50
+ **Non-Breaking, Documentation-Only Release**
51
+
52
+ This release addresses external review feedback (Grok/Lovable/Replit) about AI agent adoption friction. No runtime, API, or behavior changes. Protocol remains v1.2.0.
53
+
54
+ #### Agent Quickstart Example Added
55
+ - **New `examples/agent-quickstart.ts`** — Copy-paste ready reference for AI agents
56
+ - Uses ONLY `createRuntime()` (modern, agent-first API)
57
+ - No canvas, no p5, browser-safe
58
+ - Demonstrates: seed → runtime → deterministic ops → digest → verification
59
+ - Shows strict mode enforcement and error handling
60
+
61
+ #### Documentation Clarified — Entrypoint Selection
62
+ - **"Which API should I use?"** section added to README
63
+ - Decision table: `createRuntime()` vs `executeCodeMode()`
64
+ - Clear guidance: `createRuntime()` = DEFAULT, `executeCodeMode()` = legacy/node-only
65
+ - **"For AI coding agents"** section expanded with:
66
+ - Quick rules: always `createRuntime()`, never `Math.random()`, always `strict: true`
67
+ - Link to `examples/agent-quickstart.ts`
68
+ - Detailed strict mode explanation (why it exists, scoping, restoration)
69
+
70
+ #### Version Consistency Pass
71
+ - **New `version.ts`** — Single source of truth for SDK_VERSION, PROTOCOL_VERSION, PROTOCOL_PHASE
72
+ - All programmatic exports (runtime.ts, core-index.ts, entry/browser.ts) now import from version.ts
73
+ - Eliminates version drift between package.json, runtime exports, and documentation
74
+ - All documentation updated to reference version 1.8.2
75
+ - README, CHANGELOG, package.json all synchronized
76
+
77
+ #### Package Updates
78
+ - **Version**: 1.8.2
79
+ - **New script**: `npm run example:agent` — Run agent quickstart example
80
+
81
+ ### Unchanged
82
+
83
+ - No changes to runtime behavior
84
+ - No changes to APIs or exports
85
+ - No changes to protocol version (remains v1.2.0)
86
+ - No changes to determinism guarantees
87
+ - No changes to strict mode enforcement
88
+ - Full backward compatibility with v1.8.1
89
+
90
+ ---
91
+
7
92
  ## [1.8.1] — 2026-01-24
8
93
 
9
94
  ### Changed — Documentation & Licensing Clarity
@@ -25,7 +110,7 @@ This release addresses external review feedback about documentation framing and
25
110
  - **COMMERCIAL.md added** — Plain language licensing terms
26
111
  - **Free for**: personal, experiments, research, open-source
27
112
  - **Commercial production**: requires license
28
- - **Contact**: licensing@nexart.xyz
113
+ - **Contact**: contact@artnames.io
29
114
  - **No phase language, no future enforcement language**
30
115
 
31
116
  #### Package Updates
package/COMMERCIAL.md CHANGED
@@ -1,41 +1,43 @@
1
- # Commercial Licensing
1
+ # Commercial Use
2
2
 
3
3
  ## @nexart/codemode-sdk
4
4
 
5
5
  ---
6
6
 
7
- ## Free Use
7
+ ## License: MIT (Free for All Use)
8
8
 
9
- You may use this SDK at no cost for:
9
+ This SDK is released under the **MIT License**.
10
10
 
11
- - **Personal projects** Learning, hobby work, portfolio pieces
12
- - **Experiments and prototypes** — Proof of concepts, demos, hackathons
13
- - **Research and education** — Academic work, teaching, scientific research
14
- - **Open-source projects** — Projects with source code publicly available under an OSI-approved license
15
-
16
- ---
17
-
18
- ## Commercial Use
19
-
20
- Commercial production deployments require a license.
21
-
22
- **Commercial use includes:**
23
- - Products or services that generate revenue
24
- - Internal tools used in commercial operations
25
- - SaaS applications
26
- - Games or simulations sold or monetized
11
+ You may use it for **any purpose**, including:
12
+ - Personal projects
13
+ - Commercial products
14
+ - Revenue-generating applications
27
15
  - Enterprise deployments
16
+ - NFT minting
17
+ - SaaS applications
18
+
19
+ **No license key required. No usage tracking. No restrictions.**
28
20
 
29
21
  ---
30
22
 
31
- ## Get a License
23
+ ## How NexArt Monetizes
24
+
25
+ NexArt follows a "monetize edges, not core" model:
32
26
 
33
- Contact: **licensing@artnames.io**
27
+ | Component | Cost |
28
+ |-----------|------|
29
+ | SDK | Free (MIT) |
30
+ | CLI | Free (MIT) |
31
+ | Local run/replay/verify | Free |
32
+ | **Hosted attestation** | Paid |
33
+ | **Cloud retention** | Paid |
34
+ | **SLA guarantees** | Paid |
35
+ | **Compliance tooling** | Paid |
34
36
 
35
- We offer flexible licensing options for teams and enterprises.
37
+ See [Core vs Edges](./docs/core-vs-edges.md) for the full breakdown.
36
38
 
37
39
  ---
38
40
 
39
41
  ## Questions?
40
42
 
41
- If you're unsure whether your use case requires a license, reach out to licensing@artnames.io. We're happy to help.
43
+ Contact: **contact@artnames.io**
package/LICENSE.md CHANGED
@@ -1,44 +1,9 @@
1
- NexArt Code Mode SDK — License
2
-
3
- Version: 1.6.0
4
- Status: DRAFT — Enforcement Not Active
5
-
6
-
7
-
8
- License Status
9
-
10
- The NexArt Code Mode SDK is currently released under the MIT License.
11
-
12
- At this time, all usage — including commercial usage — is permitted under the MIT License.
13
-
14
- This document also serves as advance notice of a future commercial licensing model that may apply to certain uses of the NexArt Protocol.
15
-
16
-
17
-
18
- Future Commercial Licensing (Not Active)
19
-
20
- NexArt intends to introduce a separate commercial license for specific categories of usage in a future release.
21
-
22
- Planned commercial usage categories may include (non-exhaustive):
23
- • Minting NFTs for sale
24
- • Revenue-generating applications
25
- • Products or services that charge fees
26
- • Enterprise or business deployments
27
-
28
- Enforcement is NOT active.
29
-
30
- No license keys, validation, usage tracking, or commercial restrictions are currently implemented.
31
-
32
- Until enforcement is introduced in a future version, all usage remains governed solely by the MIT License below.
33
-
34
-
35
-
36
- MIT License
1
+ # MIT License
37
2
 
38
3
  Copyright (c) 2024–2026 NexArt
39
4
 
40
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
41
- of this software and associated documentation files (the Software), to deal
6
+ of this software and associated documentation files (the "Software"), to deal
42
7
  in the Software without restriction, including without limitation the rights
43
8
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
44
9
  copies of the Software, and to permit persons to whom the Software is
@@ -47,7 +12,7 @@ furnished to do so, subject to the following conditions:
47
12
  The above copyright notice and this permission notice shall be included in all
48
13
  copies or substantial portions of the Software.
49
14
 
50
- THE SOFTWARE IS PROVIDED AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
51
16
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
52
17
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
53
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
@@ -55,8 +20,12 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
55
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
56
21
  SOFTWARE.
57
22
 
58
-
23
+ ---
24
+
25
+ ## Summary
26
+
27
+ This SDK is **MIT licensed** — free for all use, including commercial.
59
28
 
60
- Contact
29
+ NexArt monetizes optional hosted services (attestation, verification, compliance), not the SDK.
61
30
 
62
- For future commercial licensing inquiries: arrotu@artnames.io
31
+ See [Core vs Edges](./docs/core-vs-edges.md) for details.
package/README.md CHANGED
@@ -1,11 +1,38 @@
1
1
  # @nexart/codemode-sdk
2
2
 
3
- **Version: 1.8.1 (Protocol v1.2.0)**
3
+ **Version: 1.8.3 (Protocol v1.2.0)**
4
4
 
5
5
  A deterministic execution runtime for reproducible, verifiable computation.
6
6
 
7
7
  ---
8
8
 
9
+ ## Which API Should I Use?
10
+
11
+ **Decision table for choosing the right entrypoint:**
12
+
13
+ | Your Goal | Use This | Import Path |
14
+ |-----------|----------|-------------|
15
+ | Deterministic random/noise in any environment | **`createRuntime()`** ✅ DEFAULT | `@nexart/codemode-sdk` |
16
+ | AI agent integration | **`createRuntime()`** ✅ DEFAULT | `@nexart/codemode-sdk` |
17
+ | Browser/React/Vite app | **`createRuntime()`** ✅ DEFAULT | `@nexart/codemode-sdk` |
18
+ | Server-side image rendering | `executeCodeMode()` | `@nexart/codemode-sdk/node` |
19
+ | Full p5.js-style canvas execution | `executeCodeMode()` | `@nexart/codemode-sdk/node` |
20
+
21
+ **`createRuntime()`** is the **default and recommended** API:
22
+ - ✅ Works in browser and Node.js
23
+ - ✅ No canvas dependency
24
+ - ✅ Agent-first design
25
+ - ✅ Strict mode enforcement
26
+ - ✅ Lightweight
27
+
28
+ **`executeCodeMode()`** is the **legacy / Node-only** API:
29
+ - Requires Node.js with `canvas` package
30
+ - Full p5.js-style execution environment
31
+ - Returns rendered PNG/MP4
32
+ - Use only when you need actual image/video output
33
+
34
+ ---
35
+
9
36
  ## What This SDK Does
10
37
 
11
38
  This SDK provides a **deterministic runtime layer** for executing code that must produce identical output given identical inputs — across environments, over time, and under verification.
@@ -42,7 +69,16 @@ For most applications, seeded randomness is unnecessary complexity.
42
69
 
43
70
  ## For AI Coding Agents (Replit / Lovable / Claude Code)
44
71
 
45
- **Use `createRuntime({ seed, strict: true })` for deterministic execution.**
72
+ **Always start with `createRuntime()` it is the default and recommended API.**
73
+
74
+ ### Quick Rules for AI Agents
75
+
76
+ 1. **Always use `createRuntime()`** — NOT `executeCodeMode()`
77
+ 2. **Never use `Math.random()` or `Date.now()`** — use `runtime.random()` instead
78
+ 3. **Always use `strict: true`** — unless you explicitly know why you aren't
79
+ 4. **See `examples/agent-quickstart.ts`** — copy-paste ready reference
80
+
81
+ ### Minimal Example
46
82
 
47
83
  ```typescript
48
84
  import { createRuntime } from "@nexart/codemode-sdk";
@@ -50,23 +86,47 @@ import { createRuntime } from "@nexart/codemode-sdk";
50
86
  const runtime = createRuntime({
51
87
  seed: "my-artwork-42",
52
88
  vars: [50, 75, 25],
53
- strict: true, // Throws on Math.random, Date.now, etc.
89
+ strict: true, // ALWAYS use strict: true — throws on non-deterministic APIs
54
90
  mode: "static"
55
91
  });
56
92
 
57
- // Deterministic APIs
93
+ // Deterministic APIs (use these, not Math.random!)
58
94
  const value = runtime.random(); // [0, 1)
59
95
  const intVal = runtime.randomInt(0, 10); // integer in range
60
- const n = runtime.noise(x, y); // Perlin noise
96
+ const n = runtime.noise(0.5, 0.5); // Perlin noise
97
+
98
+ // Execute with strict enforcement
99
+ const result = runtime.run(() => {
100
+ // Your deterministic code here
101
+ return runtime.random() * 100;
102
+ });
61
103
 
62
104
  // Verification
63
- console.log(runtime.digest()); // Stable hash
64
- console.log(runtime.getState()); // Canonical state snapshot
105
+ console.log(runtime.digest()); // Stable hash for verification
106
+ console.log(runtime.getState()); // Canonical state snapshot for replay
107
+ ```
108
+
109
+ ### Strict Mode Explained
110
+
111
+ Strict mode protects determinism by intercepting non-deterministic APIs during `runtime.run()`:
112
+
113
+ ```typescript
114
+ runtime.run(() => {
115
+ Math.random(); // Throws: NEXART_STRICT: Non-deterministic API used: Math.random. Use runtime.random() instead.
116
+ Date.now(); // Throws: NEXART_STRICT: Non-deterministic API used: Date.now. Pass time as an input or use deterministic counters.
117
+ });
65
118
  ```
66
119
 
67
- **Strict mode throws actionable errors:**
68
- - `NEXART_STRICT: Non-deterministic API used: Math.random. Use runtime.random() instead.`
69
- - `NEXART_STRICT: Non-deterministic API used: Date.now. Pass time as an input or use deterministic counters.`
120
+ **Why strict mode exists:**
121
+ - Determinism is the core guarantee same inputs must always produce same outputs
122
+ - AI agents often default to `Math.random()` before reading documentation
123
+ - Strict mode catches these mistakes immediately with actionable error messages
124
+ - Interception is **scoped to `runtime.run()`** — it does NOT globally mutate your application
125
+ - Globals are restored after execution
126
+
127
+ **When to use `strict: false`:**
128
+ - Almost never. Only if you're intentionally mixing deterministic and non-deterministic code.
129
+ - If you're not sure, use `strict: true`.
70
130
 
71
131
  ---
72
132
 
@@ -176,7 +236,7 @@ These are examples — the SDK is designed for any system requiring deterministi
176
236
  |----------|-------|
177
237
  | Protocol Version | v1.2.0 |
178
238
  | Status | **STABLE** |
179
- | SDK Version | 1.8.1 |
239
+ | SDK Version | 1.8.3 |
180
240
 
181
241
  **Core protocol surface is frozen. Breaking changes require v2.0.0.**
182
242
 
@@ -377,6 +437,7 @@ The following are rejected with `[Code Mode Protocol Error]`:
377
437
  ## Examples
378
438
 
379
439
  ```bash
440
+ npm run example:agent # Agent quickstart (RECOMMENDED for AI agents)
380
441
  npm run example:basic # Basic usage
381
442
  npm run example:verify # Determinism verification
382
443
  ```
@@ -389,6 +450,16 @@ See [CHANGELOG.md](./CHANGELOG.md) for version history.
389
450
 
390
451
  ---
391
452
 
453
+ ## License
454
+
455
+ **MIT License** — Free for all use, including commercial.
456
+
457
+ NexArt monetizes optional hosted services (attestation, verification, compliance), not the SDK.
458
+
459
+ See [Core vs Edges](./docs/core-vs-edges.md) for details on what's free vs paid.
460
+
461
+ ---
462
+
392
463
  ## About
393
464
 
394
465
  This SDK is a reference implementation of a deterministic execution protocol designed for replay, verification, and long-term stability.
@@ -1,12 +1,13 @@
1
1
  /**
2
- * @nexart/codemode-sdk v1.4.0 — Core Exports
2
+ * @nexart/codemode-sdk — Core Exports
3
+ * See version.ts for SDK version (single source of truth)
3
4
  *
4
5
  * Canonical execution engine for NexArt Code Mode.
5
6
  * This is the single source of truth for Code Mode semantics.
6
7
  *
7
- * Protocol: v1.2.0 (Phase 3)
8
8
  * Enforcement: HARD
9
9
  */
10
+ import { PROTOCOL_VERSION, PROTOCOL_PHASE } from './version';
10
11
  export { executeCodeMode, validateCodeModeSource, } from './execute';
11
12
  export { type RenderMode, type TimeVariables, type ProtocolMetadata, type EngineConfig, type RenderResult, type RunOptions, type ProgressInfo, type Engine, type ExecuteCodeModeInput, type ExecuteCodeModeResult, PROTOCOL_IDENTITY, DEFAULT_VARS, DEFAULT_CONFIG, } from './types';
12
13
  export { createP5Runtime, injectTimeVariables, createProtocolVAR, VAR_COUNT, VAR_MIN, VAR_MAX, CODE_MODE_PROTOCOL_VERSION, CODE_MODE_PROTOCOL_PHASE, CODE_MODE_ENFORCEMENT, type P5Runtime, type P5RuntimeConfig, } from './p5-runtime';
@@ -14,8 +15,9 @@ export { runStaticMode, } from './static-engine';
14
15
  export { runLoopMode, cancelLoopMode, } from './loop-engine';
15
16
  export { createEngine, } from './engine';
16
17
  /**
17
- * SDK Identity
18
+ * SDK Identity — imported from version.ts (single source of truth)
18
19
  */
19
- export declare const SDK_VERSION = "1.1.1";
20
+ export declare const SDK_VERSION = "1.8.3";
20
21
  export declare const SDK_NAME = "@nexart/codemode-sdk";
22
+ export { PROTOCOL_VERSION, PROTOCOL_PHASE };
21
23
  //# sourceMappingURL=core-index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core-index.d.ts","sourceRoot":"","sources":["../../../core-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EACL,eAAe,EACf,sBAAsB,GACvB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,YAAY,EACZ,cAAc,GACf,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,SAAS,EACT,OAAO,EACP,OAAO,EACP,0BAA0B,EAC1B,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,SAAS,EACd,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,aAAa,GACd,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,WAAW,EACX,cAAc,GACf,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,YAAY,GACb,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,eAAO,MAAM,QAAQ,yBAAyB,CAAC"}
1
+ {"version":3,"file":"core-index.d.ts","sourceRoot":"","sources":["../../../core-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAA+B,gBAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG1F,OAAO,EACL,eAAe,EACf,sBAAsB,GACvB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,MAAM,EACX,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,YAAY,EACZ,cAAc,GACf,MAAM,SAAS,CAAC;AAGjB,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,SAAS,EACT,OAAO,EACP,OAAO,EACP,0BAA0B,EAC1B,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,SAAS,EACd,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,aAAa,GACd,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,WAAW,EACX,cAAc,GACf,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,YAAY,GACb,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,eAAO,MAAM,WAAW,UAAe,CAAC;AACxC,eAAO,MAAM,QAAQ,yBAAyB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC"}
@@ -1,12 +1,13 @@
1
1
  /**
2
- * @nexart/codemode-sdk v1.4.0 — Core Exports
2
+ * @nexart/codemode-sdk — Core Exports
3
+ * See version.ts for SDK version (single source of truth)
3
4
  *
4
5
  * Canonical execution engine for NexArt Code Mode.
5
6
  * This is the single source of truth for Code Mode semantics.
6
7
  *
7
- * Protocol: v1.2.0 (Phase 3)
8
8
  * Enforcement: HARD
9
9
  */
10
+ import { SDK_VERSION as _SDK_VERSION, PROTOCOL_VERSION, PROTOCOL_PHASE } from './version';
10
11
  // Core execution
11
12
  export { executeCodeMode, validateCodeModeSource, } from './execute';
12
13
  // Protocol types
@@ -20,7 +21,8 @@ export { runLoopMode, cancelLoopMode, } from './loop-engine';
20
21
  // Engine utilities
21
22
  export { createEngine, } from './engine';
22
23
  /**
23
- * SDK Identity
24
+ * SDK Identity — imported from version.ts (single source of truth)
24
25
  */
25
- export const SDK_VERSION = '1.1.1';
26
+ export const SDK_VERSION = _SDK_VERSION;
26
27
  export const SDK_NAME = '@nexart/codemode-sdk';
28
+ export { PROTOCOL_VERSION, PROTOCOL_PHASE };
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * @nexart/codemode-sdk/browser — Browser-Safe Entry Point
3
+ * See ../version.ts for SDK version (single source of truth)
3
4
  *
4
5
  * ╔══════════════════════════════════════════════════════════════════════════╗
5
- * ║ BROWSER-SAFE SDK ENTRY POINT (v1.8.0)
6
+ * ║ BROWSER-SAFE SDK ENTRY POINT
6
7
  * ║ ║
7
8
  * ║ This entrypoint exports ONLY browser-safe modules. ║
8
9
  * ║ It does NOT include static-engine or any Node.js dependencies. ║
@@ -25,7 +26,9 @@ export { createEngine, } from '../engine';
25
26
  export { registerBuilderManifest, } from '../builder-manifest';
26
27
  export { createRuntime, NexArtRuntime, RUNTIME_VERSION, } from '../runtime';
27
28
  export type { RuntimeOptions, RuntimeState, NexArtRuntime as NexArtRuntimeType, } from '../runtime';
28
- export declare const SDK_VERSION = "1.8.0";
29
+ export { renderSoundArtViaCodeMode, canRenderViaCodeMode, getCodeModeAvailableStyles, } from '../soundart-engine';
30
+ export type { TweakParams, SoundArtEngineConfig, SoundArtRenderOptions, SoundArtRenderResult, SoundArtMetadata, SoundSnapshot, SoundFeatures, SoundArtSketchName, } from '../soundart-engine';
31
+ export declare const SDK_VERSION = "1.8.3";
29
32
  export declare const SDK_NAME = "@nexart/codemode-sdk";
30
33
  export declare const SDK_ENTRY = "browser";
31
34
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../../entry/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAOH,YAAY,EACV,UAAU,EACV,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,cAAc,GACf,MAAM,UAAU,CAAC;AAKlB,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,OAAO,EACP,OAAO,EACP,0BAA0B,EAC1B,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,SAAS,EACT,eAAe,GAChB,MAAM,eAAe,CAAC;AAKvB,OAAO,EACL,WAAW,EACX,cAAc,GACf,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EACL,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAKpB,OAAO,EACL,YAAY,GACb,MAAM,WAAW,CAAC;AAKnB,OAAO,EACL,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAK7B,OAAO,EACL,aAAa,EACb,aAAa,EACb,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,cAAc,EACd,YAAY,EACZ,aAAa,IAAI,iBAAiB,GACnC,MAAM,YAAY,CAAC;AAKpB,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,WAAW,EACX,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAK5B,eAAO,MAAM,WAAW,UAAe,CAAC;AACxC,eAAO,MAAM,QAAQ,yBAAyB,CAAC;AAC/C,eAAO,MAAM,SAAS,YAAY,CAAC;AAEnC;;;;;;;;;;;GAWG"}
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * @nexart/codemode-sdk/browser — Browser-Safe Entry Point
3
+ * See ../version.ts for SDK version (single source of truth)
3
4
  *
4
5
  * ╔══════════════════════════════════════════════════════════════════════════╗
5
- * ║ BROWSER-SAFE SDK ENTRY POINT (v1.8.0)
6
+ * ║ BROWSER-SAFE SDK ENTRY POINT
6
7
  * ║ ║
7
8
  * ║ This entrypoint exports ONLY browser-safe modules. ║
8
9
  * ║ It does NOT include static-engine or any Node.js dependencies. ║
@@ -14,6 +15,7 @@
14
15
  * ║ AI AGENTS: Start with createRuntime({ seed, strict: true }) ║
15
16
  * ╚══════════════════════════════════════════════════════════════════════════╝
16
17
  */
18
+ import { SDK_VERSION as _SDK_VERSION } from '../version';
17
19
  export { PROTOCOL_IDENTITY, DEFAULT_VARS, DEFAULT_CONFIG, } from '../types';
18
20
  // ═══════════════════════════════════════════════════════════════════════════
19
21
  // EXECUTION SANDBOX — Browser-safe (no Node dependencies)
@@ -40,13 +42,17 @@ export { createEngine, } from '../engine';
40
42
  // ═══════════════════════════════════════════════════════════════════════════
41
43
  export { registerBuilderManifest, } from '../builder-manifest';
42
44
  // ═══════════════════════════════════════════════════════════════════════════
43
- // AGENT-FIRST RUNTIME — v1.8.0 (Browser-safe, no Node dependencies)
45
+ // AGENT-FIRST RUNTIME — Browser-safe, no Node dependencies
44
46
  // ═══════════════════════════════════════════════════════════════════════════
45
47
  export { createRuntime, NexArtRuntime, RUNTIME_VERSION, } from '../runtime';
46
48
  // ═══════════════════════════════════════════════════════════════════════════
47
- // SDK IDENTITY
49
+ // SOUNDART ENGINE — Browser-safe (canvas-based rendering)
48
50
  // ═══════════════════════════════════════════════════════════════════════════
49
- export const SDK_VERSION = '1.8.0';
51
+ export { renderSoundArtViaCodeMode, canRenderViaCodeMode, getCodeModeAvailableStyles, } from '../soundart-engine';
52
+ // ═══════════════════════════════════════════════════════════════════════════
53
+ // SDK IDENTITY — imported from version.ts (single source of truth)
54
+ // ═══════════════════════════════════════════════════════════════════════════
55
+ export const SDK_VERSION = _SDK_VERSION;
50
56
  export const SDK_NAME = '@nexart/codemode-sdk';
51
57
  export const SDK_ENTRY = 'browser';
52
58
  /**
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * @nexart/codemode-sdk/node — Node.js Entry Point
3
+ * See ../version.ts for SDK version (single source of truth)
3
4
  *
4
5
  * ╔══════════════════════════════════════════════════════════════════════════╗
5
- * ║ NODE.JS SDK ENTRY POINT (v1.8.0)
6
+ * ║ NODE.JS SDK ENTRY POINT
6
7
  * ║ ║
7
8
  * ║ This entrypoint exports Node.js-specific modules that require: ║
8
9
  * ║ - canvas package (node-canvas) ║
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../entry/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,cAAc,WAAW,CAAC;AAK1B,OAAO,EACL,aAAa,GACd,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EACL,eAAe,GAChB,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAClD,eAAO,MAAM,SAAS,SAAS,CAAC"}
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * @nexart/codemode-sdk/node — Node.js Entry Point
3
+ * See ../version.ts for SDK version (single source of truth)
3
4
  *
4
5
  * ╔══════════════════════════════════════════════════════════════════════════╗
5
- * ║ NODE.JS SDK ENTRY POINT (v1.8.0)
6
+ * ║ NODE.JS SDK ENTRY POINT
6
7
  * ║ ║
7
8
  * ║ This entrypoint exports Node.js-specific modules that require: ║
8
9
  * ║ - canvas package (node-canvas) ║
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * NexArt Code Mode Runtime SDK - p5-like Runtime
3
+ * See version.ts for SDK/Protocol version (single source of truth)
3
4
  *
4
5
  * ╔══════════════════════════════════════════════════════════════════════════╗
5
- * ║ CODE MODE PROTOCOL v1.2.0 (Phase 3) STABLE
6
+ * ║ CODE MODE PROTOCOL STABLE (see version.ts for version)
6
7
  * ║ ║
7
8
  * ║ Status: HARD PROTOCOL ENFORCEMENT ║
8
9
  * ║ This is the stable, canonical execution surface. ║
@@ -30,7 +31,7 @@
30
31
  import type { TimeVariables } from './types';
31
32
  /**
32
33
  * Code Mode Protocol Version
33
- * This constant defines the locked protocol version.
34
+ * Imports from version.ts (single source of truth).
34
35
  * Changes to the execution surface require a version bump.
35
36
  */
36
37
  export declare const CODE_MODE_PROTOCOL_VERSION = "1.2.0";
@@ -1 +1 @@
1
- {"version":3,"file":"p5-runtime.d.ts","sourceRoot":"","sources":["../../../p5-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,UAAU,CAAC;AAClD,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,qBAAqB,EAAG,MAAe,CAAC;AAErD,MAAM,WAAW,SAAS;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAmED,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,KAAK,aAAa,GAAG,iBAAiB,CAAC;AAEvC,wBAAgB,eAAe,CAC7B,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,eAAe,GACvB,SAAS,CAs8BX;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI,CAM3E;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eAAO,MAAM,OAAO,IAAI,CAAC;AACzB,eAAO,MAAM,OAAO,MAAM,CAAC;AAE3B;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,CAmCpE;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAE3E"}
1
+ {"version":3,"file":"p5-runtime.d.ts","sourceRoot":"","sources":["../../../p5-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,UAAmB,CAAC;AAC3D,eAAO,MAAM,wBAAwB,IAAiB,CAAC;AACvD,eAAO,MAAM,qBAAqB,EAAG,MAAe,CAAC;AAErD,MAAM,WAAW,SAAS;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAmED,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,KAAK,aAAa,GAAG,iBAAiB,CAAC;AAEvC,wBAAgB,eAAe,CAC7B,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,eAAe,GACvB,SAAS,CAs8BX;AAED,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI,CAM3E;AAED;;;GAGG;AACH,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eAAO,MAAM,OAAO,IAAI,CAAC;AACzB,eAAO,MAAM,OAAO,MAAM,CAAC;AAE3B;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,CAmCpE;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAE3E"}
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * NexArt Code Mode Runtime SDK - p5-like Runtime
3
+ * See version.ts for SDK/Protocol version (single source of truth)
3
4
  *
4
5
  * ╔══════════════════════════════════════════════════════════════════════════╗
5
- * ║ CODE MODE PROTOCOL v1.2.0 (Phase 3) STABLE
6
+ * ║ CODE MODE PROTOCOL STABLE (see version.ts for version)
6
7
  * ║ ║
7
8
  * ║ Status: HARD PROTOCOL ENFORCEMENT ║
8
9
  * ║ This is the stable, canonical execution surface. ║
@@ -27,13 +28,14 @@
27
28
  * ║ ⚠️ Future changes require Phase 2+ ║
28
29
  * ╚══════════════════════════════════════════════════════════════════════════╝
29
30
  */
31
+ import { PROTOCOL_VERSION, PROTOCOL_PHASE } from './version';
30
32
  /**
31
33
  * Code Mode Protocol Version
32
- * This constant defines the locked protocol version.
34
+ * Imports from version.ts (single source of truth).
33
35
  * Changes to the execution surface require a version bump.
34
36
  */
35
- export const CODE_MODE_PROTOCOL_VERSION = '1.2.0';
36
- export const CODE_MODE_PROTOCOL_PHASE = 3;
37
+ export const CODE_MODE_PROTOCOL_VERSION = PROTOCOL_VERSION;
38
+ export const CODE_MODE_PROTOCOL_PHASE = PROTOCOL_PHASE;
37
39
  export const CODE_MODE_ENFORCEMENT = 'HARD';
38
40
  /**
39
41
  * Create a seeded random number generator (Mulberry32)
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * NexArt Code Mode SDK - Agent-First Runtime Authority Layer
3
- * Version: 1.8.0 (Protocol v1.2.0)
3
+ * See version.ts for SDK version (single source of truth)
4
4
  *
5
5
  * ╔══════════════════════════════════════════════════════════════════════════╗
6
6
  * ║ AGENT-FIRST RUNTIME — DETERMINISTIC EXECUTION AUTHORITY ║
@@ -18,7 +18,7 @@
18
18
  * ║ BROWSER-SAFE: No Node.js dependencies. Works in Vite/Next/React. ║
19
19
  * ╚══════════════════════════════════════════════════════════════════════════╝
20
20
  */
21
- export declare const RUNTIME_VERSION = "1.8.0";
21
+ export declare const RUNTIME_VERSION = "1.8.3";
22
22
  export interface RuntimeOptions {
23
23
  seed: string | number;
24
24
  vars?: number[];
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,eAAO,MAAM,eAAe,UAAc,CAAC;AAE3C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,IAAI,MAAM,CAAC;IACjB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5C,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9C,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjD,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IACvB,MAAM,IAAI,MAAM,CAAC;IACjB,QAAQ,IAAI,YAAY,CAAC;IACzB,OAAO,IAAI,MAAM,CAAC;IAClB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAqGD,wBAAgB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,aAAa,CAuHpE;AAED,eAAO,MAAM,aAAa;;;CAGzB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * NexArt Code Mode SDK - Agent-First Runtime Authority Layer
3
- * Version: 1.8.0 (Protocol v1.2.0)
3
+ * See version.ts for SDK version (single source of truth)
4
4
  *
5
5
  * ╔══════════════════════════════════════════════════════════════════════════╗
6
6
  * ║ AGENT-FIRST RUNTIME — DETERMINISTIC EXECUTION AUTHORITY ║
@@ -18,7 +18,8 @@
18
18
  * ║ BROWSER-SAFE: No Node.js dependencies. Works in Vite/Next/React. ║
19
19
  * ╚══════════════════════════════════════════════════════════════════════════╝
20
20
  */
21
- export const RUNTIME_VERSION = '1.8.0';
21
+ import { SDK_VERSION } from './version';
22
+ export const RUNTIME_VERSION = SDK_VERSION;
22
23
  function hashSeed(seed) {
23
24
  if (typeof seed === 'number') {
24
25
  return Math.floor(seed) >>> 0;