@womp/spark-agent 2.0.0 → 2.2.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 (55) hide show
  1. package/README.md +5 -0
  2. package/dist/capabilities/health.d.ts +9 -0
  3. package/dist/capabilities/health.js +27 -0
  4. package/dist/capabilities.d.ts +3 -1
  5. package/dist/capabilities.js +1 -0
  6. package/dist/cli.js +1 -0
  7. package/dist/generated/health-declarations.d.ts +1 -0
  8. package/dist/generated/health-declarations.js +3 -0
  9. package/dist/geometry/backendRegistry.d.ts +37 -0
  10. package/dist/geometry/backendRegistry.js +61 -0
  11. package/dist/geometry/common.d.ts +26 -0
  12. package/dist/geometry/common.js +78 -0
  13. package/dist/geometry/compiler.d.ts +35 -0
  14. package/dist/geometry/compiler.js +115 -0
  15. package/dist/geometry/graph.d.ts +39 -0
  16. package/dist/geometry/graph.js +32 -0
  17. package/dist/geometry/index.d.ts +9 -0
  18. package/dist/geometry/index.js +12 -0
  19. package/dist/geometry/lift.d.ts +7 -0
  20. package/dist/geometry/lift.js +376 -0
  21. package/dist/geometry/lower.d.ts +9 -0
  22. package/dist/geometry/lower.js +363 -0
  23. package/dist/geometry/parameters.d.ts +23 -0
  24. package/dist/geometry/parameters.js +46 -0
  25. package/dist/geometry/schemas/backend-schema.json +3394 -0
  26. package/dist/geometry/schemas/flowir-dialect.json +979 -0
  27. package/dist/geometry/writeParamData.d.ts +18 -0
  28. package/dist/geometry/writeParamData.js +47 -0
  29. package/dist/geometry.d.ts +10 -0
  30. package/dist/geometry.js +19 -0
  31. package/dist/kakapo.d.ts +6 -1
  32. package/dist/kakapo.js +5 -0
  33. package/dist/openscad.d.ts +85 -0
  34. package/dist/openscad.js +223 -0
  35. package/dist/repair-state.d.ts +50 -0
  36. package/dist/repair-state.js +96 -0
  37. package/dist/scene-health.d.ts +49 -0
  38. package/dist/scene-health.js +176 -0
  39. package/dist/sdk-geometry-host.d.ts +12 -0
  40. package/dist/sdk-geometry-host.js +306 -0
  41. package/dist/sdk-openscad-host.d.ts +14 -0
  42. package/dist/sdk-openscad-host.js +296 -0
  43. package/dist/sdk-openscad-renderer.d.ts +11 -0
  44. package/dist/sdk-openscad-renderer.js +71 -0
  45. package/dist/sdk-scene-health-host.d.ts +4 -0
  46. package/dist/sdk-scene-health-host.js +13 -0
  47. package/dist/sdk-scene-host.d.ts +5 -2
  48. package/dist/sdk-scene-host.js +6 -5
  49. package/dist/server/fixtures/materials/matte-blue.json +1 -1
  50. package/dist/server/fixtures/materials/polished-copper.json +1 -1
  51. package/dist/server/sqlite-store.d.ts +2 -0
  52. package/dist/server/sqlite-store.js +26 -2
  53. package/dist/server/standalone.d.ts +9 -0
  54. package/dist/server/standalone.js +91 -15
  55. package/package.json +17 -3
