@nexart/codemode-sdk 1.8.0 → 1.8.2
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 +85 -0
- package/COMMERCIAL.md +41 -0
- package/LICENSE.md +5 -5
- package/README.md +250 -700
- package/dist/sdk/codemode/core-index.d.ts +6 -4
- package/dist/sdk/codemode/core-index.d.ts.map +1 -1
- package/dist/sdk/codemode/core-index.js +6 -4
- package/dist/{entry → sdk/codemode/entry}/browser.d.ts +5 -2
- package/dist/sdk/codemode/entry/browser.d.ts.map +1 -0
- package/dist/{entry → sdk/codemode/entry}/browser.js +10 -4
- package/dist/{entry → sdk/codemode/entry}/node.d.ts +2 -1
- package/dist/sdk/codemode/entry/node.d.ts.map +1 -0
- package/dist/{entry → sdk/codemode/entry}/node.js +2 -1
- package/dist/{runtime.d.ts → sdk/codemode/runtime.d.ts} +2 -2
- package/dist/sdk/codemode/runtime.d.ts.map +1 -0
- package/dist/{runtime.js → sdk/codemode/runtime.js} +3 -2
- package/dist/sdk/codemode/static-engine.d.ts.map +1 -1
- package/dist/sdk/codemode/static-engine.js +24 -11
- package/dist/sdk/codemode/version.d.ts +18 -0
- package/dist/sdk/codemode/version.d.ts.map +1 -0
- package/dist/sdk/codemode/version.js +17 -0
- package/examples/agent-quickstart.ts +159 -0
- package/examples/preflight-test.ts +1 -1
- package/package.json +4 -2
- package/dist/builder-manifest.d.ts +0 -79
- package/dist/builder-manifest.d.ts.map +0 -1
- package/dist/builder-manifest.js +0 -97
- package/dist/core-index.d.ts +0 -21
- package/dist/core-index.d.ts.map +0 -1
- package/dist/core-index.js +0 -26
- package/dist/engine.d.ts +0 -24
- package/dist/engine.d.ts.map +0 -1
- package/dist/engine.js +0 -67
- package/dist/entry/browser.d.ts.map +0 -1
- package/dist/entry/node.d.ts.map +0 -1
- package/dist/execute.d.ts +0 -46
- package/dist/execute.d.ts.map +0 -1
- package/dist/execute.js +0 -283
- package/dist/execution-sandbox.d.ts +0 -107
- package/dist/execution-sandbox.d.ts.map +0 -1
- package/dist/execution-sandbox.js +0 -207
- package/dist/index.d.ts +0 -31
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -63
- package/dist/loop-engine.d.ts +0 -22
- package/dist/loop-engine.d.ts.map +0 -1
- package/dist/loop-engine.js +0 -229
- package/dist/noise-bridge.d.ts +0 -44
- package/dist/noise-bridge.d.ts.map +0 -1
- package/dist/noise-bridge.js +0 -68
- package/dist/noise-engine.d.ts +0 -74
- package/dist/noise-engine.d.ts.map +0 -1
- package/dist/noise-engine.js +0 -132
- package/dist/noise-sketches/fractalNoise.d.ts +0 -11
- package/dist/noise-sketches/fractalNoise.d.ts.map +0 -1
- package/dist/noise-sketches/fractalNoise.js +0 -121
- package/dist/noise-sketches/index.d.ts +0 -21
- package/dist/noise-sketches/index.d.ts.map +0 -1
- package/dist/noise-sketches/index.js +0 -28
- package/dist/p5-runtime.d.ts +0 -75
- package/dist/p5-runtime.d.ts.map +0 -1
- package/dist/p5-runtime.js +0 -1031
- package/dist/runtime.d.ts.map +0 -1
- package/dist/sdk/codemode/index.d.ts +0 -31
- package/dist/sdk/codemode/index.d.ts.map +0 -1
- package/dist/sdk/codemode/index.js +0 -63
- package/dist/sdk/codemode/noise-bridge.d.ts +0 -44
- package/dist/sdk/codemode/noise-bridge.d.ts.map +0 -1
- package/dist/sdk/codemode/noise-bridge.js +0 -68
- package/dist/sdk/codemode/noise-engine.d.ts +0 -74
- package/dist/sdk/codemode/noise-engine.d.ts.map +0 -1
- package/dist/sdk/codemode/noise-engine.js +0 -132
- package/dist/sdk/codemode/noise-sketches/fractalNoise.d.ts +0 -11
- package/dist/sdk/codemode/noise-sketches/fractalNoise.d.ts.map +0 -1
- package/dist/sdk/codemode/noise-sketches/fractalNoise.js +0 -121
- package/dist/sdk/codemode/noise-sketches/index.d.ts +0 -21
- package/dist/sdk/codemode/noise-sketches/index.d.ts.map +0 -1
- package/dist/sdk/codemode/noise-sketches/index.js +0 -28
- package/dist/shared/noiseSnapshot.d.ts +0 -59
- package/dist/shared/noiseSnapshot.d.ts.map +0 -1
- package/dist/shared/noiseSnapshot.js +0 -72
- package/dist/sound-bridge.d.ts +0 -89
- package/dist/sound-bridge.d.ts.map +0 -1
- package/dist/sound-bridge.js +0 -128
- package/dist/soundart-engine.d.ts +0 -87
- package/dist/soundart-engine.d.ts.map +0 -1
- package/dist/soundart-engine.js +0 -173
- package/dist/soundart-sketches/chladniBloom.d.ts +0 -3
- package/dist/soundart-sketches/chladniBloom.d.ts.map +0 -1
- package/dist/soundart-sketches/chladniBloom.js +0 -53
- package/dist/soundart-sketches/dualVortex.d.ts +0 -3
- package/dist/soundart-sketches/dualVortex.d.ts.map +0 -1
- package/dist/soundart-sketches/dualVortex.js +0 -67
- package/dist/soundart-sketches/geometryIllusion.d.ts +0 -3
- package/dist/soundart-sketches/geometryIllusion.d.ts.map +0 -1
- package/dist/soundart-sketches/geometryIllusion.js +0 -89
- package/dist/soundart-sketches/index.d.ts +0 -39
- package/dist/soundart-sketches/index.d.ts.map +0 -1
- package/dist/soundart-sketches/index.js +0 -72
- package/dist/soundart-sketches/isoflow.d.ts +0 -3
- package/dist/soundart-sketches/isoflow.d.ts.map +0 -1
- package/dist/soundart-sketches/isoflow.js +0 -60
- package/dist/soundart-sketches/loomWeave.d.ts +0 -3
- package/dist/soundart-sketches/loomWeave.d.ts.map +0 -1
- package/dist/soundart-sketches/loomWeave.js +0 -59
- package/dist/soundart-sketches/noiseTerraces.d.ts +0 -3
- package/dist/soundart-sketches/noiseTerraces.d.ts.map +0 -1
- package/dist/soundart-sketches/noiseTerraces.js +0 -53
- package/dist/soundart-sketches/orb.d.ts +0 -3
- package/dist/soundart-sketches/orb.d.ts.map +0 -1
- package/dist/soundart-sketches/orb.js +0 -50
- package/dist/soundart-sketches/pixelGlyphs.d.ts +0 -3
- package/dist/soundart-sketches/pixelGlyphs.d.ts.map +0 -1
- package/dist/soundart-sketches/pixelGlyphs.js +0 -72
- package/dist/soundart-sketches/prismFlowFields.d.ts +0 -3
- package/dist/soundart-sketches/prismFlowFields.d.ts.map +0 -1
- package/dist/soundart-sketches/prismFlowFields.js +0 -51
- package/dist/soundart-sketches/radialBurst.d.ts +0 -3
- package/dist/soundart-sketches/radialBurst.d.ts.map +0 -1
- package/dist/soundart-sketches/radialBurst.js +0 -60
- package/dist/soundart-sketches/resonantSoundBodies.d.ts +0 -3
- package/dist/soundart-sketches/resonantSoundBodies.d.ts.map +0 -1
- package/dist/soundart-sketches/resonantSoundBodies.js +0 -89
- package/dist/soundart-sketches/rings.d.ts +0 -11
- package/dist/soundart-sketches/rings.d.ts.map +0 -1
- package/dist/soundart-sketches/rings.js +0 -89
- package/dist/soundart-sketches/squares.d.ts +0 -3
- package/dist/soundart-sketches/squares.d.ts.map +0 -1
- package/dist/soundart-sketches/squares.js +0 -52
- package/dist/soundart-sketches/waveStripes.d.ts +0 -3
- package/dist/soundart-sketches/waveStripes.d.ts.map +0 -1
- package/dist/soundart-sketches/waveStripes.js +0 -44
- package/dist/static-engine.d.ts +0 -20
- package/dist/static-engine.d.ts.map +0 -1
- package/dist/static-engine.js +0 -157
- package/dist/types.d.ts +0 -191
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -32
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @nexart/codemode-sdk
|
|
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.
|
|
20
|
+
export declare const SDK_VERSION = "1.8.2";
|
|
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;
|
|
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
|
|
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 =
|
|
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
|
|
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
|
|
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.2";
|
|
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
|
|
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 —
|
|
45
|
+
// AGENT-FIRST RUNTIME — Browser-safe, no Node dependencies
|
|
44
46
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
45
47
|
export { createRuntime, NexArtRuntime, RUNTIME_VERSION, } from '../runtime';
|
|
46
48
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
47
|
-
//
|
|
49
|
+
// SOUNDART ENGINE — Browser-safe (canvas-based rendering)
|
|
48
50
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
49
|
-
export
|
|
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
|
|
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
|
|
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,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NexArt Code Mode SDK - Agent-First Runtime Authority Layer
|
|
3
|
-
*
|
|
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.
|
|
21
|
+
export declare const RUNTIME_VERSION = "1.8.2";
|
|
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
|
-
*
|
|
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
|
-
|
|
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-engine.d.ts","sourceRoot":"","sources":["../../../static-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"static-engine.d.ts","sourceRoot":"","sources":["../../../static-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAgB,MAAM,SAAS,CAAC;AAkDtE,wBAAsB,aAAa,CACjC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,UAAU,GAClB,OAAO,CAAC,IAAI,CAAC,CA6Hf"}
|
|
@@ -15,17 +15,32 @@
|
|
|
15
15
|
* When returnImageData is true, returns raw ImageData for determinism hashing.
|
|
16
16
|
* Works in both browser (HTMLCanvasElement) and Node (canvas package) environments.
|
|
17
17
|
*/
|
|
18
|
-
import { createRequire } from 'module';
|
|
19
18
|
import { DEFAULT_CONFIG } from './types';
|
|
20
19
|
import { createP5Runtime, injectTimeVariables, injectProtocolVariables } from './p5-runtime';
|
|
21
20
|
import { FORBIDDEN_APIS, createSafeMath } from './execution-sandbox';
|
|
22
|
-
|
|
21
|
+
let nodeCanvasModule = null;
|
|
22
|
+
async function getNodeCanvas() {
|
|
23
|
+
if (nodeCanvasModule)
|
|
24
|
+
return nodeCanvasModule;
|
|
25
|
+
if (typeof window === 'undefined') {
|
|
26
|
+
try {
|
|
27
|
+
const { createRequire } = await import('module');
|
|
28
|
+
const require = createRequire(import.meta.url);
|
|
29
|
+
nodeCanvasModule = require('canvas');
|
|
30
|
+
return nodeCanvasModule;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
23
38
|
/**
|
|
24
39
|
* Create a runtime canvas that works in both browser and Node environments.
|
|
25
40
|
* Browser: uses HTMLCanvasElement
|
|
26
41
|
* Node/Headless: uses `canvas` npm package
|
|
27
42
|
*/
|
|
28
|
-
function createRuntimeCanvas(width, height) {
|
|
43
|
+
async function createRuntimeCanvas(width, height) {
|
|
29
44
|
// Browser environment
|
|
30
45
|
if (typeof document !== 'undefined' && typeof document.createElement === 'function') {
|
|
31
46
|
const canvas = document.createElement('canvas');
|
|
@@ -34,14 +49,12 @@ function createRuntimeCanvas(width, height) {
|
|
|
34
49
|
return canvas;
|
|
35
50
|
}
|
|
36
51
|
// Node / headless environment (oracle, CI)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return createCanvas(width, height);
|
|
40
|
-
}
|
|
41
|
-
catch (err) {
|
|
42
|
-
throw new Error('[Code Mode Protocol Error] Headless canvas unavailable. ' +
|
|
43
|
-
'Install `canvas` for oracle execution.');
|
|
52
|
+
const nodeCanvas = await getNodeCanvas();
|
|
53
|
+
if (nodeCanvas && nodeCanvas.createCanvas) {
|
|
54
|
+
return nodeCanvas.createCanvas(width, height);
|
|
44
55
|
}
|
|
56
|
+
throw new Error('[Code Mode Protocol Error] Headless canvas unavailable. ' +
|
|
57
|
+
'Install `canvas` for oracle execution.');
|
|
45
58
|
}
|
|
46
59
|
export async function runStaticMode(config, options) {
|
|
47
60
|
const { code, seed, vars, onPreview, onProgress, onComplete, onError, returnImageData } = options;
|
|
@@ -54,7 +67,7 @@ export async function runStaticMode(config, options) {
|
|
|
54
67
|
message: 'Initializing canvas...',
|
|
55
68
|
});
|
|
56
69
|
// Create runtime canvas (browser or Node)
|
|
57
|
-
const canvas = createRuntimeCanvas(width, height);
|
|
70
|
+
const canvas = await createRuntimeCanvas(width, height);
|
|
58
71
|
// Create p5 runtime with optional seed for determinism
|
|
59
72
|
const p = createP5Runtime(canvas, width, height, { seed });
|
|
60
73
|
// Inject time variables (static = frame 0, t = 0, totalFrames = 1)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nexart/codemode-sdk — Single Source of Truth for Version Constants
|
|
3
|
+
*
|
|
4
|
+
* All version exports across the SDK MUST import from this module.
|
|
5
|
+
* This prevents version drift between package.json, runtime exports, and documentation.
|
|
6
|
+
*
|
|
7
|
+
* To update: Change values here and run `npm run build`.
|
|
8
|
+
* See package.json for the canonical npm version.
|
|
9
|
+
*/
|
|
10
|
+
/** SDK version - must match package.json version */
|
|
11
|
+
export declare const SDK_VERSION = "1.8.2";
|
|
12
|
+
/** Protocol version - defines runtime semantics and determinism guarantees */
|
|
13
|
+
export declare const PROTOCOL_VERSION = "1.2.0";
|
|
14
|
+
/** Protocol phase - phase 3 = stable, production-ready */
|
|
15
|
+
export declare const PROTOCOL_PHASE = 3;
|
|
16
|
+
/** Combined version string for display */
|
|
17
|
+
export declare const VERSION_STRING = "v1.8.2 (Protocol v1.2.0)";
|
|
18
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../../version.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,oDAAoD;AACpD,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC,0DAA0D;AAC1D,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,0CAA0C;AAC1C,eAAO,MAAM,cAAc,6BAAoD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nexart/codemode-sdk — Single Source of Truth for Version Constants
|
|
3
|
+
*
|
|
4
|
+
* All version exports across the SDK MUST import from this module.
|
|
5
|
+
* This prevents version drift between package.json, runtime exports, and documentation.
|
|
6
|
+
*
|
|
7
|
+
* To update: Change values here and run `npm run build`.
|
|
8
|
+
* See package.json for the canonical npm version.
|
|
9
|
+
*/
|
|
10
|
+
/** SDK version - must match package.json version */
|
|
11
|
+
export const SDK_VERSION = '1.8.2';
|
|
12
|
+
/** Protocol version - defines runtime semantics and determinism guarantees */
|
|
13
|
+
export const PROTOCOL_VERSION = '1.2.0';
|
|
14
|
+
/** Protocol phase - phase 3 = stable, production-ready */
|
|
15
|
+
export const PROTOCOL_PHASE = 3;
|
|
16
|
+
/** Combined version string for display */
|
|
17
|
+
export const VERSION_STRING = `v${SDK_VERSION} (Protocol v${PROTOCOL_VERSION})`;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @nexart/codemode-sdk — Agent Quickstart Example
|
|
3
|
+
* See package.json for SDK version
|
|
4
|
+
*
|
|
5
|
+
* This example demonstrates the RECOMMENDED approach for AI coding agents.
|
|
6
|
+
*
|
|
7
|
+
* Key principles:
|
|
8
|
+
* - Use createRuntime() — the modern, agent-first API
|
|
9
|
+
* - Always use strict: true to catch determinism violations
|
|
10
|
+
* - Never use Math.random(), Date.now(), or other non-deterministic APIs
|
|
11
|
+
* - Use runtime.random(), runtime.noise() for all randomness
|
|
12
|
+
* - Use runtime.digest() for verification
|
|
13
|
+
*
|
|
14
|
+
* This example requires NO canvas, NO p5, and is browser-safe.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { createRuntime } from "../entry/browser";
|
|
18
|
+
|
|
19
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
20
|
+
// STEP 1: Create a deterministic runtime
|
|
21
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
22
|
+
|
|
23
|
+
const runtime = createRuntime({
|
|
24
|
+
seed: "agent-quickstart-demo", // Any string or number
|
|
25
|
+
vars: [50, 75, 25, 0, 0, 0, 0, 0, 0, 0], // VAR[0..9] inputs (0-100 each)
|
|
26
|
+
strict: true, // ALWAYS use strict: true — throws on non-deterministic APIs
|
|
27
|
+
mode: "static", // "static" = single frame, "loop" = animation
|
|
28
|
+
metadata: { example: "agent-quickstart" } // Optional metadata for digest
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
console.log("=== Agent Quickstart Example ===\n");
|
|
32
|
+
|
|
33
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
34
|
+
// STEP 2: Use deterministic APIs
|
|
35
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
36
|
+
|
|
37
|
+
// Deterministic random values (Mulberry32 PRNG)
|
|
38
|
+
const randomValues = [
|
|
39
|
+
runtime.random(), // [0, 1) — deterministic float
|
|
40
|
+
runtime.random(), // Next value in sequence
|
|
41
|
+
runtime.randomInt(0, 100), // Deterministic integer in range [0, 100]
|
|
42
|
+
runtime.randomInt(1, 6), // Like rolling a die
|
|
43
|
+
runtime.randomRange(10, 20) // Deterministic float in range [10, 20]
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
console.log("Deterministic random values:");
|
|
47
|
+
randomValues.forEach((val, i) => console.log(` [${i}] ${val}`));
|
|
48
|
+
console.log();
|
|
49
|
+
|
|
50
|
+
// Deterministic noise (Perlin)
|
|
51
|
+
const noiseValues = [
|
|
52
|
+
runtime.noise(0.1, 0.2), // 2D Perlin noise
|
|
53
|
+
runtime.noise(0.5, 0.5), // Different position
|
|
54
|
+
runtime.noise(1.0, 2.0, 3.0) // 3D Perlin noise
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
console.log("Deterministic noise values:");
|
|
58
|
+
noiseValues.forEach((val, i) => console.log(` [${i}] ${val}`));
|
|
59
|
+
console.log();
|
|
60
|
+
|
|
61
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
62
|
+
// STEP 3: Execute code with strict enforcement
|
|
63
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
64
|
+
|
|
65
|
+
// runtime.run() executes code with strict mode enforcement
|
|
66
|
+
// If any non-deterministic API is called, it throws an actionable error
|
|
67
|
+
const result = runtime.run(() => {
|
|
68
|
+
// This code is safe — uses only deterministic APIs
|
|
69
|
+
const positions: Array<{x: number, y: number}> = [];
|
|
70
|
+
for (let i = 0; i < 5; i++) {
|
|
71
|
+
positions.push({
|
|
72
|
+
x: runtime.random() * 100,
|
|
73
|
+
y: runtime.random() * 100
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return positions;
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
console.log("Generated positions (deterministic):");
|
|
80
|
+
result.forEach((pos, i) => console.log(` [${i}] x=${pos.x.toFixed(2)}, y=${pos.y.toFixed(2)}`));
|
|
81
|
+
console.log();
|
|
82
|
+
|
|
83
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
84
|
+
// STEP 4: Get state snapshot and digest for verification
|
|
85
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
86
|
+
|
|
87
|
+
const state = runtime.getState();
|
|
88
|
+
const digest = runtime.digest();
|
|
89
|
+
|
|
90
|
+
console.log("State snapshot:");
|
|
91
|
+
console.log(` sdkVersion: "${state.sdkVersion}"`);
|
|
92
|
+
console.log(` seed: ${state.seed}`);
|
|
93
|
+
console.log(` vars: [${state.vars.join(", ")}]`);
|
|
94
|
+
console.log(` mode: "${state.mode}"`);
|
|
95
|
+
console.log();
|
|
96
|
+
|
|
97
|
+
console.log("Verification digest:");
|
|
98
|
+
console.log(` ${digest}`);
|
|
99
|
+
console.log();
|
|
100
|
+
|
|
101
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
102
|
+
// STEP 5: Verify determinism (same inputs → same outputs)
|
|
103
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
104
|
+
|
|
105
|
+
// Create a second runtime with identical inputs
|
|
106
|
+
const runtime2 = createRuntime({
|
|
107
|
+
seed: "agent-quickstart-demo",
|
|
108
|
+
vars: [50, 75, 25, 0, 0, 0, 0, 0, 0, 0],
|
|
109
|
+
strict: true,
|
|
110
|
+
mode: "static",
|
|
111
|
+
metadata: { example: "agent-quickstart" }
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// Generate the same sequence
|
|
115
|
+
for (let i = 0; i < randomValues.length; i++) {
|
|
116
|
+
if (i < 2) runtime2.random();
|
|
117
|
+
else if (i === 2) runtime2.randomInt(0, 100);
|
|
118
|
+
else if (i === 3) runtime2.randomInt(1, 6);
|
|
119
|
+
else runtime2.randomRange(10, 20);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Generate the same noise values
|
|
123
|
+
runtime2.noise(0.1, 0.2);
|
|
124
|
+
runtime2.noise(0.5, 0.5);
|
|
125
|
+
runtime2.noise(1.0, 2.0, 3.0);
|
|
126
|
+
|
|
127
|
+
// Run the same code
|
|
128
|
+
runtime2.run(() => {
|
|
129
|
+
for (let i = 0; i < 5; i++) {
|
|
130
|
+
runtime2.random();
|
|
131
|
+
runtime2.random();
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
const digest2 = runtime2.digest();
|
|
136
|
+
|
|
137
|
+
console.log("Determinism verification:");
|
|
138
|
+
console.log(` Runtime 1 digest: ${digest}`);
|
|
139
|
+
console.log(` Runtime 2 digest: ${digest2}`);
|
|
140
|
+
console.log(` Match: ${digest === digest2 ? "✅ PASS" : "❌ FAIL"}`);
|
|
141
|
+
console.log();
|
|
142
|
+
|
|
143
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
144
|
+
// WHAT NOT TO DO — These would throw in strict mode:
|
|
145
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
146
|
+
|
|
147
|
+
console.log("=== Common Mistakes (DO NOT DO THIS) ===\n");
|
|
148
|
+
console.log("❌ Math.random() → Use runtime.random()");
|
|
149
|
+
console.log("❌ Date.now() → Pass time as input or use frame counters");
|
|
150
|
+
console.log("❌ performance.now() → Use deterministic timing");
|
|
151
|
+
console.log("❌ new Date() → Pass time as input");
|
|
152
|
+
console.log();
|
|
153
|
+
|
|
154
|
+
// Example of what strict mode catches:
|
|
155
|
+
// runtime.run(() => {
|
|
156
|
+
// Math.random(); // Throws: NEXART_STRICT: Non-deterministic API used: Math.random. Use runtime.random() instead.
|
|
157
|
+
// });
|
|
158
|
+
|
|
159
|
+
console.log("=== Example Complete ===");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @nexart/codemode-sdk — Preflight Release Tests
|
|
3
3
|
*
|
|
4
|
-
* Extended verification tests for v1.8.
|
|
4
|
+
* Extended verification tests for v1.8.2 release validation.
|
|
5
5
|
* Tests strict mode restoration, error messages, and cross-env digest parity.
|
|
6
6
|
*
|
|
7
7
|
* Run: npx tsx examples/preflight-test.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexart/codemode-sdk",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
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/entry/browser.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"CHANGELOG.md",
|
|
41
41
|
"CODE_MODE_PROTOCOL.md",
|
|
42
42
|
"LICENSE.md",
|
|
43
|
-
"
|
|
43
|
+
"COMMERCIAL.md",
|
|
44
44
|
"builder.manifest.schema.json"
|
|
45
45
|
],
|
|
46
46
|
"scripts": {
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"test": "npx tsx smoke-test.ts",
|
|
49
49
|
"example:basic": "npx tsx examples/basic.ts",
|
|
50
50
|
"example:verify": "npx tsx examples/verify.ts",
|
|
51
|
+
"example:agent": "npx tsx examples/agent-quickstart.ts",
|
|
51
52
|
"prepublishOnly": "npm run build && npm run test"
|
|
52
53
|
},
|
|
53
54
|
"keywords": [
|
|
@@ -78,6 +79,7 @@
|
|
|
78
79
|
"type": "git",
|
|
79
80
|
"url": "https://github.com/artnames/nexart-codemode-sdk.git"
|
|
80
81
|
},
|
|
82
|
+
"homepage": "https://github.com/artnames/nexart-codemode-sdk#readme",
|
|
81
83
|
"publishConfig": {
|
|
82
84
|
"access": "public"
|
|
83
85
|
},
|
|
@@ -1,79 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|