@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.
Files changed (138) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/COMMERCIAL.md +41 -0
  3. package/LICENSE.md +5 -5
  4. package/README.md +250 -700
  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/{runtime.d.ts → sdk/codemode/runtime.d.ts} +2 -2
  15. package/dist/sdk/codemode/runtime.d.ts.map +1 -0
  16. package/dist/{runtime.js → sdk/codemode/runtime.js} +3 -2
  17. package/dist/sdk/codemode/static-engine.d.ts.map +1 -1
  18. package/dist/sdk/codemode/static-engine.js +24 -11
  19. package/dist/sdk/codemode/version.d.ts +18 -0
  20. package/dist/sdk/codemode/version.d.ts.map +1 -0
  21. package/dist/sdk/codemode/version.js +17 -0
  22. package/examples/agent-quickstart.ts +159 -0
  23. package/examples/preflight-test.ts +1 -1
  24. package/package.json +4 -2
  25. package/dist/builder-manifest.d.ts +0 -79
  26. package/dist/builder-manifest.d.ts.map +0 -1
  27. package/dist/builder-manifest.js +0 -97
  28. package/dist/core-index.d.ts +0 -21
  29. package/dist/core-index.d.ts.map +0 -1
  30. package/dist/core-index.js +0 -26
  31. package/dist/engine.d.ts +0 -24
  32. package/dist/engine.d.ts.map +0 -1
  33. package/dist/engine.js +0 -67
  34. package/dist/entry/browser.d.ts.map +0 -1
  35. package/dist/entry/node.d.ts.map +0 -1
  36. package/dist/execute.d.ts +0 -46
  37. package/dist/execute.d.ts.map +0 -1
  38. package/dist/execute.js +0 -283
  39. package/dist/execution-sandbox.d.ts +0 -107
  40. package/dist/execution-sandbox.d.ts.map +0 -1
  41. package/dist/execution-sandbox.js +0 -207
  42. package/dist/index.d.ts +0 -31
  43. package/dist/index.d.ts.map +0 -1
  44. package/dist/index.js +0 -63
  45. package/dist/loop-engine.d.ts +0 -22
  46. package/dist/loop-engine.d.ts.map +0 -1
  47. package/dist/loop-engine.js +0 -229
  48. package/dist/noise-bridge.d.ts +0 -44
  49. package/dist/noise-bridge.d.ts.map +0 -1
  50. package/dist/noise-bridge.js +0 -68
  51. package/dist/noise-engine.d.ts +0 -74
  52. package/dist/noise-engine.d.ts.map +0 -1
  53. package/dist/noise-engine.js +0 -132
  54. package/dist/noise-sketches/fractalNoise.d.ts +0 -11
  55. package/dist/noise-sketches/fractalNoise.d.ts.map +0 -1
  56. package/dist/noise-sketches/fractalNoise.js +0 -121
  57. package/dist/noise-sketches/index.d.ts +0 -21
  58. package/dist/noise-sketches/index.d.ts.map +0 -1
  59. package/dist/noise-sketches/index.js +0 -28
  60. package/dist/p5-runtime.d.ts +0 -75
  61. package/dist/p5-runtime.d.ts.map +0 -1
  62. package/dist/p5-runtime.js +0 -1031
  63. package/dist/runtime.d.ts.map +0 -1
  64. package/dist/sdk/codemode/index.d.ts +0 -31
  65. package/dist/sdk/codemode/index.d.ts.map +0 -1
  66. package/dist/sdk/codemode/index.js +0 -63
  67. package/dist/sdk/codemode/noise-bridge.d.ts +0 -44
  68. package/dist/sdk/codemode/noise-bridge.d.ts.map +0 -1
  69. package/dist/sdk/codemode/noise-bridge.js +0 -68
  70. package/dist/sdk/codemode/noise-engine.d.ts +0 -74
  71. package/dist/sdk/codemode/noise-engine.d.ts.map +0 -1
  72. package/dist/sdk/codemode/noise-engine.js +0 -132
  73. package/dist/sdk/codemode/noise-sketches/fractalNoise.d.ts +0 -11
  74. package/dist/sdk/codemode/noise-sketches/fractalNoise.d.ts.map +0 -1
  75. package/dist/sdk/codemode/noise-sketches/fractalNoise.js +0 -121
  76. package/dist/sdk/codemode/noise-sketches/index.d.ts +0 -21
  77. package/dist/sdk/codemode/noise-sketches/index.d.ts.map +0 -1
  78. package/dist/sdk/codemode/noise-sketches/index.js +0 -28
  79. package/dist/shared/noiseSnapshot.d.ts +0 -59
  80. package/dist/shared/noiseSnapshot.d.ts.map +0 -1
  81. package/dist/shared/noiseSnapshot.js +0 -72
  82. package/dist/sound-bridge.d.ts +0 -89
  83. package/dist/sound-bridge.d.ts.map +0 -1
  84. package/dist/sound-bridge.js +0 -128
  85. package/dist/soundart-engine.d.ts +0 -87
  86. package/dist/soundart-engine.d.ts.map +0 -1
  87. package/dist/soundart-engine.js +0 -173
  88. package/dist/soundart-sketches/chladniBloom.d.ts +0 -3
  89. package/dist/soundart-sketches/chladniBloom.d.ts.map +0 -1
  90. package/dist/soundart-sketches/chladniBloom.js +0 -53
  91. package/dist/soundart-sketches/dualVortex.d.ts +0 -3
  92. package/dist/soundart-sketches/dualVortex.d.ts.map +0 -1
  93. package/dist/soundart-sketches/dualVortex.js +0 -67
  94. package/dist/soundart-sketches/geometryIllusion.d.ts +0 -3
  95. package/dist/soundart-sketches/geometryIllusion.d.ts.map +0 -1
  96. package/dist/soundart-sketches/geometryIllusion.js +0 -89
  97. package/dist/soundart-sketches/index.d.ts +0 -39
  98. package/dist/soundart-sketches/index.d.ts.map +0 -1
  99. package/dist/soundart-sketches/index.js +0 -72
  100. package/dist/soundart-sketches/isoflow.d.ts +0 -3
  101. package/dist/soundart-sketches/isoflow.d.ts.map +0 -1
  102. package/dist/soundart-sketches/isoflow.js +0 -60
  103. package/dist/soundart-sketches/loomWeave.d.ts +0 -3
  104. package/dist/soundart-sketches/loomWeave.d.ts.map +0 -1
  105. package/dist/soundart-sketches/loomWeave.js +0 -59
  106. package/dist/soundart-sketches/noiseTerraces.d.ts +0 -3
  107. package/dist/soundart-sketches/noiseTerraces.d.ts.map +0 -1
  108. package/dist/soundart-sketches/noiseTerraces.js +0 -53
  109. package/dist/soundart-sketches/orb.d.ts +0 -3
  110. package/dist/soundart-sketches/orb.d.ts.map +0 -1
  111. package/dist/soundart-sketches/orb.js +0 -50
  112. package/dist/soundart-sketches/pixelGlyphs.d.ts +0 -3
  113. package/dist/soundart-sketches/pixelGlyphs.d.ts.map +0 -1
  114. package/dist/soundart-sketches/pixelGlyphs.js +0 -72
  115. package/dist/soundart-sketches/prismFlowFields.d.ts +0 -3
  116. package/dist/soundart-sketches/prismFlowFields.d.ts.map +0 -1
  117. package/dist/soundart-sketches/prismFlowFields.js +0 -51
  118. package/dist/soundart-sketches/radialBurst.d.ts +0 -3
  119. package/dist/soundart-sketches/radialBurst.d.ts.map +0 -1
  120. package/dist/soundart-sketches/radialBurst.js +0 -60
  121. package/dist/soundart-sketches/resonantSoundBodies.d.ts +0 -3
  122. package/dist/soundart-sketches/resonantSoundBodies.d.ts.map +0 -1
  123. package/dist/soundart-sketches/resonantSoundBodies.js +0 -89
  124. package/dist/soundart-sketches/rings.d.ts +0 -11
  125. package/dist/soundart-sketches/rings.d.ts.map +0 -1
  126. package/dist/soundart-sketches/rings.js +0 -89
  127. package/dist/soundart-sketches/squares.d.ts +0 -3
  128. package/dist/soundart-sketches/squares.d.ts.map +0 -1
  129. package/dist/soundart-sketches/squares.js +0 -52
  130. package/dist/soundart-sketches/waveStripes.d.ts +0 -3
  131. package/dist/soundart-sketches/waveStripes.d.ts.map +0 -1
  132. package/dist/soundart-sketches/waveStripes.js +0 -44
  133. package/dist/static-engine.d.ts +0 -20
  134. package/dist/static-engine.d.ts.map +0 -1
  135. package/dist/static-engine.js +0 -157
  136. package/dist/types.d.ts +0 -191
  137. package/dist/types.d.ts.map +0 -1
  138. package/dist/types.js +0 -32
