@womp/spark-agent 4.2.1 → 4.3.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/.env.example +6 -6
- package/README.md +457 -436
- package/dist/agent-run.d.ts +1 -1
- package/dist/capabilities/flow.js +3 -3
- package/dist/capabilities/geometry.js +14 -14
- package/dist/capabilities/openscad-instructions.d.ts +1 -1
- package/dist/capabilities/openscad-instructions.js +2 -1
- package/dist/capabilities/operations.js +33 -32
- package/dist/capabilities/scene.js +74 -74
- package/dist/client.js +8 -0
- package/dist/geometry/schemas/backend-schema.json +3393 -3393
- package/dist/geometry/schemas/flowir-dialect.json +1023 -1023
- package/dist/geometry.js +6 -6
- package/dist/models.d.ts +12 -5
- package/dist/models.js +16 -7
- package/dist/pricing.js +15 -0
- package/dist/prompt.d.ts +1 -1
- package/dist/prompt.js +65 -70
- package/dist/server/express.js +9 -1
- package/dist/server/fixtures/materials/matte-blue.json +14 -14
- package/dist/server/fixtures/materials/polished-copper.json +14 -14
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +1 -1
- package/dist/server/message-fold.d.ts +59 -0
- package/dist/server/message-fold.js +345 -0
- package/dist/server/scene-initialization.d.ts +3 -0
- package/dist/server/scene-initialization.js +44 -0
- package/dist/server/service.d.ts +82 -5
- package/dist/server/service.js +294 -63
- package/dist/server/sqlite-store.d.ts +1 -0
- package/dist/server/sqlite-store.js +40 -37
- package/dist/server/standalone.js +3 -0
- package/dist/server/store.d.ts +1 -0
- package/dist/server/store.js +7 -0
- package/dist/server/types.d.ts +7 -0
- package/package.json +139 -139
package/dist/agent-run.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare function parseAgentRunArgs(args: string[]): {
|
|
|
8
8
|
output: string | undefined;
|
|
9
9
|
images: string[];
|
|
10
10
|
settings: {
|
|
11
|
-
modelId: "gpt-6-astra" | "gpt-
|
|
11
|
+
modelId: "gpt-6-astra" | "gpt-6-sol" | "gpt-6-luna" | "gemini-3.8-flash" | "claude-opus-5-5" | "claude-fable-5";
|
|
12
12
|
reasoningEffort: ReasoningEffort;
|
|
13
13
|
};
|
|
14
14
|
} | null;
|
|
@@ -13,9 +13,9 @@ export function createFlowCapability(host, catalog) {
|
|
|
13
13
|
name: "flow-graphs",
|
|
14
14
|
version: "3",
|
|
15
15
|
description: "Read and edit the open Workbench Flow pipeline: image/mesh generation, processing, and viewers.",
|
|
16
|
-
instructions: `Use womp.flow for the open Workbench pipeline.
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
instructions: `Use womp.flow for the open Workbench pipeline.
|
|
17
|
+
Use Flow for image/mesh generation explicitly requested through Flow/nodes or continued edits to that Flow workflow, unless the user asks for an inline result.
|
|
18
|
+
An open Flow canvas alone does not redirect ordinary scene creation or inline generation.
|
|
19
19
|
Read the current graph and flow-graphs-reference before writing. Supply the complete edited s-expression document and the latest revision. Preserve unrelated nodes and stable node IDs. Omitting a node deletes it; empty source clears the graph.
|
|
20
20
|
Existing node configuration, edge identity, layout, runtime metadata, and generated outputs are retained for unchanged node identities/types. Scalar inputs represented in source are replaced by your document. The host retains preservedInputs for those same nodes. Non-private preserved inputs can be explicitly replaced in the document; never recreate asset objects or cached values as JSON strings. Private settings remain editor-owned: preserve existing private connections unchanged between retained nodes and do not introduce new private literals or connections.
|
|
21
21
|
If read returns source null, explain the diagnostics. Do not replace an unreadable graph as though it were empty.
|
|
@@ -15,20 +15,20 @@ export function createGeometryCapability(host, reference) {
|
|
|
15
15
|
name: "geometry-nodes",
|
|
16
16
|
version: "5",
|
|
17
17
|
description: "Create and edit visual Geometry Nodes graphs with adjustable parameters and animation.",
|
|
18
|
-
instructions: `Use womp.geometry for requested Geometry Nodes
|
|
19
|
-
Keep follow-up edits to an existing Geometry Nodes object in its graph, preserving its adjustable parameters and instances.
|
|
20
|
-
Read the target after any scene edit this build needs. read(0) reads the scene root as a creation container.
|
|
21
|
-
write updates an existing shared graph, attaches a new graph to an Area without one, or creates a new Area beneath the root/Group target. Use the returned objectId for follow-up edits.
|
|
22
|
-
Read geometry-nodes-reference before writing source. Supply the complete FlowIR text and the exact revision returned by the latest read. JavaScript calls execute JavaScript; source is a FlowIR string, not JavaScript or JSON.
|
|
23
|
-
After a stale revision rejection, read the latest graph and adapt the edit while preserving intervening user changes. Ask only when the edits conflict or remain ambiguous; never retry the old replacement with a refreshed revision token.
|
|
24
|
-
If source is null and diagnostics are present, the existing graph cannot be edited without loss. Explain the limitation; never treat it as empty or create a replacement to bypass the refusal.
|
|
25
|
-
Preserve unrelated statements, parameter names, and FlowIR node IDs from the read. Shared graph edits affect all listed instances; report the affected objects. Valid overrides migrate by parameter name and type. Removed or type-changed parameters return to graph defaults and are reported.
|
|
26
|
-
Use min/max/step for naturally bounded parameters and omit ranges for free-form positions/rotations. Meaningful parameter names become editor labels. Do not invent label fields.
|
|
27
|
-
SetMaterial assigns one scene material to every primitive it receives. Its Material input is a scene material ID, not a color; 0 selects the scene default material.
|
|
28
|
-
Obtain that ID from the scene-editing skill inside one scene.edit, where those lookups live: materialList with materialGetName and materialGetColor to reuse an existing material, materialCreate with materialSetColor and materialSetName for a new one, or listSuperMaterials with materialImport for a library material. Prefer reusing a material that already matches the request over creating another, and do not recolor a shared material unless every object using it should change.
|
|
29
|
-
A scene edit changes the scene revision, so create or import the material before reading the geometry target, then write, all within one JavaScript call. Each call has a fresh scope and cannot read an earlier call's variables.
|
|
30
|
-
Positions and sizes are millimetres; Boolean Blend uses the conversion in geometry-nodes-reference. Coordinates are right-handed, +X right, +Y up, +Z forward. Rotations are degrees, intrinsic X-Z-Y.
|
|
31
|
-
On compiler errors, repair the source in this same conversation and retry with a fresh read. A rejected write made no change. Committed/unknown effects remain in execution receipts even if a later call fails; inspect before retrying.
|
|
18
|
+
instructions: `Use womp.geometry for requested Geometry Nodes, parametric organic/procedural geometry, or animation.
|
|
19
|
+
Keep follow-up edits to an existing Geometry Nodes object in its graph, preserving its adjustable parameters and instances.
|
|
20
|
+
Read the target after any scene edit this build needs. read(0) reads the scene root as a creation container.
|
|
21
|
+
write updates an existing shared graph, attaches a new graph to an Area without one, or creates a new Area beneath the root/Group target. Use the returned objectId for follow-up edits.
|
|
22
|
+
Read geometry-nodes-reference before writing source. Supply the complete FlowIR text and the exact revision returned by the latest read. JavaScript calls execute JavaScript; source is a FlowIR string, not JavaScript or JSON.
|
|
23
|
+
After a stale revision rejection, read the latest graph and adapt the edit while preserving intervening user changes. Ask only when the edits conflict or remain ambiguous; never retry the old replacement with a refreshed revision token.
|
|
24
|
+
If source is null and diagnostics are present, the existing graph cannot be edited without loss. Explain the limitation; never treat it as empty or create a replacement to bypass the refusal.
|
|
25
|
+
Preserve unrelated statements, parameter names, and FlowIR node IDs from the read. Shared graph edits affect all listed instances; report the affected objects. Valid overrides migrate by parameter name and type. Removed or type-changed parameters return to graph defaults and are reported.
|
|
26
|
+
Use min/max/step for naturally bounded parameters and omit ranges for free-form positions/rotations. Meaningful parameter names become editor labels. Do not invent label fields.
|
|
27
|
+
SetMaterial assigns one scene material to every primitive it receives. Its Material input is a scene material ID, not a color; 0 selects the scene default material.
|
|
28
|
+
Obtain that ID from the scene-editing skill inside one scene.edit, where those lookups live: materialList with materialGetName and materialGetColor to reuse an existing material, materialCreate with materialSetColor and materialSetName for a new one, or listSuperMaterials with materialImport for a library material. Prefer reusing a material that already matches the request over creating another, and do not recolor a shared material unless every object using it should change.
|
|
29
|
+
A scene edit changes the scene revision, so create or import the material before reading the geometry target, then write, all within one JavaScript call. Each call has a fresh scope and cannot read an earlier call's variables.
|
|
30
|
+
Positions and sizes are millimetres; Boolean Blend uses the conversion in geometry-nodes-reference. Coordinates are right-handed, +X right, +Y up, +Z forward. Rotations are degrees, intrinsic X-Z-Y.
|
|
31
|
+
On compiler errors, repair the source in this same conversation and retry with a fresh read. A rejected write made no change. Committed/unknown effects remain in execution receipts even if a later call fails; inspect before retrying.
|
|
32
32
|
After applying, read the returned object and use the scene screenshot API with emitImage to inspect the applied result.`,
|
|
33
33
|
declarations: WOMP_GEOMETRY_DECLARATIONS,
|
|
34
34
|
examples: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const OPENSCAD_INSTRUCTIONS = "Use womp.openscad to create or update one adjustable CAD part. Read an existing part before editing it.\nread(0) returns the root container and a scene revision for creation. read(id) returns an existing\npart or container. Use the scene-editing skill when available to discover other scene objects.\ncreate requires a parentId (0 means the scene root); update requires the existing objectId.\nBoth methods compile the effective source and parameters, apply one undoable change, and check wall thickness.\nA stale revision requires reading again and adapting the edit while preserving intervening user changes.\nAsk the user only when the intended edits conflict or remain ambiguous; never reuse the old replacement\nwith a refreshed revision token. Existing overrides are preserved for parameters still present;\nparams supplies overrides to merge into the current values. Keep top-level parameter names stable.\nReturn complete source on every update and preserve unrelated geometry. Never create a replacement to repair a part.\nCompile errors return status rejected without applying. Creation requires validated placement bounds.\nAn update may apply with validation unavailable; that is a diagnostic, not proof that it compiles.\nAn applied part remains in the scene even if thickness fails or is unavailable. Use the returned objectId for repairs.\nWhen thickness fails, increase thin walls and fragile connections while preserving requested dimensions and openings.\nAt most four applied printability repairs are allowed per logical build/edit in this run. Respect the returned limit;\ndo not bypass it by recreating the part. Unavailable thickness is not a pass. Report unresolved issues honestly.\nBuild connected geometry and avoid features below 1.4 mm. OpenSCAD source dimensions use millimetres,\nindependently of the scene display unit. New parts are centered and grounded from compiled bounds.\nOpenSCAD is Z-up; the scene-editing API is Y-up. For an unrotated part at its creation-time scale and an identity parent transform,\na source point [x,y,z] mm maps to scene {x:y, y:z, z:-x} times the unitMultiplier returned by scene.read(), plus nodeGetPos(partId).\nAccount for the part and parent transforms when they are not identity; source coordinates are not scene coordinates.\nAfter a major change, use the scene screenshot API and emitImage to inspect the applied result.\nA committed effect can survive later failure. Inspect receipts and the existing part before retrying.\nDo not print source in the final answer unless requested; describe the result and any unresolved diagnostics.\n\nRUNTIME\n- Produce a single OpenSCAD file.\n- Do not use imports, includes, external libraries, text, hull, minkowski, polyhedron, or extrudes.\n- Prefer cube, sphere, cylinder, translate, rotate, color, union, difference, and intersection.\n- Do not use $fn, $fa, or $fs; tessellation controls are ignored.\n- Build faceted geometry by combining supported primitives with CSG operations and transforms.\n- Do not use scale(); size primitives directly instead.\n- Use color(\"#rrggbb\") around distinct visible parts.\n- Keep the model centered near the origin and use millimeter-like units consistently.\n- For organic blending, use goop(radius_mm) { ... }. The radius is in millimetres before parent scaling, matching scene-editing; do not multiply by project unitMultiplier. It is ordered: the first child seeds with blend 0, and each later child uses radius_mm.\n- Put core primitives first. Avoid wrapping goop children in union() when they should blend individually.\n\nSCREWS AND THREADS\n- Copy helical_ridge below for rounded screw threads, necks, caps, and coils.
|
|
1
|
+
export declare const OPENSCAD_INSTRUCTIONS = "Use womp.openscad to create or update one adjustable CAD part. Read an existing part before editing it.\nKeep follow-up edits to an existing CAD part in that part unless the user asks to change representation.\nread(0) returns the root container and a scene revision for creation. read(id) returns an existing\npart or container. Use the scene-editing skill when available to discover other scene objects.\ncreate requires a parentId (0 means the scene root); update requires the existing objectId.\nBoth methods compile the effective source and parameters, apply one undoable change, and check wall thickness.\nA stale revision requires reading again and adapting the edit while preserving intervening user changes.\nAsk the user only when the intended edits conflict or remain ambiguous; never reuse the old replacement\nwith a refreshed revision token. Existing overrides are preserved for parameters still present;\nparams supplies overrides to merge into the current values. Keep top-level parameter names stable.\nReturn complete source on every update and preserve unrelated geometry. Never create a replacement to repair a part.\nCompile errors return status rejected without applying. Creation requires validated placement bounds.\nAn update may apply with validation unavailable; that is a diagnostic, not proof that it compiles.\nAn applied part remains in the scene even if thickness fails or is unavailable. Use the returned objectId for repairs.\nWhen thickness fails, increase thin walls and fragile connections while preserving requested dimensions and openings.\nAt most four applied printability repairs are allowed per logical build/edit in this run. Respect the returned limit;\ndo not bypass it by recreating the part. Unavailable thickness is not a pass. Report unresolved issues honestly.\nBuild connected geometry and avoid features below 1.4 mm. OpenSCAD source dimensions use millimetres,\nindependently of the scene display unit. New parts are centered and grounded from compiled bounds.\nOpenSCAD is Z-up; the scene-editing API is Y-up. For an unrotated part at its creation-time scale and an identity parent transform,\na source point [x,y,z] mm maps to scene {x:y, y:z, z:-x} times the unitMultiplier returned by scene.read(), plus nodeGetPos(partId).\nAccount for the part and parent transforms when they are not identity; source coordinates are not scene coordinates.\nAfter a major change, use the scene screenshot API and emitImage to inspect the applied result.\nA committed effect can survive later failure. Inspect receipts and the existing part before retrying.\nDo not print source in the final answer unless requested; describe the result and any unresolved diagnostics.\n\nRUNTIME\n- Produce a single OpenSCAD file.\n- Do not use imports, includes, external libraries, text, hull, minkowski, polyhedron, or extrudes.\n- Prefer cube, sphere, cylinder, translate, rotate, color, union, difference, and intersection.\n- Do not use $fn, $fa, or $fs; tessellation controls are ignored.\n- Build faceted geometry by combining supported primitives with CSG operations and transforms.\n- Do not use scale(); size primitives directly instead.\n- Use color(\"#rrggbb\") around distinct visible parts.\n- Keep the model centered near the origin and use millimeter-like units consistently.\n- For organic blending, use goop(radius_mm) { ... }. The radius is in millimetres before parent scaling, matching scene-editing; do not multiply by project unitMultiplier. It is ordered: the first child seeds with blend 0, and each later child uses radius_mm.\n- Put core primitives first. Avoid wrapping goop children in union() when they should blend individually.\n\nSCREWS AND THREADS\n- Copy helical_ridge below for rounded screw threads, necks, caps, and coils. It joins spheres with cylinders; never use stacked rings or disconnected spheres.\n- Dimensions are mm: radius = ridge centerline radius; pitch = axial travel/turn; tube_radius = half ridge thickness; handedness = 1 (right) or -1 (left).\n- For a hand control use thread_hand = 1; // [-1:Left, 1:Right] and pass it directly. Ternary expressions (?:) are unsupported.\n- Embed the ridge in the shaft/neck (e.g. radius = shaft_radius). Hollow fittings: subtract the bore from body + thread. Internal threads: subtract the helix from the socket wall with mating clearance. Mating parts need matching pitch and handedness.\n- Expose diameter, pitch, thread length, and thickness in Customizer; derive sampling. Keep 2 * tube_radius < pitch and allow tube_radius beyond both path endpoints for rounded ends. This is a rounded profile, not ISO/metric V-thread; never claim standards compliance.\n- Build heads/grips separately using cylinders, tapered cylinders, and radial ribs/cutters, not thread samples.\n\nmodule helical_ridge(radius, pitch, turns, tube_radius, handedness) {\n if (radius > 0 && pitch > 0 && turns > 0 && tube_radius > 0) {\n // Limit chord error to 0.03 mm or 3% of the ridge radius.\n chord_error = min(0.03, tube_radius * 0.03);\n steps_per_turn = max(48, ceil(180 / acos(1 - min(1, chord_error / radius))));\n steps = ceil(turns * steps_per_turn);\n for (i = [0:steps]) {\n angle = handedness * 360 * turns * i / steps;\n p = [radius * cos(angle), radius * sin(angle), pitch * turns * i / steps];\n translate(p) sphere(r = tube_radius);\n if (i < steps) {\n next_angle = handedness * 360 * turns * (i + 1) / steps;\n dx = radius * cos(next_angle) - p[0];\n dy = radius * sin(next_angle) - p[1];\n dz = pitch * turns / steps;\n segment_length = sqrt(dx * dx + dy * dy + dz * dz);\n translate(p)\n rotate([0, acos(dz / segment_length), atan2(dy, dx)])\n cylinder(h = segment_length, r = tube_radius);\n }\n }\n }\n}\n\nPARAMETERS\n- Make important top-level constants user-adjustable with OpenSCAD Customizer comments:\n - Numbers with ranges: body_radius = 12; // [4:0.5:40]\n - Counts: leg_count = 4; // [2:8]\n - Booleans: show_base = true;\n - Options: style = \"round\"; // [round, sharp, chunky]\n- Prefer stable size/count/ratio/style controls; keep fragile dependent dimensions as local expressions.\n\nSUPPORTED SUBSET\n- Export is best-effort from a supported CSG subset: cube, sphere, cylinder, translate, rotate, color, union, difference, intersection, and goop.\n- difference() cutters become subtractive primitives, so use clean cutters that fully pass through the target solid.\n- Unsupported OpenSCAD may validate but can warn or skip during export; prefer the supported subset above.";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export const OPENSCAD_INSTRUCTIONS = `Use womp.openscad to create or update one adjustable CAD part. Read an existing part before editing it.
|
|
2
|
+
Keep follow-up edits to an existing CAD part in that part unless the user asks to change representation.
|
|
2
3
|
read(0) returns the root container and a scene revision for creation. read(id) returns an existing
|
|
3
4
|
part or container. Use the scene-editing skill when available to discover other scene objects.
|
|
4
5
|
create requires a parentId (0 means the scene root); update requires the existing objectId.
|
|
@@ -36,7 +37,7 @@ RUNTIME
|
|
|
36
37
|
- Put core primitives first. Avoid wrapping goop children in union() when they should blend individually.
|
|
37
38
|
|
|
38
39
|
SCREWS AND THREADS
|
|
39
|
-
- Copy helical_ridge below for rounded screw threads, necks, caps, and coils.
|
|
40
|
+
- Copy helical_ridge below for rounded screw threads, necks, caps, and coils. It joins spheres with cylinders; never use stacked rings or disconnected spheres.
|
|
40
41
|
- Dimensions are mm: radius = ridge centerline radius; pitch = axial travel/turn; tube_radius = half ridge thickness; handedness = 1 (right) or -1 (left).
|
|
41
42
|
- For a hand control use thread_hand = 1; // [-1:Left, 1:Right] and pass it directly. Ternary expressions (?:) are unsupported.
|
|
42
43
|
- Embed the ridge in the shaft/neck (e.g. radius = shaft_radius). Hollow fittings: subtract the bore from body + thread. Internal threads: subtract the helix from the socket wall with mating clearance. Mating parts need matching pitch and handedness.
|
|
@@ -79,38 +79,39 @@ export function createOperationsCapability(host) {
|
|
|
79
79
|
name: "generation",
|
|
80
80
|
version: "7",
|
|
81
81
|
description: "Generate or edit images and meshes, inspect jobs, and wait for their outputs.",
|
|
82
|
-
instructions: `Read operations.catalog() for the currently available models and selected defaults.
|
|
83
|
-
Use generation for inline
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
Use generate() for image/mesh generation, image editing, upscaling, or background removal. Model IDs must
|
|
87
|
-
come from the catalog and support the requested operation. An unavailable or restricted explicit choice
|
|
88
|
-
is an error; do not silently substitute another model. Omit model IDs to use the user's defaults.
|
|
89
|
-
For text-to-mesh, imageParams configures the image step and params configures the mesh step. For
|
|
90
|
-
image-to-mesh, an optional prompt requests an image-editing step first. Advanced params are JSON
|
|
91
|
-
values passed to the existing service; use documented options and do not invent provider settings.
|
|
92
|
-
Author the full text-to-mesh image prompt yourself, preserving the user's requested subject and details.
|
|
93
|
-
For a standalone object, describe a clear three-quarter view with a plain background and even lighting
|
|
94
|
-
unless the user requests otherwise. Do not rely on another model to expand or rewrite this prompt.
|
|
95
|
-
Inputs are image references returned by the available assets API or a previous completed operation.
|
|
96
|
-
Do not fabricate references, replace a missing input with another image, or pass arbitrary URLs.
|
|
97
|
-
Assign a short, distinct key to each intended job. Reuse that key when checking the same submission;
|
|
98
|
-
never choose a new key merely to retry a timeout or unknown outcome. A key cannot identify two
|
|
99
|
-
different requests. Host receipts and saved message IDs record submitted effects.
|
|
100
|
-
generate() waits for cost confirmation and then for completion, failure, or cancellation.
|
|
101
|
-
Use exactly one generation per execute_javascript call and print its result. Put follow-up work in
|
|
102
|
-
another call. Do not poll, start background work, use Promise.all, or report success before completion.
|
|
103
|
-
The host waits without consuming model steps. Stop ends agent execution; the host handles cancellation of its accepted jobs.
|
|
104
|
-
Refresh recovery reconnects the same job. It never resumes the interrupted JavaScript stack.
|
|
105
|
-
Read the recovered status and artifact references, then continue any requested remaining work in a new call; do not repeat generation.
|
|
106
|
-
generate() returns the terminal status and job.outputs artifact references directly, including after recovery.
|
|
107
|
-
Completed generations are shown automatically to the user; image bytes are intentionally omitted from your context. Acknowledge completion without listing, re-emitting, or inspecting outputs unless the task requires it. Use returned artifact references for follow-up work.
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
82
|
+
instructions: `Read operations.catalog() for the currently available models and selected defaults.
|
|
83
|
+
Use generation for requested inline image/mesh results, not unsolicited previews of scene creations.
|
|
84
|
+
For generation explicitly requested through Flow/nodes or continued edits to that Flow workflow, use flow-graphs
|
|
85
|
+
unless the user asks for an inline result. If Flow is unavailable or closed, explain the prerequisite; do not substitute inline generation.
|
|
86
|
+
Use generate() for image/mesh generation, image editing, upscaling, or background removal. Model IDs must
|
|
87
|
+
come from the catalog and support the requested operation. An unavailable or restricted explicit choice
|
|
88
|
+
is an error; do not silently substitute another model. Omit model IDs to use the user's defaults.
|
|
89
|
+
For text-to-mesh, imageParams configures the image step and params configures the mesh step. For
|
|
90
|
+
image-to-mesh, an optional prompt requests an image-editing step first. Advanced params are JSON
|
|
91
|
+
values passed to the existing service; use documented options and do not invent provider settings.
|
|
92
|
+
Author the full text-to-mesh image prompt yourself, preserving the user's requested subject and details.
|
|
93
|
+
For a standalone object, describe a clear three-quarter view with a plain background and even lighting
|
|
94
|
+
unless the user requests otherwise. Do not rely on another model to expand or rewrite this prompt.
|
|
95
|
+
Inputs are image references returned by the available assets API or a previous completed operation.
|
|
96
|
+
Do not fabricate references, replace a missing input with another image, or pass arbitrary URLs.
|
|
97
|
+
Assign a short, distinct key to each intended job. Reuse that key when checking the same submission;
|
|
98
|
+
never choose a new key merely to retry a timeout or unknown outcome. A key cannot identify two
|
|
99
|
+
different requests. Host receipts and saved message IDs record submitted effects.
|
|
100
|
+
generate() waits for cost confirmation and then for completion, failure, or cancellation.
|
|
101
|
+
Use exactly one generation per execute_javascript call and print its result. Put follow-up work in
|
|
102
|
+
another call. Do not poll, start background work, use Promise.all, or report success before completion.
|
|
103
|
+
The host waits without consuming model steps. Stop ends agent execution; the host handles cancellation of its accepted jobs.
|
|
104
|
+
Refresh recovery reconnects the same job. It never resumes the interrupted JavaScript stack.
|
|
105
|
+
Read the recovered status and artifact references, then continue any requested remaining work in a new call; do not repeat generation.
|
|
106
|
+
generate() returns the terminal status and job.outputs artifact references directly, including after recovery.
|
|
107
|
+
Completed generations are shown automatically to the user; image bytes are intentionally omitted from your context. Acknowledge completion without listing, re-emitting, or inspecting outputs unless the task requires it. Use returned artifact references for follow-up work.
|
|
108
|
+
A brief, relevant follow-up suggestion is optional after completion. Offer only available actions; wait for a clear choice
|
|
109
|
+
and required confirmations before acting. Clarify ambiguous acceptance of multiple options. Reuse returned artifacts for the chosen follow-up.
|
|
110
|
+
Inspect images deliberately when needed for verification or reference comparisons; never claim visual verification without inspecting the image.
|
|
111
|
+
Omitted image bytes are expected; missing artifact references are not. If a completed job has no outputs, recover the references or report the missing result.
|
|
112
|
+
Reserve list() for older jobs or missing references. Follow nextFrom even when a page has no jobs.
|
|
113
|
+
Verify an uncertain submission's job status, never issue a replacement request.
|
|
114
|
+
Only returned outputs exist. Generating a mesh does not import it into the scene. Use the assets skill for requested imports.
|
|
114
115
|
Never resume stopped work or resubmit a job because cancellation or submission is uncertain.`,
|
|
115
116
|
declarations: WOMP_OPERATIONS_DECLARATIONS,
|
|
116
117
|
examples: [
|
|
@@ -39,80 +39,80 @@ export function createSceneCapability(host) {
|
|
|
39
39
|
name: "scene-editing",
|
|
40
40
|
version: "30",
|
|
41
41
|
description: "Inspect the open scene and edit its objects, materials, curves, and environment.",
|
|
42
|
-
instructions: `Read the scene first and keep its revision and object IDs. read() includes health.
|
|
43
|
-
Use womp.scene.health() to refresh whole-scene health or womp.scene.health(objectIds) to check specific objects (mapped to their owning Areas).
|
|
44
|
-
Health is a separate snapshot, not proof of consistency with read().revision or that the latest edit finished evaluating. Inspect post-edit health in receipts before claiming success; refresh only when needed.
|
|
45
|
-
Unavailable, stale, or unverified feedback must not trigger blind regeneration or a claim that the model passed. Hosts without health services return unverified health with a reason.
|
|
46
|
-
For confirmed primitive or depth overflow, repair the same target while preserving design, dimensions, active parameter overrides, and unrelated objects. At most two geometry repairs are allowed per target in one logical run.
|
|
47
|
-
Empty Areas may be pending, intentionally empty, mesh-only, or failed. Overflow flags take precedence over possibly stale counts.
|
|
48
|
-
max_total_depth reports the engine's tier-dependent nesting allowance, not measured depth. Compiled Boolean depth includes generated grouping; organizational Groups do not add a level. Use flag_depth_overflow to detect evaluator rejection.
|
|
49
|
-
Call scene.edit(callback, expectedRevision)
|
|
50
|
-
for one coherent undoable change. The callback receives a draft; all node/material/curve functions and enums
|
|
51
|
-
are properties of that draft. The draft expires when the callback ends. Await asynchronous methods.
|
|
52
|
-
Do not start unrelated operations from inside an edit. A stale revision requires reading again.
|
|
53
|
-
Preserve the existing scene unless asked to remove or replace content. Use semantic object names and reuse
|
|
54
|
-
known IDs when editing rather than creating duplicates. Distances follow the current project's units
|
|
55
|
-
(read().unitMultiplier is 1 for millimetres, 0.1 for centimetres, approximately 0.0393701 for inches).
|
|
56
|
-
Convert a dimension in millimetres to project units by multiplying it by read().unitMultiplier.
|
|
57
|
-
The SDK-backed draft clamps dimension writes to 0.01–1000 mm per component before converting to native units; this is an adapter limit, not a scene-wide size limit. Read back dimensions when physical size matters.
|
|
58
|
-
Area size is a dimensionless scale; Group size stays fixed at one. Lights must be created at root (parentId 0); their size has x/y dimensions.
|
|
59
|
-
Light power must be a finite number in [0, 100].
|
|
60
|
-
nodeCreate(Curve, parentId) creates an empty curve with zero blend. curvePointAdd(curveId, point, index?) returns the new index; omit index to append or supply an integer from 0 through point count to insert before that position.
|
|
61
|
-
Point defaults: position/rotation/handles zero, profile size {x:1,y:1,z:1} in project units, the curve's material, fixed false, round 0. Pass {} for defaults.
|
|
62
|
-
Removing all points is supported. One point renders a single profile primitive, not a path.
|
|
63
|
-
Curves render sampled profiles, not a continuous sweep. For smooth curves, start with nodeSetDensity(curveId, 250) and nodeSetBlend(curveId, 3).
|
|
64
|
-
Density increases sampling and primitive cost; the 3 mm blend softens joins, not sample positions. Adjust blend to preserve thin features and the intended silhouette; these settings do not guarantee continuity.
|
|
65
|
-
nodeSetUnionResolution(unionId, resolution) sets Area/Union resolution, not child-part resolution, and clamps to 0.01–0.65; higher values increase detail and voxel cost. Material emission ranges from 0 to 1.
|
|
66
|
-
nodeSetBlend and mirror goop take radii in millimetres before parent scaling, regardless of project units, and clamp to 0–500 mm. This does not apply to the FlowIR Boolean Blend port, which takes native units; geometry-nodes-reference gives its conversion.
|
|
67
|
-
V1/V2 curve transforms are read-only;
|
|
68
|
-
edit their points instead. Handles and closure are available only on V3 Bezier curves.
|
|
69
|
-
Typed rotations are right-handed intrinsic XYZ Euler degrees, relative to the parent (R = Rx Ry Rz), including curve points and mirrors.
|
|
70
|
-
Points and curve mirrors use the owning curve frame; primitive mirrors use the primitive's parent frame.
|
|
71
|
-
lookAt(origin, target) aligns local +Z; both points must be in the same parent-local space. For a segment along a different local axis,
|
|
72
|
-
use alignAxis(direction, 'x'|'y'|'z'); cylinders and cones extend along local Y. These return rotations, not world-space transforms.
|
|
73
|
-
Alignment chooses a deterministic roll using Y-up (Z-up fallback when parallel); coincident/non-finite directions are errors.
|
|
74
|
-
The SDK handles native XZY conversion; do not swap Euler components or convert again. Geometry Nodes source remains native XZY.
|
|
75
|
-
Colors use RGB values from 0 to 255. Use the exposed enums instead of guessing values.
|
|
76
|
-
For visible geometry color, create or clone a material, call materialSetColor, and assign it with nodeSetMaterialId only to
|
|
77
|
-
Primitive, Curve, Text, SVG, Mesh, Field, Decal or OpenSCAD nodes. Assigning a curve material recolors its existing points; use curvePointSetMaterialId for per-point overrides afterward.
|
|
78
|
-
Areas/Unions, Groups, Lights and Sockets do not accept direct materials. Color ordinary containers through their supported children.
|
|
79
|
-
Geometry Nodes materials belong in the graph: create or import the material here, then assign it inside the graph with the FlowIR SetMaterial node, passing the numeric ID this skill returns.
|
|
80
|
-
Never replace a parametric graph with ordinary primitives to color it. Ordinary Stain/CSG children do not modify graph output.
|
|
81
|
-
nodeSetColor writes the node color field (used by lights); it does not replace a geometry object's material color.
|
|
82
|
-
Do not recolor a shared material unless every object using it should change. Create and assign the material in the same edit as the scene geometry that uses it; a Geometry Nodes graph instead consumes a material ID created in an earlier edit.
|
|
83
|
-
Create primitives, curves, and text inside Areas/Unions. Respect tree order for subtraction and intersection.
|
|
84
|
-
Groups are organizational only; move and rotate their child Areas individually, not the Group. Use unions for blended masses.
|
|
85
|
-
Sphere uses size.x as uniform diameter (y/z do not stretch it), including new or resized spherical curve points. Cylinder/Cone/Pyramid use x as base diameter/width and y as height;
|
|
86
|
-
Torus uses x as outer diameter and y as tube thickness. For these four primitives, nodeSetSize accepts {x, y}; z follows x even when supplied. Cube uses all three dimensions. Node and curve-point round are dimensionless fractions clamped to [0, 1], not radii in project units; rounding does not set size. Cube rounding reaches half its shortest dimension at 1, so a shallow Cube retains broad flat faces rather than becoming an ellipsoid.
|
|
87
|
-
Build and verify coarse geometry and unfamiliar operations before replicating details. Check one representative result, then repeat it.
|
|
88
|
-
Reference fidelity:
|
|
89
|
-
When recreating an image, treat its visible geometry and level of detail as the target—not merely its subject, colors, or list of parts. Preserve the user's chosen workflow and editability requirements.
|
|
90
|
-
Establish a comparison view matching the reference's angle, projection, and subject framing as closely as practical. Match silhouette, proportions, pose, and negative spaces first; then local contours, thickness, curvature, surface transitions, and defining details. Infer unseen geometry conservatively.
|
|
91
|
-
Compare each rendered pass directly with the source. Identify the largest remaining visible shape mismatch, edit it, and verify that it improved before moving to smaller details. Use close-ups when the comparison view cannot resolve a feature; return to the comparison view afterward. Adjust sampling or resolution when visible faceting or segmentation requires it—not as a substitute for reshaping.
|
|
92
|
-
Do not stop at semantic resemblance or after a fixed number of screenshots. Continue while substantial visible mismatches remain and supported edits are making progress, within the available budget. If progress stalls or the chosen representation cannot achieve the requested fidelity, explain the specific limitation and ask before changing workflows. Before finishing, compare the latest render with the reference and address the largest remaining visible mismatch; if substantial differences remain, identify the concrete stopping reason rather than treating an approximation disclaimer as completion.
|
|
93
|
-
|
|
94
|
-
nodeClone is shallow (no children). await cloneSubtree(id, { parentId?, name?, index? }) copies the complete hierarchy with fresh IDs,
|
|
95
|
-
preserving local transforms, order and metadata, remapping internal references and sharing external materials/assets.
|
|
96
|
-
Cloning requires a host transport with atomic scene patches; an unsupported host rejects it without changing the draft.
|
|
97
|
-
For primitives, nodeSetBlend joins against all accumulated preceding geometry in the Area, not only the nearest part. A Union's blend affects its outer join, not joins between its children; top-level Area blend does not smooth its contents.
|
|
98
|
-
For organic joins, overlap primitives and tune blend on the joining children while preserving intended gaps; keep crisp accessories separate.
|
|
99
|
-
Check font, HDR, and material catalogs before selecting names. A host can explicitly report a catalog as
|
|
100
|
-
unavailable. Selecting an HDR resets its intensity; apply a custom intensity after selecting it.
|
|
101
|
-
For library materials, use listSuperMaterials(), then await materialImport(name) inside scene.edit and assign the returned numeric ID the way that object requires: nodeSetMaterialId or curvePointSetMaterialId for scene nodes, the FlowIR SetMaterial node for a Geometry Nodes graph. A failed import rolls back the draft.
|
|
102
|
-
Filter large read results with JavaScript and print only useful details.
|
|
103
|
-
After a major edit, capture a screenshot outside the transaction and emitImage its reference.
|
|
104
|
-
screenshot({ camera: { position: {x,y,z}, target: {x,y,z}, projection: 'perspective', horizontalFovDegrees: 60 } })
|
|
105
|
-
sets a world-space camera in the same Womp coordinates and project units as scene positions (Y-up).
|
|
106
|
-
For orthographic framing use projection: 'orthographic' and orthographicWidth in project units instead of FOV.
|
|
107
|
-
Direction is derived from position/target; do not use coincident points or an exactly vertical viewing direction.
|
|
108
|
-
Omitted projection/lens settings come from the active camera. Pass the camera again for repeatable captures.
|
|
109
|
-
For object-focused screenshots, identify the requested object and frame it with an explicit camera position and target using its bounds; reuse established framing when appropriate. Choose a view that reveals the requested features without clipping the subject.
|
|
110
|
-
Omitting camera captures the active viewport without auto-fit. Use it when the user asks about the current viewport or clearly refers to what is visible on screen, not on the assumption that it shows the requested object.
|
|
111
|
-
Respect the host's camera-lock restrictions. Verify silhouette,
|
|
112
|
-
connections, openings, proportions, and materials before claiming completion. Use the owning top-level Area for scene-space bounds;
|
|
113
|
-
OpenSCAD part bounds are local to the part; individual primitive and curve bounds are unsupported. Renderer bounds and resize calls
|
|
114
|
-
must finish before subsequent writes. Inside scene.edit, complete renderer-backed bounds reads before the first
|
|
115
|
-
draft mutation; the SDK rejects them once the draft is dirty. Inspect committed results when renderer state has not caught up.
|
|
42
|
+
instructions: `Read the scene first and keep its revision and object IDs. read() includes health.
|
|
43
|
+
Use womp.scene.health() to refresh whole-scene health or womp.scene.health(objectIds) to check specific objects (mapped to their owning Areas).
|
|
44
|
+
Health is a separate snapshot, not proof of consistency with read().revision or that the latest edit finished evaluating. Inspect post-edit health in receipts before claiming success; refresh only when needed.
|
|
45
|
+
Unavailable, stale, or unverified feedback must not trigger blind regeneration or a claim that the model passed. Hosts without health services return unverified health with a reason.
|
|
46
|
+
For confirmed primitive or depth overflow, repair the same target while preserving design, dimensions, active parameter overrides, and unrelated objects. At most two geometry repairs are allowed per target in one logical run.
|
|
47
|
+
Empty Areas may be pending, intentionally empty, mesh-only, or failed. Overflow flags take precedence over possibly stale counts.
|
|
48
|
+
max_total_depth reports the engine's tier-dependent nesting allowance, not measured depth. Compiled Boolean depth includes generated grouping; organizational Groups do not add a level. Use flag_depth_overflow to detect evaluator rejection.
|
|
49
|
+
Call scene.edit(callback, expectedRevision)
|
|
50
|
+
for one coherent undoable change. The callback receives a draft; all node/material/curve functions and enums
|
|
51
|
+
are properties of that draft. The draft expires when the callback ends. Await asynchronous methods.
|
|
52
|
+
Do not start unrelated operations from inside an edit. A stale revision requires reading again.
|
|
53
|
+
Preserve the existing scene unless asked to remove or replace content. Use semantic object names and reuse
|
|
54
|
+
known IDs when editing rather than creating duplicates. Distances follow the current project's units
|
|
55
|
+
(read().unitMultiplier is 1 for millimetres, 0.1 for centimetres, approximately 0.0393701 for inches).
|
|
56
|
+
Convert a dimension in millimetres to project units by multiplying it by read().unitMultiplier.
|
|
57
|
+
The SDK-backed draft clamps dimension writes to 0.01–1000 mm per component before converting to native units; this is an adapter limit, not a scene-wide size limit. Read back dimensions when physical size matters.
|
|
58
|
+
Area size is a dimensionless scale; Group size stays fixed at one. Lights must be created at root (parentId 0); their size has x/y dimensions.
|
|
59
|
+
Light power must be a finite number in [0, 100].
|
|
60
|
+
nodeCreate(Curve, parentId) creates an empty curve with zero blend. curvePointAdd(curveId, point, index?) returns the new index; omit index to append or supply an integer from 0 through point count to insert before that position.
|
|
61
|
+
Point defaults: position/rotation/handles zero, profile size {x:1,y:1,z:1} in project units, the curve's material, fixed false, round 0. Pass {} for defaults.
|
|
62
|
+
Removing all points is supported. One point renders a single profile primitive, not a path.
|
|
63
|
+
Curves render sampled profiles, not a continuous sweep. For smooth curves, start with nodeSetDensity(curveId, 250) and nodeSetBlend(curveId, 3).
|
|
64
|
+
Density increases sampling and primitive cost; the 3 mm blend softens joins, not sample positions. Adjust blend to preserve thin features and the intended silhouette; these settings do not guarantee continuity.
|
|
65
|
+
nodeSetUnionResolution(unionId, resolution) sets Area/Union resolution, not child-part resolution, and clamps to 0.01–0.65; higher values increase detail and voxel cost. Material emission ranges from 0 to 1.
|
|
66
|
+
nodeSetBlend and mirror goop take radii in millimetres before parent scaling, regardless of project units, and clamp to 0–500 mm. This does not apply to the FlowIR Boolean Blend port, which takes native units; geometry-nodes-reference gives its conversion.
|
|
67
|
+
V1/V2 curve transforms are read-only;
|
|
68
|
+
edit their points instead. Handles and closure are available only on V3 Bezier curves.
|
|
69
|
+
Typed rotations are right-handed intrinsic XYZ Euler degrees, relative to the parent (R = Rx Ry Rz), including curve points and mirrors.
|
|
70
|
+
Points and curve mirrors use the owning curve frame; primitive mirrors use the primitive's parent frame.
|
|
71
|
+
lookAt(origin, target) aligns local +Z; both points must be in the same parent-local space. For a segment along a different local axis,
|
|
72
|
+
use alignAxis(direction, 'x'|'y'|'z'); cylinders and cones extend along local Y. These return rotations, not world-space transforms.
|
|
73
|
+
Alignment chooses a deterministic roll using Y-up (Z-up fallback when parallel); coincident/non-finite directions are errors.
|
|
74
|
+
The SDK handles native XZY conversion; do not swap Euler components or convert again. Geometry Nodes source remains native XZY.
|
|
75
|
+
Colors use RGB values from 0 to 255. Use the exposed enums instead of guessing values.
|
|
76
|
+
For visible geometry color, create or clone a material, call materialSetColor, and assign it with nodeSetMaterialId only to
|
|
77
|
+
Primitive, Curve, Text, SVG, Mesh, Field, Decal or OpenSCAD nodes. Assigning a curve material recolors its existing points; use curvePointSetMaterialId for per-point overrides afterward.
|
|
78
|
+
Areas/Unions, Groups, Lights and Sockets do not accept direct materials. Color ordinary containers through their supported children.
|
|
79
|
+
Geometry Nodes materials belong in the graph: create or import the material here, then assign it inside the graph with the FlowIR SetMaterial node, passing the numeric ID this skill returns.
|
|
80
|
+
Never replace a parametric graph with ordinary primitives to color it. Ordinary Stain/CSG children do not modify graph output.
|
|
81
|
+
nodeSetColor writes the node color field (used by lights); it does not replace a geometry object's material color.
|
|
82
|
+
Do not recolor a shared material unless every object using it should change. Create and assign the material in the same edit as the scene geometry that uses it; a Geometry Nodes graph instead consumes a material ID created in an earlier edit.
|
|
83
|
+
Create primitives, curves, and text inside Areas/Unions. Respect tree order for subtraction and intersection.
|
|
84
|
+
Groups are organizational only; move and rotate their child Areas individually, not the Group. Use unions for blended masses.
|
|
85
|
+
Sphere uses size.x as uniform diameter (y/z do not stretch it), including new or resized spherical curve points. Cylinder/Cone/Pyramid use x as base diameter/width and y as height;
|
|
86
|
+
Torus uses x as outer diameter and y as tube thickness. For these four primitives, nodeSetSize accepts {x, y}; z follows x even when supplied. Cube uses all three dimensions. Node and curve-point round are dimensionless fractions clamped to [0, 1], not radii in project units; rounding does not set size. Cube rounding reaches half its shortest dimension at 1, so a shallow Cube retains broad flat faces rather than becoming an ellipsoid.
|
|
87
|
+
Build and verify coarse geometry and unfamiliar operations before replicating details. Check one representative result, then repeat it.
|
|
88
|
+
Reference fidelity:
|
|
89
|
+
When recreating an image, treat its visible geometry and level of detail as the target—not merely its subject, colors, or list of parts. Preserve the user's chosen workflow and editability requirements.
|
|
90
|
+
Establish a comparison view matching the reference's angle, projection, and subject framing as closely as practical. Match silhouette, proportions, pose, and negative spaces first; then local contours, thickness, curvature, surface transitions, and defining details. Infer unseen geometry conservatively.
|
|
91
|
+
Compare each rendered pass directly with the source. Identify the largest remaining visible shape mismatch, edit it, and verify that it improved before moving to smaller details. Use close-ups when the comparison view cannot resolve a feature; return to the comparison view afterward. Adjust sampling or resolution when visible faceting or segmentation requires it—not as a substitute for reshaping.
|
|
92
|
+
Do not stop at semantic resemblance or after a fixed number of screenshots. Continue while substantial visible mismatches remain and supported edits are making progress, within the available budget. If progress stalls or the chosen representation cannot achieve the requested fidelity, explain the specific limitation and ask before changing workflows. Before finishing, compare the latest render with the reference and address the largest remaining visible mismatch; if substantial differences remain, identify the concrete stopping reason rather than treating an approximation disclaimer as completion.
|
|
93
|
+
|
|
94
|
+
nodeClone is shallow (no children). await cloneSubtree(id, { parentId?, name?, index? }) copies the complete hierarchy with fresh IDs,
|
|
95
|
+
preserving local transforms, order and metadata, remapping internal references and sharing external materials/assets.
|
|
96
|
+
Cloning requires a host transport with atomic scene patches; an unsupported host rejects it without changing the draft.
|
|
97
|
+
For primitives, nodeSetBlend joins against all accumulated preceding geometry in the Area, not only the nearest part. A Union's blend affects its outer join, not joins between its children; top-level Area blend does not smooth its contents.
|
|
98
|
+
For organic joins, overlap primitives and tune blend on the joining children while preserving intended gaps; keep crisp accessories separate.
|
|
99
|
+
Check font, HDR, and material catalogs before selecting names. A host can explicitly report a catalog as
|
|
100
|
+
unavailable. Selecting an HDR resets its intensity; apply a custom intensity after selecting it.
|
|
101
|
+
For library materials, use listSuperMaterials(), then await materialImport(name) inside scene.edit and assign the returned numeric ID the way that object requires: nodeSetMaterialId or curvePointSetMaterialId for scene nodes, the FlowIR SetMaterial node for a Geometry Nodes graph. A failed import rolls back the draft.
|
|
102
|
+
Filter large read results with JavaScript and print only useful details.
|
|
103
|
+
After a major edit, capture a screenshot outside the transaction and emitImage its reference.
|
|
104
|
+
screenshot({ camera: { position: {x,y,z}, target: {x,y,z}, projection: 'perspective', horizontalFovDegrees: 60 } })
|
|
105
|
+
sets a world-space camera in the same Womp coordinates and project units as scene positions (Y-up).
|
|
106
|
+
For orthographic framing use projection: 'orthographic' and orthographicWidth in project units instead of FOV.
|
|
107
|
+
Direction is derived from position/target; do not use coincident points or an exactly vertical viewing direction.
|
|
108
|
+
Omitted projection/lens settings come from the active camera. Pass the camera again for repeatable captures.
|
|
109
|
+
For object-focused screenshots, identify the requested object and frame it with an explicit camera position and target using its bounds; reuse established framing when appropriate. Choose a view that reveals the requested features without clipping the subject.
|
|
110
|
+
Omitting camera captures the active viewport without auto-fit. Use it when the user asks about the current viewport or clearly refers to what is visible on screen, not on the assumption that it shows the requested object.
|
|
111
|
+
Respect the host's camera-lock restrictions. Verify silhouette,
|
|
112
|
+
connections, openings, proportions, and materials before claiming completion. Use the owning top-level Area for scene-space bounds;
|
|
113
|
+
OpenSCAD part bounds are local to the part; individual primitive and curve bounds are unsupported. Renderer bounds and resize calls
|
|
114
|
+
must finish before subsequent writes. Inside scene.edit, complete renderer-backed bounds reads before the first
|
|
115
|
+
draft mutation; the SDK rejects them once the draft is dirty. Inspect committed results when renderer state has not caught up.
|
|
116
116
|
A failed script can retain earlier committed effects. Use receipts and inspect unknown outcomes before retrying.`,
|
|
117
117
|
declarations: WOMP_SCENE_DECLARATIONS,
|
|
118
118
|
examples: [
|
package/dist/client.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventSourceParserStream } from "eventsource-parser/stream";
|
|
2
|
+
import { sparkErrorDiagnosticsSchema } from "./error-diagnostics.js";
|
|
2
3
|
function isStoredChunk(value) {
|
|
3
4
|
if (value === null || typeof value !== "object")
|
|
4
5
|
return false;
|
|
@@ -13,6 +14,13 @@ function isStoredChunk(value) {
|
|
|
13
14
|
async function responseError(response) {
|
|
14
15
|
try {
|
|
15
16
|
const body = await response.json();
|
|
17
|
+
const parsed = sparkErrorDiagnosticsSchema.safeParse(body.diagnostics);
|
|
18
|
+
if (parsed.success) {
|
|
19
|
+
const details = parsed.data;
|
|
20
|
+
const context = [details.name, details.code, details.requestId && `request ${details.requestId}`].filter(Boolean).join(" · ");
|
|
21
|
+
const causes = [details.cause?.message, details.cause?.cause?.message].filter(Boolean);
|
|
22
|
+
return new Error(`HTTP ${response.status}${context ? ` · ${context}` : ""}: ${details.message}${causes.length ? ` — ${causes.join(" — ")}` : ""}`);
|
|
23
|
+
}
|
|
16
24
|
if (typeof body.error === "string")
|
|
17
25
|
return new Error(body.error);
|
|
18
26
|
}
|