@vector-nodes/core 0.1.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/LICENSE +201 -0
- package/README.md +20 -0
- package/dist/colors.d.ts +13 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js +23 -0
- package/dist/colors.js.map +1 -0
- package/dist/conversions.d.ts +12 -0
- package/dist/conversions.d.ts.map +1 -0
- package/dist/conversions.js +45 -0
- package/dist/conversions.js.map +1 -0
- package/dist/graph.d.ts +104 -0
- package/dist/graph.d.ts.map +1 -0
- package/dist/graph.js +66 -0
- package/dist/graph.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/node-definition.d.ts +55 -0
- package/dist/node-definition.d.ts.map +1 -0
- package/dist/node-definition.js +14 -0
- package/dist/node-definition.js.map +1 -0
- package/dist/nodes.d.ts +16 -0
- package/dist/nodes.d.ts.map +1 -0
- package/dist/nodes.js +207 -0
- package/dist/nodes.js.map +1 -0
- package/dist/registry.d.ts +28 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +50 -0
- package/dist/registry.js.map +1 -0
- package/dist/schema.d.ts +220 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +163 -0
- package/dist/schema.js.map +1 -0
- package/dist/socket-types.d.ts +25 -0
- package/dist/socket-types.d.ts.map +1 -0
- package/dist/socket-types.js +26 -0
- package/dist/socket-types.js.map +1 -0
- package/dist/validate-graph.d.ts +37 -0
- package/dist/validate-graph.d.ts.map +1 -0
- package/dist/validate-graph.js +201 -0
- package/dist/validate-graph.js.map +1 -0
- package/dist/vnodes.d.ts +37 -0
- package/dist/vnodes.d.ts.map +1 -0
- package/dist/vnodes.js +59 -0
- package/dist/vnodes.js.map +1 -0
- package/package.json +40 -0
package/dist/nodes.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NodeDefinition } from './node-definition';
|
|
2
|
+
import { NodeRegistry } from './registry';
|
|
3
|
+
import { type SocketType } from './socket-types';
|
|
4
|
+
/** Prefix shared by the per-type Parameter node types (e.g. `ParameterFloat`). */
|
|
5
|
+
export declare const PARAMETER_NODE_PREFIX = "Parameter";
|
|
6
|
+
/** The node type that exposes a network parameter of socket type `type`. */
|
|
7
|
+
export declare function parameterNodeType(type: SocketType): string;
|
|
8
|
+
/** Whether `type` is one of the generated Parameter node types. */
|
|
9
|
+
export declare function isParameterNodeType(type: string): boolean;
|
|
10
|
+
/** Every Parameter node type, one per socket type (incl. `ParameterGeometry`). */
|
|
11
|
+
export declare const PARAMETER_NODE_TYPES: string[];
|
|
12
|
+
/** Declarative definitions for the basic node set (Phase 2). */
|
|
13
|
+
export declare const BASIC_NODE_DEFINITIONS: NodeDefinition[];
|
|
14
|
+
/** A {@link NodeRegistry} pre-populated with the basic node definitions. */
|
|
15
|
+
export declare function createBasicRegistry(): NodeRegistry;
|
|
16
|
+
//# sourceMappingURL=nodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../src/nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE/D,kFAAkF;AAClF,eAAO,MAAM,qBAAqB,cAAc,CAAC;AAEjD,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAE1D;AAED,mEAAmE;AACnE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKzD;AAED,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,EAAE,MAAM,EAAwC,CAAC;AAyClF,gEAAgE;AAChE,eAAO,MAAM,sBAAsB,EAAE,cAAc,EA2JlD,CAAC;AAEF,4EAA4E;AAC5E,wBAAgB,mBAAmB,IAAI,YAAY,CAElD"}
|
package/dist/nodes.js
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { NodeRegistry } from './registry';
|
|
2
|
+
import { SOCKET_TYPES } from './socket-types';
|
|
3
|
+
/** Prefix shared by the per-type Parameter node types (e.g. `ParameterFloat`). */
|
|
4
|
+
export const PARAMETER_NODE_PREFIX = 'Parameter';
|
|
5
|
+
/** The node type that exposes a network parameter of socket type `type`. */
|
|
6
|
+
export function parameterNodeType(type) {
|
|
7
|
+
return `${PARAMETER_NODE_PREFIX}${type}`;
|
|
8
|
+
}
|
|
9
|
+
/** Whether `type` is one of the generated Parameter node types. */
|
|
10
|
+
export function isParameterNodeType(type) {
|
|
11
|
+
return (type.startsWith(PARAMETER_NODE_PREFIX) &&
|
|
12
|
+
SOCKET_TYPES.includes(type.slice(PARAMETER_NODE_PREFIX.length)));
|
|
13
|
+
}
|
|
14
|
+
/** Every Parameter node type, one per socket type (incl. `ParameterGeometry`). */
|
|
15
|
+
export const PARAMETER_NODE_TYPES = SOCKET_TYPES.map(parameterNodeType);
|
|
16
|
+
/** A constant node: a single param `value` echoed to a `value` output. */
|
|
17
|
+
function constantDef(type, socketType, defaultValue) {
|
|
18
|
+
return {
|
|
19
|
+
type,
|
|
20
|
+
label: `${socketType} Constant`,
|
|
21
|
+
category: 'Input',
|
|
22
|
+
inputs: [],
|
|
23
|
+
outputs: [{ name: 'value', type: socketType }],
|
|
24
|
+
params: [{ name: 'value', type: socketType, default: defaultValue }],
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const xyzInputs = [
|
|
28
|
+
{ name: 'x', type: 'Float', default: 0 },
|
|
29
|
+
{ name: 'y', type: 'Float', default: 0 },
|
|
30
|
+
{ name: 'z', type: 'Float', default: 0 },
|
|
31
|
+
];
|
|
32
|
+
// The point-source nodes (grid/line/circle/random) all emit the same pair of
|
|
33
|
+
// outputs: a geometry bundle and the raw point field.
|
|
34
|
+
const pointSourceOutputs = [
|
|
35
|
+
{ name: 'geometry', type: 'Geometry' },
|
|
36
|
+
{ name: 'points', type: 'Vector', isArray: true },
|
|
37
|
+
];
|
|
38
|
+
/** A point-source node definition: shared outputs, mode-specific params. */
|
|
39
|
+
function pointSourceDef(type, label, params) {
|
|
40
|
+
return { type, label, category: 'Geometry', inputs: [], outputs: pointSourceOutputs, params };
|
|
41
|
+
}
|
|
42
|
+
const parameterDefs = SOCKET_TYPES.map((type) => ({
|
|
43
|
+
type: parameterNodeType(type),
|
|
44
|
+
label: `Parameter (${type})`,
|
|
45
|
+
category: 'Input',
|
|
46
|
+
inputs: [],
|
|
47
|
+
outputs: [{ name: 'value', type }],
|
|
48
|
+
params: [{ name: 'name', type: 'String', default: '' }],
|
|
49
|
+
}));
|
|
50
|
+
/** Declarative definitions for the basic node set (Phase 2). */
|
|
51
|
+
export const BASIC_NODE_DEFINITIONS = [
|
|
52
|
+
// Constants
|
|
53
|
+
constantDef('ConstFloat', 'Float', 0),
|
|
54
|
+
constantDef('ConstInteger', 'Integer', 0),
|
|
55
|
+
constantDef('ConstBoolean', 'Boolean', false),
|
|
56
|
+
constantDef('ConstVector', 'Vector', [0, 0, 0]),
|
|
57
|
+
constantDef('ConstColor', 'Color', [0, 0, 0, 1]),
|
|
58
|
+
constantDef('ConstString', 'String', ''),
|
|
59
|
+
// Vector construction / decomposition
|
|
60
|
+
{
|
|
61
|
+
type: 'Point',
|
|
62
|
+
label: 'Point',
|
|
63
|
+
category: 'Vector',
|
|
64
|
+
inputs: xyzInputs,
|
|
65
|
+
outputs: [{ name: 'point', type: 'Vector' }],
|
|
66
|
+
params: [],
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
type: 'Vector',
|
|
70
|
+
label: 'Vector',
|
|
71
|
+
category: 'Vector',
|
|
72
|
+
inputs: xyzInputs,
|
|
73
|
+
outputs: [{ name: 'vector', type: 'Vector' }],
|
|
74
|
+
params: [],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
type: 'CombineXYZ',
|
|
78
|
+
label: 'Combine XYZ',
|
|
79
|
+
category: 'Vector',
|
|
80
|
+
inputs: xyzInputs,
|
|
81
|
+
outputs: [{ name: 'vector', type: 'Vector' }],
|
|
82
|
+
params: [],
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
type: 'SeparateXYZ',
|
|
86
|
+
label: 'Separate XYZ',
|
|
87
|
+
category: 'Vector',
|
|
88
|
+
inputs: [{ name: 'vector', type: 'Vector', default: [0, 0, 0] }],
|
|
89
|
+
outputs: [
|
|
90
|
+
{ name: 'x', type: 'Float' },
|
|
91
|
+
{ name: 'y', type: 'Float' },
|
|
92
|
+
{ name: 'z', type: 'Float' },
|
|
93
|
+
],
|
|
94
|
+
params: [],
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
type: 'VectorMath',
|
|
98
|
+
label: 'Vector Math',
|
|
99
|
+
category: 'Vector',
|
|
100
|
+
inputs: [
|
|
101
|
+
{ name: 'a', type: 'Vector', default: [0, 0, 0] },
|
|
102
|
+
{ name: 'b', type: 'Vector', default: [0, 0, 0] },
|
|
103
|
+
{ name: 'scale', type: 'Float', default: 1 },
|
|
104
|
+
],
|
|
105
|
+
outputs: [
|
|
106
|
+
{ name: 'vector', type: 'Vector' },
|
|
107
|
+
{ name: 'value', type: 'Float' },
|
|
108
|
+
],
|
|
109
|
+
params: [
|
|
110
|
+
{
|
|
111
|
+
name: 'operation',
|
|
112
|
+
type: 'String',
|
|
113
|
+
default: 'add',
|
|
114
|
+
options: ['add', 'subtract', 'scale', 'dot', 'cross', 'normalize', 'length', 'distance'],
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
type: 'VectorArray',
|
|
120
|
+
label: 'Vector Array',
|
|
121
|
+
category: 'Vector',
|
|
122
|
+
inputs: [],
|
|
123
|
+
outputs: [{ name: 'vectors', type: 'Vector', isArray: true }],
|
|
124
|
+
params: [{ name: 'values', type: 'Vector', isArray: true, default: [] }],
|
|
125
|
+
},
|
|
126
|
+
// Geometry — point sources, one node per pattern
|
|
127
|
+
pointSourceDef('PointGrid', 'Point Grid', [
|
|
128
|
+
{ name: 'countX', type: 'Integer', default: 3, min: 1 },
|
|
129
|
+
{ name: 'countY', type: 'Integer', default: 3, min: 1 },
|
|
130
|
+
{ name: 'spacingX', type: 'Float', default: 1 },
|
|
131
|
+
{ name: 'spacingY', type: 'Float', default: 1 },
|
|
132
|
+
]),
|
|
133
|
+
pointSourceDef('PointLine', 'Point Line', [
|
|
134
|
+
{ name: 'start', type: 'Vector', default: [0, 0, 0] },
|
|
135
|
+
{ name: 'end', type: 'Vector', default: [1, 0, 0] },
|
|
136
|
+
{ name: 'count', type: 'Integer', default: 8, min: 0 },
|
|
137
|
+
]),
|
|
138
|
+
pointSourceDef('PointCircle', 'Point Circle', [
|
|
139
|
+
{ name: 'radius', type: 'Float', default: 1 },
|
|
140
|
+
{ name: 'count', type: 'Integer', default: 8, min: 0 },
|
|
141
|
+
]),
|
|
142
|
+
pointSourceDef('PointRandom', 'Point Random', [
|
|
143
|
+
{ name: 'count', type: 'Integer', default: 8, min: 0 },
|
|
144
|
+
{ name: 'min', type: 'Vector', default: [0, 0, 0] },
|
|
145
|
+
{ name: 'max', type: 'Vector', default: [1, 1, 1] },
|
|
146
|
+
{ name: 'seed', type: 'Integer', default: 0 },
|
|
147
|
+
]),
|
|
148
|
+
{
|
|
149
|
+
type: 'Project',
|
|
150
|
+
label: 'Project',
|
|
151
|
+
category: 'Geometry',
|
|
152
|
+
inputs: [{ name: 'geometry', type: 'Geometry' }],
|
|
153
|
+
outputs: [{ name: 'geometry', type: 'Geometry' }],
|
|
154
|
+
params: [
|
|
155
|
+
{
|
|
156
|
+
name: 'mode',
|
|
157
|
+
type: 'String',
|
|
158
|
+
default: 'orthographic',
|
|
159
|
+
options: ['orthographic', 'perspective'],
|
|
160
|
+
},
|
|
161
|
+
{ name: 'distance', type: 'Float', default: 10 },
|
|
162
|
+
],
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
type: 'Translate',
|
|
166
|
+
label: 'Translate',
|
|
167
|
+
category: 'Geometry',
|
|
168
|
+
inputs: [
|
|
169
|
+
{ name: 'geometry', type: 'Geometry' },
|
|
170
|
+
{ name: 'offset', type: 'Vector', default: [0, 0, 0] },
|
|
171
|
+
],
|
|
172
|
+
outputs: [{ name: 'geometry', type: 'Geometry' }],
|
|
173
|
+
params: [],
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
type: 'BezierCurve',
|
|
177
|
+
label: 'Bezier Curve',
|
|
178
|
+
category: 'Geometry',
|
|
179
|
+
inputs: [
|
|
180
|
+
{ name: 'p0', type: 'Vector', default: [0, 0, 0] },
|
|
181
|
+
{ name: 'p1', type: 'Vector', default: [0, 0, 0] },
|
|
182
|
+
{ name: 'p2', type: 'Vector', default: [0, 0, 0] },
|
|
183
|
+
{ name: 'p3', type: 'Vector', default: [0, 0, 0] },
|
|
184
|
+
],
|
|
185
|
+
outputs: [
|
|
186
|
+
{ name: 'geometry', type: 'Geometry' },
|
|
187
|
+
{ name: 'points', type: 'Vector', isArray: true },
|
|
188
|
+
],
|
|
189
|
+
params: [{ name: 'segments', type: 'Integer', default: 16, min: 1 }],
|
|
190
|
+
},
|
|
191
|
+
// Parameters (one per socket type, incl. Geometry)
|
|
192
|
+
...parameterDefs,
|
|
193
|
+
// Output
|
|
194
|
+
{
|
|
195
|
+
type: 'OutputGeometry',
|
|
196
|
+
label: 'Output Geometry',
|
|
197
|
+
category: 'Output',
|
|
198
|
+
inputs: [{ name: 'geometry', type: 'Geometry' }],
|
|
199
|
+
outputs: [],
|
|
200
|
+
params: [],
|
|
201
|
+
},
|
|
202
|
+
];
|
|
203
|
+
/** A {@link NodeRegistry} pre-populated with the basic node definitions. */
|
|
204
|
+
export function createBasicRegistry() {
|
|
205
|
+
return new Node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AAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;QAChD,OAAO,EAAE,EAAE;QACX,MAAM,EAAE,EAAE;KACX;CACF,CAAC;AAEF,4EAA4E;AAC5E,MAAM,UAAU,mBAAmB;IACjC,OAAO,IAAI,YAAY,CAAC,sBAAsB,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { NodeDefinition } from './node-definition';
|
|
2
|
+
/**
|
|
3
|
+
* A lookup table of {@link NodeDefinition}s keyed by their `type`.
|
|
4
|
+
*
|
|
5
|
+
* The editor, validator, interpreter, and codegen all resolve node types
|
|
6
|
+
* through a registry so that adding a node in one place flows everywhere.
|
|
7
|
+
*/
|
|
8
|
+
export declare class NodeRegistry {
|
|
9
|
+
#private;
|
|
10
|
+
/** Create a registry, optionally pre-populated with definitions. */
|
|
11
|
+
constructor(definitions?: Iterable<NodeDefinition>);
|
|
12
|
+
/**
|
|
13
|
+
* Register a definition. Throws if a definition with the same `type` is
|
|
14
|
+
* already registered.
|
|
15
|
+
*/
|
|
16
|
+
register(def: NodeDefinition): void;
|
|
17
|
+
/** Whether a definition is registered for `type`. */
|
|
18
|
+
has(type: string): boolean;
|
|
19
|
+
/** Get a definition by `type`, or `undefined` if none is registered. */
|
|
20
|
+
get(type: string): NodeDefinition | undefined;
|
|
21
|
+
/** Get a definition by `type`, throwing if none is registered. */
|
|
22
|
+
require(type: string): NodeDefinition;
|
|
23
|
+
/** All registered definitions, in registration order. */
|
|
24
|
+
list(): NodeDefinition[];
|
|
25
|
+
/** Number of registered definitions. */
|
|
26
|
+
get size(): number;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;;;GAKG;AACH,qBAAa,YAAY;;IAGvB,oEAAoE;gBACxD,WAAW,GAAE,QAAQ,CAAC,cAAc,CAAM;IAMtD;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;IAOnC,qDAAqD;IACrD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI1B,wEAAwE;IACxE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS;IAI7C,kEAAkE;IAClE,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc;IAQrC,yDAAyD;IACzD,IAAI,IAAI,cAAc,EAAE;IAIxB,wCAAwC;IACxC,IAAI,IAAI,IAAI,MAAM,CAEjB;CACF"}
|
package/dist/registry.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A lookup table of {@link NodeDefinition}s keyed by their `type`.
|
|
3
|
+
*
|
|
4
|
+
* The editor, validator, interpreter, and codegen all resolve node types
|
|
5
|
+
* through a registry so that adding a node in one place flows everywhere.
|
|
6
|
+
*/
|
|
7
|
+
export class NodeRegistry {
|
|
8
|
+
#definitions = new Map();
|
|
9
|
+
/** Create a registry, optionally pre-populated with definitions. */
|
|
10
|
+
constructor(definitions = []) {
|
|
11
|
+
for (const def of definitions) {
|
|
12
|
+
this.register(def);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Register a definition. Throws if a definition with the same `type` is
|
|
17
|
+
* already registered.
|
|
18
|
+
*/
|
|
19
|
+
register(def) {
|
|
20
|
+
if (this.#definitions.has(def.type)) {
|
|
21
|
+
throw new Error(`Node type already registered: "${def.type}"`);
|
|
22
|
+
}
|
|
23
|
+
this.#definitions.set(def.type, def);
|
|
24
|
+
}
|
|
25
|
+
/** Whether a definition is registered for `type`. */
|
|
26
|
+
has(type) {
|
|
27
|
+
return this.#definitions.has(type);
|
|
28
|
+
}
|
|
29
|
+
/** Get a definition by `type`, or `undefined` if none is registered. */
|
|
30
|
+
get(type) {
|
|
31
|
+
return this.#definitions.get(type);
|
|
32
|
+
}
|
|
33
|
+
/** Get a definition by `type`, throwing if none is registered. */
|
|
34
|
+
require(type) {
|
|
35
|
+
const def = this.#definitions.get(type);
|
|
36
|
+
if (def === undefined) {
|
|
37
|
+
throw new Error(`Unknown node type: "${type}"`);
|
|
38
|
+
}
|
|
39
|
+
return def;
|
|
40
|
+
}
|
|
41
|
+
/** All registered definitions, in registration order. */
|
|
42
|
+
list() {
|
|
43
|
+
return [...this.#definitions.values()];
|
|
44
|
+
}
|
|
45
|
+
/** Number of registered definitions. */
|
|
46
|
+
get size() {
|
|
47
|
+
return this.#definitions.size;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,OAAO,YAAY;IACd,YAAY,GAAG,IAAI,GAAG,EAA0B,CAAC;IAE1D,oEAAoE;IACpE,YAAY,cAAwC,EAAE;QACpD,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;YAC9B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,GAAmB;QAC1B,IAAI,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,kCAAkC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC;QACjE,CAAC;QACD,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACvC,CAAC;IAED,qDAAqD;IACrD,GAAG,CAAC,IAAY;QACd,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,wEAAwE;IACxE,GAAG,CAAC,IAAY;QACd,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAED,kEAAkE;IAClE,OAAO,CAAC,IAAY;QAClB,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,GAAG,CAAC,CAAC;QAClD,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,yDAAyD;IACzD,IAAI;QACF,OAAO,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,wCAAwC;IACxC,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;IAChC,CAAC;CACF"}
|
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `.vnodes` JSON Schema (draft 2020-12), embedded so the package is
|
|
3
|
+
* self-contained when published.
|
|
4
|
+
*
|
|
5
|
+
* This is a verbatim copy of the canonical `docs/vnodes.schema.json`. The two
|
|
6
|
+
* are kept in sync by `schema.test.ts`, which fails if they diverge.
|
|
7
|
+
*/
|
|
8
|
+
export declare const VNODES_SCHEMA: {
|
|
9
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
10
|
+
readonly $id: "https://vector-nodes.dev/schema/vnodes.schema.json";
|
|
11
|
+
readonly title: "Vector Nodes network (.vnodes)";
|
|
12
|
+
readonly description: "Skeleton schema for the Vector Nodes JSON network definition format. Refined during Phase 1.";
|
|
13
|
+
readonly type: "object";
|
|
14
|
+
readonly required: readonly ["format", "version", "nodes", "links"];
|
|
15
|
+
readonly additionalProperties: false;
|
|
16
|
+
readonly properties: {
|
|
17
|
+
readonly format: {
|
|
18
|
+
readonly const: "vector-nodes";
|
|
19
|
+
readonly description: "Format discriminator.";
|
|
20
|
+
};
|
|
21
|
+
readonly version: {
|
|
22
|
+
readonly type: "string";
|
|
23
|
+
readonly pattern: "^\\d+\\.\\d+$";
|
|
24
|
+
readonly description: "Format version, e.g. \"1.0\".";
|
|
25
|
+
};
|
|
26
|
+
readonly metadata: {
|
|
27
|
+
readonly type: "object";
|
|
28
|
+
readonly description: "Human-facing info. `name` seeds the generated function name.";
|
|
29
|
+
readonly properties: {
|
|
30
|
+
readonly name: {
|
|
31
|
+
readonly type: "string";
|
|
32
|
+
};
|
|
33
|
+
readonly author: {
|
|
34
|
+
readonly type: "string";
|
|
35
|
+
};
|
|
36
|
+
readonly description: {
|
|
37
|
+
readonly type: "string";
|
|
38
|
+
};
|
|
39
|
+
readonly created: {
|
|
40
|
+
readonly type: "string";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
readonly additionalProperties: true;
|
|
44
|
+
};
|
|
45
|
+
readonly parameters: {
|
|
46
|
+
readonly type: "array";
|
|
47
|
+
readonly description: "External, typed inputs exposed as the generated function's arguments.";
|
|
48
|
+
readonly items: {
|
|
49
|
+
readonly $ref: "#/$defs/parameter";
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
readonly nodes: {
|
|
53
|
+
readonly type: "array";
|
|
54
|
+
readonly description: "The nodes in the network. Exactly one OutputGeometry node is expected.";
|
|
55
|
+
readonly items: {
|
|
56
|
+
readonly $ref: "#/$defs/node";
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
readonly links: {
|
|
60
|
+
readonly type: "array";
|
|
61
|
+
readonly description: "Edges connecting an output socket to an input socket.";
|
|
62
|
+
readonly items: {
|
|
63
|
+
readonly $ref: "#/$defs/link";
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
readonly metaNodes: {
|
|
67
|
+
readonly type: "object";
|
|
68
|
+
readonly description: "Reusable meta-node (function) definitions, keyed by name.";
|
|
69
|
+
readonly additionalProperties: {
|
|
70
|
+
readonly $ref: "#/$defs/metaNode";
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
readonly $defs: {
|
|
75
|
+
readonly socketType: {
|
|
76
|
+
readonly type: "string";
|
|
77
|
+
readonly enum: readonly ["Float", "Integer", "Boolean", "Vector", "Color", "String", "Geometry", "Matrix"];
|
|
78
|
+
readonly description: "Socket data type. Drives color-coding and link type-checking.";
|
|
79
|
+
};
|
|
80
|
+
readonly parameter: {
|
|
81
|
+
readonly type: "object";
|
|
82
|
+
readonly required: readonly ["id", "type"];
|
|
83
|
+
readonly additionalProperties: false;
|
|
84
|
+
readonly properties: {
|
|
85
|
+
readonly id: {
|
|
86
|
+
readonly type: "string";
|
|
87
|
+
};
|
|
88
|
+
readonly type: {
|
|
89
|
+
readonly $ref: "#/$defs/socketType";
|
|
90
|
+
};
|
|
91
|
+
readonly isArray: {
|
|
92
|
+
readonly type: "boolean";
|
|
93
|
+
readonly default: false;
|
|
94
|
+
readonly description: "True if this carries a field/array of the type.";
|
|
95
|
+
};
|
|
96
|
+
readonly default: {
|
|
97
|
+
readonly description: "Default value; shape depends on `type`.";
|
|
98
|
+
};
|
|
99
|
+
readonly min: {
|
|
100
|
+
readonly type: "number";
|
|
101
|
+
};
|
|
102
|
+
readonly max: {
|
|
103
|
+
readonly type: "number";
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
readonly node: {
|
|
108
|
+
readonly type: "object";
|
|
109
|
+
readonly required: readonly ["id", "type"];
|
|
110
|
+
readonly additionalProperties: false;
|
|
111
|
+
readonly properties: {
|
|
112
|
+
readonly id: {
|
|
113
|
+
readonly type: "string";
|
|
114
|
+
readonly description: "Stable unique id used by links.";
|
|
115
|
+
};
|
|
116
|
+
readonly type: {
|
|
117
|
+
readonly type: "string";
|
|
118
|
+
readonly description: "Node type from the node library (e.g. \"PointCircle\", \"OutputGeometry\").";
|
|
119
|
+
};
|
|
120
|
+
readonly position: {
|
|
121
|
+
readonly type: "array";
|
|
122
|
+
readonly description: "Editor canvas position [x, y].";
|
|
123
|
+
readonly items: {
|
|
124
|
+
readonly type: "number";
|
|
125
|
+
};
|
|
126
|
+
readonly minItems: 2;
|
|
127
|
+
readonly maxItems: 2;
|
|
128
|
+
};
|
|
129
|
+
readonly params: {
|
|
130
|
+
readonly type: "object";
|
|
131
|
+
readonly description: "Static parameter values baked into the node.";
|
|
132
|
+
readonly additionalProperties: true;
|
|
133
|
+
};
|
|
134
|
+
readonly label: {
|
|
135
|
+
readonly type: "string";
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
readonly endpoint: {
|
|
140
|
+
readonly type: "array";
|
|
141
|
+
readonly description: "A [nodeId, socketName] reference.";
|
|
142
|
+
readonly items: {
|
|
143
|
+
readonly type: "string";
|
|
144
|
+
};
|
|
145
|
+
readonly minItems: 2;
|
|
146
|
+
readonly maxItems: 2;
|
|
147
|
+
};
|
|
148
|
+
readonly link: {
|
|
149
|
+
readonly type: "object";
|
|
150
|
+
readonly required: readonly ["from", "to"];
|
|
151
|
+
readonly additionalProperties: false;
|
|
152
|
+
readonly properties: {
|
|
153
|
+
readonly from: {
|
|
154
|
+
readonly $ref: "#/$defs/endpoint";
|
|
155
|
+
readonly description: "Source output socket [nodeId, outputSocketName].";
|
|
156
|
+
};
|
|
157
|
+
readonly to: {
|
|
158
|
+
readonly $ref: "#/$defs/endpoint";
|
|
159
|
+
readonly description: "Target input socket [nodeId, inputSocketName].";
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
readonly metaNode: {
|
|
164
|
+
readonly type: "object";
|
|
165
|
+
readonly required: readonly ["interface", "nodes", "links"];
|
|
166
|
+
readonly additionalProperties: false;
|
|
167
|
+
readonly properties: {
|
|
168
|
+
readonly interface: {
|
|
169
|
+
readonly type: "object";
|
|
170
|
+
readonly required: readonly ["inputs", "outputs"];
|
|
171
|
+
readonly additionalProperties: false;
|
|
172
|
+
readonly properties: {
|
|
173
|
+
readonly inputs: {
|
|
174
|
+
readonly type: "array";
|
|
175
|
+
readonly items: {
|
|
176
|
+
readonly $ref: "#/$defs/interfaceSocket";
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
readonly outputs: {
|
|
180
|
+
readonly type: "array";
|
|
181
|
+
readonly items: {
|
|
182
|
+
readonly $ref: "#/$defs/interfaceSocket";
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
readonly nodes: {
|
|
188
|
+
readonly type: "array";
|
|
189
|
+
readonly items: {
|
|
190
|
+
readonly $ref: "#/$defs/node";
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
readonly links: {
|
|
194
|
+
readonly type: "array";
|
|
195
|
+
readonly items: {
|
|
196
|
+
readonly $ref: "#/$defs/link";
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
readonly interfaceSocket: {
|
|
202
|
+
readonly type: "object";
|
|
203
|
+
readonly required: readonly ["name", "type"];
|
|
204
|
+
readonly additionalProperties: false;
|
|
205
|
+
readonly properties: {
|
|
206
|
+
readonly name: {
|
|
207
|
+
readonly type: "string";
|
|
208
|
+
};
|
|
209
|
+
readonly type: {
|
|
210
|
+
readonly $ref: "#/$defs/socketType";
|
|
211
|
+
};
|
|
212
|
+
readonly isArray: {
|
|
213
|
+
readonly type: "boolean";
|
|
214
|
+
readonly default: false;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2JhB,CAAC"}
|