@@ -1,157 +0,0 @@
1
- /**
2
- * NexArt Code Mode Runtime SDK - Static Engine
3
- * Protocol: v1.2.0 (Phase 3) — HARD ENFORCEMENT
4
- *
5
- * Static mode renderer: executes setup() only, captures single PNG.
6
- * Does NOT execute draw() - per NexArt Execution Specification v1.
7
- *
8
- * Determinism Guarantee:
9
- * Same code + same seed + same VARs = identical PNG output
10
- *
11
- * Security:
12
- * All external entropy sources are blocked at runtime via execution sandbox.
13
- *
14
- * Oracle Support:
15
- * When returnImageData is true, returns raw ImageData for determinism hashing.
16
- * Works in both browser (HTMLCanvasElement) and Node (canvas package) environments.
17
- */
18
- import { DEFAULT_CONFIG } from './types';
19
- import { createP5Runtime, injectTimeVariables, injectProtocolVariables } from './p5-runtime';
20
- import { FORBIDDEN_APIS, createSafeMath } from './execution-sandbox';
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
- }
38
- /**
39
- * Create a runtime canvas that works in both browser and Node environments.
40
- * Browser: uses HTMLCanvasElement
41
- * Node/Headless: uses `canvas` npm package
42
- */
43
- async function createRuntimeCanvas(width, height) {
44
- // Browser environment
45
- if (typeof document !== 'undefined' && typeof document.createElement === 'function') {
46
- const canvas = document.createElement('canvas');
47
- canvas.width = width;
48
- canvas.height = height;
49
- return canvas;
50
- }
51
- // Node / headless environment (oracle, CI)
52
- const nodeCanvas = await getNodeCanvas();
53
- if (nodeCanvas && nodeCanvas.createCanvas) {
54
- return nodeCanvas.createCanvas(width, height);
55
- }
56
- throw new Error('[Code Mode Protocol Error] Headless canvas unavailable. ' +
57
- 'Install `canvas` for oracle execution.');
58
- }
59
- export async function runStaticMode(config, options) {
60
- const { code, seed, vars, onPreview, onProgress, onComplete, onError, returnImageData } = options;
61
- const width = config.width ?? DEFAULT_CONFIG.width;
62
- const height = config.height ?? DEFAULT_CONFIG.height;
63
- try {
64
- onProgress?.({
65
- phase: 'setup',
66
- percent: 0,
67
- message: 'Initializing canvas...',
68
- });
69
- // Create runtime canvas (browser or Node)
70
- const canvas = await createRuntimeCanvas(width, height);
71
- // Create p5 runtime with optional seed for determinism
72
- const p = createP5Runtime(canvas, width, height, { seed });
73
- // Inject time variables (static = frame 0, t = 0, totalFrames = 1)
74
- injectTimeVariables(p, {
75
- frameCount: 0,
76
- t: 0,
77
- time: 0,
78
- tGlobal: 0,
79
- totalFrames: 1, // Static mode has 1 frame
80
- });
81
- // Inject protocol variables (VAR[0..9])
82
- injectProtocolVariables(p, vars);
83
- onProgress?.({
84
- phase: 'setup',
85
- percent: 10,
86
- message: 'Parsing code...',
87
- });
88
- // Extract setup() function only - draw() is NOT executed in Static Mode
89
- const setupMatch = code.match(/function\s+setup\s*\(\s*\)\s*\{([\s\S]*?)\}(?=\s*function|\s*$)/);
90
- const setupCode = setupMatch ? setupMatch[1].trim() : code;
91
- // Validate - no forbidden patterns
92
- const forbiddenPatterns = ['setTimeout', 'setInterval', 'requestAnimationFrame'];
93
- for (const pattern of forbiddenPatterns) {
94
- if (code.includes(pattern)) {
95
- throw new Error(`Forbidden async timing function: ${pattern}`);
96
- }
97
- }
98
- onProgress?.({
99
- phase: 'rendering',
100
- percent: 30,
101
- message: 'Executing setup()...',
102
- });
103
- // Create sandboxed execution context
104
- // All forbidden APIs are injected as parameters to override globals
105
- const safeMath = createSafeMath();
106
- const forbiddenKeys = Object.keys(FORBIDDEN_APIS);
107
- // Create wrapped setup function with p5 context, VAR, and blocked globals
108
- const wrappedSetup = new Function('p', 'frameCount', 't', 'time', 'tGlobal', 'VAR', 'Math', ...forbiddenKeys, `with(p) { ${setupCode} }`);
109
- // Execute setup() only with sandboxed context
110
- const forbiddenValues = forbiddenKeys.map(k => FORBIDDEN_APIS[k]);
111
- wrappedSetup(p, 0, 0, 0, 0, p.VAR, safeMath, ...forbiddenValues);
112
- // Provide preview callback
113
- onPreview?.(canvas);
114
- onProgress?.({
115
- phase: 'encoding',
116
- percent: 70,
117
- message: returnImageData ? 'Capturing ImageData...' : 'Capturing PNG...',
118
- });
119
- // Get 2D context for pixel access
120
- const ctx = canvas.getContext('2d');
121
- if (!ctx) {
122
- throw new Error('Failed to acquire 2D context');
123
- }
124
- // Always capture pixel data first
125
- const imageData = ctx.getImageData(0, 0, width, height);
126
- // ORACLE / NODE PATH — MUST NOT TOUCH toBlob
127
- if (returnImageData) {
128
- onProgress?.({
129
- phase: 'complete',
130
- percent: 100,
131
- message: 'Complete',
132
- });
133
- onComplete({
134
- type: 'image',
135
- imageData,
136
- });
137
- return; // Early return - never touch toBlob in oracle mode
138
- }
139
- // BROWSER / UI PATH ONLY
140
- const blob = await new Promise((resolve, reject) => {
141
- canvas.toBlob((b) => b ? resolve(b) : reject(new Error('Failed to capture PNG')), 'image/png');
142
- });
143
- onProgress?.({
144
- phase: 'complete',
145
- percent: 100,
146
- message: 'Complete',
147
- });
148
- onComplete({
149
- type: 'image',
150
- blob,
151
- });
152
- }
153
- catch (error) {
154
- const err = error instanceof Error ? error : new Error(String(error));
155
- onError?.(err);
156
- }
157
- }
package/dist/types.d.ts DELETED
@@ -1,191 +0,0 @@
1
- /**
2
- * NexArt Code Mode Runtime SDK - Types
3
- * Version: 1.6.0 (Protocol v1.2.0)
4
- *
5
- * Type definitions for the Code Mode runtime engine.
6
- * This is the canonical type surface for @nexart/codemode-sdk.
7
- */
8
- /**
9
- * Protocol Constants
10
- * These define the locked protocol identity.
11
- */
12
- export declare const PROTOCOL_IDENTITY: {
13
- readonly protocol: "nexart";
14
- readonly engine: "codemode";
15
- readonly protocolVersion: "1.2.0";
16
- readonly phase: 3;
17
- readonly deterministic: true;
18
- };
19
- export type RenderMode = 'static' | 'loop';
20
- /**
21
- * Runtime Canvas
22
- * Abstraction for browser (HTMLCanvasElement) and Node (canvas package) environments.
23
- * In Node, the `canvas` npm package provides an HTMLCanvasElement-compatible interface.
24
- */
25
- export type RuntimeCanvas = HTMLCanvasElement;
26
- export interface EngineConfig {
27
- mode: RenderMode;
28
- width?: number;
29
- height?: number;
30
- duration?: number;
31
- fps?: number;
32
- }
33
- /**
34
- * Render Result (Discriminated Union)
35
- *
36
- * Static mode can return either:
37
- * - blob: For display/download (PNG)
38
- * - imageData: For oracle hashing (raw pixels)
39
- *
40
- * Video mode returns blob with frame/duration metadata.
41
- */
42
- export type RenderResult = {
43
- type: 'image';
44
- blob: Blob;
45
- } | {
46
- type: 'image';
47
- imageData: ImageData;
48
- } | {
49
- type: 'video';
50
- blob: Blob;
51
- frames?: number;
52
- duration?: number;
53
- };
54
- export interface RunOptions {
55
- code: string;
56
- seed?: number;
57
- vars?: number[];
58
- onPreview?: (canvas: RuntimeCanvas) => void;
59
- onProgress?: (progress: ProgressInfo) => void;
60
- onComplete: (result: RenderResult) => void;
61
- onError?: (error: Error) => void;
62
- returnImageData?: boolean;
63
- }
64
- export interface ProgressInfo {
65
- phase: 'setup' | 'rendering' | 'encoding' | 'complete';
66
- frame?: number;
67
- totalFrames?: number;
68
- percent: number;
69
- message: string;
70
- }
71
- export interface Engine {
72
- run: (options: RunOptions) => Promise<void>;
73
- stop: () => void;
74
- getConfig: () => Readonly<EngineConfig>;
75
- }
76
- export interface TimeVariables {
77
- frameCount: number;
78
- t: number;
79
- time: number;
80
- tGlobal: number;
81
- totalFrames: number;
82
- }
83
- /**
84
- * Protocol Variables (VAR[0..9])
85
- * First-class protocol inputs for deterministic rendering.
86
- * Used by SoundArt, Shapes, Noise, and ByX collections.
87
- *
88
- * Rules (SDK v1.0.2, Protocol v1.0.0):
89
- * - Input array can have 0-10 elements (protocol error if > 10)
90
- * - All values MUST be finite numbers (protocol error if not)
91
- * - Values MUST be in range 0-100 (protocol error if out of range, NO clamping)
92
- * - Runtime VAR is ALWAYS 10 elements (padded with zeros for consistency)
93
- * - Read-only inside sketches (write attempts throw protocol error)
94
- * - Default: all zeros if not provided
95
- */
96
- export interface ProtocolVariables {
97
- VAR: readonly [number, number, number, number, number, number, number, number, number, number];
98
- }
99
- /**
100
- * Default protocol variables (all zeros)
101
- */
102
- export declare const DEFAULT_VARS: ProtocolVariables;
103
- export declare const DEFAULT_CONFIG: {
104
- readonly width: 1950;
105
- readonly height: 2400;
106
- readonly duration: 2;
107
- readonly fps: 30;
108
- readonly minDuration: 1;
109
- readonly maxDuration: 4;
110
- };
111
- /**
112
- * Protocol Metadata
113
- * Attached to every execution result for verification.
114
- */
115
- export interface ProtocolMetadata {
116
- protocol: 'nexart';
117
- engine: 'codemode';
118
- protocolVersion: '1.2.0';
119
- phase: 3;
120
- deterministic: true;
121
- seed: number;
122
- vars: number[];
123
- width: number;
124
- height: number;
125
- mode: RenderMode;
126
- totalFrames?: number;
127
- }
128
- /**
129
- * Canonical Execution Input
130
- * The single entry point for all Code Mode execution.
131
- */
132
- export interface ExecuteCodeModeInput {
133
- source: string;
134
- width: number;
135
- height: number;
136
- seed: number;
137
- vars?: number[];
138
- mode: RenderMode;
139
- totalFrames?: number;
140
- }
141
- /**
142
- * Canonical Execution Result
143
- * Every execution produces this structure.
144
- */
145
- export interface ExecuteCodeModeResult {
146
- image?: Blob;
147
- video?: Blob;
148
- frames?: ImageData[];
149
- metadata: ProtocolMetadata;
150
- }
151
- /**
152
- * Builder Manifest (v1.6.0)
153
- *
154
- * Passive, declarative metadata for builder attribution.
155
- * This is data-only with no logic, rewards, or enforcement attached.
156
- *
157
- * Rules:
158
- * - Registration is optional
159
- * - Missing or invalid manifest does NOT throw
160
- * - No network calls, no telemetry, no analytics
161
- * - Does NOT affect execution behavior or determinism
162
- * - Used for future attribution and ecosystem discovery
163
- */
164
- export interface NexArtBuilderManifest {
165
- protocol: 'nexart';
166
- manifestVersion: string;
167
- app?: {
168
- name?: string;
169
- url?: string;
170
- description?: string;
171
- contact?: string;
172
- };
173
- sdk?: {
174
- package?: string;
175
- version?: string;
176
- execution?: string;
177
- };
178
- renderer?: {
179
- package?: string;
180
- version?: string;
181
- mode?: 'preview' | 'canonical';
182
- };
183
- features?: Record<string, boolean>;
184
- declaration?: {
185
- usesOfficialSdk?: boolean;
186
- noRuntimeModification?: boolean;
187
- noProtocolBypass?: boolean;
188
- };
189
- timestamp?: string;
190
- }
191
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;CAMpB,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE3C;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GACpB;IACE,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;CACZ,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,SAAS,CAAC;CACtB,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IAC5C,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAC;IAC9C,UAAU,E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C,EAAE,SAAS,GAAG,WAAW,CAAC;KAChC,CAAC;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,WAAW,CAAC,EAAE;QACZ,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAC;QAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;KAC5B,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
package/dist/types.js DELETED
@@ -1,32 +0,0 @@
1
- /**
2
- * NexArt Code Mode Runtime SDK - Types
3
- * Version: 1.6.0 (Protocol v1.2.0)
4
- *
5
- * Type definitions for the Code Mode runtime engine.
6
- * This is the canonical type surface for @nexart/codemode-sdk.
7
- */
8
- /**
9
- * Protocol Constants
10
- * These define the locked protocol identity.
11
- */
12
- export const PROTOCOL_IDENTITY = {
13
- protocol: 'nexart',
14
- engine: 'codemode',
15
- protocolVersion: '1.2.0',
16
- phase: 3,
17
- deterministic: true,
18
- };
19
- /**
20
- * Default protocol variables (all zeros)
21
- */
22
- export const DEFAULT_VARS = {
23
- VAR: Object.freeze([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
24
- };
25
- export const DEFAULT_CONFIG = {
26
- width: 1950,
27
- height: 2400,
28
- duration: 2,
29
- fps: 30,
30
- minDuration: 1,
31
- maxDuration: 4,
32
- };