@xenolithengine/graph-plugin-runtime 0.7.0-beta.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.
Files changed (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +60 -0
  3. package/dist/editor/output-widget.d.ts +3 -0
  4. package/dist/editor/output-widget.d.ts.map +1 -0
  5. package/dist/editor/output-widget.js +43 -0
  6. package/dist/editor/output-widget.js.map +1 -0
  7. package/dist/editor/plugin.d.ts +3 -0
  8. package/dist/editor/plugin.d.ts.map +1 -0
  9. package/dist/editor/plugin.js +115 -0
  10. package/dist/editor/plugin.js.map +1 -0
  11. package/dist/editor/runtime-bridge.d.ts +6 -0
  12. package/dist/editor/runtime-bridge.d.ts.map +1 -0
  13. package/dist/editor/runtime-bridge.js +24 -0
  14. package/dist/editor/runtime-bridge.js.map +1 -0
  15. package/dist/editor/schema-sync.d.ts +28 -0
  16. package/dist/editor/schema-sync.d.ts.map +1 -0
  17. package/dist/editor/schema-sync.js +70 -0
  18. package/dist/editor/schema-sync.js.map +1 -0
  19. package/dist/editor/schemas.d.ts +28 -0
  20. package/dist/editor/schemas.d.ts.map +1 -0
  21. package/dist/editor/schemas.js +205 -0
  22. package/dist/editor/schemas.js.map +1 -0
  23. package/dist/editor/struct-widget.d.ts +37 -0
  24. package/dist/editor/struct-widget.d.ts.map +1 -0
  25. package/dist/editor/struct-widget.js +242 -0
  26. package/dist/editor/struct-widget.js.map +1 -0
  27. package/dist/index.d.ts +16 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +13 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/model/allocate-graph.d.ts +57 -0
  32. package/dist/model/allocate-graph.d.ts.map +1 -0
  33. package/dist/model/allocate-graph.js +209 -0
  34. package/dist/model/allocate-graph.js.map +1 -0
  35. package/dist/model/allocate.d.ts +3 -0
  36. package/dist/model/allocate.d.ts.map +1 -0
  37. package/dist/model/allocate.js +47 -0
  38. package/dist/model/allocate.js.map +1 -0
  39. package/dist/model/mandelbrot-graph.d.ts +8 -0
  40. package/dist/model/mandelbrot-graph.d.ts.map +1 -0
  41. package/dist/model/mandelbrot-graph.js +146 -0
  42. package/dist/model/mandelbrot-graph.js.map +1 -0
  43. package/dist/model/spawn-graph.d.ts +31 -0
  44. package/dist/model/spawn-graph.d.ts.map +1 -0
  45. package/dist/model/spawn-graph.js +117 -0
  46. package/dist/model/spawn-graph.js.map +1 -0
  47. package/dist/vm/codegen.d.ts +12 -0
  48. package/dist/vm/codegen.d.ts.map +1 -0
  49. package/dist/vm/codegen.js +303 -0
  50. package/dist/vm/codegen.js.map +1 -0
  51. package/dist/vm/collection.d.ts +8 -0
  52. package/dist/vm/collection.d.ts.map +1 -0
  53. package/dist/vm/collection.js +129 -0
  54. package/dist/vm/collection.js.map +1 -0
  55. package/dist/vm/compiler.bench.d.ts +2 -0
  56. package/dist/vm/compiler.bench.d.ts.map +1 -0
  57. package/dist/vm/compiler.bench.js +35 -0
  58. package/dist/vm/compiler.bench.js.map +1 -0
  59. package/dist/vm/compiler.d.ts +14 -0
  60. package/dist/vm/compiler.d.ts.map +1 -0
  61. package/dist/vm/compiler.js +190 -0
  62. package/dist/vm/compiler.js.map +1 -0
  63. package/dist/vm/interpreter.d.ts +87 -0
  64. package/dist/vm/interpreter.d.ts.map +1 -0
  65. package/dist/vm/interpreter.js +155 -0
  66. package/dist/vm/interpreter.js.map +1 -0
  67. package/dist/vm/primitives.d.ts +4 -0
  68. package/dist/vm/primitives.d.ts.map +1 -0
  69. package/dist/vm/primitives.js +436 -0
  70. package/dist/vm/primitives.js.map +1 -0
  71. package/dist/vm/value.d.ts +7 -0
  72. package/dist/vm/value.d.ts.map +1 -0
  73. package/dist/vm/value.js +28 -0
  74. package/dist/vm/value.js.map +1 -0
  75. package/dist/vm/wasm-codegen.bench.d.ts +2 -0
  76. package/dist/vm/wasm-codegen.bench.d.ts.map +1 -0
  77. package/dist/vm/wasm-codegen.bench.js +81 -0
  78. package/dist/vm/wasm-codegen.bench.js.map +1 -0
  79. package/dist/vm/wasm-codegen.d.ts +12 -0
  80. package/dist/vm/wasm-codegen.d.ts.map +1 -0
  81. package/dist/vm/wasm-codegen.js +352 -0
  82. package/dist/vm/wasm-codegen.js.map +1 -0
  83. package/package.json +57 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 strelok2012
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # @xenolithengine/graph-plugin-runtime
2
+
3
+ [![BETA](https://img.shields.io/badge/status-BETA-FCB400?style=flat-square)](https://github.com/XenolithEngine/xenolith-graph#status)
4
+ [![MIT](https://img.shields.io/badge/license-MIT-FCB400?style=flat-square)](https://github.com/XenolithEngine/xenolith-graph/blob/main/LICENSE)
5
+
6
+ Blueprint-style node runtime for XenolithGraph: typed exec/data primitives + a headless interpreter that runs a graph as a simulation. Installs as an editor plugin.
7
+
8
+ > **Experimental** — runtime APIs (`Runtime`, `codegen`, `RtGraph`) may still evolve before v1.0. The editor-plugin surface (`runtimePlugin`, schemas) tracks the v0.7 BETA freeze.
9
+
10
+ Part of [XenolithGraph](https://github.com/XenolithEngine/xenolith-graph) — an AI-native, embeddable node-graph editor for the web with its own visual design language (Xen).
11
+
12
+ ## Install
13
+
14
+ ```bash
15
+ pnpm add @xenolithengine/graph-plugin-runtime
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ Register primitives + pin types into an editor:
21
+
22
+ ```ts
23
+ import { XenolithEditor } from '@xenolithengine/graph-editor'
24
+ import { runtimePlugin, attachRuntimeBridge } from '@xenolithengine/graph-plugin-runtime'
25
+
26
+ const editor = await XenolithEditor.init('#graph')
27
+ editor.use(runtimePlugin)
28
+ attachRuntimeBridge(editor) // drives the live graph + mirrors outputs into widgets
29
+ ```
30
+
31
+ Headless VM (no editor):
32
+
33
+ ```ts
34
+ import { Runtime, BUILTIN_PRIMITIVES, type RtGraph } from '@xenolithengine/graph-plugin-runtime'
35
+
36
+ const rt = new Runtime(BUILTIN_PRIMITIVES)
37
+ rt.setVar('x', 3)
38
+ rt.tick(myRtGraph)
39
+ console.log(rt.getVar('result'))
40
+ ```
41
+
42
+ ## What's exported
43
+
44
+ - `runtimePlugin` — install into an editor with `editor.use(runtimePlugin)`
45
+ - `attachRuntimeBridge(editor)` — drives the live graph from the editor and mirrors Output values to widgets
46
+ - `Runtime` — headless interpreter (`tick`, `getVar`, `setVar`, `onAfterTick`)
47
+ - `codegen(graph, defs)` — emits a compiled JS evaluator from an `RtGraph`
48
+ - `Allocate`, `mandelbrotPixelGraph`, `mandelbrotPixelReference` — reference graphs / nodes for benchmarks
49
+ - `BUILTIN_PRIMITIVES`, `COLLECTION_PRIMITIVES`, `domainNodes`
50
+ - Schemas: `PIN_TYPES`, `PRIMITIVE_SCHEMAS`, `PRIMITIVE_CATEGORY_COLORS`, `PRIMITIVE_ICONS`
51
+ - Schema-sync helpers: `pinsFromSchemaFields`, `widgetsFromSchemaFields`, `schemaPinTypeFor`
52
+ - Value coercion: `asNumber`, `asBool`, `asArray`
53
+ - Types: `NodeDef`, `RtNode`, `RtPin`, `RtEdge`, `RtGraph`, `PureIO`, `ExecIO`, `VmValue`
54
+
55
+ ## Docs
56
+
57
+ - [API reference](https://xenolithengine.github.io/xenolith-graph/guides/api/) — every method exposed by `XenolithEditor`
58
+ - [GitHub](https://github.com/XenolithEngine/xenolith-graph)
59
+
60
+ MIT © XenolithEngine
@@ -0,0 +1,3 @@
1
+ import type { CanvasWidgetController } from '@xenolithengine/graph-editor';
2
+ export declare const outputWidget: CanvasWidgetController;
3
+ //# sourceMappingURL=output-widget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-widget.d.ts","sourceRoot":"","sources":["../../src/editor/output-widget.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAW1E,eAAO,MAAM,YAAY,EAAE,sBAsB1B,CAAA"}
@@ -0,0 +1,43 @@
1
+ // Canvas-widget renderer for the `Output` primitive — draws whatever value the Output node received
2
+ // straight into the node. Generic: supports number / string / bool / array / object. Registered by
3
+ // `runtimePlugin.install` so any host that uses the plugin gets Output rendering out of the box.
4
+ function format(value) {
5
+ if (value === undefined || value === null)
6
+ return '—';
7
+ if (typeof value === 'number')
8
+ return Number.isInteger(value) ? String(value) : value.toFixed(2);
9
+ if (typeof value === 'string' || typeof value === 'boolean')
10
+ return String(value);
11
+ if (Array.isArray(value))
12
+ return `${value.length} item${value.length === 1 ? '' : 's'}`;
13
+ if (typeof value === 'object')
14
+ return `${Object.keys(value).length} fields`;
15
+ return String(value);
16
+ }
17
+ export const outputWidget = {
18
+ draw(ctx, { value, width, height, accent, muted }) {
19
+ const text = format(value);
20
+ // Pick the largest font size from a fixed ladder that still fits the rect width — prevents the
21
+ // big-number-clipped-on-the-left bug where "0.45" rendered as ".45" because right-aligned text
22
+ // overflowed past the widget's left edge.
23
+ const sizes = [24, 20, 17, 14, 12, 10];
24
+ ctx.textBaseline = 'middle';
25
+ ctx.textAlign = 'right';
26
+ let size = sizes[sizes.length - 1];
27
+ for (const s of sizes) {
28
+ ctx.font = `${s}px Inter`;
29
+ if (ctx.measureText(text).width <= width - 2) {
30
+ size = s;
31
+ break;
32
+ }
33
+ }
34
+ ctx.font = `${size}px Inter`;
35
+ ctx.fillStyle = accent;
36
+ ctx.fillText(text, width, height / 2);
37
+ ctx.fillStyle = muted;
38
+ ctx.font = '9px Inter';
39
+ ctx.textAlign = 'left';
40
+ ctx.fillText('output', 0, height - 4);
41
+ },
42
+ };
43
+ //# sourceMappingURL=output-widget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-widget.js","sourceRoot":"","sources":["../../src/editor/output-widget.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,mGAAmG;AACnG,iGAAiG;AAIjG,SAAS,MAAM,CAAC,KAAc;IAC5B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,GAAG,CAAA;IACrD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAChG,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;IACjF,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,GAAG,KAAK,CAAC,MAAM,QAAQ,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAA;IACvF,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,GA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,QAAQ,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAA;IACvC,CAAC;CACF,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { XenolithPlugin } from '@xenolithengine/graph-editor';
2
+ export declare const runtimePlugin: XenolithPlugin;
3
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/editor/plugin.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,8BAA8B,CAAA;AA8CjF,eAAO,MAAM,aAAa,EAAE,cAkD3B,CAAA"}
@@ -0,0 +1,115 @@
1
+ // The XenolithGraph plugin: installs the runtime's pin types + primitive node schemas into the
2
+ // editor (so the COMPUTE graph is visible/editable and the primitives show in the Tab palette).
3
+ // Type-only imports from core/editor → erased at runtime, so the headless VM stays import-free.
4
+ //
5
+ // This is the registration layer only — driving the live graph (reading editor.graph each tick and
6
+ // running the VM) is the host's job, kept separate so the same VM can run headlessly.
7
+ import { PIN_TYPES, PRIMITIVE_SCHEMAS } from './schemas.js';
8
+ import { outputWidget } from './output-widget.js';
9
+ import { structWidget } from './struct-widget.js';
10
+ import { pinsFromSchemaFields, widgetsFromSchemaFields } from './schema-sync.js';
11
+ /** Find the Struct's `schema` IN-pin id (looks for label='schema', falls back to id ending ':schema'). */
12
+ function findSchemaPinId(node) {
13
+ for (const p of node.pins) {
14
+ if (p.kind === 'data' && p.direction === 'in' && (p.label === 'schema' || String(p.id) === 'schema' || String(p.id).endsWith(':schema'))) {
15
+ return String(p.id);
16
+ }
17
+ }
18
+ return null;
19
+ }
20
+ /** Re-sync a Struct's pins from the Schema currently wired into its `schema` pin. No-op if the
21
+ * Struct has no schema pin, or no edge into it, or the source isn't a Schema-typed node. */
22
+ function syncStructFromSchema(ctx, structId) {
23
+ const struct = ctx.graph.getNode(structId);
24
+ if (!struct || struct.type !== 'Struct')
25
+ return;
26
+ const schemaPinId = findSchemaPinId(struct);
27
+ if (!schemaPinId)
28
+ return;
29
+ let sourceSchema = null;
30
+ for (const e of ctx.graph.edges()) {
31
+ if (String(e.to.node) === String(structId) && String(e.to.pin) === schemaPinId) {
32
+ const src = ctx.graph.getNode(e.from.node);
33
+ if (src && src.type === 'Schema') {
34
+ sourceSchema = src;
35
+ break;
36
+ }
37
+ }
38
+ }
39
+ const fields = sourceSchema?.state['fields'] ?? {};
40
+ const extras = sourceSchema?.state['extraPins'] ?? [];
41
+ ctx.setNodePins(structId, pinsFromSchemaFields(struct.pins, fields, extras));
42
+ // Preserve any HAND-AUTHORED widgets that aren't `field:*` (none today, but the API allows it);
43
+ // replace the schema-derived widget block wholesale on every sync.
44
+ const handAuthored = (struct.widgets ?? []).filter((w) => !String(w.id).startsWith('field:'));
45
+ ctx.setNodeWidgets(structId, [...handAuthored, ...widgetsFromSchemaFields(fields)]);
46
+ // Seed `state[<field>]` with each field's default value so the pinKey-bound widget shows
47
+ // something and the Struct evaluator's fallback returns that value (not undefined) on the first
48
+ // tick before any wire delivers. Skip a field whose state is already set (user already typed).
49
+ for (const [key, value] of Object.entries(fields)) {
50
+ if (struct.state[key] === undefined)
51
+ ctx.setWidgetValue(structId, `field:${key}`, value, { ephemeral: true });
52
+ }
53
+ }
54
+ export const runtimePlugin = {
55
+ name: 'runtime',
56
+ install(ctx) {
57
+ for (const t of PIN_TYPES)
58
+ ctx.types.register(t);
59
+ for (const s of PRIMITIVE_SCHEMAS)
60
+ ctx.registry.register(s);
61
+ ctx.registerWidget('output', outputWidget);
62
+ ctx.registerWidget('struct', structWidget);
63
+ // Schema → Struct pin sync: when an edge enters a Struct's `schema` pin, synthesize one in-pin
64
+ // per field of the source Schema. On disconnect, strip the synthesized field pins.
65
+ const offConn = ctx.on('edge:connected', ({ edge }) => {
66
+ const target = ctx.graph.getNode(edge.to.node);
67
+ if (target?.type === 'Struct')
68
+ syncStructFromSchema(ctx, edge.to.node);
69
+ });
70
+ const offDisc = ctx.on('edge:disconnected', () => {
71
+ // We don't know which endpoint vanished without an edge record; rescan all Structs and
72
+ // re-sync. Cheap on graphs of any plausible size (one setNodePins per Struct, no-op when
73
+ // pins didn't change).
74
+ for (const n of ctx.graph.nodes()) {
75
+ if (n.type === 'Struct')
76
+ syncStructFromSchema(ctx, n.id);
77
+ }
78
+ });
79
+ // `loadJSON` adds edges via a fast path that doesn't fire edge:connected, so on graph load
80
+ // we explicitly rescan every Struct with a wired Schema and sync once.
81
+ const offLoaded = ctx.on('graph:loaded', () => {
82
+ for (const n of ctx.graph.nodes()) {
83
+ if (n.type === 'Struct')
84
+ syncStructFromSchema(ctx, n.id);
85
+ }
86
+ });
87
+ // A Schema's `fields` widget changing also needs a re-sync on every Struct wired to it.
88
+ const offWidget = ctx.on('widget:changed', ({ nodeId, widgetId }) => {
89
+ const n = ctx.graph.getNode(nodeId);
90
+ if (!n || n.type !== 'Schema' || widgetId !== 'fields')
91
+ return;
92
+ for (const struct of ctx.graph.nodes()) {
93
+ if (struct.type !== 'Struct')
94
+ continue;
95
+ for (const e of ctx.graph.edges()) {
96
+ if (String(e.from.node) === String(nodeId) && String(e.to.node) === String(struct.id)) {
97
+ syncStructFromSchema(ctx, struct.id);
98
+ break;
99
+ }
100
+ }
101
+ }
102
+ });
103
+ return () => {
104
+ offConn();
105
+ offDisc();
106
+ offLoaded();
107
+ offWidget();
108
+ for (const s of PRIMITIVE_SCHEMAS)
109
+ ctx.registry.unregister(s.type);
110
+ for (const t of PIN_TYPES)
111
+ ctx.types.unregister(t.id);
112
+ };
113
+ },
114
+ };
115
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/editor/plugin.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,gGAAgG;AAChG,gGAAgG;AAChG,EAAE;AACF,mGAAmG;AACnG,sFAAsF;AAItF,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAC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IAAI,iBAAiB;gBAAE,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;YAClE,KAAK,MAAM,CAAC,IAAI,SAAS;gBAAE,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QACvD,CAAC,CAAA;IACH,CAAC;CACF,CAAA"}
@@ -0,0 +1,6 @@
1
+ import type { XenolithEditor } from '@xenolithengine/graph-editor';
2
+ import type { Runtime } from '../vm/interpreter.js';
3
+ /** Wire automatic post-tick behaviour into a Runtime: mirror Output VM vars into widget state.
4
+ * Returns a disposer that removes the listener (call on host teardown / engine switch). */
5
+ export declare function attachRuntimeBridge(editor: XenolithEditor, rt: Runtime): () => void;
6
+ //# sourceMappingURL=runtime-bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-bridge.d.ts","sourceRoot":"","sources":["../../src/editor/runtime-bridge.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAGnD;4FAC4F;AAC5F,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE,EAAE,OAAO,GAAG,MAAM,IAAI,CASnF"}
@@ -0,0 +1,24 @@
1
+ // Editor ↔ Runtime bridge. The bits a host shouldn't have to re-implement:
2
+ // - Output node value mirroring: every `Output` writes its current value into VM var
3
+ // `output:<nodeId>`; the bridge copies that into the node's `state.value` so the in-node
4
+ // `output` widget shows the live value. WORKAROUND until core ships
5
+ // `graphSnapshot({ shareState: true })` so Output can mutate its own state in-place.
6
+ //
7
+ // Hosts call `attachRuntimeBridge(editor, rt)` ONCE after creating the Runtime. From then on,
8
+ // every `rt.tick(...)` automatically refreshes Output widgets. No per-host loop.
9
+ import { OUTPUT_VAR_PREFIX } from '../vm/collection.js';
10
+ /** Wire automatic post-tick behaviour into a Runtime: mirror Output VM vars into widget state.
11
+ * Returns a disposer that removes the listener (call on host teardown / engine switch). */
12
+ export function attachRuntimeBridge(editor, rt) {
13
+ return rt.onAfterTick(() => {
14
+ for (const n of editor.graph.nodes()) {
15
+ if (n.type !== 'Output')
16
+ continue;
17
+ const v = rt.getVar(`${OUTPUT_VAR_PREFIX}${String(n.id)}`);
18
+ if (v === undefined)
19
+ continue;
20
+ editor.setWidgetValue(n.id, 'value', v, { ephemeral: true });
21
+ }
22
+ });
23
+ }
24
+ //# sourceMappingURL=runtime-bridge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-bridge.js","sourceRoot":"","sources":["../../src/editor/runtime-bridge.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,uFAAuF;AACvF,6FAA6F;AAC7F,wEAAwE;AACxE,yFAAyF;AACzF,EAAE;AACF,8FAA8F;AAC9F,iFAAiF;AAIjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD;4FAC4F;AAC5F,MAAM,UAAU,mBAAmB,CAAC,MAAsB,EAAE,EAAW;IACrE,OAAO,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE;QACzB,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;YACrC,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ;gBAAE,SAAQ;YACjC,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,iBAAiB,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA;YAC1D,IAAI,CAAC,KAAK,SAAS;gBAAE,SAAQ;YAC7B,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QAC9D,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { Pin, WidgetSpec } from '@xenolithengine/graph-core';
2
+ /** Declaration for a non-field pin synthesized from a Schema (multi-inputs, named outputs, etc.).
3
+ * Lives in `Schema.state.extraPins` so the graph author can express things that don't fit the
4
+ * flat `state.fields = {key: defaultValue}` model — e.g. an Agent's `subscribe` multi pin. */
5
+ export interface SchemaExtraPin {
6
+ label: string;
7
+ direction: 'in' | 'out';
8
+ type: string;
9
+ multiple?: boolean;
10
+ }
11
+ /** Map a default value's runtime type to a pin type. `null`/`undefined` → `'any'`. */
12
+ export declare function schemaPinTypeFor(defaultValue: unknown): string;
13
+ /** Replace any prior `field:*` AND `extra:*` pins on the node with a fresh set derived from the
14
+ * Schema's `state.fields` (one IN-pin per key) and `state.extraPins` (verbatim declarations).
15
+ * Non-synthesized pins (the schema in-pin, the self out-pin) are kept in place at the front of
16
+ * the result so the binding pin survives a re-sync. Order: kept-base + field:* + extra:*. */
17
+ export declare function pinsFromSchemaFields(current: ReadonlyArray<Pin>, fields: Readonly<Record<string, unknown>>, extras?: ReadonlyArray<SchemaExtraPin>): Pin[];
18
+ /** Synthesize one WidgetSpec per field on a Schema. `key = fieldName` so the editor's implicit
19
+ * pinKey-binding kicks in (widget hides when its matching pin is wired, shows otherwise). Label
20
+ * is empty — the pin row already shows the field name on the left, a second copy inside the
21
+ * chip would just duplicate it.
22
+ * - string → text (editable)
23
+ * - number → number (editable)
24
+ * - boolean → toggle
25
+ * - array/object/null/undefined → DISABLED text (read-only display; no editable widget exists
26
+ * for these types, but we still render the current value so the user sees what's in state). */
27
+ export declare function widgetsFromSchemaFields(fields: Readonly<Record<string, unknown>>): WidgetSpec[];
28
+ //# sourceMappingURL=schema-sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-sync.d.ts","sourceRoot":"","sources":["../../src/editor/schema-sync.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,GAAG,EAAS,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAExE;;+FAE+F;AAC/F,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,IAAI,GAAG,KAAK,CAAA;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,sFAAsF;AACtF,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,OAAO,GAAG,MAAM,CAQ9D;AAED;;;8FAG8F;AAC9F,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,aAAa,CAAC,GAAG,CAAC,EAC3B,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,MAAM,GAAE,aAAa,CAAC,cAAc,CAAM,GACzC,GAAG,EAAE,CAsBP;AAED;;;;;;;;kGAQkG;AAClG,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,UAAU,EAAE,CAS/F"}
@@ -0,0 +1,70 @@
1
+ // Schema → Struct pin synthesis. A connected Schema's `state.fields` object (`{name: default}`) is
2
+ // turned into one data-in Pin per key on the Struct. Pure helpers — the plugin's edge listener
3
+ // calls them and forwards the result to `ctx.setNodePins`. Pin id convention: `field:<key>` so the
4
+ // Struct V3 evaluator (which derives field name from id suffix after `:`) sees the right field.
5
+ /** Map a default value's runtime type to a pin type. `null`/`undefined` → `'any'`. */
6
+ export function schemaPinTypeFor(defaultValue) {
7
+ if (defaultValue === null || defaultValue === undefined)
8
+ return 'any';
9
+ if (typeof defaultValue === 'string')
10
+ return 'string';
11
+ if (typeof defaultValue === 'number')
12
+ return 'scalar';
13
+ if (typeof defaultValue === 'boolean')
14
+ return 'bool';
15
+ if (Array.isArray(defaultValue))
16
+ return 'array';
17
+ if (typeof defaultValue === 'object')
18
+ return 'object';
19
+ return 'any';
20
+ }
21
+ /** Replace any prior `field:*` AND `extra:*` pins on the node with a fresh set derived from the
22
+ * Schema's `state.fields` (one IN-pin per key) and `state.extraPins` (verbatim declarations).
23
+ * Non-synthesized pins (the schema in-pin, the self out-pin) are kept in place at the front of
24
+ * the result so the binding pin survives a re-sync. Order: kept-base + field:* + extra:*. */
25
+ export function pinsFromSchemaFields(current, fields, extras = []) {
26
+ const kept = current.filter((p) => {
27
+ const id = String(p.id);
28
+ return !id.startsWith('field:') && !id.startsWith('extra:');
29
+ });
30
+ const fieldPins = Object.keys(fields).map((key) => ({
31
+ id: (`field:${key}`),
32
+ kind: 'data',
33
+ direction: 'in',
34
+ type: schemaPinTypeFor(fields[key]),
35
+ multiple: false,
36
+ label: key,
37
+ }));
38
+ const extraPins = extras.map((spec) => ({
39
+ id: (`extra:${spec.label}`),
40
+ kind: 'data',
41
+ direction: spec.direction,
42
+ type: spec.type,
43
+ multiple: spec.multiple ?? false,
44
+ label: spec.label,
45
+ }));
46
+ return [...kept, ...fieldPins, ...extraPins];
47
+ }
48
+ /** Synthesize one WidgetSpec per field on a Schema. `key = fieldName` so the editor's implicit
49
+ * pinKey-binding kicks in (widget hides when its matching pin is wired, shows otherwise). Label
50
+ * is empty — the pin row already shows the field name on the left, a second copy inside the
51
+ * chip would just duplicate it.
52
+ * - string → text (editable)
53
+ * - number → number (editable)
54
+ * - boolean → toggle
55
+ * - array/object/null/undefined → DISABLED text (read-only display; no editable widget exists
56
+ * for these types, but we still render the current value so the user sees what's in state). */
57
+ export function widgetsFromSchemaFields(fields) {
58
+ return Object.keys(fields).map((key) => {
59
+ const v = fields[key];
60
+ const id = `field:${key}`;
61
+ if (typeof v === 'string')
62
+ return { id, type: 'text', key, label: '' };
63
+ if (typeof v === 'number')
64
+ return { id, type: 'number', key, label: '' };
65
+ if (typeof v === 'boolean')
66
+ return { id, type: 'toggle', key, label: '' };
67
+ return { id, type: 'text', key, label: '', disabled: true };
68
+ });
69
+ }
70
+ //# sourceMappingURL=schema-sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-sync.js","sourceRoot":"","sources":["../../src/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E,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;IAC7D,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { NodeSchema, TypeDescriptor } from '@xenolithengine/graph-core';
2
+ export declare const PIN_TYPES: TypeDescriptor[];
3
+ export declare const PRIMITIVE_SCHEMAS: NodeSchema[];
4
+ /** Header glyph icon per primitive type (names from render-pixi's built-in Feather set). Hosts can
5
+ * apply these to node `glyph` so the generic nodes are visually distinguishable at a glance. */
6
+ export declare const PRIMITIVE_ICONS: Record<string, string>;
7
+ /** Colours for the primitive categories — declared in the runtime preset's `categories` palette. */
8
+ export declare const PRIMITIVE_CATEGORY_COLORS: {
9
+ readonly flow: {
10
+ readonly color: "#E8E8E8";
11
+ };
12
+ readonly state: {
13
+ readonly color: "#5B9DFF";
14
+ };
15
+ readonly math: {
16
+ readonly color: "#4FC08D";
17
+ };
18
+ readonly array: {
19
+ readonly color: "#3FB6FF";
20
+ };
21
+ readonly domain: {
22
+ readonly color: "#FFB020";
23
+ };
24
+ readonly io: {
25
+ readonly color: "#E6C87A";
26
+ };
27
+ };
28
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/editor/schemas.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAa,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAEvF,eAAO,MAAM,SAAS,EAAE,cAAc,EAOrC,CAAA;AAUD,eAAO,MAAM,iBAAiB,EAAE,UAAU,EAuJzC,CAAA;AAED;iGACiG;AACjG,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAmBlD,CAAA;AAGD,oGAAoG;AACpG,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;CAO5B,CAAA"}