@@ -0,0 +1,176 @@
1
+ import { z } from "zod";
2
+ export const MAX_GEOMETRY_REPAIR_ATTEMPTS = 2;
3
+ const HEALTH_TIMEOUT_MS = 15_000;
4
+ const count = z.number().finite().nonnegative();
5
+ export const sceneHealthObjectSchema = z.object({
6
+ num_prims: count,
7
+ flag_prim_overflow: count,
8
+ flag_depth_overflow: count,
9
+ flag_vox_overflow: count,
10
+ voxels: count,
11
+ });
12
+ export const thermometerSchema = z.object({
13
+ objects: z.record(z.string(), sceneHealthObjectSchema),
14
+ max_num_prims: count.positive(),
15
+ max_total_depth: count,
16
+ max_per_object: count.positive(),
17
+ total: count,
18
+ max_total: count.positive(),
19
+ assets_budget_used: count,
20
+ assets_budget_total: count.positive(),
21
+ mesh_instances_used: count.optional(),
22
+ mesh_instances_total: count.optional(),
23
+ decal_instances_used: count.optional(),
24
+ decal_instances_total: count.optional(),
25
+ field_instances_used: count.optional(),
26
+ field_instances_total: count.optional(),
27
+ });
28
+ export function unverifiedSceneHealth(affectedAreaIds, reason) {
29
+ return {
30
+ status: "unverified",
31
+ freshness: "unverified",
32
+ revisionVerified: false,
33
+ affectedAreaIds,
34
+ reason,
35
+ };
36
+ }
37
+ export function getSdkSceneAreaId(api, objectId) {
38
+ let node = api.getNode(objectId);
39
+ let areaId = node.kind === "union" ? node.id : objectId;
40
+ while (node.parentId !== null) {
41
+ node = api.getNode(node.parentId);
42
+ if (node.kind === "union")
43
+ areaId = node.id;
44
+ }
45
+ return String(areaId);
46
+ }
47
+ export function getSdkSceneAreaIds(api) {
48
+ return api
49
+ .listNodes({ kind: "union" })
50
+ .filter((node) => node.kind === "union" &&
51
+ getSdkSceneAreaId(api, node.id) === String(node.id))
52
+ .map((node) => String(node.id));
53
+ }
54
+ export function hasGeometryOverflow(health) {
55
+ if (health.thermometer === undefined || health.status === "unverified")
56
+ return false;
57
+ const thermometer = health.thermometer;
58
+ return health.affectedAreaIds.some((id) => {
59
+ const object = thermometer.objects[id];
60
+ return (object !== undefined &&
61
+ (object.flag_prim_overflow > 0 ||
62
+ object.flag_depth_overflow > 0 ||
63
+ object.num_prims >= thermometer.max_num_prims));
64
+ });
65
+ }
66
+ export function hasSceneResourcePressure(health) {
67
+ const thermometer = health.thermometer;
68
+ if (thermometer === undefined || health.status === "unverified")
69
+ return false;
70
+ if (thermometer.total >= thermometer.max_total ||
71
+ thermometer.assets_budget_used >= thermometer.assets_budget_total)
72
+ return true;
73
+ for (const [used, total] of [
74
+ [thermometer.mesh_instances_used, thermometer.mesh_instances_total],
75
+ [thermometer.decal_instances_used, thermometer.decal_instances_total],
76
+ [thermometer.field_instances_used, thermometer.field_instances_total],
77
+ ]) {
78
+ if (used !== undefined && total !== undefined && used >= total)
79
+ return true;
80
+ }
81
+ return Object.values(thermometer.objects).some((object) => object.flag_prim_overflow > 0 ||
82
+ object.flag_depth_overflow > 0 ||
83
+ object.flag_vox_overflow > 0 ||
84
+ object.num_prims >= thermometer.max_num_prims ||
85
+ object.voxels >= thermometer.max_per_object);
86
+ }
87
+ export function parseSceneHealth(response, affectedAreaIds) {
88
+ let value = response;
89
+ if (typeof response === "string") {
90
+ try {
91
+ value = JSON.parse(response);
92
+ }
93
+ catch {
94
+ return unverifiedSceneHealth(affectedAreaIds, "Incomplete thermometer response.");
95
+ }
96
+ }
97
+ const parsed = thermometerSchema.safeParse(value);
98
+ if (parsed.success === false)
99
+ return unverifiedSceneHealth(affectedAreaIds, "Incomplete thermometer response.");
100
+ const thermometer = parsed.data;
101
+ if (affectedAreaIds.some((id) => thermometer.objects[id] === undefined))
102
+ return unverifiedSceneHealth(affectedAreaIds, "The affected Area is not in the engine thermometer yet.");
103
+ const overflow = Object.values(thermometer.objects).some((object) => object.flag_prim_overflow > 0 ||
104
+ object.flag_depth_overflow > 0 ||
105
+ object.flag_vox_overflow > 0 ||
106
+ object.num_prims >= thermometer.max_num_prims);
107
+ const emptyAreaIds = Object.keys(thermometer.objects).filter((id) => thermometer.objects[id]?.num_prims === 0);
108
+ const emptyTarget = emptyAreaIds.some((id) => affectedAreaIds.length === 0 || affectedAreaIds.includes(id));
109
+ return {
110
+ status: overflow
111
+ ? "overflow"
112
+ : emptyTarget
113
+ ? "unverified"
114
+ : "within_limits",
115
+ freshness: "snapshot",
116
+ revisionVerified: false,
117
+ affectedAreaIds,
118
+ thermometer,
119
+ emptyAreaIds,
120
+ ...(emptyAreaIds.length > 0
121
+ ? {
122
+ reason: "These Areas have no evaluated primitive geometry. Zero counts and clear flags do not prove the model is working: output may be empty, pending, or failed.",
123
+ }
124
+ : {}),
125
+ };
126
+ }
127
+ export async function readSdkSceneHealth(api, affectedAreaIds, signal) {
128
+ let timeout;
129
+ let removeAbortListener;
130
+ try {
131
+ signal?.throwIfAborted();
132
+ const aborted = new Promise((_resolve, reject) => {
133
+ if (signal === undefined)
134
+ return;
135
+ const onAbort = () => reject(signal.reason);
136
+ signal.addEventListener("abort", onAbort, { once: true });
137
+ removeAbortListener = () => signal.removeEventListener("abort", onAbort);
138
+ });
139
+ return await Promise.race([
140
+ (async () => {
141
+ await api.waitForRenderer();
142
+ signal?.throwIfAborted();
143
+ return parseSceneHealth(await api.rpc("get_thermometer"), affectedAreaIds);
144
+ })(),
145
+ new Promise((resolve) => {
146
+ timeout = setTimeout(() => resolve(unverifiedSceneHealth(affectedAreaIds, "Scene health timed out.")), HEALTH_TIMEOUT_MS);
147
+ }),
148
+ aborted,
149
+ ]);
150
+ }
151
+ catch (error) {
152
+ return unverifiedSceneHealth(affectedAreaIds, String(error));
153
+ }
154
+ finally {
155
+ if (timeout !== undefined)
156
+ clearTimeout(timeout);
157
+ removeAbortListener?.();
158
+ }
159
+ }
160
+ export async function readStableSdkSceneHealth(api, affectedAreaIds, signal) {
161
+ try {
162
+ signal?.throwIfAborted();
163
+ const before = await api.getSceneRevision();
164
+ const health = await readSdkSceneHealth(api, affectedAreaIds, signal);
165
+ signal?.throwIfAborted();
166
+ await api.refreshScene();
167
+ signal?.throwIfAborted();
168
+ const after = await api.getSceneRevision();
169
+ if (before === after)
170
+ return health;
171
+ return unverifiedSceneHealth(affectedAreaIds, "The scene changed while reading its health.");
172
+ }
173
+ catch (error) {
174
+ return unverifiedSceneHealth(affectedAreaIds, String(error));
175
+ }
176
+ }
@@ -0,0 +1,12 @@
1
+ import { type SdkSceneEditor } from "./sdk-scene-host.js";
2
+ import type { GeometryHost } from "./capabilities.js";
3
+ import { readStableSdkSceneHealth } from "./scene-health.js";
4
+ import { type RepairStateStore } from "./repair-state.js";
5
+ export type SdkGeometryHostOptions = {
6
+ editor: SdkSceneEditor;
7
+ repairs: RepairStateStore;
8
+ canGrow?: () => boolean;
9
+ onHealth?: (health: Awaited<ReturnType<typeof readStableSdkSceneHealth>>) => void;
10
+ onSelect?: (objectId: number) => void | Promise<void>;
11
+ };
12
+ export declare function createSdkGeometryHost(options: SdkGeometryHostOptions): GeometryHost;
@@ -0,0 +1,306 @@
1
+ import { compileGeometry, migrateGraphExt, readEditableGeometry, } from "./geometry/compiler.js";
2
+ import { graphExtSchema } from "./geometry/graph.js";
3
+ import { migrateParameterOverrides, readParameterOverrides, } from "./geometry/parameters.js";
4
+ import { getSdkSceneAreaId, readStableSdkSceneHealth } from "./scene-health.js";
5
+ import { createGeometryRepairTracker, } from "./repair-state.js";
6
+ function errorMessage(error) {
7
+ return error instanceof Error ? error.message : String(error);
8
+ }
9
+ function unusedId(entries) {
10
+ let id = 0;
11
+ while (id in entries)
12
+ id++;
13
+ return id;
14
+ }
15
+ function scriptStorage(source) {
16
+ const scripts = source.getSceneStorage().scripts;
17
+ if (!scripts || typeof scripts !== "object" || Array.isArray(scripts))
18
+ return { graphs: {}, instances: {} };
19
+ const value = scripts;
20
+ return {
21
+ graphs: value.graphs && typeof value.graphs === "object"
22
+ ? value.graphs
23
+ : {},
24
+ instances: value.instances && typeof value.instances === "object"
25
+ ? value.instances
26
+ : {},
27
+ };
28
+ }
29
+ function objectIdsFor(source, instanceId) {
30
+ return source
31
+ .listNodes({ kind: "union" })
32
+ .filter((node) => node.kind === "union" && node.scriptInstanceId === instanceId)
33
+ .map((node) => node.id);
34
+ }
35
+ function resolveTarget(source, objectId) {
36
+ const node = source.getNode(objectId);
37
+ if (objectId !== 0 && node.kind !== "union" && node.kind !== "group")
38
+ throw new Error("Geometry Nodes requires an Area, Group, or scene root target.");
39
+ const instanceId = node.kind === "union" ? node.scriptInstanceId : undefined;
40
+ const scripts = scriptStorage(source);
41
+ const instance = instanceId === undefined ? undefined : scripts.instances[instanceId];
42
+ if (instanceId !== undefined && !instance)
43
+ throw new Error("The target's Geometry Nodes instance is missing. Inspect it before editing.");
44
+ const graphId = instance?.graph_id;
45
+ const graph = graphId === undefined ? undefined : scripts.graphs[graphId];
46
+ if (instance && (graph === undefined || !Number.isInteger(graphId)))
47
+ throw new Error("The target's Geometry Nodes graph is missing. Inspect it before editing.");
48
+ return { node, graph, graphId, instanceId, scripts };
49
+ }
50
+ async function readTarget(api, objectId, target = resolveTarget(api, objectId)) {
51
+ const result = {
52
+ kind: target.graphId === undefined ? "container" : "graph",
53
+ objectId,
54
+ title: target.node.name,
55
+ graphId: target.graphId,
56
+ instanceId: target.instanceId,
57
+ source: null,
58
+ instances: [],
59
+ revision: await api.getSceneRevision(),
60
+ diagnostics: [],
61
+ };
62
+ if (target.graphId === undefined || target.graph === undefined)
63
+ return result;
64
+ try {
65
+ const ext = graphExtSchema.parse(api.getSceneExt().graphsExt?.[target.graphId] ?? {});
66
+ const editable = readEditableGeometry(target.graph, ext);
67
+ result.source = editable.source;
68
+ for (const [id, instance] of Object.entries(target.scripts.instances)) {
69
+ if (instance.graph_id !== target.graphId)
70
+ continue;
71
+ const { params } = readParameterOverrides(editable.graph, ext, instance.data ?? {});
72
+ result.instances.push({
73
+ instanceId: Number(id),
74
+ objectIds: objectIdsFor(api, Number(id)),
75
+ params,
76
+ });
77
+ }
78
+ }
79
+ catch (error) {
80
+ result.source = null;
81
+ result.diagnostics.push(errorMessage(error));
82
+ }
83
+ return structuredClone(result);
84
+ }
85
+ function writeGraphStorage(draft, graphId, graph, instances) {
86
+ const scripts = draft.getSceneStorage().scripts;
87
+ if (!scripts || typeof scripts !== "object" || Array.isArray(scripts)) {
88
+ draft.patchSceneStorage([
89
+ {
90
+ op: "add",
91
+ path: "/scripts",
92
+ value: { graphs: {}, instances: {} },
93
+ },
94
+ ]);
95
+ }
96
+ else {
97
+ const record = scripts;
98
+ const additions = [];
99
+ if (!record.graphs)
100
+ additions.push({
101
+ op: "add",
102
+ path: "/scripts/graphs",
103
+ value: {},
104
+ });
105
+ if (!record.instances)
106
+ additions.push({
107
+ op: "add",
108
+ path: "/scripts/instances",
109
+ value: {},
110
+ });
111
+ if (additions.length)
112
+ draft.patchSceneStorage(additions);
113
+ }
114
+ draft.patchSceneStorage([
115
+ {
116
+ op: "add",
117
+ path: `/scripts/graphs/${graphId}`,
118
+ value: graph,
119
+ },
120
+ ...[...instances].map(([id, instance]) => ({
121
+ op: "add",
122
+ path: `/scripts/instances/${id}`,
123
+ value: instance,
124
+ })),
125
+ ]);
126
+ }
127
+ export function createSdkGeometryHost(options) {
128
+ const editor = options.editor;
129
+ const repairs = createGeometryRepairTracker(options.repairs, "geometry");
130
+ const pendingTargets = new Set();
131
+ return {
132
+ read: (objectId, invocation) => editor.read(invocation, (api) => readTarget(api, objectId)),
133
+ write: async (input, invocation) => {
134
+ invocation.signal.throwIfAborted();
135
+ const inspected = await editor.read(invocation, async (api) => {
136
+ const current = resolveTarget(api, input.objectId);
137
+ return {
138
+ target: await readTarget(api, input.objectId, current),
139
+ current,
140
+ graphExt: current.graphId === undefined
141
+ ? undefined
142
+ : api.getSceneExt().graphsExt?.[current.graphId],
143
+ };
144
+ });
145
+ const { target } = inspected;
146
+ const pendingKey = target.graphId === undefined
147
+ ? `object:${input.objectId}`
148
+ : `graph:${target.graphId}`;
149
+ if (pendingTargets.has(pendingKey))
150
+ throw new Error("This Geometry Nodes target is still being updated. Await its current update first.");
151
+ pendingTargets.add(pendingKey);
152
+ try {
153
+ if (target.revision !== input.expectedRevision)
154
+ throw new Error("The scene changed. Read it again before editing.");
155
+ const repairingGeometry = target.graphId !== undefined &&
156
+ (await repairs.isPending(String(target.graphId)));
157
+ if (target.graphId !== undefined)
158
+ await repairs.assertCanWrite(String(target.graphId));
159
+ const rejected = (diagnostics) => ({
160
+ status: "rejected",
161
+ objectId: input.objectId,
162
+ graphId: target.graphId,
163
+ instanceId: target.instanceId,
164
+ affectedObjectIds: [],
165
+ revision: target.revision,
166
+ diagnostics,
167
+ });
168
+ let compiled;
169
+ let nextExt;
170
+ const updates = new Map();
171
+ const diagnostics = [];
172
+ try {
173
+ compiled = compileGeometry(input.source);
174
+ readEditableGeometry(compiled.graph, compiled.graphExt);
175
+ if (target.graphId === undefined) {
176
+ nextExt = migrateGraphExt({ nodes: {} }, {}, compiled);
177
+ }
178
+ else {
179
+ const { current } = inspected;
180
+ if (current.graph === undefined)
181
+ throw new Error("The Geometry Nodes graph is missing.");
182
+ const ext = graphExtSchema.parse(inspected.graphExt ?? {});
183
+ const previous = readEditableGeometry(current.graph, ext);
184
+ nextExt = migrateGraphExt(ext, previous.nodeIds, compiled);
185
+ for (const [id, instance] of Object.entries(current.scripts.instances)) {
186
+ if (instance.graph_id !== target.graphId)
187
+ continue;
188
+ const old = readParameterOverrides(previous.graph, ext, instance.data ?? {});
189
+ const migrated = migrateParameterOverrides(previous.graph, ext, compiled.graph, nextExt, old.data);
190
+ updates.set(id, {
191
+ graph_id: target.graphId,
192
+ data: migrated.data,
193
+ });
194
+ if (migrated.removed.length)
195
+ diagnostics.push(`Instance ${id}: removed or type-changed overrides ${migrated.removed.join(", ")} now use graph defaults where present.`);
196
+ }
197
+ }
198
+ }
199
+ catch (error) {
200
+ return rejected([errorMessage(error)]);
201
+ }
202
+ if (repairingGeometry === false && options.canGrow?.() === false)
203
+ return rejected(["Scene memory limits prevent applying this graph."]);
204
+ const receiptTarget = {
205
+ objectId: input.objectId,
206
+ };
207
+ let operationId;
208
+ let applied;
209
+ try {
210
+ applied = await editor.edit({
211
+ capability: "geometry",
212
+ operation: "write",
213
+ target: () => receiptTarget,
214
+ }, async (_api, draft, id) => {
215
+ operationId = id;
216
+ const current = resolveTarget(draft, input.objectId);
217
+ if (repairingGeometry === false && options.canGrow?.() === false)
218
+ throw new Error("Scene memory limits prevent applying this graph.");
219
+ if (current.graphId !== target.graphId)
220
+ throw new Error("The Geometry Nodes target changed. Read it again.");
221
+ if (current.graphId !== undefined)
222
+ await repairs.reserve(String(current.graphId), id);
223
+ let objectId = input.objectId;
224
+ let graphId = current.graphId;
225
+ let instanceId = current.instanceId;
226
+ const nextInstances = new Map(updates);
227
+ if (graphId === undefined) {
228
+ graphId = unusedId(current.scripts.graphs);
229
+ instanceId = unusedId(current.scripts.instances);
230
+ if (objectId === 0 || current.node.kind !== "union") {
231
+ objectId = draft.createNode({
232
+ kind: "union",
233
+ parentId: objectId,
234
+ name: "Area",
235
+ }).id;
236
+ }
237
+ draft.updateNode(objectId, { scriptInstanceId: instanceId });
238
+ nextInstances.set(String(instanceId), {
239
+ graph_id: graphId,
240
+ data: {},
241
+ });
242
+ }
243
+ writeGraphStorage(draft, graphId, compiled.graph, nextInstances);
244
+ const ext = draft.getSceneExt();
245
+ if (!ext.graphsExt)
246
+ draft.patchSceneExt([
247
+ { op: "add", path: "/graphsExt", value: {} },
248
+ ]);
249
+ draft.patchSceneExt([
250
+ {
251
+ op: "add",
252
+ path: `/graphsExt/${graphId}`,
253
+ value: nextExt,
254
+ },
255
+ ]);
256
+ const affectedObjectIds = Object.entries(scriptStorage(draft).instances)
257
+ .filter(([, instance]) => instance.graph_id === graphId)
258
+ .flatMap(([id]) => objectIdsFor(draft, Number(id)));
259
+ Object.assign(receiptTarget, { objectId, graphId, instanceId });
260
+ return { objectId, graphId, instanceId, affectedObjectIds };
261
+ }, input.expectedRevision, invocation, async (_operation, api) => {
262
+ const committed = resolveTarget(api, receiptTarget.objectId);
263
+ if (committed.graphId === undefined)
264
+ return;
265
+ const affectedObjectIds = Object.entries(committed.scripts.instances)
266
+ .filter(([, instance]) => instance.graph_id === committed.graphId)
267
+ .flatMap(([id]) => objectIdsFor(api, Number(id)));
268
+ const areaIds = [
269
+ ...new Set(affectedObjectIds.map((id) => getSdkSceneAreaId(api, id))),
270
+ ];
271
+ const sceneHealth = await readStableSdkSceneHealth(api, areaIds, invocation.signal);
272
+ options.onHealth?.(sceneHealth);
273
+ const recorded = await repairs.record(String(committed.graphId), _operation.id, sceneHealth);
274
+ return {
275
+ sceneHealth,
276
+ geometryRepairAttempts: recorded.repairAttempts,
277
+ geometryRepairLimit: recorded.repairLimit,
278
+ };
279
+ });
280
+ }
281
+ catch (error) {
282
+ if (operationId !== undefined && target.graphId !== undefined) {
283
+ const operation = await editor.getOperation(operationId);
284
+ if (operation?.status === "rolled_back")
285
+ await repairs.refund(String(target.graphId), operationId);
286
+ }
287
+ throw error;
288
+ }
289
+ invocation.signal.throwIfAborted();
290
+ try {
291
+ await options.onSelect?.(applied.value.objectId);
292
+ }
293
+ catch { }
294
+ return {
295
+ status: "applied",
296
+ ...applied.value,
297
+ revision: applied.operation.resultRevision ?? input.expectedRevision,
298
+ diagnostics,
299
+ };
300
+ }
301
+ finally {
302
+ pendingTargets.delete(pendingKey);
303
+ }
304
+ },
305
+ };
306
+ }
@@ -0,0 +1,14 @@
1
+ import type { OpenScadHost } from "./capabilities.js";
2
+ import { type SdkSceneEditor } from "./sdk-scene-host.js";
3
+ import { type OpenScadPrintabilityRequest, type OpenScadPrintabilityResult } from "./openscad.js";
4
+ import { type RepairStateStore } from "./repair-state.js";
5
+ import { type SceneHealth } from "./scene-health.js";
6
+ export type SdkOpenScadHostOptions = {
7
+ editor: SdkSceneEditor;
8
+ repairs: RepairStateStore;
9
+ canGrow?: () => boolean;
10
+ onHealth?: (health: SceneHealth) => void;
11
+ onSelect?: (objectId: number) => void | Promise<void>;
12
+ requestPrintability?: (request: OpenScadPrintabilityRequest) => Promise<OpenScadPrintabilityResult>;
13
+ };
14
+ export declare function createSdkOpenScadHost(options: SdkOpenScadHostOptions): OpenScadHost;