From 072ab9063ba56df0673020eb639548f3a8601e04 Mon Sep 17 00:00:00 2001 From: release-bot Date: Thu, 12 Feb 2026 14:00:18 +0100 Subject: [PATCH] feat: add initial debug node --- .../lib/node-registry/node-registry-client.ts | 11 +++++++++-- app/src/routes/+page.svelte | 16 +++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/app/src/lib/node-registry/node-registry-client.ts b/app/src/lib/node-registry/node-registry-client.ts index c8c7601..b3561bf 100644 --- a/app/src/lib/node-registry/node-registry-client.ts +++ b/app/src/lib/node-registry/node-registry-client.ts @@ -15,8 +15,15 @@ export class RemoteNodeRegistry implements NodeRegistry { constructor( private url: string, - public cache?: AsyncCache - ) {} + public cache?: AsyncCache, + nodes?: NodeDefinition[] + ) { + if (nodes?.length) { + for (const node of nodes) { + this.nodes.set(node.id, node); + } + } + } async fetchJson(url: string, skipCache = false) { const finalUrl = `${this.url}/${url}`; diff --git a/app/src/routes/+page.svelte b/app/src/routes/+page.svelte index 84030a1..eaf23d2 100644 --- a/app/src/routes/+page.svelte +++ b/app/src/routes/+page.svelte @@ -32,7 +32,21 @@ const { data } = $props(); const registryCache = new IndexDBCache('node-registry'); - const nodeRegistry = new RemoteNodeRegistry('', registryCache); + + const debugNode = { + id: 'max/plantarium/debug', + inputs: { + a: { + type: '*' + } + }, + execute(data: Int32Array) { + console.log({ data }); + return data; + } + } as const; + + const nodeRegistry = new RemoteNodeRegistry('', registryCache, [debugNode]); const workerRuntime = new WorkerRuntimeExecutor(); const runtimeCache = new MemoryRuntimeCache(); const memoryRuntime = new MemoryRuntimeExecutor(nodeRegistry, runtimeCache);