@nexart/codemode-sdk 1.6.0 → 1.7.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.
- package/CHANGELOG.md +41 -0
- package/README.md +91 -5
- package/dist/core-index.d.ts +1 -1
- package/dist/core-index.js +1 -1
- package/dist/entry/browser.d.ts +37 -0
- package/dist/entry/browser.d.ts.map +1 -0
- package/dist/entry/browser.js +55 -0
- package/dist/entry/node.d.ts +21 -0
- package/dist/entry/node.d.ts.map +1 -0
- package/dist/entry/node.js +32 -0
- package/dist/index.d.ts +14 -33
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +41 -33
- package/dist/sdk/codemode/builder-manifest.d.ts +79 -0
- package/dist/sdk/codemode/builder-manifest.d.ts.map +1 -0
- package/dist/sdk/codemode/builder-manifest.js +97 -0
- package/dist/sdk/codemode/core-index.d.ts +21 -0
- package/dist/sdk/codemode/core-index.d.ts.map +1 -0
- package/dist/sdk/codemode/core-index.js +26 -0
- package/dist/sdk/codemode/engine.d.ts +24 -0
- package/dist/sdk/codemode/engine.d.ts.map +1 -0
- package/dist/sdk/codemode/engine.js +67 -0
- package/dist/sdk/codemode/execute.d.ts +46 -0
- package/dist/sdk/codemode/execute.d.ts.map +1 -0
- package/dist/sdk/codemode/execute.js +283 -0
- package/dist/sdk/codemode/execution-sandbox.d.ts +107 -0
- package/dist/sdk/codemode/execution-sandbox.d.ts.map +1 -0
- package/dist/sdk/codemode/execution-sandbox.js +207 -0
- package/dist/sdk/codemode/index.d.ts +31 -0
- package/dist/sdk/codemode/index.d.ts.map +1 -0
- package/dist/sdk/codemode/index.js +63 -0
- package/dist/sdk/codemode/loop-engine.d.ts +22 -0
- package/dist/sdk/codemode/loop-engine.d.ts.map +1 -0
- package/dist/sdk/codemode/loop-engine.js +229 -0
- package/dist/sdk/codemode/noise-bridge.d.ts +44 -0
- package/dist/sdk/codemode/noise-bridge.d.ts.map +1 -0
- package/dist/sdk/codemode/noise-bridge.js +68 -0
- package/dist/sdk/codemode/noise-engine.d.ts +74 -0
- package/dist/sdk/codemode/noise-engine.d.ts.map +1 -0
- package/dist/sdk/codemode/noise-engine.js +132 -0
- package/dist/sdk/codemode/noise-sketches/fractalNoise.d.ts +11 -0
- package/dist/sdk/codemode/noise-sketches/fractalNoise.d.ts.map +1 -0
- package/dist/sdk/codemode/noise-sketches/fractalNoise.js +121 -0
- package/dist/sdk/codemode/noise-sketches/index.d.ts +21 -0
- package/dist/sdk/codemode/noise-sketches/index.d.ts.map +1 -0
- package/dist/sdk/codemode/noise-sketches/index.js +28 -0
- package/dist/sdk/codemode/p5-runtime.d.ts +75 -0
- package/dist/sdk/codemode/p5-runtime.d.ts.map +1 -0
- package/dist/sdk/codemode/p5-runtime.js +1031 -0
- package/dist/sdk/codemode/sound-bridge.d.ts +89 -0
- package/dist/sdk/codemode/sound-bridge.d.ts.map +1 -0
- package/dist/sdk/codemode/sound-bridge.js +128 -0
- package/dist/sdk/codemode/soundart-engine.d.ts +87 -0
- package/dist/sdk/codemode/soundart-engine.d.ts.map +1 -0
- package/dist/sdk/codemode/soundart-engine.js +173 -0
- package/dist/sdk/codemode/soundart-sketches/chladniBloom.d.ts +3 -0
- package/dist/sdk/codemode/soundart-sketches/chladniBloom.d.ts.map +1 -0
- package/dist/sdk/codemode/soundart-sketches/chladniBloom.js +53 -0
- package/dist/sdk/codemode/soundart-sketches/dualVortex.d.ts +3 -0
- package/dist/sdk/codemode/soundart-sketches/dualVortex.d.ts.map +1 -0
- package/dist/sdk/codemode/soundart-sketches/dualVortex.js +67 -0
- package/dist/sdk/codemode/soundart-sketches/geometryIllusion.d.ts +3 -0
- package/dist/sdk/codemode/soundart-sketches/geometryIllusion.d.ts.map +1 -0
- package/dist/sdk/codemode/soundart-sketches/geometryIllusion.js +89 -0
- package/dist/sdk/codemode/soundart-sketches/index.d.ts +39 -0
- package/dist/sdk/codemode/soundart-sketches/index.d.ts.map +1 -0
- package/dist/sdk/codemode/soundart-sketches/index.js +72 -0
- package/dist/sdk/codemode/soundart-sketches/isoflow.d.ts +3 -0
- package/dist/sdk/codemode/soundart-sketches/isoflow.d.ts.map +1 -0
- package/dist/sdk/codemode/soundart-sketches/isoflow.js +60 -0
- package/dist/sdk/codemode/soundart-sketches/loomWeave.d.ts +3 -0
- package/dist/sdk/codemode/soundart-sketches/loomWeave.d.ts.map +1 -0
- package/dist/sdk/codemode/soundart-sketches/loomWeave.js +59 -0
- package/dist/sdk/codemode/soundart-sketches/noiseTerraces.d.ts +3 -0
- package/dist/sdk/codemode/soundart-sketches/noiseTerraces.d.ts.map +1 -0
- package/dist/sdk/codemode/soundart-sketches/noiseTerraces.js +53 -0
- package/dist/sdk/codemode/soundart-sketches/orb.d.ts +3 -0
- package/dist/sdk/codemode/soundart-sketches/orb.d.ts.map +1 -0
- package/dist/sdk/codemode/soundart-sketches/orb.js +50 -0
- package/dist/sdk/codemode/soundart-sketches/pixelGlyphs.d.ts +3 -0
- package/dist/sdk/codemode/soundart-sketches/pixelGlyphs.d.ts.map +1 -0
- package/dist/sdk/codemode/soundart-sketches/pixelGlyphs.js +72 -0
- package/dist/sdk/codemode/soundart-sketches/prismFlowFields.d.ts +3 -0
- package/dist/sdk/codemode/soundart-sketches/prismFlowFields.d.ts.map +1 -0
- package/dist/sdk/codemode/soundart-sketches/prismFlowFields.js +51 -0
- package/dist/sdk/codemode/soundart-sketches/radialBurst.d.ts +3 -0
- package/dist/sdk/codemode/soundart-sketches/radialBurst.d.ts.map +1 -0
- package/dist/sdk/codemode/soundart-sketches/radialBurst.js +60 -0
- package/dist/sdk/codemode/soundart-sketches/resonantSoundBodies.d.ts +3 -0
- package/dist/sdk/codemode/soundart-sketches/resonantSoundBodies.d.ts.map +1 -0
- package/dist/sdk/codemode/soundart-sketches/resonantSoundBodies.js +89 -0
- package/dist/sdk/codemode/soundart-sketches/rings.d.ts +11 -0
- package/dist/sdk/codemode/soundart-sketches/rings.d.ts.map +1 -0
- package/dist/sdk/codemode/soundart-sketches/rings.js +89 -0
- package/dist/sdk/codemode/soundart-sketches/squares.d.ts +3 -0
- package/dist/sdk/codemode/soundart-sketches/squares.d.ts.map +1 -0
- package/dist/sdk/codemode/soundart-sketches/squares.js +52 -0
- package/dist/sdk/codemode/soundart-sketches/waveStripes.d.ts +3 -0
- package/dist/sdk/codemode/soundart-sketches/waveStripes.d.ts.map +1 -0
- package/dist/sdk/codemode/soundart-sketches/waveStripes.js +44 -0
- package/dist/sdk/codemode/static-engine.d.ts +20 -0
- package/dist/sdk/codemode/static-engine.d.ts.map +1 -0
- package/dist/sdk/codemode/static-engine.js +144 -0
- package/dist/sdk/codemode/types.d.ts +191 -0
- package/dist/sdk/codemode/types.d.ts.map +1 -0
- package/dist/sdk/codemode/types.js +32 -0
- package/dist/shared/noiseSnapshot.d.ts +59 -0
- package/dist/shared/noiseSnapshot.d.ts.map +1 -0
- package/dist/shared/noiseSnapshot.js +72 -0
- package/dist/shared/soundSnapshot.d.ts +94 -0
- package/dist/shared/soundSnapshot.d.ts.map +1 -0
- package/dist/shared/soundSnapshot.js +128 -0
- package/dist/static-engine.d.ts.map +1 -1
- package/dist/static-engine.js +24 -11
- package/package.json +28 -4
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,47 @@ All notable changes to @nexart/codemode-sdk will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## [1.7.0] — 2026-01-21
|
|
8
|
+
|
|
9
|
+
### Added — Browser-Safe Entrypoint + Conditional Exports
|
|
10
|
+
|
|
11
|
+
**Packaging/Exports Update — No Breaking Changes**
|
|
12
|
+
|
|
13
|
+
This release makes the SDK reliably usable in browser environments (Vite/React) without any Node.js dependency leakage.
|
|
14
|
+
|
|
15
|
+
#### New Entry Points
|
|
16
|
+
- **`@nexart/codemode-sdk/browser`** — Browser-safe modules only
|
|
17
|
+
- All types, P5 runtime, loop engine, execution sandbox, validation, builder manifest
|
|
18
|
+
- Does NOT include static-engine or executeCodeMode (which require Node.js canvas)
|
|
19
|
+
- **`@nexart/codemode-sdk/node`** — Full SDK for Node.js
|
|
20
|
+
- Everything from browser entry plus static-engine and executeCodeMode
|
|
21
|
+
- Requires `canvas` package for static rendering
|
|
22
|
+
|
|
23
|
+
#### Package.json Conditional Exports
|
|
24
|
+
- Default import (`.`) uses conditional exports:
|
|
25
|
+
- Browser bundlers (Vite, webpack) → browser entry
|
|
26
|
+
- Node.js → node entry
|
|
27
|
+
- Explicit subpaths for direct control: `./browser` and `./node`
|
|
28
|
+
|
|
29
|
+
#### Why This Matters
|
|
30
|
+
- AI agents and bundlers will no longer accidentally import Node.js modules
|
|
31
|
+
- Vite/React apps can safely import without "createRequire is not defined" errors
|
|
32
|
+
- Server-side code gets full functionality including static image rendering
|
|
33
|
+
|
|
34
|
+
#### Files Added
|
|
35
|
+
- `entry/browser.ts` — Browser-safe entry point
|
|
36
|
+
- `entry/node.ts` — Node.js entry point (re-exports browser + adds static-engine)
|
|
37
|
+
|
|
38
|
+
### Unchanged
|
|
39
|
+
|
|
40
|
+
- No changes to protocol behavior or determinism
|
|
41
|
+
- No changes to protocol version (remains v1.2.0)
|
|
42
|
+
- No changes to API surface (all functions work the same)
|
|
43
|
+
- Full backward compatibility with v1.6.x
|
|
44
|
+
- Existing sketches run unchanged
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
7
48
|
## [1.6.0] — 2026-01-12
|
|
8
49
|
|
|
9
50
|
### Added — Licensing & Builder Identity Scaffolding
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# NexArt Code Mode Runtime SDK
|
|
2
2
|
|
|
3
|
-
**Version: 1.
|
|
3
|
+
**Version: 1.7.0 (Protocol v1.2.0)**
|
|
4
4
|
|
|
5
5
|
╔══════════════════════════════════════════════════════════════════════════════╗
|
|
6
6
|
║ @nexart/codemode-sdk — Canonical Execution Surface ║
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
║ ║
|
|
10
10
|
║ Protocol: nexart ║
|
|
11
11
|
║ Engine: codemode ║
|
|
12
|
-
║ SDK Version: 1.
|
|
12
|
+
║ SDK Version: 1.7.0 ║
|
|
13
13
|
║ Protocol Version: 1.2.0 ║
|
|
14
14
|
║ Phase: 3 ║
|
|
15
15
|
║ Enforcement: HARD ║
|
|
@@ -62,6 +62,32 @@ The answer is: "Whatever @nexart/codemode-sdk does — that is the protocol."
|
|
|
62
62
|
|
|
63
63
|
---
|
|
64
64
|
|
|
65
|
+
## What's New in v1.7.0
|
|
66
|
+
|
|
67
|
+
**Browser-Safe Entrypoint + Conditional Exports**
|
|
68
|
+
|
|
69
|
+
This release makes the SDK reliably usable in browser environments (Vite/React) without any Node.js dependency leakage.
|
|
70
|
+
|
|
71
|
+
### New Entry Points
|
|
72
|
+
- `@nexart/codemode-sdk/browser` — Browser-safe modules only (no Node.js dependencies)
|
|
73
|
+
- `@nexart/codemode-sdk/node` — Full SDK including static-engine (requires `canvas` package)
|
|
74
|
+
|
|
75
|
+
### Package.json Conditional Exports
|
|
76
|
+
- Default import (`.`) now uses conditional exports: browser gets browser entry, Node gets Node entry
|
|
77
|
+
- Explicit subpaths: `./browser` and `./node` for direct control
|
|
78
|
+
|
|
79
|
+
### Why This Matters
|
|
80
|
+
- AI agents and bundlers will no longer accidentally import Node.js modules in browser builds
|
|
81
|
+
- Vite/React apps can safely import the SDK without "createRequire is not defined" errors
|
|
82
|
+
- Server-side code gets full functionality including static image rendering
|
|
83
|
+
|
|
84
|
+
### No Breaking Changes
|
|
85
|
+
- Protocol behavior and determinism unchanged
|
|
86
|
+
- API surface unchanged
|
|
87
|
+
- Existing Node.js code continues to work
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
65
91
|
## What's New in v1.6.0
|
|
66
92
|
|
|
67
93
|
**Licensing & Builder Identity Scaffolding (Metadata Only)**
|
|
@@ -214,6 +240,61 @@ cp -r sdk/codemode your-project/lib/codemode
|
|
|
214
240
|
|
|
215
241
|
---
|
|
216
242
|
|
|
243
|
+
## Browser Usage (v1.7.0+)
|
|
244
|
+
|
|
245
|
+
For Vite, React, Next.js, or any browser environment, import from the browser-safe entry:
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
import {
|
|
249
|
+
runLoopMode,
|
|
250
|
+
cancelLoopMode,
|
|
251
|
+
createP5Runtime,
|
|
252
|
+
validateCodeModeSource,
|
|
253
|
+
PROTOCOL_IDENTITY,
|
|
254
|
+
DEFAULT_CONFIG,
|
|
255
|
+
} from '@nexart/codemode-sdk/browser';
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**What's included in `@nexart/codemode-sdk/browser`:**
|
|
259
|
+
- All types (RenderMode, EngineConfig, ExecuteCodeModeInput, etc.)
|
|
260
|
+
- P5 runtime (createP5Runtime, injectTimeVariables, injectProtocolVariables)
|
|
261
|
+
- Loop engine (runLoopMode, cancelLoopMode)
|
|
262
|
+
- Execution sandbox (FORBIDDEN_APIS, createSafeMath)
|
|
263
|
+
- Validation (validateCodeModeSource)
|
|
264
|
+
- Builder manifest (registerBuilderManifest)
|
|
265
|
+
|
|
266
|
+
**What's NOT included (Node.js only):**
|
|
267
|
+
- `executeCodeMode` — Uses static-engine which requires Node.js canvas
|
|
268
|
+
- `runStaticMode` — Requires Node.js canvas package
|
|
269
|
+
|
|
270
|
+
For static rendering in browser apps, use your server-side API endpoint.
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## Node.js Usage (v1.7.0+)
|
|
275
|
+
|
|
276
|
+
For server-side rendering, oracles, or CLI tools, import from the Node entry:
|
|
277
|
+
|
|
278
|
+
```typescript
|
|
279
|
+
import {
|
|
280
|
+
executeCodeMode,
|
|
281
|
+
runStaticMode,
|
|
282
|
+
runLoopMode,
|
|
283
|
+
validateCodeModeSource,
|
|
284
|
+
} from '@nexart/codemode-sdk/node';
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**What's included in `@nexart/codemode-sdk/node`:**
|
|
288
|
+
- Everything from the browser entry
|
|
289
|
+
- `executeCodeMode` — Canonical execution API
|
|
290
|
+
- `runStaticMode` — Node.js static rendering (requires `canvas` package)
|
|
291
|
+
|
|
292
|
+
**Requirements:**
|
|
293
|
+
- Node.js 18+
|
|
294
|
+
- `canvas` package installed for static mode (`npm install canvas`)
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
217
298
|
## Canonical API
|
|
218
299
|
|
|
219
300
|
### `executeCodeMode(input: ExecuteCodeModeInput): Promise<ExecuteCodeModeResult>`
|
|
@@ -602,13 +683,18 @@ Ensure your server has this endpoint available (NexArt provides this).
|
|
|
602
683
|
|
|
603
684
|
```
|
|
604
685
|
sdk/codemode/
|
|
605
|
-
├──
|
|
686
|
+
├── entry/
|
|
687
|
+
│ ├── browser.ts # Browser-safe entry point (v1.7.0)
|
|
688
|
+
│ └── node.ts # Node.js entry point (v1.7.0)
|
|
689
|
+
├── index.ts # Main export (app integration layer)
|
|
690
|
+
├── core-index.ts # Core runtime exports
|
|
606
691
|
├── execute.ts # executeCodeMode canonical entry point
|
|
607
692
|
├── engine.ts # createEngine entry point (legacy)
|
|
608
693
|
├── types.ts # TypeScript types
|
|
609
|
-
├── static-engine.ts # Static mode implementation
|
|
610
|
-
├── loop-engine.ts # Loop mode implementation
|
|
694
|
+
├── static-engine.ts # Static mode implementation (Node.js)
|
|
695
|
+
├── loop-engine.ts # Loop mode implementation (browser)
|
|
611
696
|
├── p5-runtime.ts # p5.js-like runtime
|
|
697
|
+
├── execution-sandbox.ts # Determinism enforcement
|
|
612
698
|
├── builder-manifest.ts # Builder manifest (write-only)
|
|
613
699
|
├── CHANGELOG.md # Version history
|
|
614
700
|
└── README.md # This file
|
package/dist/core-index.d.ts
CHANGED
|
@@ -16,6 +16,6 @@ export { createEngine, } from './engine';
|
|
|
16
16
|
/**
|
|
17
17
|
* SDK Identity
|
|
18
18
|
*/
|
|
19
|
-
export declare const SDK_VERSION = "1.
|
|
19
|
+
export declare const SDK_VERSION = "1.7.0";
|
|
20
20
|
export declare const SDK_NAME = "@nexart/codemode-sdk";
|
|
21
21
|
//# sourceMappingURL=core-index.d.ts.map
|
package/dist/core-index.js
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nexart/codemode-sdk/browser — Browser-Safe Entry Point
|
|
3
|
+
*
|
|
4
|
+
* ╔══════════════════════════════════════════════════════════════════════════╗
|
|
5
|
+
* ║ BROWSER-SAFE SDK ENTRY POINT (v1.7.0) ║
|
|
6
|
+
* ║ ║
|
|
7
|
+
* ║ This entrypoint exports ONLY browser-safe modules. ║
|
|
8
|
+
* ║ It does NOT include static-engine or any Node.js dependencies. ║
|
|
9
|
+
* ║ ║
|
|
10
|
+
* ║ Use this for Vite, React, Next.js, or any browser environment. ║
|
|
11
|
+
* ║ ║
|
|
12
|
+
* ║ For Node.js/server: import from '@nexart/codemode-sdk/node' ║
|
|
13
|
+
* ╚══════════════════════════════════════════════════════════════════════════╝
|
|
14
|
+
*/
|
|
15
|
+
export type { RenderMode, RuntimeCanvas, EngineConfig, RenderResult, RunOptions, ProgressInfo, Engine, TimeVariables, ProtocolVariables, ProtocolMetadata, ExecuteCodeModeInput, ExecuteCodeModeResult, NexArtBuilderManifest, } from '../types';
|
|
16
|
+
export { PROTOCOL_IDENTITY, DEFAULT_VARS, DEFAULT_CONFIG, } from '../types';
|
|
17
|
+
export { FORBIDDEN_APIS, FORBIDDEN_API_NAMES, createSafeMath, buildSandboxContext, createSandboxedExecutor, executeSandboxed, } from '../execution-sandbox';
|
|
18
|
+
export { createP5Runtime, injectTimeVariables, injectProtocolVariables, createProtocolVAR, VAR_COUNT, VAR_MIN, VAR_MAX, CODE_MODE_PROTOCOL_VERSION, CODE_MODE_PROTOCOL_PHASE, CODE_MODE_ENFORCEMENT, } from '../p5-runtime';
|
|
19
|
+
export type { P5Runtime, P5RuntimeConfig, } from '../p5-runtime';
|
|
20
|
+
export { runLoopMode, cancelLoopMode, } from '../loop-engine';
|
|
21
|
+
export { validateCodeModeSource, } from '../execute';
|
|
22
|
+
export { createEngine, } from '../engine';
|
|
23
|
+
export { registerBuilderManifest, } from '../builder-manifest';
|
|
24
|
+
export declare const SDK_VERSION = "1.7.0";
|
|
25
|
+
export declare const SDK_NAME = "@nexart/codemode-sdk";
|
|
26
|
+
export declare const SDK_ENTRY = "browser";
|
|
27
|
+
/**
|
|
28
|
+
* Note: executeCodeMode is NOT exported from browser entry.
|
|
29
|
+
*
|
|
30
|
+
* In browser environments, static mode requires the canvas package which
|
|
31
|
+
* has Node.js dependencies. For browser apps:
|
|
32
|
+
*
|
|
33
|
+
* - Use runLoopMode() directly for animations
|
|
34
|
+
* - For static rendering, use the server-side endpoint
|
|
35
|
+
* - Or import from '@nexart/codemode-sdk/node' in SSR contexts
|
|
36
|
+
*/
|
|
37
|
+
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../entry/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,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,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,eAAO,MAAM,QAAQ,yBAAyB,CAAC;AAC/C,eAAO,MAAM,SAAS,YAAY,CAAC;AAEnC;;;;;;;;;GASG"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nexart/codemode-sdk/browser — Browser-Safe Entry Point
|
|
3
|
+
*
|
|
4
|
+
* ╔══════════════════════════════════════════════════════════════════════════╗
|
|
5
|
+
* ║ BROWSER-SAFE SDK ENTRY POINT (v1.7.0) ║
|
|
6
|
+
* ║ ║
|
|
7
|
+
* ║ This entrypoint exports ONLY browser-safe modules. ║
|
|
8
|
+
* ║ It does NOT include static-engine or any Node.js dependencies. ║
|
|
9
|
+
* ║ ║
|
|
10
|
+
* ║ Use this for Vite, React, Next.js, or any browser environment. ║
|
|
11
|
+
* ║ ║
|
|
12
|
+
* ║ For Node.js/server: import from '@nexart/codemode-sdk/node' ║
|
|
13
|
+
* ╚══════════════════════════════════════════════════════════════════════════╝
|
|
14
|
+
*/
|
|
15
|
+
export { PROTOCOL_IDENTITY, DEFAULT_VARS, DEFAULT_CONFIG, } from '../types';
|
|
16
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
17
|
+
// EXECUTION SANDBOX — Browser-safe (no Node dependencies)
|
|
18
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
19
|
+
export { FORBIDDEN_APIS, FORBIDDEN_API_NAMES, createSafeMath, buildSandboxContext, createSandboxedExecutor, executeSandboxed, } from '../execution-sandbox';
|
|
20
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
21
|
+
// P5 RUNTIME — Browser-safe (DOM-based canvas)
|
|
22
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
23
|
+
export { createP5Runtime, injectTimeVariables, injectProtocolVariables, createProtocolVAR, VAR_COUNT, VAR_MIN, VAR_MAX, CODE_MODE_PROTOCOL_VERSION, CODE_MODE_PROTOCOL_PHASE, CODE_MODE_ENFORCEMENT, } from '../p5-runtime';
|
|
24
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
25
|
+
// LOOP ENGINE — Browser-safe (uses document.createElement, fetch)
|
|
26
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
27
|
+
export { runLoopMode, cancelLoopMode, } from '../loop-engine';
|
|
28
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
29
|
+
// VALIDATION — Browser-safe (pure logic)
|
|
30
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
31
|
+
export { validateCodeModeSource, } from '../execute';
|
|
32
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
33
|
+
// ENGINE FACTORY — Browser-safe wrapper
|
|
34
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
35
|
+
export { createEngine, } from '../engine';
|
|
36
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
37
|
+
// BUILDER MANIFEST — Browser-safe (data-only, no side effects)
|
|
38
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
39
|
+
export { registerBuilderManifest, } from '../builder-manifest';
|
|
40
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
41
|
+
// SDK IDENTITY
|
|
42
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
43
|
+
export const SDK_VERSION = '1.7.0';
|
|
44
|
+
export const SDK_NAME = '@nexart/codemode-sdk';
|
|
45
|
+
export const SDK_ENTRY = 'browser';
|
|
46
|
+
/**
|
|
47
|
+
* Note: executeCodeMode is NOT exported from browser entry.
|
|
48
|
+
*
|
|
49
|
+
* In browser environments, static mode requires the canvas package which
|
|
50
|
+
* has Node.js dependencies. For browser apps:
|
|
51
|
+
*
|
|
52
|
+
* - Use runLoopMode() directly for animations
|
|
53
|
+
* - For static rendering, use the server-side endpoint
|
|
54
|
+
* - Or import from '@nexart/codemode-sdk/node' in SSR contexts
|
|
55
|
+
*/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nexart/codemode-sdk/node — Node.js Entry Point
|
|
3
|
+
*
|
|
4
|
+
* ╔══════════════════════════════════════════════════════════════════════════╗
|
|
5
|
+
* ║ NODE.JS SDK ENTRY POINT (v1.7.0) ║
|
|
6
|
+
* ║ ║
|
|
7
|
+
* ║ This entrypoint exports Node.js-specific modules that require: ║
|
|
8
|
+
* ║ - canvas package (node-canvas) ║
|
|
9
|
+
* ║ - Node.js built-ins (module, fs, path) ║
|
|
10
|
+
* ║ ║
|
|
11
|
+
* ║ Use this for server-side rendering, oracles, or CLI tools. ║
|
|
12
|
+
* ║ ║
|
|
13
|
+
* ║ For browser/Vite: import from '@nexart/codemode-sdk/browser' ║
|
|
14
|
+
* ╚══════════════════════════════════════════════════════════════════════════╝
|
|
15
|
+
*/
|
|
16
|
+
export * from './browser';
|
|
17
|
+
export { runStaticMode, } from '../static-engine';
|
|
18
|
+
export { executeCodeMode, } from '../execute';
|
|
19
|
+
export { SDK_VERSION, SDK_NAME } from './browser';
|
|
20
|
+
export declare const SDK_ENTRY = "node";
|
|
21
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../entry/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nexart/codemode-sdk/node — Node.js Entry Point
|
|
3
|
+
*
|
|
4
|
+
* ╔══════════════════════════════════════════════════════════════════════════╗
|
|
5
|
+
* ║ NODE.JS SDK ENTRY POINT (v1.7.0) ║
|
|
6
|
+
* ║ ║
|
|
7
|
+
* ║ This entrypoint exports Node.js-specific modules that require: ║
|
|
8
|
+
* ║ - canvas package (node-canvas) ║
|
|
9
|
+
* ║ - Node.js built-ins (module, fs, path) ║
|
|
10
|
+
* ║ ║
|
|
11
|
+
* ║ Use this for server-side rendering, oracles, or CLI tools. ║
|
|
12
|
+
* ║ ║
|
|
13
|
+
* ║ For browser/Vite: import from '@nexart/codemode-sdk/browser' ║
|
|
14
|
+
* ╚══════════════════════════════════════════════════════════════════════════╝
|
|
15
|
+
*/
|
|
16
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
17
|
+
// RE-EXPORT ALL BROWSER-SAFE MODULES
|
|
18
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
19
|
+
export * from './browser';
|
|
20
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
21
|
+
// STATIC ENGINE — Node.js only (requires canvas package)
|
|
22
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
23
|
+
export { runStaticMode, } from '../static-engine';
|
|
24
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
25
|
+
// CANONICAL EXECUTION — Node.js only (imports static-engine)
|
|
26
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
27
|
+
export { executeCodeMode, } from '../execute';
|
|
28
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
29
|
+
// SDK IDENTITY (override browser entry)
|
|
30
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
31
|
+
export { SDK_VERSION, SDK_NAME } from './browser';
|
|
32
|
+
export const SDK_ENTRY = 'node';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,50 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* NexArt Code Mode Runtime SDK
|
|
3
|
-
* Version: 1.1.0 (Protocol v1.0.0)
|
|
2
|
+
* NexArt Code Mode Runtime SDK - App Integration Layer
|
|
4
3
|
*
|
|
5
4
|
* ╔══════════════════════════════════════════════════════════════════════════╗
|
|
6
|
-
* ║
|
|
5
|
+
* ║ LOCAL SDK WRAPPER ║
|
|
7
6
|
* ║ ║
|
|
8
|
-
* ║ This
|
|
9
|
-
* ║
|
|
7
|
+
* ║ This file re-exports the core runtime from @nexart/codemode-sdk (npm) ║
|
|
8
|
+
* ║ and adds app-specific integrations (SoundArt, Noise, etc.) ║
|
|
10
9
|
* ║ ║
|
|
11
|
-
* ║
|
|
12
|
-
* ║
|
|
13
|
-
* ║ SDK Version: 1.1.0 ║
|
|
14
|
-
* ║ Protocol Version: 1.0.0 ║
|
|
15
|
-
* ║ Phase: 1 ║
|
|
16
|
-
* ║ Enforcement: HARD ║
|
|
10
|
+
* ║ For core Code Mode: import from '@nexart/codemode-sdk' ║
|
|
11
|
+
* ║ For app integrations: import from 'sdk/codemode' ║
|
|
17
12
|
* ╚══════════════════════════════════════════════════════════════════════════╝
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* import { executeCodeMode } from '@nexart/codemode-sdk';
|
|
22
|
-
*
|
|
23
|
-
* const result = await executeCodeMode({
|
|
24
|
-
* source: `function setup() { background(255); ellipse(width/2, height/2, 100); }`,
|
|
25
|
-
* width: 1950,
|
|
26
|
-
* height: 2400,
|
|
27
|
-
* seed: 12345,
|
|
28
|
-
* vars: [50, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
|
29
|
-
* mode: 'static'
|
|
30
|
-
* });
|
|
31
|
-
*
|
|
32
|
-
* console.log(result.metadata.protocolVersion); // '1.0.0'
|
|
33
|
-
* ```
|
|
34
13
|
*/
|
|
35
|
-
export { executeCodeMode, validateCodeModeSource } from '
|
|
36
|
-
export type { ExecuteCodeModeInput, ExecuteCodeModeResult, ProtocolMetadata, } from '
|
|
37
|
-
export {
|
|
14
|
+
export { executeCodeMode, validateCodeModeSource, DEFAULT_CONFIG, PROTOCOL_IDENTITY, } from '@nexart/codemode-sdk';
|
|
15
|
+
export type { ExecuteCodeModeInput, ExecuteCodeModeResult, ProtocolMetadata, RenderResult, TimeVariables, } from '@nexart/codemode-sdk';
|
|
16
|
+
export { createP5Runtime, injectTimeVariables, injectProtocolVariables, createProtocolVAR } from './p5-runtime';
|
|
17
|
+
export type { P5Runtime, P5RuntimeConfig } from './p5-runtime';
|
|
38
18
|
export { createEngine } from './engine';
|
|
39
|
-
export type { Engine, EngineConfig, RunOptions,
|
|
40
|
-
export { DEFAULT_CONFIG } from './types';
|
|
19
|
+
export type { Engine, EngineConfig, RunOptions, ProgressInfo, RenderMode, } from './types';
|
|
20
|
+
export { DEFAULT_CONFIG as LOCAL_DEFAULT_CONFIG } from './types';
|
|
41
21
|
export { renderSoundArtViaCodeMode, canRenderViaCodeMode, getCodeModeAvailableStyles, type SoundArtEngineConfig, type SoundArtRenderOptions, type SoundArtRenderResult, type SoundArtMetadata, } from './soundart-engine';
|
|
42
22
|
export { type SoundSnapshot, type SoundFeatures, createSoundSnapshot, createEmptySoundSnapshot, freezeSoundSnapshot, } from '../../shared/soundSnapshot';
|
|
43
23
|
export { injectSoundGlobals, createSoundGlobals, createEmptySoundGlobals, generateSoundPalette, inferGenreProfile, createSoundHelpers, type SoundGlobals, type GenreProfile, } from './sound-bridge';
|
|
44
24
|
export { getSoundArtSketch, getAvailableSoundArtSketches, isSoundArtSketchAvailable, type SoundArtSketchName, } from './soundart-sketches';
|
|
45
|
-
export { createP5Runtime, type P5Runtime, type P5RuntimeConfig } from './p5-runtime';
|
|
46
25
|
export { renderNoiseViaCodeMode, compileNoiseSystem, canRenderNoiseViaCodeMode, type NoiseEngineConfig, type NoiseRenderOptions, type NoiseRenderResult, type NoiseMetadata, } from './noise-engine';
|
|
47
26
|
export { type NoiseSnapshot, type NoiseParams, type NoiseBlendMode, createNoiseSnapshot, validateNoiseSnapshot, } from '../../shared/noiseSnapshot';
|
|
48
27
|
export { createNoiseGlobals, injectNoiseGlobals, type NoiseGlobals, } from './noise-bridge';
|
|
49
28
|
export { getNoiseSketch, getAvailableNoiseSketchNames, isValidNoiseSketch, type NoiseSketchName, } from './noise-sketches';
|
|
29
|
+
export { registerBuilderManifest } from './builder-manifest';
|
|
30
|
+
export type { NexArtBuilderManifest } from './types';
|
|
50
31
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,iBAAiB,GAClB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,aAAa,GACd,MAAM,sBAAsB,CAAC;AAO9B,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChH,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/D,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,YAAY,EACV,MAAM,EACN,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,cAAc,IAAI,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAGjE,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,0BAA0B,EAC1B,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,GACtB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,YAAY,EACjB,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,EACzB,KAAK,kBAAkB,GACxB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,aAAa,GACnB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,cAAc,EACd,4BAA4B,EAC5B,kBAAkB,EAClB,KAAK,eAAe,GACrB,MAAM,kBAAkB,CAAC;AAkB1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,YAAY,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,55 +1,63 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* NexArt Code Mode Runtime SDK
|
|
3
|
-
* Version: 1.1.0 (Protocol v1.0.0)
|
|
2
|
+
* NexArt Code Mode Runtime SDK - App Integration Layer
|
|
4
3
|
*
|
|
5
4
|
* ╔══════════════════════════════════════════════════════════════════════════╗
|
|
6
|
-
* ║
|
|
5
|
+
* ║ LOCAL SDK WRAPPER ║
|
|
7
6
|
* ║ ║
|
|
8
|
-
* ║ This
|
|
9
|
-
* ║
|
|
7
|
+
* ║ This file re-exports the core runtime from @nexart/codemode-sdk (npm) ║
|
|
8
|
+
* ║ and adds app-specific integrations (SoundArt, Noise, etc.) ║
|
|
10
9
|
* ║ ║
|
|
11
|
-
* ║
|
|
12
|
-
* ║
|
|
13
|
-
* ║ SDK Version: 1.1.0 ║
|
|
14
|
-
* ║ Protocol Version: 1.0.0 ║
|
|
15
|
-
* ║ Phase: 1 ║
|
|
16
|
-
* ║ Enforcement: HARD ║
|
|
10
|
+
* ║ For core Code Mode: import from '@nexart/codemode-sdk' ║
|
|
11
|
+
* ║ For app integrations: import from 'sdk/codemode' ║
|
|
17
12
|
* ╚══════════════════════════════════════════════════════════════════════════╝
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* import { executeCodeMode } from '@nexart/codemode-sdk';
|
|
22
|
-
*
|
|
23
|
-
* const result = await executeCodeMode({
|
|
24
|
-
* source: `function setup() { background(255); ellipse(width/2, height/2, 100); }`,
|
|
25
|
-
* width: 1950,
|
|
26
|
-
* height: 2400,
|
|
27
|
-
* seed: 12345,
|
|
28
|
-
* vars: [50, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
|
29
|
-
* mode: 'static'
|
|
30
|
-
* });
|
|
31
|
-
*
|
|
32
|
-
* console.log(result.metadata.protocolVersion); // '1.0.0'
|
|
33
|
-
* ```
|
|
34
13
|
*/
|
|
35
14
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
36
|
-
//
|
|
15
|
+
// CORE RUNTIME - Re-exported from @nexart/codemode-sdk (npm package)
|
|
16
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
17
|
+
export { executeCodeMode, validateCodeModeSource, DEFAULT_CONFIG, PROTOCOL_IDENTITY, } from '@nexart/codemode-sdk';
|
|
18
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
19
|
+
// LOCAL P5 RUNTIME - Used by app integrations (SoundArt, Noise)
|
|
20
|
+
// The npm package also exports createP5Runtime, but we keep local for
|
|
21
|
+
// app-specific extensions that need tighter integration
|
|
37
22
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
38
|
-
export {
|
|
39
|
-
export { PROTOCOL_IDENTITY } from './types';
|
|
23
|
+
export { createP5Runtime, injectTimeVariables, injectProtocolVariables, createProtocolVAR } from './p5-runtime';
|
|
40
24
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
41
|
-
// LEGACY ENGINE API (
|
|
25
|
+
// LEGACY ENGINE API (kept for backwards compatibility)
|
|
42
26
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
43
27
|
export { createEngine } from './engine';
|
|
44
|
-
export { DEFAULT_CONFIG } from './types';
|
|
28
|
+
export { DEFAULT_CONFIG as LOCAL_DEFAULT_CONFIG } from './types';
|
|
45
29
|
// SoundArt → Code Mode integration
|
|
46
30
|
export { renderSoundArtViaCodeMode, canRenderViaCodeMode, getCodeModeAvailableStyles, } from './soundart-engine';
|
|
47
31
|
export { createSoundSnapshot, createEmptySoundSnapshot, freezeSoundSnapshot, } from '../../shared/soundSnapshot';
|
|
48
32
|
export { injectSoundGlobals, createSoundGlobals, createEmptySoundGlobals, generateSoundPalette, inferGenreProfile, createSoundHelpers, } from './sound-bridge';
|
|
49
33
|
export { getSoundArtSketch, getAvailableSoundArtSketches, isSoundArtSketchAvailable, } from './soundart-sketches';
|
|
50
|
-
export { createP5Runtime } from './p5-runtime';
|
|
51
34
|
// Noise → Code Mode integration
|
|
52
35
|
export { renderNoiseViaCodeMode, compileNoiseSystem, canRenderNoiseViaCodeMode, } from './noise-engine';
|
|
53
36
|
export { createNoiseSnapshot, validateNoiseSnapshot, } from '../../shared/noiseSnapshot';
|
|
54
37
|
export { createNoiseGlobals, injectNoiseGlobals, } from './noise-bridge';
|
|
55
38
|
export { getNoiseSketch, getAvailableNoiseSketchNames, isValidNoiseSketch, } from './noise-sketches';
|
|
39
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
40
|
+
// BUILDER MANIFEST (v1.6.0) — Passive Attribution
|
|
41
|
+
//
|
|
42
|
+
// The Builder Manifest is a declaration of intent, not a capability.
|
|
43
|
+
// The SDK does not expose any API to read or inspect manifests.
|
|
44
|
+
//
|
|
45
|
+
// This is:
|
|
46
|
+
// - Declarative (write-only)
|
|
47
|
+
// - Optional (no errors if missing)
|
|
48
|
+
// - Non-enforced (no validation)
|
|
49
|
+
// - Non-rewarding (no incentives)
|
|
50
|
+
//
|
|
51
|
+
// There is NO SDK API to read manifests, NO validation, NO attribution
|
|
52
|
+
// logic, and NO tracking. Execution behavior is identical with or without
|
|
53
|
+
// a manifest registered.
|
|
54
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
55
|
+
export { registerBuilderManifest } from './builder-manifest';
|
|
56
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
57
|
+
// EXECUTION BOUNDARY (Internal — Not Exported)
|
|
58
|
+
//
|
|
59
|
+
// The execution sandbox blocks all external entropy sources at runtime.
|
|
60
|
+
// See EXECUTION_BOUNDARY.md for details.
|
|
61
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
62
|
+
// Note: FORBIDDEN_APIS and createSafeMath are NOT exported.
|
|
63
|
+
// They are internal implementation details used by the engines.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NexArt Code Mode SDK - Builder Manifest
|
|
3
|
+
* Version: 1.6.0 (Protocol v1.2.0)
|
|
4
|
+
*
|
|
5
|
+
* ╔══════════════════════════════════════════════════════════════════════════╗
|
|
6
|
+
* ║ BUILDER MANIFEST — PASSIVE ATTRIBUTION (WRITE-ONLY) ║
|
|
7
|
+
* ║ ║
|
|
8
|
+
* ║ The Builder Manifest is a declaration of intent, not a capability. ║
|
|
9
|
+
* ║ The SDK does not expose any API to read or inspect manifests. ║
|
|
10
|
+
* ║ ║
|
|
11
|
+
* ║ This is: ║
|
|
12
|
+
* ║ - Declarative (write-only, no read API exposed) ║
|
|
13
|
+
* ║ - Optional (no errors if missing or invalid) ║
|
|
14
|
+
* ║ - Non-enforced (no validation logic) ║
|
|
15
|
+
* ║ - Non-rewarding (no incentives, no tracking) ║
|
|
16
|
+
* ║ ║
|
|
17
|
+
* ║ There is: ║
|
|
18
|
+
* ║ - No SDK API to read manifests ║
|
|
19
|
+
* ║ - No validation ║
|
|
20
|
+
* ║ - No attribution logic ║
|
|
21
|
+
* ║ - No tracking, analytics, or network calls ║
|
|
22
|
+
* ║ ║
|
|
23
|
+
* ║ Execution behavior is identical with or without a manifest. ║
|
|
24
|
+
* ╚══════════════════════════════════════════════════════════════════════════╝
|
|
25
|
+
*/
|
|
26
|
+
import type { NexArtBuilderManifest } from './types';
|
|
27
|
+
/**
|
|
28
|
+
* Register a builder manifest for attribution.
|
|
29
|
+
*
|
|
30
|
+
* This is optional and does not affect execution behavior.
|
|
31
|
+
* The manifest is stored in-memory only and is not:
|
|
32
|
+
* - Serialized to disk
|
|
33
|
+
* - Sent over the network
|
|
34
|
+
* - Logged to console
|
|
35
|
+
* - Used for validation or enforcement
|
|
36
|
+
*
|
|
37
|
+
* @param manifest - Optional builder manifest. Pass undefined to clear.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* import { registerBuilderManifest } from "@nexart/codemode-sdk";
|
|
42
|
+
*
|
|
43
|
+
* registerBuilderManifest({
|
|
44
|
+
* protocol: "nexart",
|
|
45
|
+
* manifestVersion: "0.1",
|
|
46
|
+
* app: { name: "My App", url: "https://myapp.com" }
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function registerBuilderManifest(manifest?: NexArtBuilderManifest): void;
|
|
51
|
+
/**
|
|
52
|
+
* Get the currently registered builder manifest.
|
|
53
|
+
*
|
|
54
|
+
* ╔══════════════════════════════════════════════════════════════════════════╗
|
|
55
|
+
* ║ INTERNAL FUNCTION — NOT EXPORTED TO SDK CONSUMERS ║
|
|
56
|
+
* ║ ║
|
|
57
|
+
* ║ This function exists only for internal SDK execution context. ║
|
|
58
|
+
* ║ It is NOT part of the public API and must NOT be exported from index. ║
|
|
59
|
+
* ║ Runtime code and sketch code cannot access this function. ║
|
|
60
|
+
* ╚══════════════════════════════════════════════════════════════════════════╝
|
|
61
|
+
*
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
export declare function getBuilderManifest(): NexArtBuilderManifest | null;
|
|
65
|
+
/**
|
|
66
|
+
* Clear the registered builder manifest.
|
|
67
|
+
*
|
|
68
|
+
* ╔══════════════════════════════════════════════════════════════════════════╗
|
|
69
|
+
* ║ INTERNAL FUNCTION — NOT EXPORTED TO SDK CONSUMERS ║
|
|
70
|
+
* ║ ║
|
|
71
|
+
* ║ This function exists only for internal SDK execution context. ║
|
|
72
|
+
* ║ It is NOT part of the public API and must NOT be exported from index. ║
|
|
73
|
+
* ║ Runtime code and sketch code cannot access this function. ║
|
|
74
|
+
* ╚══════════════════════════════════════════════════════════════════════════╝
|
|
75
|
+
*
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
export declare function clearBuilderManifest(): void;
|
|
79
|
+
//# sourceMappingURL=builder-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder-manifest.d.ts","sourceRoot":"","sources":["../../../builder-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAKrD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAiB9E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,IAAI,qBAAqB,GAAG,IAAI,CAEjE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
|