feat: initial node groups

This commit is contained in:
2026-04-26 18:41:25 +02:00
parent a56e8f445e
commit 72f07d0a50
17 changed files with 488 additions and 76 deletions
+2 -1
View File
@@ -4,11 +4,12 @@ export type {
Box,
Edge,
Graph,
GroupDefinition,
NodeDefinition,
NodeId,
NodeInstance,
SerializedNode,
Socket
} from './types';
export { GraphSchema, NodeSchema } from './types';
export { GraphSchema, GroupSchema, NodeSchema } from './types';
export { NodeDefinitionSchema } from './types';
+12 -1
View File
@@ -76,6 +76,16 @@ export type Socket = {
export type Edge = [NodeInstance, number, NodeInstance, string];
export const GroupSchema = z.object({
id: z.number(),
nodes: z.array(NodeSchema),
edges: z.array(z.tuple([z.number(), z.number(), z.number(), z.string()])),
inputs: z.record(z.string(), NodeInputSchema).optional(),
outputs: z.array(z.string()).optional()
});
export type GroupDefinition = z.infer<typeof GroupSchema>;
export const GraphSchema = z.object({
id: z.number(),
meta: z
@@ -86,7 +96,8 @@ export const GraphSchema = z.object({
.optional(),
settings: z.record(z.string(), z.any()).optional(),
nodes: z.array(NodeSchema),
edges: z.array(z.tuple([z.number(), z.number(), z.number(), z.string()]))
edges: z.array(z.tuple([z.number(), z.number(), z.number(), z.string()])),
groups: z.array(GroupSchema)
});
export type Graph = z.infer<typeof GraphSchema>;