@womp/spark-agent 1.0.1 → 2.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/README.md +42 -19
- package/dist/capabilities/health.d.ts +9 -0
- package/dist/capabilities/health.js +27 -0
- package/dist/capabilities/scene-draft.d.ts +2 -404
- package/dist/capabilities/scene.d.ts +1 -1
- package/dist/capabilities/scene.js +13 -4
- package/dist/capabilities.d.ts +3 -1
- package/dist/capabilities.js +1 -0
- package/dist/cli.js +20 -2
- package/dist/client.js +15 -15
- package/dist/coordinates.d.ts +23 -0
- package/dist/coordinates.js +132 -0
- package/dist/generated/health-declarations.d.ts +1 -0
- package/dist/generated/health-declarations.js +3 -0
- package/dist/generated/scene-declarations.d.ts +1 -1
- package/dist/generated/scene-declarations.js +1 -1
- package/dist/geometry/backendRegistry.d.ts +37 -0
- package/dist/geometry/backendRegistry.js +61 -0
- package/dist/geometry/common.d.ts +26 -0
- package/dist/geometry/common.js +78 -0
- package/dist/geometry/compiler.d.ts +35 -0
- package/dist/geometry/compiler.js +115 -0
- package/dist/geometry/graph.d.ts +39 -0
- package/dist/geometry/graph.js +32 -0
- package/dist/geometry/index.d.ts +9 -0
- package/dist/geometry/index.js +12 -0
- package/dist/geometry/lift.d.ts +7 -0
- package/dist/geometry/lift.js +376 -0
- package/dist/geometry/lower.d.ts +9 -0
- package/dist/geometry/lower.js +363 -0
- package/dist/geometry/parameters.d.ts +23 -0
- package/dist/geometry/parameters.js +46 -0
- package/dist/geometry/schemas/backend-schema.json +3394 -0
- package/dist/geometry/schemas/flowir-dialect.json +976 -0
- package/dist/geometry/writeParamData.d.ts +18 -0
- package/dist/geometry/writeParamData.js +47 -0
- package/dist/geometry.d.ts +10 -0
- package/dist/geometry.js +19 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/kakapo.d.ts +9 -5
- package/dist/kakapo.js +7 -6
- package/dist/openscad.d.ts +85 -0
- package/dist/openscad.js +223 -0
- package/dist/pricing.js +9 -29
- package/dist/repair-state.d.ts +50 -0
- package/dist/repair-state.js +96 -0
- package/dist/runtime.d.ts +16 -36
- package/dist/runtime.js +132 -139
- package/dist/scene-environment.d.ts +25 -0
- package/dist/scene-environment.js +76 -0
- package/dist/scene-health.d.ts +49 -0
- package/dist/scene-health.js +176 -0
- package/dist/scene-metadata.d.ts +6 -0
- package/dist/scene-metadata.js +65 -0
- package/dist/scene-operations.d.ts +47 -0
- package/dist/scene-operations.js +126 -0
- package/dist/sdk-geometry-host.d.ts +12 -0
- package/dist/sdk-geometry-host.js +306 -0
- package/dist/sdk-openscad-host.d.ts +14 -0
- package/dist/sdk-openscad-host.js +296 -0
- package/dist/sdk-openscad-renderer.d.ts +11 -0
- package/dist/sdk-openscad-renderer.js +71 -0
- package/dist/sdk-scene-health-host.d.ts +4 -0
- package/dist/sdk-scene-health-host.js +13 -0
- package/dist/sdk-scene-host.d.ts +312 -0
- package/dist/sdk-scene-host.js +202 -0
- package/dist/sdk-scene-screenshot.d.ts +7 -0
- package/dist/sdk-scene-screenshot.js +17 -0
- package/dist/server/demo-scene-materials.d.ts +3 -0
- package/dist/server/demo-scene-materials.js +18 -0
- package/dist/server/express.js +2 -4
- package/dist/server/fixtures/materials/matte-blue.json +14 -0
- package/dist/server/fixtures/materials/polished-copper.json +14 -0
- package/dist/server/index.d.ts +2 -1
- package/dist/server/index.js +2 -1
- package/dist/server/service.d.ts +4 -0
- package/dist/server/service.js +26 -2
- package/dist/server/sqlite-store.d.ts +31 -0
- package/dist/server/sqlite-store.js +224 -0
- package/dist/server/standalone.d.ts +14 -1
- package/dist/server/standalone.js +160 -27
- package/dist/server/store.js +3 -1
- package/dist/types.d.ts +1 -1
- package/dist/womp-scene-api.d.ts +283 -0
- package/dist/womp-scene-api.js +974 -0
- package/package.json +22 -10
- package/dist/kakapo-capability.d.ts +0 -45
- package/dist/kakapo-capability.js +0 -169
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** Scalar backend storage is zero-initialized. Empty arrays have node-specific semantics. */
|
|
2
|
+
export function defaultScalar(port) {
|
|
3
|
+
if (port.enumValues?.length || port.type === "Float" || port.type === "Int")
|
|
4
|
+
return 0;
|
|
5
|
+
if (port.type === "Bool")
|
|
6
|
+
return false;
|
|
7
|
+
if (port.type === "Vec" || port.type === "Vec3")
|
|
8
|
+
return { x: 0, y: 0, z: 0 };
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Backend node name → FlowIR scalar type (used by lift / writeParamData).
|
|
13
|
+
* Inverted form used by lower via {@link valueBackendName}.
|
|
14
|
+
*/
|
|
15
|
+
export const VALUE_BACKEND_NAMES = {
|
|
16
|
+
ValueFloat: "Float",
|
|
17
|
+
ValueInt: "Int",
|
|
18
|
+
ValueVec: "Vec3",
|
|
19
|
+
};
|
|
20
|
+
/** FlowIR scalar type → backend node name (inverse of VALUE_BACKEND_NAMES). */
|
|
21
|
+
export function valueBackendName(typeName) {
|
|
22
|
+
for (const [backend, type] of Object.entries(VALUE_BACKEND_NAMES)) {
|
|
23
|
+
if (type === typeName)
|
|
24
|
+
return backend;
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
export function titleToAstName(title) {
|
|
29
|
+
return title
|
|
30
|
+
.trim()
|
|
31
|
+
.replace(/\s+(.)/g, (_, c) => "_" + c.toLowerCase())
|
|
32
|
+
.replace(/^(.)/, (m) => m.toLowerCase());
|
|
33
|
+
}
|
|
34
|
+
export function astNameToTitle(s) {
|
|
35
|
+
return s
|
|
36
|
+
.replace(/_./g, (m) => " " + m[1].toUpperCase())
|
|
37
|
+
.replace(/^./, (m) => m.toUpperCase());
|
|
38
|
+
}
|
|
39
|
+
export function isArrayPortType(type) {
|
|
40
|
+
return type.endsWith("[]") || type.endsWith("Array");
|
|
41
|
+
}
|
|
42
|
+
export function parseConnection(key) {
|
|
43
|
+
const m = key.match(/^(\d+):(\d+)-(\d+):(\d+)$/);
|
|
44
|
+
if (!m)
|
|
45
|
+
return null;
|
|
46
|
+
return {
|
|
47
|
+
fromBid: m[1],
|
|
48
|
+
fromPort: Number(m[2]),
|
|
49
|
+
toBid: m[3],
|
|
50
|
+
toPort: Number(m[4]),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export function buildIncomingMap(connections) {
|
|
54
|
+
const incoming = new Map();
|
|
55
|
+
for (const key of Object.keys(connections)) {
|
|
56
|
+
const edge = parseConnection(key);
|
|
57
|
+
if (!edge)
|
|
58
|
+
continue;
|
|
59
|
+
let list = incoming.get(edge.toBid);
|
|
60
|
+
if (!list) {
|
|
61
|
+
list = [];
|
|
62
|
+
incoming.set(edge.toBid, list);
|
|
63
|
+
}
|
|
64
|
+
list.push(edge);
|
|
65
|
+
}
|
|
66
|
+
return incoming;
|
|
67
|
+
}
|
|
68
|
+
/** Resolve the GIP and value-node type IDs from the backend registry. */
|
|
69
|
+
export function resolveParamTypeIds(backendRegistry) {
|
|
70
|
+
const gipTypeId = backendRegistry.getSchemaByName("GroupInputParam")?.typeId ?? null;
|
|
71
|
+
const valueTypeIds = new Map();
|
|
72
|
+
for (const [backendName, typeName] of Object.entries(VALUE_BACKEND_NAMES)) {
|
|
73
|
+
const schema = backendRegistry.getSchemaByName(backendName);
|
|
74
|
+
if (schema)
|
|
75
|
+
valueTypeIds.set(schema.typeId, typeName);
|
|
76
|
+
}
|
|
77
|
+
return { gipTypeId, valueTypeIds };
|
|
78
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as flowir from "@womp/flowir";
|
|
2
|
+
import { BackendRegistry, type GraphExt } from "./backendRegistry.js";
|
|
3
|
+
import { type GeometryGraph, type StatementNodes } from "./graph.js";
|
|
4
|
+
export declare const backendRegistry: BackendRegistry;
|
|
5
|
+
export declare const flowirRegistry: flowir.Registry;
|
|
6
|
+
export declare function compileGeometry(source: string): {
|
|
7
|
+
program: flowir.AstProgram;
|
|
8
|
+
graph: GeometryGraph;
|
|
9
|
+
graphExt: GraphExt;
|
|
10
|
+
nodeIds: StatementNodes;
|
|
11
|
+
};
|
|
12
|
+
/** Refuse full replacement unless the editable representation retains the stored graph. */
|
|
13
|
+
export declare function readEditableGeometry(rawGraph: unknown, graphExt: GraphExt): {
|
|
14
|
+
program: flowir.AstProgram;
|
|
15
|
+
nodeIds: StatementNodes;
|
|
16
|
+
graph: {
|
|
17
|
+
nodes: Record<string, {
|
|
18
|
+
type_id: number;
|
|
19
|
+
}>;
|
|
20
|
+
connections: Record<string, 0>;
|
|
21
|
+
data: Record<string, {
|
|
22
|
+
inputs: Record<string, string | number | boolean | string[] | number[] | boolean[] | {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
z: number;
|
|
26
|
+
} | {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
z: number;
|
|
30
|
+
}[]>;
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
source: string;
|
|
34
|
+
};
|
|
35
|
+
export declare function migrateGraphExt(previous: GraphExt, oldIds: StatementNodes, compiled: ReturnType<typeof compileGeometry>): GraphExt;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import * as flowir from "@womp/flowir";
|
|
2
|
+
import isEqual from "lodash/isEqual.js";
|
|
3
|
+
import { BackendRegistry } from "./backendRegistry.js";
|
|
4
|
+
import { defaultScalar, parseConnection } from "./common.js";
|
|
5
|
+
import { geometryGraphSchema, } from "./graph.js";
|
|
6
|
+
import { createGeoNodesRegistry } from "./index.js";
|
|
7
|
+
import { lift } from "./lift.js";
|
|
8
|
+
import { lower } from "./lower.js";
|
|
9
|
+
export const backendRegistry = BackendRegistry.fromBundledJson();
|
|
10
|
+
export const flowirRegistry = createGeoNodesRegistry();
|
|
11
|
+
export function compileGeometry(source) {
|
|
12
|
+
const parsed = flowir.parseIRText(source);
|
|
13
|
+
if (!parsed.ok)
|
|
14
|
+
throw new Error(parsed.diagnostics
|
|
15
|
+
.map((item) => `Line ${item.line}: ${item.message} ${item.hint}`)
|
|
16
|
+
.join("\n"));
|
|
17
|
+
const result = flowir.compileFromProgram(parsed.program, source, flowirRegistry);
|
|
18
|
+
if (!result.ok)
|
|
19
|
+
throw new Error(flowir.formatDiagnostics(result));
|
|
20
|
+
const compiled = lower(parsed.program, flowirRegistry, backendRegistry);
|
|
21
|
+
for (const statement of parsed.program.statements) {
|
|
22
|
+
const name = statement.kind === "node"
|
|
23
|
+
? statement.id
|
|
24
|
+
: statement.kind === "out"
|
|
25
|
+
? statement.outputName
|
|
26
|
+
: statement.name;
|
|
27
|
+
if (compiled.nodeIds[`${statement.kind}:${name}`] === undefined)
|
|
28
|
+
throw new Error(`The backend cannot lower ${statement.kind} ${name}. Use a supported node or literal input instead.`);
|
|
29
|
+
}
|
|
30
|
+
return { ...compiled, program: parsed.program };
|
|
31
|
+
}
|
|
32
|
+
function comparableGraph(graph, nodeIds) {
|
|
33
|
+
const roles = new Map(Object.entries(nodeIds).map(([role, id]) => [id, role]));
|
|
34
|
+
if (roles.size !== Object.keys(graph.nodes).length)
|
|
35
|
+
throw new Error("This graph contains nodes that FlowIR cannot preserve.");
|
|
36
|
+
const nodes = {};
|
|
37
|
+
for (const [id, node] of Object.entries(graph.nodes)) {
|
|
38
|
+
const role = roles.get(id);
|
|
39
|
+
if (!role)
|
|
40
|
+
throw new Error(`FlowIR cannot preserve node ${id}.`);
|
|
41
|
+
const schema = backendRegistry.getSchema(node.type_id);
|
|
42
|
+
const inputs = {};
|
|
43
|
+
for (const [portId, value] of Object.entries(graph.data[id]?.inputs ?? {})) {
|
|
44
|
+
const port = schema?.inputs[Number(portId)];
|
|
45
|
+
if (!port ||
|
|
46
|
+
schema?.name === "GroupInputParam" ||
|
|
47
|
+
!isEqual(value, defaultScalar(port)))
|
|
48
|
+
inputs[portId] = value;
|
|
49
|
+
}
|
|
50
|
+
nodes[role] = { typeId: node.type_id, inputs };
|
|
51
|
+
}
|
|
52
|
+
for (const id of Object.keys(graph.data)) {
|
|
53
|
+
if (!graph.nodes[id])
|
|
54
|
+
throw new Error(`Graph data refers to missing node ${id}.`);
|
|
55
|
+
}
|
|
56
|
+
const edges = Object.keys(graph.connections)
|
|
57
|
+
.map((key) => {
|
|
58
|
+
const edge = parseConnection(key);
|
|
59
|
+
if (!edge || !roles.has(edge.fromBid) || !roles.has(edge.toBid))
|
|
60
|
+
throw new Error(`FlowIR cannot preserve connection ${key}.`);
|
|
61
|
+
return `${roles.get(edge.fromBid)}:${edge.fromPort}-${roles.get(edge.toBid)}:${edge.toPort}`;
|
|
62
|
+
})
|
|
63
|
+
.sort();
|
|
64
|
+
return { nodes, edges };
|
|
65
|
+
}
|
|
66
|
+
/** Refuse full replacement unless the editable representation retains the stored graph. */
|
|
67
|
+
export function readEditableGeometry(rawGraph, graphExt) {
|
|
68
|
+
const graph = geometryGraphSchema.parse(rawGraph);
|
|
69
|
+
const lifted = lift(graph, graphExt, flowirRegistry, backendRegistry);
|
|
70
|
+
const source = flowir.programToIRText(lifted.program);
|
|
71
|
+
const rebuilt = compileGeometry(source);
|
|
72
|
+
if (!isEqual(comparableGraph(graph, lifted.nodeIds), comparableGraph(rebuilt.graph, rebuilt.nodeIds)))
|
|
73
|
+
throw new Error("This graph contains inputs or connections that FlowIR cannot preserve. Edit it in the graph editor instead of replacing it.");
|
|
74
|
+
return { graph, source, ...lifted };
|
|
75
|
+
}
|
|
76
|
+
export function migrateGraphExt(previous, oldIds, compiled) {
|
|
77
|
+
const nodes = {};
|
|
78
|
+
for (const [role, id] of Object.entries(compiled.nodeIds)) {
|
|
79
|
+
const oldId = oldIds[role];
|
|
80
|
+
nodes[id] = {
|
|
81
|
+
...compiled.graphExt.nodes[id],
|
|
82
|
+
...(oldId === undefined ? {} : previous.nodes[oldId]),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
// New nodes get a readable layout without invoking another open graph's UI callback.
|
|
86
|
+
const existingX = Object.values(nodes).flatMap((node) => node.position?.slice(0, 1) ?? []);
|
|
87
|
+
const startX = existingX.length ? Math.max(...existingX) + 350 : 0;
|
|
88
|
+
const depths = new Map();
|
|
89
|
+
for (const id of Object.keys(compiled.graph.nodes))
|
|
90
|
+
depths.set(id, 0);
|
|
91
|
+
const edges = Object.keys(compiled.graph.connections).map(parseConnection);
|
|
92
|
+
for (let pass = 0; pass < depths.size; pass++) {
|
|
93
|
+
let changed = false;
|
|
94
|
+
for (const edge of edges) {
|
|
95
|
+
if (!edge)
|
|
96
|
+
continue;
|
|
97
|
+
const depth = (depths.get(edge.fromBid) ?? 0) + 1;
|
|
98
|
+
if (depth > (depths.get(edge.toBid) ?? 0)) {
|
|
99
|
+
depths.set(edge.toBid, depth);
|
|
100
|
+
changed = true;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (!changed)
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
const rows = new Map();
|
|
107
|
+
for (const [id, depth] of depths) {
|
|
108
|
+
if (nodes[id]?.position)
|
|
109
|
+
continue;
|
|
110
|
+
const row = rows.get(depth) ?? 0;
|
|
111
|
+
nodes[id] = { ...nodes[id], position: [startX + depth * 350, row * 500] };
|
|
112
|
+
rows.set(depth, row + 1);
|
|
113
|
+
}
|
|
114
|
+
return { ...previous, nodes };
|
|
115
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const graphDataSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
3
|
+
inputs: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean, z.ZodString, z.ZodObject<{
|
|
4
|
+
x: z.ZodNumber;
|
|
5
|
+
y: z.ZodNumber;
|
|
6
|
+
z: z.ZodNumber;
|
|
7
|
+
}, z.core.$strict>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodBoolean>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodObject<{
|
|
8
|
+
x: z.ZodNumber;
|
|
9
|
+
y: z.ZodNumber;
|
|
10
|
+
z: z.ZodNumber;
|
|
11
|
+
}, z.core.$strict>>]>>;
|
|
12
|
+
}, z.core.$strict>>;
|
|
13
|
+
export declare const geometryGraphSchema: z.ZodObject<{
|
|
14
|
+
nodes: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
15
|
+
type_id: z.ZodNumber;
|
|
16
|
+
}, z.core.$strict>>;
|
|
17
|
+
connections: z.ZodRecord<z.ZodString, z.ZodLiteral<0>>;
|
|
18
|
+
data: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
19
|
+
inputs: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean, z.ZodString, z.ZodObject<{
|
|
20
|
+
x: z.ZodNumber;
|
|
21
|
+
y: z.ZodNumber;
|
|
22
|
+
z: z.ZodNumber;
|
|
23
|
+
}, z.core.$strict>, z.ZodArray<z.ZodNumber>, z.ZodArray<z.ZodBoolean>, z.ZodArray<z.ZodString>, z.ZodArray<z.ZodObject<{
|
|
24
|
+
x: z.ZodNumber;
|
|
25
|
+
y: z.ZodNumber;
|
|
26
|
+
z: z.ZodNumber;
|
|
27
|
+
}, z.core.$strict>>]>>;
|
|
28
|
+
}, z.core.$strict>>;
|
|
29
|
+
}, z.core.$strict>;
|
|
30
|
+
export declare const graphExtSchema: z.ZodObject<{
|
|
31
|
+
nodes: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
32
|
+
name: z.ZodOptional<z.ZodString>;
|
|
33
|
+
position: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
34
|
+
}, z.core.$catchall<z.ZodJSONSchema>>>>;
|
|
35
|
+
}, z.core.$catchall<z.ZodJSONSchema>>;
|
|
36
|
+
export type GeometryGraph = z.infer<typeof geometryGraphSchema>;
|
|
37
|
+
export type GraphData = z.infer<typeof graphDataSchema>;
|
|
38
|
+
/** FlowIR statement roles map to backend IDs only for the current conversion. */
|
|
39
|
+
export type StatementNodes = Record<string, string>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const vec3 = z.object({ x: z.number(), y: z.number(), z: z.number() }).strict();
|
|
3
|
+
const value = z.union([
|
|
4
|
+
z.number(),
|
|
5
|
+
z.boolean(),
|
|
6
|
+
z.string(),
|
|
7
|
+
vec3,
|
|
8
|
+
z.array(z.number()),
|
|
9
|
+
z.array(z.boolean()),
|
|
10
|
+
z.array(z.string()),
|
|
11
|
+
z.array(vec3),
|
|
12
|
+
]);
|
|
13
|
+
export const graphDataSchema = z.record(z.string().regex(/^\d+$/), z.object({ inputs: z.record(z.string().regex(/^\d+$/), value) }).strict());
|
|
14
|
+
export const geometryGraphSchema = z
|
|
15
|
+
.object({
|
|
16
|
+
nodes: z.record(z.string().regex(/^\d+$/), z.object({ type_id: z.number().int().nonnegative() }).strict()),
|
|
17
|
+
connections: z.record(z.string().regex(/^\d+:\d+-\d+:\d+$/), z.literal(0)),
|
|
18
|
+
data: graphDataSchema,
|
|
19
|
+
})
|
|
20
|
+
.strict();
|
|
21
|
+
export const graphExtSchema = z
|
|
22
|
+
.object({
|
|
23
|
+
nodes: z
|
|
24
|
+
.record(z.string(), z
|
|
25
|
+
.object({
|
|
26
|
+
name: z.string().optional(),
|
|
27
|
+
position: z.array(z.number()).length(2).optional(),
|
|
28
|
+
})
|
|
29
|
+
.catchall(z.json()))
|
|
30
|
+
.default({}),
|
|
31
|
+
})
|
|
32
|
+
.catchall(z.json());
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as flowir from "@womp/flowir";
|
|
2
|
+
export { BackendRegistry } from "./backendRegistry.js";
|
|
3
|
+
export type { BackendValue, BackendNodeSchema, BackendPort, GraphExt, } from "./backendRegistry.js";
|
|
4
|
+
export { lower } from "./lower.js";
|
|
5
|
+
export type { LowerResult } from "./lower.js";
|
|
6
|
+
export { lift } from "./lift.js";
|
|
7
|
+
export { writeParamData } from "./writeParamData.js";
|
|
8
|
+
export declare function loadGeoNodesDialect(): flowir.DialectSchema;
|
|
9
|
+
export declare function createGeoNodesRegistry(): flowir.Registry;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as flowir from "@womp/flowir";
|
|
2
|
+
import dialectJson from "./schemas/flowir-dialect.json" with { type: "json" };
|
|
3
|
+
export { BackendRegistry } from "./backendRegistry.js";
|
|
4
|
+
export { lower } from "./lower.js";
|
|
5
|
+
export { lift } from "./lift.js";
|
|
6
|
+
export { writeParamData } from "./writeParamData.js";
|
|
7
|
+
export function loadGeoNodesDialect() {
|
|
8
|
+
return dialectJson;
|
|
9
|
+
}
|
|
10
|
+
export function createGeoNodesRegistry() {
|
|
11
|
+
return flowir.Registry.fromJsonObject(dialectJson);
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as flowir from "@womp/flowir";
|
|
2
|
+
import type { GeometryGraph, StatementNodes } from "./graph.js";
|
|
3
|
+
import type { BackendRegistry, GraphExt } from "./backendRegistry.js";
|
|
4
|
+
export declare function lift(graph: GeometryGraph, graphExt: GraphExt, flowirRegistry: flowir.Registry, backendRegistry: BackendRegistry): {
|
|
5
|
+
program: flowir.AstProgram;
|
|
6
|
+
nodeIds: StatementNodes;
|
|
7
|
+
};
|