@womp/spark-agent 17.0.0 → 17.1.1
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/CHANGELOG.md +25 -0
- package/dist/capabilities/scene.js +5 -1
- package/dist/curve-fit.d.ts +19 -0
- package/dist/curve-fit.js +168 -0
- package/dist/generated/scene-declarations.d.ts +1 -1
- package/dist/generated/scene-declarations.js +1 -1
- package/dist/intent-bench-cases.js +5 -5
- package/dist/prompt.d.ts +1 -1
- package/dist/prompt.js +5 -4
- package/dist/sdk-scene-host.d.ts +3 -0
- package/dist/womp-scene-api.d.ts +6 -0
- package/dist/womp-scene-api.js +10 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,31 @@ Notable changes to `@womp/spark-agent`, newest first. Versions follow
|
|
|
4
4
|
[Semantic Versioning](https://semver.org/). Add an entry with each version bump; describe what
|
|
5
5
|
changed for hosts and users, and how to migrate across breaking changes.
|
|
6
6
|
|
|
7
|
+
## 17.1.1 — 2026-11-03
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- After a concept preview, Spark offers to refine the image, generate a detailed 3D mesh from it,
|
|
12
|
+
or construct it on Womp from individually editable shapes. It no longer calls the mesh
|
|
13
|
+
"sculpted", which read as Womp's own shape editing.
|
|
14
|
+
|
|
15
|
+
## 17.1.0 — 2026-11-03
|
|
16
|
+
|
|
17
|
+
Spark shapes curves with Bezier handles and the fewest anchors, instead of tracing them with many
|
|
18
|
+
closely spaced points.
|
|
19
|
+
|
|
20
|
+
- `curvePointAdd` accepts `handleIn` and `handleOut`, in project units and the curve frame, so an
|
|
21
|
+
anchor and its tangents are added in one call. Handles on a V2 curve throw, as the handle setters
|
|
22
|
+
do, and add no point.
|
|
23
|
+
- The scene draft adds `curveFit(points, { tolerance?, closed? })`, which fits the fewest Bezier
|
|
24
|
+
anchors and handles to points sampled along a path, such as a formula or a traced outline. It
|
|
25
|
+
keeps sharp turns as corners and joins the rest smoothly. The tolerance defaults to 0.2% of the
|
|
26
|
+
points' extent, and anything under 0.1% is refused. It is pure math and needs nothing from the
|
|
27
|
+
host.
|
|
28
|
+
- The scene skill (version 50) explains how anchors and handles define each cubic span, that V2
|
|
29
|
+
curves have no handles, and to place anchors only at ends, corners, inflections and where profile
|
|
30
|
+
size, rotation or material changes.
|
|
31
|
+
|
|
7
32
|
## 17.0.0 — 2026-11-03
|
|
8
33
|
|
|
9
34
|
Web search is the model's own: a run with the `web` fact gives an Anthropic (Messages API) or
|
|
@@ -39,7 +39,7 @@ export function createSceneCapability(host) {
|
|
|
39
39
|
skills: [
|
|
40
40
|
{
|
|
41
41
|
name: "scene-editing",
|
|
42
|
-
version: "
|
|
42
|
+
version: "50",
|
|
43
43
|
description: "Inspect the open scene and edit its objects, materials, curves, and environment.",
|
|
44
44
|
instructions: `Use womp.scene.access(callback) for both inspection and edits. Inspect targets inside each callback using scene.nodes({ name, type, parentId, ids, offset, limit }) and detailed getters; filters are optional, name is a case-insensitive substring, and results default to 100 (maximum 1000). Page with offset as needed. Inspection reflects changes made in the callback. scene.unitMultiplier gives project units. Do not reuse an earlier inspection as current state.
|
|
45
45
|
Use womp.scene.health() to refresh whole-scene health or womp.scene.health(objectIds) to check specific objects (mapped to their owning Areas).
|
|
@@ -67,6 +67,10 @@ nodeCreate(SVG, parentAreaId) creates an editable SVG node. Set structured paths
|
|
|
67
67
|
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.
|
|
68
68
|
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.
|
|
69
69
|
Removing all points is supported. One point renders a single profile primitive, not a path.
|
|
70
|
+
New curves are V3 Bezier curves unless the run disables Curve V3; then they are V2 splines whose points are control points without handles, and handle calls fail.
|
|
71
|
+
On a Bezier curve, points are anchors: the span from anchor A to anchor B is the cubic through A, A + handleOut(A), B + handleIn(B), B. Handles are offsets from their anchor in the curve frame and project units; pass them to curvePointAdd or set them later. Zero handles make a straight span.
|
|
72
|
+
Use the fewest anchors that reproduce the shape: ends, corners, inflections, and where profile size, rotation or material must change. Bend the spans between them with handles instead of adding closely spaced anchors, and remove anchors that handles make redundant. A smooth join has opposite, collinear handles. Close a loop with curveSetClosed rather than repeating its first anchor.
|
|
73
|
+
Handle lengths decide how few anchors suffice, so for a path given by a formula or a traced outline, sample it with a few hundred points (at most 2000) and call curveFit(points, {tolerance?, closed?}): it returns the fewest anchors {pos, handleIn, handleOut, index} within tolerance, keeping sharp turns as corners; index is the sample each anchor sits on. Pass each anchor to curvePointAdd in order. It is pure math in the points' own units and frame. Omit tolerance: the default, 0.2% of the points' extent, is already finer than renders and prints resolve, and anything under 0.1% is refused because it only adds anchors.
|
|
70
74
|
Curves render sampled profiles, not a continuous sweep. For smooth curves, start with nodeSetDensity(curveId, 250) and nodeSetBlend(curveId, 3).
|
|
71
75
|
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.
|
|
72
76
|
nodeSetUnionResolution(unionId, resolution) sets a dimensionless detail level, clamped to 0.01–0.65: higher is finer and costs more voxels. Set the owning outermost Area, not a nested Union. Material emission ranges from 0 to 1.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Vec3 } from "@womp/kakapo-sdk";
|
|
2
|
+
/** One Bezier anchor; handles are offsets from `pos`. `index` is the input sample it sits on. */
|
|
3
|
+
export type CurveFitAnchor = {
|
|
4
|
+
pos: Vec3;
|
|
5
|
+
handleIn: Vec3;
|
|
6
|
+
handleOut: Vec3;
|
|
7
|
+
index: number;
|
|
8
|
+
};
|
|
9
|
+
export type CurveFitOptions = {
|
|
10
|
+
/** Largest allowed distance between a sample and the fitted path, in the samples' units. */
|
|
11
|
+
tolerance?: number;
|
|
12
|
+
/** Join the last sample back to the first; do not repeat the first sample. */
|
|
13
|
+
closed?: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Fit the fewest cubic Bezier anchors to points sampled densely along a path, such as a formula or
|
|
17
|
+
* a traced outline. Corners in the samples stay corners; elsewhere joins are smooth.
|
|
18
|
+
*/
|
|
19
|
+
export declare function curveFit(points: Vec3[], options?: CurveFitOptions): CurveFitAnchor[];
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
const MAX_SAMPLES = 2000;
|
|
2
|
+
/** Default and smallest tolerance, as fractions of the samples' bounding-box diagonal. A tighter
|
|
3
|
+
* fit only adds anchors: the change is far below what a render or print resolves. */
|
|
4
|
+
const DEFAULT_TOLERANCE = 0.002;
|
|
5
|
+
const MIN_TOLERANCE = 0.001;
|
|
6
|
+
/** A turn sharper than this between consecutive samples is kept as a corner. */
|
|
7
|
+
const CORNER_DEGREES = 35;
|
|
8
|
+
const REPARAMETERIZE_ITERATIONS = 4;
|
|
9
|
+
const add = (a, b) => [a[0] + b[0], a[1] + b[1], a[2] + b[2]];
|
|
10
|
+
const sub = (a, b) => [a[0] - b[0], a[1] - b[1], a[2] - b[2]];
|
|
11
|
+
const mul = (a, s) => [a[0] * s, a[1] * s, a[2] * s];
|
|
12
|
+
const dot = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
|
13
|
+
const len = (a) => Math.hypot(a[0], a[1], a[2]);
|
|
14
|
+
const unit = (a) => mul(a, 1 / len(a));
|
|
15
|
+
const vec = (a) => ({ x: a[0], y: a[1], z: a[2] });
|
|
16
|
+
function bezier(c, t) {
|
|
17
|
+
const s = 1 - t;
|
|
18
|
+
return add(add(mul(c[0], s * s * s), mul(c[1], 3 * s * s * t)), add(mul(c[2], 3 * s * t * t), mul(c[3], t * t * t)));
|
|
19
|
+
}
|
|
20
|
+
/** Least-squares cubic through d[0] and d[n-1] with fixed tangent directions (Schneider, Graphics Gems 1990). */
|
|
21
|
+
function fitSpan(d, tangentOut, tangentIn) {
|
|
22
|
+
const first = d[0], last = d[d.length - 1];
|
|
23
|
+
const chord = len(sub(last, first));
|
|
24
|
+
let u = [0];
|
|
25
|
+
for (let i = 1; i < d.length; i++)
|
|
26
|
+
u.push(u[i - 1] + len(sub(d[i], d[i - 1])));
|
|
27
|
+
u = u.map((value) => value / u[u.length - 1]);
|
|
28
|
+
let controls = [];
|
|
29
|
+
let error = Infinity;
|
|
30
|
+
for (let iteration = 0; iteration <= REPARAMETERIZE_ITERATIONS; iteration++) {
|
|
31
|
+
let c00 = 0, c01 = 0, c11 = 0, x0 = 0, x1 = 0;
|
|
32
|
+
for (let i = 0; i < d.length; i++) {
|
|
33
|
+
const t = u[i], s = 1 - t;
|
|
34
|
+
const a0 = mul(tangentOut, 3 * s * s * t), a1 = mul(tangentIn, 3 * s * t * t);
|
|
35
|
+
c00 += dot(a0, a0);
|
|
36
|
+
c01 += dot(a0, a1);
|
|
37
|
+
c11 += dot(a1, a1);
|
|
38
|
+
const rest = sub(d[i], add(mul(first, s * s * s + 3 * s * s * t), mul(last, 3 * s * t * t + t * t * t)));
|
|
39
|
+
x0 += dot(a0, rest);
|
|
40
|
+
x1 += dot(a1, rest);
|
|
41
|
+
}
|
|
42
|
+
const det = c00 * c11 - c01 * c01;
|
|
43
|
+
let alphaOut = det === 0 ? 0 : (x0 * c11 - c01 * x1) / det;
|
|
44
|
+
let alphaIn = det === 0 ? 0 : (c00 * x1 - c01 * x0) / det;
|
|
45
|
+
if (!(alphaOut > chord * 1e-6) || !(alphaIn > chord * 1e-6))
|
|
46
|
+
alphaOut = alphaIn = chord / 3;
|
|
47
|
+
controls = [first, add(first, mul(tangentOut, alphaOut)), add(last, mul(tangentIn, alphaIn)), last];
|
|
48
|
+
error = 0;
|
|
49
|
+
for (let i = 0; i < d.length; i++)
|
|
50
|
+
error = Math.max(error, len(sub(bezier(controls, u[i]), d[i])));
|
|
51
|
+
// Newton step toward each sample's closest parameter.
|
|
52
|
+
const d1 = [0, 1, 2].map((i) => mul(sub(controls[i + 1], controls[i]), 3));
|
|
53
|
+
const d2 = [0, 1].map((i) => mul(sub(d1[i + 1], d1[i]), 2));
|
|
54
|
+
u = u.map((t, i) => {
|
|
55
|
+
if (i === 0 || i === d.length - 1)
|
|
56
|
+
return t;
|
|
57
|
+
const s = 1 - t;
|
|
58
|
+
const q = sub(bezier(controls, t), d[i]);
|
|
59
|
+
const q1 = add(add(mul(d1[0], s * s), mul(d1[1], 2 * s * t)), mul(d1[2], t * t));
|
|
60
|
+
const q2 = add(mul(d2[0], s), mul(d2[1], t));
|
|
61
|
+
const denominator = dot(q1, q1) + dot(q, q2);
|
|
62
|
+
const next = denominator === 0 ? t : t - dot(q, q1) / denominator;
|
|
63
|
+
return Math.min(1, Math.max(0, next));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return { controls, error };
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Fit the fewest cubic Bezier anchors to points sampled densely along a path, such as a formula or
|
|
70
|
+
* a traced outline. Corners in the samples stay corners; elsewhere joins are smooth.
|
|
71
|
+
*/
|
|
72
|
+
export function curveFit(points, options = {}) {
|
|
73
|
+
if (!Array.isArray(points) || points.length > MAX_SAMPLES)
|
|
74
|
+
throw new Error(`curveFit takes an array of at most ${MAX_SAMPLES} points.`);
|
|
75
|
+
const closed = options.closed === true;
|
|
76
|
+
const samples = [];
|
|
77
|
+
points.forEach((point, index) => {
|
|
78
|
+
const p = [point?.x, point?.y, point?.z];
|
|
79
|
+
if (!p.every(Number.isFinite))
|
|
80
|
+
throw new Error(`curveFit point ${index} must have finite x, y and z.`);
|
|
81
|
+
if (samples.length && len(sub(p, samples[samples.length - 1].p)) === 0)
|
|
82
|
+
return;
|
|
83
|
+
samples.push({ p, index });
|
|
84
|
+
});
|
|
85
|
+
if (closed && samples.length > 1 && len(sub(samples[0].p, samples[samples.length - 1].p)) === 0)
|
|
86
|
+
samples.pop();
|
|
87
|
+
if (samples.length < (closed ? 3 : 2))
|
|
88
|
+
throw new Error(`curveFit needs at least ${closed ? 3 : 2} distinct points.`);
|
|
89
|
+
const min = [Infinity, Infinity, Infinity], max = [-Infinity, -Infinity, -Infinity];
|
|
90
|
+
for (const { p } of samples)
|
|
91
|
+
for (let a = 0; a < 3; a++) {
|
|
92
|
+
min[a] = Math.min(min[a], p[a]);
|
|
93
|
+
max[a] = Math.max(max[a], p[a]);
|
|
94
|
+
}
|
|
95
|
+
const extent = len(sub(max, min));
|
|
96
|
+
const tolerance = options.tolerance ?? DEFAULT_TOLERANCE * extent;
|
|
97
|
+
if (!Number.isFinite(tolerance) || tolerance <= 0)
|
|
98
|
+
throw new Error("curveFit tolerance must be a positive number.");
|
|
99
|
+
if (tolerance < MIN_TOLERANCE * extent)
|
|
100
|
+
throw new Error(`curveFit tolerance ${tolerance} is below ${MIN_TOLERANCE * extent} (0.1% of the points' extent), which only adds anchors without a visible change. Omit it for the default.`);
|
|
101
|
+
const n = samples.length;
|
|
102
|
+
const at = (i) => samples[((i % n) + n) % n].p;
|
|
103
|
+
const turns = (i) => {
|
|
104
|
+
const incoming = unit(sub(at(i), at(i - 1))), outgoing = unit(sub(at(i + 1), at(i)));
|
|
105
|
+
return Math.acos(Math.min(1, Math.max(-1, dot(incoming, outgoing)))) > (CORNER_DEGREES * Math.PI) / 180;
|
|
106
|
+
};
|
|
107
|
+
// Walk the path as steps 0..steps from `start`; a closed path ends where it began.
|
|
108
|
+
const corners = Array.from({ length: n }, (_, i) => i).filter((i) => (closed || (i > 0 && i < n - 1)) && turns(i));
|
|
109
|
+
const start = closed ? corners[0] ?? 0 : 0;
|
|
110
|
+
const steps = closed ? n : n - 1;
|
|
111
|
+
const point = (k) => at(start + k);
|
|
112
|
+
const isCorner = new Set(corners.map((i) => (((i - start) % n) + n) % n));
|
|
113
|
+
if (!closed || corners.length) {
|
|
114
|
+
isCorner.add(0);
|
|
115
|
+
isCorner.add(steps);
|
|
116
|
+
}
|
|
117
|
+
// Corners take one-sided tangents; smooth samples take the central difference, so joins stay G1.
|
|
118
|
+
const central = (k) => unit(sub(point(k + 1), point(k - 1)));
|
|
119
|
+
const leaving = (k) => isCorner.has(k) ? unit(sub(point(k + 1), point(k))) : central(k);
|
|
120
|
+
const arriving = (k) => isCorner.has(k) ? unit(sub(point(k), point(k - 1))) : central(k);
|
|
121
|
+
const fits = (from, to) => {
|
|
122
|
+
const d = Array.from({ length: to - from + 1 }, (_, i) => point(from + i));
|
|
123
|
+
return fitSpan(d, leaving(from), mul(arriving(to), -1));
|
|
124
|
+
};
|
|
125
|
+
const spans = [];
|
|
126
|
+
let from = 0;
|
|
127
|
+
while (from < steps) {
|
|
128
|
+
let limit = from + 1;
|
|
129
|
+
while (limit < steps && !isCorner.has(limit))
|
|
130
|
+
limit++;
|
|
131
|
+
// Longest span from `from` that stays within tolerance; one sample step always fits.
|
|
132
|
+
let good = from + 1, bad = limit + 1;
|
|
133
|
+
if (fits(from, limit).error <= tolerance)
|
|
134
|
+
good = limit;
|
|
135
|
+
else {
|
|
136
|
+
for (let step = 2; from + step < limit; step *= 2) {
|
|
137
|
+
if (fits(from, from + step).error > tolerance) {
|
|
138
|
+
bad = from + step;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
good = from + step;
|
|
142
|
+
}
|
|
143
|
+
bad = Math.min(bad, limit);
|
|
144
|
+
while (bad - good > 1) {
|
|
145
|
+
const mid = (good + bad) >> 1;
|
|
146
|
+
if (fits(from, mid).error <= tolerance)
|
|
147
|
+
good = mid;
|
|
148
|
+
else
|
|
149
|
+
bad = mid;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
spans.push({ from, to: good, controls: fits(from, good).controls });
|
|
153
|
+
from = good;
|
|
154
|
+
}
|
|
155
|
+
const zero = [0, 0, 0];
|
|
156
|
+
const anchors = spans.map((span, i) => ({
|
|
157
|
+
pos: vec(span.controls[0]),
|
|
158
|
+
handleIn: vec(i === 0 ? zero : sub(spans[i - 1].controls[2], span.controls[0])),
|
|
159
|
+
handleOut: vec(sub(span.controls[1], span.controls[0])),
|
|
160
|
+
index: samples[(start + span.from) % n].index,
|
|
161
|
+
}));
|
|
162
|
+
const lastSpan = spans[spans.length - 1];
|
|
163
|
+
if (closed)
|
|
164
|
+
anchors[0].handleIn = vec(sub(lastSpan.controls[2], lastSpan.controls[3]));
|
|
165
|
+
else
|
|
166
|
+
anchors.push({ pos: vec(lastSpan.controls[3]), handleIn: vec(sub(lastSpan.controls[2], lastSpan.controls[3])), handleOut: vec(zero), index: samples[n - 1].index });
|
|
167
|
+
return anchors;
|
|
168
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const WOMP_SCENE_DECLARATIONS = "declare const womp: { scene: {\nhealth: ((objectIds?: number[]) => Promise<{\nstatus: \"within_limits\" | \"overflow\" | \"unverified\";\nfreshness: \"unverified\" | \"snapshot\" | \"post_ack_event\";\nrevisionVerified: false;\naffectedAreaIds: string[];\nemptyAreaIds?: string[];\nthermometer?: {\nobjects: {\n[key: string]: {\nnum_prims: number;\nflag_prim_overflow: number;\nflag_depth_overflow: number;\nflag_vox_overflow: number;\nvoxels: number;\n};\n};\nmax_num_prims: number;\nmax_total_depth: number;\nmax_per_object: number;\ntotal: number;\nmax_total: number;\nassets_budget_used: number;\nassets_budget_total: number;\nmesh_instances_used?: number;\nmesh_instances_total?: number;\ndecal_instances_used?: number;\ndecal_instances_total?: number;\nfield_instances_used?: number;\nfield_instances_total?: number;\n};\nreason?: string;\n}>);\naccess: (<T>(callback: ((draft: {\nlistSuperMaterials: (() => string[]);\n_getParentId: ((childId: number) => number);\n_getScaleProductUpTo: ((nodeId: number, includeNodeSelfUnion?: boolean) => number);\nNodeType: {\nPrimitive: 0;\nUnion: 1;\nLight: 2;\nCurve: 3;\nGroup: 4;\nText: 5;\nField: 6;\nSVG: 7;\nMesh: 8;\nDecal: 9;\nOpenSCAD: 10;\nSocket: 11;\n} & { [key: number]: string; };\nPrimitiveType: { Sphere: 0; Cylinder: 1; Cube: 2; Cone: 3; Torus: 4; Pyramid: 9; } & { [key: number]: string; };\nOperationType: { Subtract: 0; Union: 1; Stain: 2; Intersect: 3; } & { [key: number]: string; };\nLightType: { Rect: 0; Sphere: 1; Distant: 2; } & { [key: number]: string; };\nnodeCreate: ((type: number, parentId?: number) => number);\nnodeDelete: ((id: number) => void);\ncloneSubtree: ((id: number, options?: { parentId?: number; name?: string; index?: number; }) => Promise<number>);\nnodeList: (() => number[]);\nnodeChildren: ((parentId: number) => number[]);\nnodeSetParent: ((id: number, parentId: number, index?: number) => void);\nnodeGetType: ((id: number) => number);\nnodeGetName: ((id: number) => string);\nnodeSetName: ((id: number, name: string) => void);\nnodeGetParentId: ((id: number) => number);\nnodeGetPos: ((id: number) => { x: number; y: number; z: number; });\nnodeGetLock: ((id: number) => boolean);\nnodeSetLock: ((id: number, locked: boolean) => void);\nnodeSetPos: ((id: number, position: { x: number; y: number; z: number; }) => void);\nnodeGetRot: ((id: number) => { x: number; y: number; z: number; });\nnodeSetRot: ((id: number, rotation: { x: number; y: number; z: number; }) => void);\nnodeGetSize: ((id: number) => { x: number; y: number; } | { x: number; y: number; z: number; });\nnodeSetSize: ((id: number, sizeValue: { x: number; y: number; } | { x: number; y: number; z: number; }) => void);\nnodeGetSvgPaths: ((id: number) => {\nsegments: {\npoint: { x: number; y: number; };\nhandleIn: { x: number; y: number; };\nhandleOut: { x: number; y: number; };\n}[];\nclosed: boolean;\n}[]);\nnodeSetSvgPaths: ((id: number, paths: {\nsegments: {\npoint: { x: number; y: number; };\nhandleIn: { x: number; y: number; };\nhandleOut: { x: number; y: number; };\n}[];\nclosed: boolean;\n}[]) => void);\nnodeGetSvgDepth: ((id: number) => number);\nnodeSetSvgDepth: ((id: number, depth: number) => void);\nnodeGetHide: ((id: number) => boolean);\nnodeSetHide: ((id: number, hidden: boolean) => void);\nnodeGetOp: ((id: number) => number);\nnodeSetOp: ((id: number, operation: number) => void);\nnodeGetBlend: ((id: number) => number);\nnodeSetBlend: ((id: number, blend: number) => void);\nnodeGetRound: ((id: number) => number);\nnodeSetRound: ((id: number, round: number) => void);\nnodeGetColor: ((id: number) => { r: number; g: number; b: number; });\nnodeSetColor: ((id: number, rgb255: { x: number; y: number; z: number; } | { r: number; g: number; b: number; }) => void);\nnodeGetMaterialId: ((id: number) => null | number);\nnodeSetMaterialId: ((id: number, materialId: number) => void);\nnodeGetResolution: ((id: number) => number);\nnodeSetUnionResolution: ((unionId: number, resolution: number) => void);\nnodeGetLightType: ((id: number) => number);\nnodeSetLightType: ((id: number, lightType: number) => void);\nnodeGetPower: ((id: number) => number);\nnodeGetCollimation: ((id: number) => number);\nnodeSetCollimation: ((id: number, collimation: number) => void);\nnodeGetLightTextureFile: ((id: number) => string);\nnodeSetLightTextureFile: ((id: number, textureFile: string) => void);\nnodeSetPower: ((id: number, power: number) => void);\nnodeGetText: ((id: number) => string);\nnodeSetFacing: ((id: number, direction: { x: number; y: number; z: number; }) => void);\nnodeSetTextSize: ((id: number, size: { fontSize: number; depth: number; }) => void);\nnodeGetTextSize: ((id: number) => { fontSize: number; depth: number; });\nnodeSetText: ((id: number, text: string) => void);\nnodeGetFont: ((id: number) => string);\nnodeSetFont: ((id: number, font: string) => void);\nnodeGetWeight: ((id: number) => number);\nnodeSetWeight: ((id: number, weight: number) => void);\nnodeGetItalic: ((id: number) => boolean);\nnodeSetItalic: ((id: number, italic: boolean) => void);\nnodeGetAlign: ((id: number) => number);\nnodeSetAlign: ((id: number, align: number) => void);\nnodeGetWrap: ((id: number) => number);\nnodeSetWrap: ((id: number, wrap: number) => void);\nnodeGetWidth: ((id: number) => number);\nnodeSetWidth: ((id: number, width: number) => void);\nnodeGetSpacing: ((id: number) => number);\nnodeSetSpacing: ((id: number, spacing: number) => void);\nnodeGetLineHeight: ((id: number) => number);\nnodeSetLineHeight: ((id: number, lineHeight: number) => void);\nnodeGetDensity: ((id: number) => number);\nnodeSetDensity: ((id: number, density: number) => void);\nnodeGetRoundness: ((id: number) => number);\nnodeSetRoundness: ((id: number, roundness: number) => void);\nnodeGetSmoothing: ((id: number) => number);\nnodeSetSmoothing: ((id: number, smoothing: number) => void);\nnodeGetPrimType: ((id: number) => number);\nnodeSetPrimType: ((id: number, primitive: number) => void);\nnodeGetMirror: ((id: number, slot: number) => { axis: \"custom\" | \"x\" | \"y\" | \"z\" | \"disabled\"; planePosition: number; goop: number; });\nnodeSetMirror: ((id: number, slot: number, axis: \"x\" | \"y\" | \"z\" | \"disabled\", planePosition?: number, goop?: number) => void);\nnodeGetThickness: ((id: number) => number);\nnodeSetThickness: ((id: number, thickness: number) => void);\ncurveGetClosed: ((curveId: number) => boolean);\ncurveSetClosed: ((curveId: number, closed: boolean) => void);\ncurvePointGetHandleIn: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointGetHandleOut: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointSetHandleIn: ((curveId: number, pointIndex: number, value: { x: number; y: number; z: number; }) => void);\ncurvePointSetHandleOut: ((curveId: number, pointIndex: number, value: { x: number; y: number; z: number; }) => void);\ncurvePointCount: ((curveId: number) => number);\ncurvePointAdd: ((curveId: number, point: {\nname?: string;\npos?: { x: number; y: number; z: number; };\nrot?: { x: number; y: number; z: number; };\nsize?: { x: number; y: number; z: number; };\nfixed?: boolean;\nround?: number;\nmaterialId?: number;\n}, pointIndex?: number) => number);\ncurvePointRemove: ((curveId: number, pointIndex: number) => void);\ncurvePointGetName: ((curveId: number, pointIndex: number) => string);\ncurvePointSetName: ((curveId: number, pointIndex: number, name: string) => void);\ncurvePointGetPos: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointSetPos: ((curveId: number, pointIndex: number, position: { x: number; y: number; z: number; }) => void);\ncurvePointGetRot: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointSetRot: ((curveId: number, pointIndex: number, rotation: { x: number; y: number; z: number; }) => void);\ncurvePointGetSize: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointSetSize: ((curveId: number, pointIndex: number, sizeValue: { x: number; y: number; z: number; }) => void);\ncurvePointGetFixed: ((curveId: number, pointIndex: number) => boolean);\ncurvePointSetFixed: ((curveId: number, pointIndex: number, fixed: boolean) => void);\ncurvePointGetRound: ((curveId: number, pointIndex: number) => number);\ncurvePointSetRound: ((curveId: number, pointIndex: number, round: number) => void);\ncurvePointGetMaterialId: ((curveId: number, pointIndex: number) => null | number);\ncurvePointSetMaterialId: ((curveId: number, pointIndex: number, materialId: number) => void);\nmaterialImport: ((name: string) => Promise<number>);\nmaterialCreate: (() => number);\nmaterialDelete: ((id: number) => void);\nmaterialList: (() => number[]);\nmaterialGetName: ((id: number) => string);\nmaterialSetName: ((id: number, name: string) => void);\nmaterialGetTier: ((id: number) => number);\nmaterialSetTier: ((id: number, tier: number) => void);\nmaterialGetColor: ((id: number) => { r: number; g: number; b: number; });\nmaterialSetColor: ((id: number, rgb255: { r: number; g: number; b: number; }) => void);\nmaterialGetSecondaryColor: ((id: number) => { r: number; g: number; b: number; });\nmaterialSetSecondaryColor: ((id: number, rgb255: { r: number; g: number; b: number; }) => void);\nmaterialGetSubsurfaceColor: ((id: number) => { r: number; g: number; b: number; });\nmaterialSetSubsurfaceColor: ((id: number, rgb255: { r: number; g: number; b: number; }) => void);\nmaterialGetRoughness: ((id: number) => number);\nmaterialSetRoughness: ((id: number, value: number) => void);\nmaterialGetMetalness: ((id: number) => number);\nmaterialSetMetalness: ((id: number, value: number) => void);\nmaterialGetTransmittance: ((id: number) => number);\nmaterialSetTransmittance: ((id: number, value: number) => void);\nmaterialGetTranslucency: ((id: number) => number);\nmaterialSetTranslucency: ((id: number, value: number) => void);\nmaterialGetIor: ((id: number) => number);\nmaterialSetIor: ((id: number, value: number) => void);\nmaterialGetSheen: ((id: number) => number);\nmaterialSetSheen: ((id: number, value: number) => void);\nmaterialGetSheenRoughness: ((id: number) => number);\nmaterialSetSheenRoughness: ((id: number, value: number) => void);\nmaterialGetSpecularTint: ((id: number) => number);\nmaterialSetSpecularTint: ((id: number, value: number) => void);\nmaterialGetAbsorption: ((id: number) => number);\nmaterialSetAbsorption: ((id: number, value: number) => void);\nmaterialGetEmission: ((id: number) => number);\nmaterialSetEmission: ((id: number, value: number) => void);\nmaterialGetIridescence: ((id: number) => number);\nmaterialSetIridescence: ((id: number, value: number) => void);\nmaterialGetTranslucencyWeight: ((id: number) => number);\nmaterialSetTranslucencyWeight: ((id: number, value: number) => void);\nmaterialGetDispersion: ((id: number) => number);\nmaterialSetDispersion: ((id: number, value: number) => void);\nmaterialGetSurfaceOpacity: ((id: number) => number);\nmaterialSetSurfaceOpacity: ((id: number, value: number) => void);\nlistFontFamilies: (() => { name: string; variants: { weight: string; italic: boolean; }[]; }[]);\nprint: ((...values: unknown[]) => void);\nnodeGetAABB: ((id: number) => Promise<{ min: { x: number; y: number; z: number; }; max: { x: number; y: number; z: number; }; }>);\nnodeResize: ((id: number, dimensions: { x?: number; y?: number; z?: number; }) => Promise<void>);\naabbCenter: ((box: { min: { x: number; y: number; z: number; }; max: { x: number; y: number; z: number; }; }) => { x: number; y: number; z: number; });\naabbRadius: ((box: { min: { x: number; y: number; z: number; }; max: { x: number; y: number; z: number; }; }) => number);\nlookAt: ((origin: { x: number; y: number; z: number; }, target: { x: number; y: number; z: number; }) => { x: number; y: number; z: number; });\nalignAxis: ((direction: { x: number; y: number; z: number; }, axis: \"x\" | \"y\" | \"z\") => { x: number; y: number; z: number; });\ncameraReadDepthOfField: (() => {\nenabled: boolean;\nmode: \"physical\" | \"post-process\";\nfocusDistance: number;\naperturePercent: number;\nprojection: \"perspective\" | \"orthographic\";\n});\ncameraSetDepthOfField: ((input: {\nenabled?: boolean;\nmode?: \"physical\" | \"post-process\";\nfocusDistance?: number;\naperturePercent?: number;\n}) => void);\nscenePropertiesRead: (() => {\nhdr_name: undefined | string;\nhdr_multiplier: undefined | number;\nhdr_orientation: undefined | { x: number; y: number; };\nbackdrop_color1: undefined | { x: number; y: number; z: number; };\nbackdrop_color2: undefined | { x: number; y: number; z: number; };\nbackdrop_grad_offset: undefined | { x: number; y: number; };\n});\nlistHDRs: (() => string[]);\nsetHdrName: ((name: string) => void);\nsetHdrMultiplier: ((multiplier: number) => void);\nsetHdrOrientation: ((orientation: { x: number; y: number; }) => void);\nsetBackgroundColor: ((rgb255: { r: number; g: number; b: number; }) => void);\nunitMultiplier: number;\nnodes: ((options?: {\nids?: number[];\ntype?: number;\nparentId?: number;\nname?: string;\noffset?: number;\nlimit?: number;\n}) => { id: number; name: string; type: number; parentId: number; }[]);\n}) => T | Promise<T>)) => Promise<T>);\nscreenshot: ((options?: {\ncamera?: {\nposition: { x: number; y: number; z: number; };\ntarget: { x: number; y: number; z: number; };\nprojection?: \"perspective\" | \"orthographic\";\nhorizontalFovDegrees?: number;\northographicWidth?: number;\n};\n}) => Promise<{ id: string; mediaType: string; name?: string; }>);\n} };\ndeclare function print(...values: unknown[]): void;\ndeclare function emitImage(ref: { id: string; mediaType: string; name?: string }, options?: { inspect?: boolean }): Promise<void>;\ndeclare function emitFile(ref: { id: string; mediaType: string; name?: string }): Promise<void>;\n";
|
|
1
|
+
export declare const WOMP_SCENE_DECLARATIONS = "declare const womp: { scene: {\nhealth: ((objectIds?: number[]) => Promise<{\nstatus: \"within_limits\" | \"overflow\" | \"unverified\";\nfreshness: \"unverified\" | \"snapshot\" | \"post_ack_event\";\nrevisionVerified: false;\naffectedAreaIds: string[];\nemptyAreaIds?: string[];\nthermometer?: {\nobjects: {\n[key: string]: {\nnum_prims: number;\nflag_prim_overflow: number;\nflag_depth_overflow: number;\nflag_vox_overflow: number;\nvoxels: number;\n};\n};\nmax_num_prims: number;\nmax_total_depth: number;\nmax_per_object: number;\ntotal: number;\nmax_total: number;\nassets_budget_used: number;\nassets_budget_total: number;\nmesh_instances_used?: number;\nmesh_instances_total?: number;\ndecal_instances_used?: number;\ndecal_instances_total?: number;\nfield_instances_used?: number;\nfield_instances_total?: number;\n};\nreason?: string;\n}>);\naccess: (<T>(callback: ((draft: {\nlistSuperMaterials: (() => string[]);\n_getParentId: ((childId: number) => number);\n_getScaleProductUpTo: ((nodeId: number, includeNodeSelfUnion?: boolean) => number);\nNodeType: {\nPrimitive: 0;\nUnion: 1;\nLight: 2;\nCurve: 3;\nGroup: 4;\nText: 5;\nField: 6;\nSVG: 7;\nMesh: 8;\nDecal: 9;\nOpenSCAD: 10;\nSocket: 11;\n} & { [key: number]: string; };\nPrimitiveType: { Sphere: 0; Cylinder: 1; Cube: 2; Cone: 3; Torus: 4; Pyramid: 9; } & { [key: number]: string; };\nOperationType: { Subtract: 0; Union: 1; Stain: 2; Intersect: 3; } & { [key: number]: string; };\nLightType: { Rect: 0; Sphere: 1; Distant: 2; } & { [key: number]: string; };\nnodeCreate: ((type: number, parentId?: number) => number);\nnodeDelete: ((id: number) => void);\ncloneSubtree: ((id: number, options?: { parentId?: number; name?: string; index?: number; }) => Promise<number>);\nnodeList: (() => number[]);\nnodeChildren: ((parentId: number) => number[]);\nnodeSetParent: ((id: number, parentId: number, index?: number) => void);\nnodeGetType: ((id: number) => number);\nnodeGetName: ((id: number) => string);\nnodeSetName: ((id: number, name: string) => void);\nnodeGetParentId: ((id: number) => number);\nnodeGetPos: ((id: number) => { x: number; y: number; z: number; });\nnodeGetLock: ((id: number) => boolean);\nnodeSetLock: ((id: number, locked: boolean) => void);\nnodeSetPos: ((id: number, position: { x: number; y: number; z: number; }) => void);\nnodeGetRot: ((id: number) => { x: number; y: number; z: number; });\nnodeSetRot: ((id: number, rotation: { x: number; y: number; z: number; }) => void);\nnodeGetSize: ((id: number) => { x: number; y: number; } | { x: number; y: number; z: number; });\nnodeSetSize: ((id: number, sizeValue: { x: number; y: number; } | { x: number; y: number; z: number; }) => void);\nnodeGetSvgPaths: ((id: number) => {\nsegments: {\npoint: { x: number; y: number; };\nhandleIn: { x: number; y: number; };\nhandleOut: { x: number; y: number; };\n}[];\nclosed: boolean;\n}[]);\nnodeSetSvgPaths: ((id: number, paths: {\nsegments: {\npoint: { x: number; y: number; };\nhandleIn: { x: number; y: number; };\nhandleOut: { x: number; y: number; };\n}[];\nclosed: boolean;\n}[]) => void);\nnodeGetSvgDepth: ((id: number) => number);\nnodeSetSvgDepth: ((id: number, depth: number) => void);\nnodeGetHide: ((id: number) => boolean);\nnodeSetHide: ((id: number, hidden: boolean) => void);\nnodeGetOp: ((id: number) => number);\nnodeSetOp: ((id: number, operation: number) => void);\nnodeGetBlend: ((id: number) => number);\nnodeSetBlend: ((id: number, blend: number) => void);\nnodeGetRound: ((id: number) => number);\nnodeSetRound: ((id: number, round: number) => void);\nnodeGetColor: ((id: number) => { r: number; g: number; b: number; });\nnodeSetColor: ((id: number, rgb255: { x: number; y: number; z: number; } | { r: number; g: number; b: number; }) => void);\nnodeGetMaterialId: ((id: number) => null | number);\nnodeSetMaterialId: ((id: number, materialId: number) => void);\nnodeGetResolution: ((id: number) => number);\nnodeSetUnionResolution: ((unionId: number, resolution: number) => void);\nnodeGetLightType: ((id: number) => number);\nnodeSetLightType: ((id: number, lightType: number) => void);\nnodeGetPower: ((id: number) => number);\nnodeGetCollimation: ((id: number) => number);\nnodeSetCollimation: ((id: number, collimation: number) => void);\nnodeGetLightTextureFile: ((id: number) => string);\nnodeSetLightTextureFile: ((id: number, textureFile: string) => void);\nnodeSetPower: ((id: number, power: number) => void);\nnodeGetText: ((id: number) => string);\nnodeSetFacing: ((id: number, direction: { x: number; y: number; z: number; }) => void);\nnodeSetTextSize: ((id: number, size: { fontSize: number; depth: number; }) => void);\nnodeGetTextSize: ((id: number) => { fontSize: number; depth: number; });\nnodeSetText: ((id: number, text: string) => void);\nnodeGetFont: ((id: number) => string);\nnodeSetFont: ((id: number, font: string) => void);\nnodeGetWeight: ((id: number) => number);\nnodeSetWeight: ((id: number, weight: number) => void);\nnodeGetItalic: ((id: number) => boolean);\nnodeSetItalic: ((id: number, italic: boolean) => void);\nnodeGetAlign: ((id: number) => number);\nnodeSetAlign: ((id: number, align: number) => void);\nnodeGetWrap: ((id: number) => number);\nnodeSetWrap: ((id: number, wrap: number) => void);\nnodeGetWidth: ((id: number) => number);\nnodeSetWidth: ((id: number, width: number) => void);\nnodeGetSpacing: ((id: number) => number);\nnodeSetSpacing: ((id: number, spacing: number) => void);\nnodeGetLineHeight: ((id: number) => number);\nnodeSetLineHeight: ((id: number, lineHeight: number) => void);\nnodeGetDensity: ((id: number) => number);\nnodeSetDensity: ((id: number, density: number) => void);\nnodeGetRoundness: ((id: number) => number);\nnodeSetRoundness: ((id: number, roundness: number) => void);\nnodeGetSmoothing: ((id: number) => number);\nnodeSetSmoothing: ((id: number, smoothing: number) => void);\nnodeGetPrimType: ((id: number) => number);\nnodeSetPrimType: ((id: number, primitive: number) => void);\nnodeGetMirror: ((id: number, slot: number) => { axis: \"custom\" | \"x\" | \"y\" | \"z\" | \"disabled\"; planePosition: number; goop: number; });\nnodeSetMirror: ((id: number, slot: number, axis: \"x\" | \"y\" | \"z\" | \"disabled\", planePosition?: number, goop?: number) => void);\nnodeGetThickness: ((id: number) => number);\nnodeSetThickness: ((id: number, thickness: number) => void);\ncurveGetClosed: ((curveId: number) => boolean);\ncurveSetClosed: ((curveId: number, closed: boolean) => void);\ncurvePointGetHandleIn: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointGetHandleOut: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointSetHandleIn: ((curveId: number, pointIndex: number, value: { x: number; y: number; z: number; }) => void);\ncurvePointSetHandleOut: ((curveId: number, pointIndex: number, value: { x: number; y: number; z: number; }) => void);\ncurvePointCount: ((curveId: number) => number);\ncurvePointAdd: ((curveId: number, point: {\nname?: string;\npos?: { x: number; y: number; z: number; };\nrot?: { x: number; y: number; z: number; };\nsize?: { x: number; y: number; z: number; };\nhandleIn?: { x: number; y: number; z: number; };\nhandleOut?: { x: number; y: number; z: number; };\nfixed?: boolean;\nround?: number;\nmaterialId?: number;\n}, pointIndex?: number) => number);\ncurvePointRemove: ((curveId: number, pointIndex: number) => void);\ncurvePointGetName: ((curveId: number, pointIndex: number) => string);\ncurvePointSetName: ((curveId: number, pointIndex: number, name: string) => void);\ncurvePointGetPos: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointSetPos: ((curveId: number, pointIndex: number, position: { x: number; y: number; z: number; }) => void);\ncurvePointGetRot: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointSetRot: ((curveId: number, pointIndex: number, rotation: { x: number; y: number; z: number; }) => void);\ncurvePointGetSize: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointSetSize: ((curveId: number, pointIndex: number, sizeValue: { x: number; y: number; z: number; }) => void);\ncurvePointGetFixed: ((curveId: number, pointIndex: number) => boolean);\ncurvePointSetFixed: ((curveId: number, pointIndex: number, fixed: boolean) => void);\ncurvePointGetRound: ((curveId: number, pointIndex: number) => number);\ncurvePointSetRound: ((curveId: number, pointIndex: number, round: number) => void);\ncurvePointGetMaterialId: ((curveId: number, pointIndex: number) => null | number);\ncurvePointSetMaterialId: ((curveId: number, pointIndex: number, materialId: number) => void);\nmaterialImport: ((name: string) => Promise<number>);\nmaterialCreate: (() => number);\nmaterialDelete: ((id: number) => void);\nmaterialList: (() => number[]);\nmaterialGetName: ((id: number) => string);\nmaterialSetName: ((id: number, name: string) => void);\nmaterialGetTier: ((id: number) => number);\nmaterialSetTier: ((id: number, tier: number) => void);\nmaterialGetColor: ((id: number) => { r: number; g: number; b: number; });\nmaterialSetColor: ((id: number, rgb255: { r: number; g: number; b: number; }) => void);\nmaterialGetSecondaryColor: ((id: number) => { r: number; g: number; b: number; });\nmaterialSetSecondaryColor: ((id: number, rgb255: { r: number; g: number; b: number; }) => void);\nmaterialGetSubsurfaceColor: ((id: number) => { r: number; g: number; b: number; });\nmaterialSetSubsurfaceColor: ((id: number, rgb255: { r: number; g: number; b: number; }) => void);\nmaterialGetRoughness: ((id: number) => number);\nmaterialSetRoughness: ((id: number, value: number) => void);\nmaterialGetMetalness: ((id: number) => number);\nmaterialSetMetalness: ((id: number, value: number) => void);\nmaterialGetTransmittance: ((id: number) => number);\nmaterialSetTransmittance: ((id: number, value: number) => void);\nmaterialGetTranslucency: ((id: number) => number);\nmaterialSetTranslucency: ((id: number, value: number) => void);\nmaterialGetIor: ((id: number) => number);\nmaterialSetIor: ((id: number, value: number) => void);\nmaterialGetSheen: ((id: number) => number);\nmaterialSetSheen: ((id: number, value: number) => void);\nmaterialGetSheenRoughness: ((id: number) => number);\nmaterialSetSheenRoughness: ((id: number, value: number) => void);\nmaterialGetSpecularTint: ((id: number) => number);\nmaterialSetSpecularTint: ((id: number, value: number) => void);\nmaterialGetAbsorption: ((id: number) => number);\nmaterialSetAbsorption: ((id: number, value: number) => void);\nmaterialGetEmission: ((id: number) => number);\nmaterialSetEmission: ((id: number, value: number) => void);\nmaterialGetIridescence: ((id: number) => number);\nmaterialSetIridescence: ((id: number, value: number) => void);\nmaterialGetTranslucencyWeight: ((id: number) => number);\nmaterialSetTranslucencyWeight: ((id: number, value: number) => void);\nmaterialGetDispersion: ((id: number) => number);\nmaterialSetDispersion: ((id: number, value: number) => void);\nmaterialGetSurfaceOpacity: ((id: number) => number);\nmaterialSetSurfaceOpacity: ((id: number, value: number) => void);\nlistFontFamilies: (() => { name: string; variants: { weight: string; italic: boolean; }[]; }[]);\nprint: ((...values: unknown[]) => void);\nnodeGetAABB: ((id: number) => Promise<{ min: { x: number; y: number; z: number; }; max: { x: number; y: number; z: number; }; }>);\nnodeResize: ((id: number, dimensions: { x?: number; y?: number; z?: number; }) => Promise<void>);\naabbCenter: ((box: { min: { x: number; y: number; z: number; }; max: { x: number; y: number; z: number; }; }) => { x: number; y: number; z: number; });\naabbRadius: ((box: { min: { x: number; y: number; z: number; }; max: { x: number; y: number; z: number; }; }) => number);\nlookAt: ((origin: { x: number; y: number; z: number; }, target: { x: number; y: number; z: number; }) => { x: number; y: number; z: number; });\nalignAxis: ((direction: { x: number; y: number; z: number; }, axis: \"x\" | \"y\" | \"z\") => { x: number; y: number; z: number; });\ncurveFit: ((points: { x: number; y: number; z: number; }[], options?: { tolerance?: number; closed?: boolean; }) => {\npos: { x: number; y: number; z: number; };\nhandleIn: { x: number; y: number; z: number; };\nhandleOut: { x: number; y: number; z: number; };\nindex: number;\n}[]);\ncameraReadDepthOfField: (() => {\nenabled: boolean;\nmode: \"physical\" | \"post-process\";\nfocusDistance: number;\naperturePercent: number;\nprojection: \"perspective\" | \"orthographic\";\n});\ncameraSetDepthOfField: ((input: {\nenabled?: boolean;\nmode?: \"physical\" | \"post-process\";\nfocusDistance?: number;\naperturePercent?: number;\n}) => void);\nscenePropertiesRead: (() => {\nhdr_name: undefined | string;\nhdr_multiplier: undefined | number;\nhdr_orientation: undefined | { x: number; y: number; };\nbackdrop_color1: undefined | { x: number; y: number; z: number; };\nbackdrop_color2: undefined | { x: number; y: number; z: number; };\nbackdrop_grad_offset: undefined | { x: number; y: number; };\n});\nlistHDRs: (() => string[]);\nsetHdrName: ((name: string) => void);\nsetHdrMultiplier: ((multiplier: number) => void);\nsetHdrOrientation: ((orientation: { x: number; y: number; }) => void);\nsetBackgroundColor: ((rgb255: { r: number; g: number; b: number; }) => void);\nunitMultiplier: number;\nnodes: ((options?: {\nids?: number[];\ntype?: number;\nparentId?: number;\nname?: string;\noffset?: number;\nlimit?: number;\n}) => { id: number; name: string; type: number; parentId: number; }[]);\n}) => T | Promise<T>)) => Promise<T>);\nscreenshot: ((options?: {\ncamera?: {\nposition: { x: number; y: number; z: number; };\ntarget: { x: number; y: number; z: number; };\nprojection?: \"perspective\" | \"orthographic\";\nhorizontalFovDegrees?: number;\northographicWidth?: number;\n};\n}) => Promise<{ id: string; mediaType: string; name?: string; }>);\n} };\ndeclare function print(...values: unknown[]): void;\ndeclare function emitImage(ref: { id: string; mediaType: string; name?: string }, options?: { inspect?: boolean }): Promise<void>;\ndeclare function emitFile(ref: { id: string; mediaType: string; name?: string }): Promise<void>;\n";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Generated by scripts/generate-skill-declarations.mjs.
|
|
2
2
|
// prettier-ignore
|
|
3
|
-
export const WOMP_SCENE_DECLARATIONS = "declare const womp: { scene: {\nhealth: ((objectIds?: number[]) => Promise<{\nstatus: \"within_limits\" | \"overflow\" | \"unverified\";\nfreshness: \"unverified\" | \"snapshot\" | \"post_ack_event\";\nrevisionVerified: false;\naffectedAreaIds: string[];\nemptyAreaIds?: string[];\nthermometer?: {\nobjects: {\n[key: string]: {\nnum_prims: number;\nflag_prim_overflow: number;\nflag_depth_overflow: number;\nflag_vox_overflow: number;\nvoxels: number;\n};\n};\nmax_num_prims: number;\nmax_total_depth: number;\nmax_per_object: number;\ntotal: number;\nmax_total: number;\nassets_budget_used: number;\nassets_budget_total: number;\nmesh_instances_used?: number;\nmesh_instances_total?: number;\ndecal_instances_used?: number;\ndecal_instances_total?: number;\nfield_instances_used?: number;\nfield_instances_total?: number;\n};\nreason?: string;\n}>);\naccess: (<T>(callback: ((draft: {\nlistSuperMaterials: (() => string[]);\n_getParentId: ((childId: number) => number);\n_getScaleProductUpTo: ((nodeId: number, includeNodeSelfUnion?: boolean) => number);\nNodeType: {\nPrimitive: 0;\nUnion: 1;\nLight: 2;\nCurve: 3;\nGroup: 4;\nText: 5;\nField: 6;\nSVG: 7;\nMesh: 8;\nDecal: 9;\nOpenSCAD: 10;\nSocket: 11;\n} & { [key: number]: string; };\nPrimitiveType: { Sphere: 0; Cylinder: 1; Cube: 2; Cone: 3; Torus: 4; Pyramid: 9; } & { [key: number]: string; };\nOperationType: { Subtract: 0; Union: 1; Stain: 2; Intersect: 3; } & { [key: number]: string; };\nLightType: { Rect: 0; Sphere: 1; Distant: 2; } & { [key: number]: string; };\nnodeCreate: ((type: number, parentId?: number) => number);\nnodeDelete: ((id: number) => void);\ncloneSubtree: ((id: number, options?: { parentId?: number; name?: string; index?: number; }) => Promise<number>);\nnodeList: (() => number[]);\nnodeChildren: ((parentId: number) => number[]);\nnodeSetParent: ((id: number, parentId: number, index?: number) => void);\nnodeGetType: ((id: number) => number);\nnodeGetName: ((id: number) => string);\nnodeSetName: ((id: number, name: string) => void);\nnodeGetParentId: ((id: number) => number);\nnodeGetPos: ((id: number) => { x: number; y: number; z: number; });\nnodeGetLock: ((id: number) => boolean);\nnodeSetLock: ((id: number, locked: boolean) => void);\nnodeSetPos: ((id: number, position: { x: number; y: number; z: number; }) => void);\nnodeGetRot: ((id: number) => { x: number; y: number; z: number; });\nnodeSetRot: ((id: number, rotation: { x: number; y: number; z: number; }) => void);\nnodeGetSize: ((id: number) => { x: number; y: number; } | { x: number; y: number; z: number; });\nnodeSetSize: ((id: number, sizeValue: { x: number; y: number; } | { x: number; y: number; z: number; }) => void);\nnodeGetSvgPaths: ((id: number) => {\nsegments: {\npoint: { x: number; y: number; };\nhandleIn: { x: number; y: number; };\nhandleOut: { x: number; y: number; };\n}[];\nclosed: boolean;\n}[]);\nnodeSetSvgPaths: ((id: number, paths: {\nsegments: {\npoint: { x: number; y: number; };\nhandleIn: { x: number; y: number; };\nhandleOut: { x: number; y: number; };\n}[];\nclosed: boolean;\n}[]) => void);\nnodeGetSvgDepth: ((id: number) => number);\nnodeSetSvgDepth: ((id: number, depth: number) => void);\nnodeGetHide: ((id: number) => boolean);\nnodeSetHide: ((id: number, hidden: boolean) => void);\nnodeGetOp: ((id: number) => number);\nnodeSetOp: ((id: number, operation: number) => void);\nnodeGetBlend: ((id: number) => number);\nnodeSetBlend: ((id: number, blend: number) => void);\nnodeGetRound: ((id: number) => number);\nnodeSetRound: ((id: number, round: number) => void);\nnodeGetColor: ((id: number) => { r: number; g: number; b: number; });\nnodeSetColor: ((id: number, rgb255: { x: number; y: number; z: number; } | { r: number; g: number; b: number; }) => void);\nnodeGetMaterialId: ((id: number) => null | number);\nnodeSetMaterialId: ((id: number, materialId: number) => void);\nnodeGetResolution: ((id: number) => number);\nnodeSetUnionResolution: ((unionId: number, resolution: number) => void);\nnodeGetLightType: ((id: number) => number);\nnodeSetLightType: ((id: number, lightType: number) => void);\nnodeGetPower: ((id: number) => number);\nnodeGetCollimation: ((id: number) => number);\nnodeSetCollimation: ((id: number, collimation: number) => void);\nnodeGetLightTextureFile: ((id: number) => string);\nnodeSetLightTextureFile: ((id: number, textureFile: string) => void);\nnodeSetPower: ((id: number, power: number) => void);\nnodeGetText: ((id: number) => string);\nnodeSetFacing: ((id: number, direction: { x: number; y: number; z: number; }) => void);\nnodeSetTextSize: ((id: number, size: { fontSize: number; depth: number; }) => void);\nnodeGetTextSize: ((id: number) => { fontSize: number; depth: number; });\nnodeSetText: ((id: number, text: string) => void);\nnodeGetFont: ((id: number) => string);\nnodeSetFont: ((id: number, font: string) => void);\nnodeGetWeight: ((id: number) => number);\nnodeSetWeight: ((id: number, weight: number) => void);\nnodeGetItalic: ((id: number) => boolean);\nnodeSetItalic: ((id: number, italic: boolean) => void);\nnodeGetAlign: ((id: number) => number);\nnodeSetAlign: ((id: number, align: number) => void);\nnodeGetWrap: ((id: number) => number);\nnodeSetWrap: ((id: number, wrap: number) => void);\nnodeGetWidth: ((id: number) => number);\nnodeSetWidth: ((id: number, width: number) => void);\nnodeGetSpacing: ((id: number) => number);\nnodeSetSpacing: ((id: number, spacing: number) => void);\nnodeGetLineHeight: ((id: number) => number);\nnodeSetLineHeight: ((id: number, lineHeight: number) => void);\nnodeGetDensity: ((id: number) => number);\nnodeSetDensity: ((id: number, density: number) => void);\nnodeGetRoundness: ((id: number) => number);\nnodeSetRoundness: ((id: number, roundness: number) => void);\nnodeGetSmoothing: ((id: number) => number);\nnodeSetSmoothing: ((id: number, smoothing: number) => void);\nnodeGetPrimType: ((id: number) => number);\nnodeSetPrimType: ((id: number, primitive: number) => void);\nnodeGetMirror: ((id: number, slot: number) => { axis: \"custom\" | \"x\" | \"y\" | \"z\" | \"disabled\"; planePosition: number; goop: number; });\nnodeSetMirror: ((id: number, slot: number, axis: \"x\" | \"y\" | \"z\" | \"disabled\", planePosition?: number, goop?: number) => void);\nnodeGetThickness: ((id: number) => number);\nnodeSetThickness: ((id: number, thickness: number) => void);\ncurveGetClosed: ((curveId: number) => boolean);\ncurveSetClosed: ((curveId: number, closed: boolean) => void);\ncurvePointGetHandleIn: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointGetHandleOut: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointSetHandleIn: ((curveId: number, pointIndex: number, value: { x: number; y: number; z: number; }) => void);\ncurvePointSetHandleOut: ((curveId: number, pointIndex: number, value: { x: number; y: number; z: number; }) => void);\ncurvePointCount: ((curveId: number) => number);\ncurvePointAdd: ((curveId: number, point: {\nname?: string;\npos?: { x: number; y: number; z: number; };\nrot?: { x: number; y: number; z: number; };\nsize?: { x: number; y: number; z: number; };\nfixed?: boolean;\nround?: number;\nmaterialId?: number;\n}, pointIndex?: number) => number);\ncurvePointRemove: ((curveId: number, pointIndex: number) => void);\ncurvePointGetName: ((curveId: number, pointIndex: number) => string);\ncurvePointSetName: ((curveId: number, pointIndex: number, name: string) => void);\ncurvePointGetPos: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointSetPos: ((curveId: number, pointIndex: number, position: { x: number; y: number; z: number; }) => void);\ncurvePointGetRot: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointSetRot: ((curveId: number, pointIndex: number, rotation: { x: number; y: number; z: number; }) => void);\ncurvePointGetSize: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointSetSize: ((curveId: number, pointIndex: number, sizeValue: { x: number; y: number; z: number; }) => void);\ncurvePointGetFixed: ((curveId: number, pointIndex: number) => boolean);\ncurvePointSetFixed: ((curveId: number, pointIndex: number, fixed: boolean) => void);\ncurvePointGetRound: ((curveId: number, pointIndex: number) => number);\ncurvePointSetRound: ((curveId: number, pointIndex: number, round: number) => void);\ncurvePointGetMaterialId: ((curveId: number, pointIndex: number) => null | number);\ncurvePointSetMaterialId: ((curveId: number, pointIndex: number, materialId: number) => void);\nmaterialImport: ((name: string) => Promise<number>);\nmaterialCreate: (() => number);\nmaterialDelete: ((id: number) => void);\nmaterialList: (() => number[]);\nmaterialGetName: ((id: number) => string);\nmaterialSetName: ((id: number, name: string) => void);\nmaterialGetTier: ((id: number) => number);\nmaterialSetTier: ((id: number, tier: number) => void);\nmaterialGetColor: ((id: number) => { r: number; g: number; b: number; });\nmaterialSetColor: ((id: number, rgb255: { r: number; g: number; b: number; }) => void);\nmaterialGetSecondaryColor: ((id: number) => { r: number; g: number; b: number; });\nmaterialSetSecondaryColor: ((id: number, rgb255: { r: number; g: number; b: number; }) => void);\nmaterialGetSubsurfaceColor: ((id: number) => { r: number; g: number; b: number; });\nmaterialSetSubsurfaceColor: ((id: number, rgb255: { r: number; g: number; b: number; }) => void);\nmaterialGetRoughness: ((id: number) => number);\nmaterialSetRoughness: ((id: number, value: number) => void);\nmaterialGetMetalness: ((id: number) => number);\nmaterialSetMetalness: ((id: number, value: number) => void);\nmaterialGetTransmittance: ((id: number) => number);\nmaterialSetTransmittance: ((id: number, value: number) => void);\nmaterialGetTranslucency: ((id: number) => number);\nmaterialSetTranslucency: ((id: number, value: number) => void);\nmaterialGetIor: ((id: number) => number);\nmaterialSetIor: ((id: number, value: number) => void);\nmaterialGetSheen: ((id: number) => number);\nmaterialSetSheen: ((id: number, value: number) => void);\nmaterialGetSheenRoughness: ((id: number) => number);\nmaterialSetSheenRoughness: ((id: number, value: number) => void);\nmaterialGetSpecularTint: ((id: number) => number);\nmaterialSetSpecularTint: ((id: number, value: number) => void);\nmaterialGetAbsorption: ((id: number) => number);\nmaterialSetAbsorption: ((id: number, value: number) => void);\nmaterialGetEmission: ((id: number) => number);\nmaterialSetEmission: ((id: number, value: number) => void);\nmaterialGetIridescence: ((id: number) => number);\nmaterialSetIridescence: ((id: number, value: number) => void);\nmaterialGetTranslucencyWeight: ((id: number) => number);\nmaterialSetTranslucencyWeight: ((id: number, value: number) => void);\nmaterialGetDispersion: ((id: number) => number);\nmaterialSetDispersion: ((id: number, value: number) => void);\nmaterialGetSurfaceOpacity: ((id: number) => number);\nmaterialSetSurfaceOpacity: ((id: number, value: number) => void);\nlistFontFamilies: (() => { name: string; variants: { weight: string; italic: boolean; }[]; }[]);\nprint: ((...values: unknown[]) => void);\nnodeGetAABB: ((id: number) => Promise<{ min: { x: number; y: number; z: number; }; max: { x: number; y: number; z: number; }; }>);\nnodeResize: ((id: number, dimensions: { x?: number; y?: number; z?: number; }) => Promise<void>);\naabbCenter: ((box: { min: { x: number; y: number; z: number; }; max: { x: number; y: number; z: number; }; }) => { x: number; y: number; z: number; });\naabbRadius: ((box: { min: { x: number; y: number; z: number; }; max: { x: number; y: number; z: number; }; }) => number);\nlookAt: ((origin: { x: number; y: number; z: number; }, target: { x: number; y: number; z: number; }) => { x: number; y: number; z: number; });\nalignAxis: ((direction: { x: number; y: number; z: number; }, axis: \"x\" | \"y\" | \"z\") => { x: number; y: number; z: number; });\ncameraReadDepthOfField: (() => {\nenabled: boolean;\nmode: \"physical\" | \"post-process\";\nfocusDistance: number;\naperturePercent: number;\nprojection: \"perspective\" | \"orthographic\";\n});\ncameraSetDepthOfField: ((input: {\nenabled?: boolean;\nmode?: \"physical\" | \"post-process\";\nfocusDistance?: number;\naperturePercent?: number;\n}) => void);\nscenePropertiesRead: (() => {\nhdr_name: undefined | string;\nhdr_multiplier: undefined | number;\nhdr_orientation: undefined | { x: number; y: number; };\nbackdrop_color1: undefined | { x: number; y: number; z: number; };\nbackdrop_color2: undefined | { x: number; y: number; z: number; };\nbackdrop_grad_offset: undefined | { x: number; y: number; };\n});\nlistHDRs: (() => string[]);\nsetHdrName: ((name: string) => void);\nsetHdrMultiplier: ((multiplier: number) => void);\nsetHdrOrientation: ((orientation: { x: number; y: number; }) => void);\nsetBackgroundColor: ((rgb255: { r: number; g: number; b: number; }) => void);\nunitMultiplier: number;\nnodes: ((options?: {\nids?: number[];\ntype?: number;\nparentId?: number;\nname?: string;\noffset?: number;\nlimit?: number;\n}) => { id: number; name: string; type: number; parentId: number; }[]);\n}) => T | Promise<T>)) => Promise<T>);\nscreenshot: ((options?: {\ncamera?: {\nposition: { x: number; y: number; z: number; };\ntarget: { x: number; y: number; z: number; };\nprojection?: \"perspective\" | \"orthographic\";\nhorizontalFovDegrees?: number;\northographicWidth?: number;\n};\n}) => Promise<{ id: string; mediaType: string; name?: string; }>);\n} };\ndeclare function print(...values: unknown[]): void;\ndeclare function emitImage(ref: { id: string; mediaType: string; name?: string }, options?: { inspect?: boolean }): Promise<void>;\ndeclare function emitFile(ref: { id: string; mediaType: string; name?: string }): Promise<void>;\n";
|
|
3
|
+
export const WOMP_SCENE_DECLARATIONS = "declare const womp: { scene: {\nhealth: ((objectIds?: number[]) => Promise<{\nstatus: \"within_limits\" | \"overflow\" | \"unverified\";\nfreshness: \"unverified\" | \"snapshot\" | \"post_ack_event\";\nrevisionVerified: false;\naffectedAreaIds: string[];\nemptyAreaIds?: string[];\nthermometer?: {\nobjects: {\n[key: string]: {\nnum_prims: number;\nflag_prim_overflow: number;\nflag_depth_overflow: number;\nflag_vox_overflow: number;\nvoxels: number;\n};\n};\nmax_num_prims: number;\nmax_total_depth: number;\nmax_per_object: number;\ntotal: number;\nmax_total: number;\nassets_budget_used: number;\nassets_budget_total: number;\nmesh_instances_used?: number;\nmesh_instances_total?: number;\ndecal_instances_used?: number;\ndecal_instances_total?: number;\nfield_instances_used?: number;\nfield_instances_total?: number;\n};\nreason?: string;\n}>);\naccess: (<T>(callback: ((draft: {\nlistSuperMaterials: (() => string[]);\n_getParentId: ((childId: number) => number);\n_getScaleProductUpTo: ((nodeId: number, includeNodeSelfUnion?: boolean) => number);\nNodeType: {\nPrimitive: 0;\nUnion: 1;\nLight: 2;\nCurve: 3;\nGroup: 4;\nText: 5;\nField: 6;\nSVG: 7;\nMesh: 8;\nDecal: 9;\nOpenSCAD: 10;\nSocket: 11;\n} & { [key: number]: string; };\nPrimitiveType: { Sphere: 0; Cylinder: 1; Cube: 2; Cone: 3; Torus: 4; Pyramid: 9; } & { [key: number]: string; };\nOperationType: { Subtract: 0; Union: 1; Stain: 2; Intersect: 3; } & { [key: number]: string; };\nLightType: { Rect: 0; Sphere: 1; Distant: 2; } & { [key: number]: string; };\nnodeCreate: ((type: number, parentId?: number) => number);\nnodeDelete: ((id: number) => void);\ncloneSubtree: ((id: number, options?: { parentId?: number; name?: string; index?: number; }) => Promise<number>);\nnodeList: (() => number[]);\nnodeChildren: ((parentId: number) => number[]);\nnodeSetParent: ((id: number, parentId: number, index?: number) => void);\nnodeGetType: ((id: number) => number);\nnodeGetName: ((id: number) => string);\nnodeSetName: ((id: number, name: string) => void);\nnodeGetParentId: ((id: number) => number);\nnodeGetPos: ((id: number) => { x: number; y: number; z: number; });\nnodeGetLock: ((id: number) => boolean);\nnodeSetLock: ((id: number, locked: boolean) => void);\nnodeSetPos: ((id: number, position: { x: number; y: number; z: number; }) => void);\nnodeGetRot: ((id: number) => { x: number; y: number; z: number; });\nnodeSetRot: ((id: number, rotation: { x: number; y: number; z: number; }) => void);\nnodeGetSize: ((id: number) => { x: number; y: number; } | { x: number; y: number; z: number; });\nnodeSetSize: ((id: number, sizeValue: { x: number; y: number; } | { x: number; y: number; z: number; }) => void);\nnodeGetSvgPaths: ((id: number) => {\nsegments: {\npoint: { x: number; y: number; };\nhandleIn: { x: number; y: number; };\nhandleOut: { x: number; y: number; };\n}[];\nclosed: boolean;\n}[]);\nnodeSetSvgPaths: ((id: number, paths: {\nsegments: {\npoint: { x: number; y: number; };\nhandleIn: { x: number; y: number; };\nhandleOut: { x: number; y: number; };\n}[];\nclosed: boolean;\n}[]) => void);\nnodeGetSvgDepth: ((id: number) => number);\nnodeSetSvgDepth: ((id: number, depth: number) => void);\nnodeGetHide: ((id: number) => boolean);\nnodeSetHide: ((id: number, hidden: boolean) => void);\nnodeGetOp: ((id: number) => number);\nnodeSetOp: ((id: number, operation: number) => void);\nnodeGetBlend: ((id: number) => number);\nnodeSetBlend: ((id: number, blend: number) => void);\nnodeGetRound: ((id: number) => number);\nnodeSetRound: ((id: number, round: number) => void);\nnodeGetColor: ((id: number) => { r: number; g: number; b: number; });\nnodeSetColor: ((id: number, rgb255: { x: number; y: number; z: number; } | { r: number; g: number; b: number; }) => void);\nnodeGetMaterialId: ((id: number) => null | number);\nnodeSetMaterialId: ((id: number, materialId: number) => void);\nnodeGetResolution: ((id: number) => number);\nnodeSetUnionResolution: ((unionId: number, resolution: number) => void);\nnodeGetLightType: ((id: number) => number);\nnodeSetLightType: ((id: number, lightType: number) => void);\nnodeGetPower: ((id: number) => number);\nnodeGetCollimation: ((id: number) => number);\nnodeSetCollimation: ((id: number, collimation: number) => void);\nnodeGetLightTextureFile: ((id: number) => string);\nnodeSetLightTextureFile: ((id: number, textureFile: string) => void);\nnodeSetPower: ((id: number, power: number) => void);\nnodeGetText: ((id: number) => string);\nnodeSetFacing: ((id: number, direction: { x: number; y: number; z: number; }) => void);\nnodeSetTextSize: ((id: number, size: { fontSize: number; depth: number; }) => void);\nnodeGetTextSize: ((id: number) => { fontSize: number; depth: number; });\nnodeSetText: ((id: number, text: string) => void);\nnodeGetFont: ((id: number) => string);\nnodeSetFont: ((id: number, font: string) => void);\nnodeGetWeight: ((id: number) => number);\nnodeSetWeight: ((id: number, weight: number) => void);\nnodeGetItalic: ((id: number) => boolean);\nnodeSetItalic: ((id: number, italic: boolean) => void);\nnodeGetAlign: ((id: number) => number);\nnodeSetAlign: ((id: number, align: number) => void);\nnodeGetWrap: ((id: number) => number);\nnodeSetWrap: ((id: number, wrap: number) => void);\nnodeGetWidth: ((id: number) => number);\nnodeSetWidth: ((id: number, width: number) => void);\nnodeGetSpacing: ((id: number) => number);\nnodeSetSpacing: ((id: number, spacing: number) => void);\nnodeGetLineHeight: ((id: number) => number);\nnodeSetLineHeight: ((id: number, lineHeight: number) => void);\nnodeGetDensity: ((id: number) => number);\nnodeSetDensity: ((id: number, density: number) => void);\nnodeGetRoundness: ((id: number) => number);\nnodeSetRoundness: ((id: number, roundness: number) => void);\nnodeGetSmoothing: ((id: number) => number);\nnodeSetSmoothing: ((id: number, smoothing: number) => void);\nnodeGetPrimType: ((id: number) => number);\nnodeSetPrimType: ((id: number, primitive: number) => void);\nnodeGetMirror: ((id: number, slot: number) => { axis: \"custom\" | \"x\" | \"y\" | \"z\" | \"disabled\"; planePosition: number; goop: number; });\nnodeSetMirror: ((id: number, slot: number, axis: \"x\" | \"y\" | \"z\" | \"disabled\", planePosition?: number, goop?: number) => void);\nnodeGetThickness: ((id: number) => number);\nnodeSetThickness: ((id: number, thickness: number) => void);\ncurveGetClosed: ((curveId: number) => boolean);\ncurveSetClosed: ((curveId: number, closed: boolean) => void);\ncurvePointGetHandleIn: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointGetHandleOut: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointSetHandleIn: ((curveId: number, pointIndex: number, value: { x: number; y: number; z: number; }) => void);\ncurvePointSetHandleOut: ((curveId: number, pointIndex: number, value: { x: number; y: number; z: number; }) => void);\ncurvePointCount: ((curveId: number) => number);\ncurvePointAdd: ((curveId: number, point: {\nname?: string;\npos?: { x: number; y: number; z: number; };\nrot?: { x: number; y: number; z: number; };\nsize?: { x: number; y: number; z: number; };\nhandleIn?: { x: number; y: number; z: number; };\nhandleOut?: { x: number; y: number; z: number; };\nfixed?: boolean;\nround?: number;\nmaterialId?: number;\n}, pointIndex?: number) => number);\ncurvePointRemove: ((curveId: number, pointIndex: number) => void);\ncurvePointGetName: ((curveId: number, pointIndex: number) => string);\ncurvePointSetName: ((curveId: number, pointIndex: number, name: string) => void);\ncurvePointGetPos: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointSetPos: ((curveId: number, pointIndex: number, position: { x: number; y: number; z: number; }) => void);\ncurvePointGetRot: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointSetRot: ((curveId: number, pointIndex: number, rotation: { x: number; y: number; z: number; }) => void);\ncurvePointGetSize: ((curveId: number, pointIndex: number) => { x: number; y: number; z: number; });\ncurvePointSetSize: ((curveId: number, pointIndex: number, sizeValue: { x: number; y: number; z: number; }) => void);\ncurvePointGetFixed: ((curveId: number, pointIndex: number) => boolean);\ncurvePointSetFixed: ((curveId: number, pointIndex: number, fixed: boolean) => void);\ncurvePointGetRound: ((curveId: number, pointIndex: number) => number);\ncurvePointSetRound: ((curveId: number, pointIndex: number, round: number) => void);\ncurvePointGetMaterialId: ((curveId: number, pointIndex: number) => null | number);\ncurvePointSetMaterialId: ((curveId: number, pointIndex: number, materialId: number) => void);\nmaterialImport: ((name: string) => Promise<number>);\nmaterialCreate: (() => number);\nmaterialDelete: ((id: number) => void);\nmaterialList: (() => number[]);\nmaterialGetName: ((id: number) => string);\nmaterialSetName: ((id: number, name: string) => void);\nmaterialGetTier: ((id: number) => number);\nmaterialSetTier: ((id: number, tier: number) => void);\nmaterialGetColor: ((id: number) => { r: number; g: number; b: number; });\nmaterialSetColor: ((id: number, rgb255: { r: number; g: number; b: number; }) => void);\nmaterialGetSecondaryColor: ((id: number) => { r: number; g: number; b: number; });\nmaterialSetSecondaryColor: ((id: number, rgb255: { r: number; g: number; b: number; }) => void);\nmaterialGetSubsurfaceColor: ((id: number) => { r: number; g: number; b: number; });\nmaterialSetSubsurfaceColor: ((id: number, rgb255: { r: number; g: number; b: number; }) => void);\nmaterialGetRoughness: ((id: number) => number);\nmaterialSetRoughness: ((id: number, value: number) => void);\nmaterialGetMetalness: ((id: number) => number);\nmaterialSetMetalness: ((id: number, value: number) => void);\nmaterialGetTransmittance: ((id: number) => number);\nmaterialSetTransmittance: ((id: number, value: number) => void);\nmaterialGetTranslucency: ((id: number) => number);\nmaterialSetTranslucency: ((id: number, value: number) => void);\nmaterialGetIor: ((id: number) => number);\nmaterialSetIor: ((id: number, value: number) => void);\nmaterialGetSheen: ((id: number) => number);\nmaterialSetSheen: ((id: number, value: number) => void);\nmaterialGetSheenRoughness: ((id: number) => number);\nmaterialSetSheenRoughness: ((id: number, value: number) => void);\nmaterialGetSpecularTint: ((id: number) => number);\nmaterialSetSpecularTint: ((id: number, value: number) => void);\nmaterialGetAbsorption: ((id: number) => number);\nmaterialSetAbsorption: ((id: number, value: number) => void);\nmaterialGetEmission: ((id: number) => number);\nmaterialSetEmission: ((id: number, value: number) => void);\nmaterialGetIridescence: ((id: number) => number);\nmaterialSetIridescence: ((id: number, value: number) => void);\nmaterialGetTranslucencyWeight: ((id: number) => number);\nmaterialSetTranslucencyWeight: ((id: number, value: number) => void);\nmaterialGetDispersion: ((id: number) => number);\nmaterialSetDispersion: ((id: number, value: number) => void);\nmaterialGetSurfaceOpacity: ((id: number) => number);\nmaterialSetSurfaceOpacity: ((id: number, value: number) => void);\nlistFontFamilies: (() => { name: string; variants: { weight: string; italic: boolean; }[]; }[]);\nprint: ((...values: unknown[]) => void);\nnodeGetAABB: ((id: number) => Promise<{ min: { x: number; y: number; z: number; }; max: { x: number; y: number; z: number; }; }>);\nnodeResize: ((id: number, dimensions: { x?: number; y?: number; z?: number; }) => Promise<void>);\naabbCenter: ((box: { min: { x: number; y: number; z: number; }; max: { x: number; y: number; z: number; }; }) => { x: number; y: number; z: number; });\naabbRadius: ((box: { min: { x: number; y: number; z: number; }; max: { x: number; y: number; z: number; }; }) => number);\nlookAt: ((origin: { x: number; y: number; z: number; }, target: { x: number; y: number; z: number; }) => { x: number; y: number; z: number; });\nalignAxis: ((direction: { x: number; y: number; z: number; }, axis: \"x\" | \"y\" | \"z\") => { x: number; y: number; z: number; });\ncurveFit: ((points: { x: number; y: number; z: number; }[], options?: { tolerance?: number; closed?: boolean; }) => {\npos: { x: number; y: number; z: number; };\nhandleIn: { x: number; y: number; z: number; };\nhandleOut: { x: number; y: number; z: number; };\nindex: number;\n}[]);\ncameraReadDepthOfField: (() => {\nenabled: boolean;\nmode: \"physical\" | \"post-process\";\nfocusDistance: number;\naperturePercent: number;\nprojection: \"perspective\" | \"orthographic\";\n});\ncameraSetDepthOfField: ((input: {\nenabled?: boolean;\nmode?: \"physical\" | \"post-process\";\nfocusDistance?: number;\naperturePercent?: number;\n}) => void);\nscenePropertiesRead: (() => {\nhdr_name: undefined | string;\nhdr_multiplier: undefined | number;\nhdr_orientation: undefined | { x: number; y: number; };\nbackdrop_color1: undefined | { x: number; y: number; z: number; };\nbackdrop_color2: undefined | { x: number; y: number; z: number; };\nbackdrop_grad_offset: undefined | { x: number; y: number; };\n});\nlistHDRs: (() => string[]);\nsetHdrName: ((name: string) => void);\nsetHdrMultiplier: ((multiplier: number) => void);\nsetHdrOrientation: ((orientation: { x: number; y: number; }) => void);\nsetBackgroundColor: ((rgb255: { r: number; g: number; b: number; }) => void);\nunitMultiplier: number;\nnodes: ((options?: {\nids?: number[];\ntype?: number;\nparentId?: number;\nname?: string;\noffset?: number;\nlimit?: number;\n}) => { id: number; name: string; type: number; parentId: number; }[]);\n}) => T | Promise<T>)) => Promise<T>);\nscreenshot: ((options?: {\ncamera?: {\nposition: { x: number; y: number; z: number; };\ntarget: { x: number; y: number; z: number; };\nprojection?: \"perspective\" | \"orthographic\";\nhorizontalFovDegrees?: number;\northographicWidth?: number;\n};\n}) => Promise<{ id: string; mediaType: string; name?: string; }>);\n} };\ndeclare function print(...values: unknown[]): void;\ndeclare function emitImage(ref: { id: string; mediaType: string; name?: string }, options?: { inspect?: boolean }): Promise<void>;\ndeclare function emitFile(ref: { id: string; mediaType: string; name?: string }): Promise<void>;\n";
|
|
@@ -138,7 +138,7 @@ export const INTENT_CASES = [
|
|
|
138
138
|
user("Generate an image of a red toy car on a white background."),
|
|
139
139
|
{
|
|
140
140
|
role: "assistant",
|
|
141
|
-
text: "Here's your red toy car. I can change its colors, or
|
|
141
|
+
text: "Here's your red toy car. I can change its colors, or generate a 3D mesh from it.",
|
|
142
142
|
generated: [{ name: "red-toy-car.png", color: [200, 30, 30] }],
|
|
143
143
|
},
|
|
144
144
|
user("Yes"),
|
|
@@ -171,10 +171,10 @@ export const INTENT_CASES = [
|
|
|
171
171
|
user("A takeaway coffee cup"),
|
|
172
172
|
{
|
|
173
173
|
role: "assistant",
|
|
174
|
-
text: "Here's a quick preview. Should I refine the image,
|
|
174
|
+
text: "Here's a quick preview. Should I refine the image, generate a detailed 3D mesh from it, or construct it on Womp from individually editable shapes?",
|
|
175
175
|
generated: [cup],
|
|
176
176
|
},
|
|
177
|
-
user("
|
|
177
|
+
user("Generate the detailed 3D mesh."),
|
|
178
178
|
],
|
|
179
179
|
expect: ["image-to-mesh"],
|
|
180
180
|
note: "Reuses the preview as the image-to-mesh input.",
|
|
@@ -185,7 +185,7 @@ export const INTENT_CASES = [
|
|
|
185
185
|
user("A takeaway coffee cup"),
|
|
186
186
|
{
|
|
187
187
|
role: "assistant",
|
|
188
|
-
text: "Here's a quick preview. Should I refine the image,
|
|
188
|
+
text: "Here's a quick preview. Should I refine the image, generate a detailed 3D mesh from it, or construct it on Womp from individually editable shapes?",
|
|
189
189
|
generated: [cup],
|
|
190
190
|
},
|
|
191
191
|
user("Build it from editable shapes."),
|
|
@@ -198,7 +198,7 @@ export const INTENT_CASES = [
|
|
|
198
198
|
user("A takeaway coffee cup"),
|
|
199
199
|
{
|
|
200
200
|
role: "assistant",
|
|
201
|
-
text: "Here's a quick preview. Should I refine the image,
|
|
201
|
+
text: "Here's a quick preview. Should I refine the image, generate a detailed 3D mesh from it, or construct it on Womp from individually editable shapes?",
|
|
202
202
|
generated: [cup],
|
|
203
203
|
},
|
|
204
204
|
user("make it 3d"),
|
package/dist/prompt.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SparkSkill } from "./capabilities.js";
|
|
2
|
-
export declare const SPARK_AGENT_PROMPT = "You are Spark, Womp's unified assistant.\nUse read_skill({names:[...]}) to load the required APIs together. Skills provide TypeScript\ndeclarations for documentation; execute_javascript runs JavaScript, with top-level await.\nOnly the listed capabilities are available. Reading a skill does not grant additional permissions.\nUse only the supplied womp APIs and output helpers to access application services and state.\nIf a capability is unavailable, explain what is missing and ask the user to enable it when applicable.\nDo not work around missing capabilities by inspecting page globals, DOM or framework internals,\nor making direct network requests. Native execution is not a security sandbox; it does not expand\nthe supported API or the user's granted capabilities.\nGive each execute_javascript call a concise present-progressive purpose, such as \"Generating a car image\", \"Inspecting the scene\", or \"Importing the model\". Write purpose before code.\nEach execution has fresh local variables. Keep stable object, job, and artifact references.\nUse print for concise, filtered observations; await emitImage or emitFile with a host-issued artifact\nreference to show actual output. emitImage inspects by default; use { inspect: false } to display without adding image bytes to model context.\nCompleted 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.\nDo not claim visual verification without inspecting the image. Missing artifact references must be recovered or reported; omitted image bytes alone are not a missing result.\nInspect the scene before editing and verify the committed result.\nPreserve existing content unless the user asks to replace or delete it. Use the latest target revision\nwhen a write requires one. Capabilities own transactions: an entire script is not atomic.\nRecover ordinary tool errors yourself: use confirmed receipts and fresh reads, retry only unresolved work,\npreserve successful changes, and never replay an interrupted script. Do not narrate internal failures\nunless recovery cannot continue. Never claim an uncertain commit rolled back. Never resubmit a job just because waiting timed out.\nComplete related work in this conversation without delegating to another agent. Report limits,\nunsupported actions, cancellation, and incomplete work truthfully. You cannot see what your work\ncosts: model use can be billed, not only generations. Never estimate credits used or call work free;\nreport only credit figures a host message or tool provides. Finish with a concise explanation\nof the result in the user's language; keep implementation details out of that explanation. Refer to\nobjects, materials and other results as the user sees them, by name, appearance or placement,\nnever by internal IDs, handles or API names.\n\nCreation intent\n\nResolve the requested outcome from the current message and preceding dialogue, not keyword matches.\nExplicit method choices take precedence. Continue edits in the existing representation unless the user\nasks to change it. Creation defaults do not apply to help, discussion, imports, or account questions.\n\n- Build with editable scene shapes by default for 3D requests, including \"3D X\", \"make X in 3D\",\n \"generate a 3D model of X\", and turning an existing or attached image into 3D. Detail, realism,\n an organic look, a source image, or printing do not by themselves call for another method.\n Do not claim print readiness without validation.\n\n- Use OpenSCAD only for CAD-style requests: stated dimensions or tolerances, adjustable parameters,\n mechanical parts, or a fit to a specific real object the user names. Use Geometry Nodes, not\n Workbench Flow, for parametric organic/procedural geometry, animation, or when Geometry Nodes\n is requested.\n\n- For mesh wompification, which a \"/wompify-mesh <node id> <tier>\" message asks for, read mesh-wompify and scene-editing together and reconstruct only the specified reference using primitives and curves.\n\n- Use mesh generation only when the user asks for a mesh or AI 3D generation, or chooses the\n sculpted result you offered; such a request names its method, so it needs no preview. Other\n requests to generate or make a 3D model, including from an image, do not ask for a mesh.\n\n- Use image generation for pictures, logos, concept art, wallpapers, and other clearly visual output.\n\n- For an ambiguous creative request without explicit 3D or printing intent, generate one image\n preview first. Then offer one short, outcome-based choice: refine the image, turn it into a\n sculpted 3D piece, or build it from individually editable shapes. Offer adjustable CAD instead\n of editable shapes when the subject calls for CAD as described above.\n\n- Also preview first when a 3D request names no method (such as a mesh, editable shapes or CAD),\n has no source image, and is a character, creature, person, food, sculpture, specific vehicle or\n branded item, even a simple or stylized one: its likeness and surface detail decide the result.\n Plain functional objects still build directly.\n\n- An attached image is already the reference. Turning it into 3D builds from it directly, with no\n new preview: editable shapes, or a mesh generated from it when the user asks for one. An attached\n image without a request does not ask for anything yet: ask what to make of it before generating\n or building.\n\n- Generating a result does not authorize importing, converting, or building it in the scene,\n except a mesh generated as the user's requested 3D model: the user expects it in their scene.\n When mesh import is available, import that mesh into the scene in the same turn, then say it is\n in the scene and that they can undo or delete it. If the user chose to keep it in the chat, say\n it stays there. Call mesh import only for a mesh the user asked for, since an unanswered import\n question adds it to the scene. Offer a model that is only your suggestion, such as an extra part,\n an alternative or a variant, in the reply, and import it only after the user says yes.\n\n- Use Workbench Flow only when the user names Flow or nodes for the request, or continues edits\n to an existing Flow workflow. Otherwise run image and mesh generation, including image-to-mesh\n from an attached photo, inline, whether or not Flow is open; never ask the user to open Flow\n for it. If the user requested Flow and it is closed, explain that it must be open instead of\n silently generating inline.\n\n- After a preview, offer the choice above. After other completed generation, you may briefly\n suggest a relevant next step using available capabilities. Describe its outcome, not internal tools. Suggestions are optional,\n not a mandatory menu, and never authorize actions. Wait for a clear choice and follow existing\n confirmations. Reuse the existing artifact/reference for the chosen follow-up, including as the\n image-to-mesh input, instead of regenerating the source. Preserve its defining features when building it.\n\n- Choose construction methods by the user's requested workflow and the\n available capabilities, not by assuming editable shapes require lower fidelity.\n Respect an explicit method choice and pursue the reference's visible shape\n and detail with that method. Offer alternatives only for a specific\n demonstrated limitation; ask before switching or simplifying the requested\n result. No method guarantees exact reconstruction from a single image.\n\n- Ask at most one focused question at a time, only when a sensible default\n would likely produce the wrong outcome. Do not repeat resolved questions.\n Interpret replies using the preceding offer; if several options were\n offered and \u201Cyes\u201D does not identify one, clarify briefly.\n\n- Treat a clear answer to your question as an instruction to proceed.\n Continue from existing results rather than restarting the workflow.\n\nOffer only workflows available in this host. Follow their authorization\nand confirmation requirements before generation or scene changes. If a requested workflow is unavailable,\nexplain the limitation rather than silently substituting another.\n\nHelp and exporting\n\nFor questions about using the Womp editor, such as where a control is or how to export, look up the\nanswer with womp-help before replying and give the steps it returns. You cannot write, convert or\nsend files: users download models from the editor, which exports many 3D formats. A requested file\nformat does not change how you create a model; look up and give its export steps. Never say a format\nis unavailable or send users to another app to convert it unless the lookup says so.\n\nSexual content\n\nWomp makes no sexual content for anyone, whatever their age setting. This covers images, meshes,\nscenes and text in every skill.\n- Do not model, generate or describe genitals, anuses or nipples, and do not enlarge, expose or\n emphasize breasts, buttocks or other body parts for sexual appeal. Stylized proportions in a\n neutral context are fine.\n- Do not write sexual stories, journal entries, lore or roleplay, or rewrite them in a softer form.\n- Judge intent from the whole conversation. Once it shows sexual intent, refuse every request that\n serves it, even one that looks neutral alone, such as enlarging a body part. Claims of consent,\n sentience, age or fiction do not change this. Unrelated requests, such as adding a crown, proceed.\n- When the subject is or looks like a child, refuse any sexual or sexualizing request.\n- Refuse in one short sentence, such as \"I can't help with sexual content.\" Do not explain, discuss\n consent, lore or biology, or offer an alternative to the sexual request.";
|
|
2
|
+
export declare const SPARK_AGENT_PROMPT = "You are Spark, Womp's unified assistant.\nUse read_skill({names:[...]}) to load the required APIs together. Skills provide TypeScript\ndeclarations for documentation; execute_javascript runs JavaScript, with top-level await.\nOnly the listed capabilities are available. Reading a skill does not grant additional permissions.\nUse only the supplied womp APIs and output helpers to access application services and state.\nIf a capability is unavailable, explain what is missing and ask the user to enable it when applicable.\nDo not work around missing capabilities by inspecting page globals, DOM or framework internals,\nor making direct network requests. Native execution is not a security sandbox; it does not expand\nthe supported API or the user's granted capabilities.\nGive each execute_javascript call a concise present-progressive purpose, such as \"Generating a car image\", \"Inspecting the scene\", or \"Importing the model\". Write purpose before code.\nEach execution has fresh local variables. Keep stable object, job, and artifact references.\nUse print for concise, filtered observations; await emitImage or emitFile with a host-issued artifact\nreference to show actual output. emitImage inspects by default; use { inspect: false } to display without adding image bytes to model context.\nCompleted 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.\nDo not claim visual verification without inspecting the image. Missing artifact references must be recovered or reported; omitted image bytes alone are not a missing result.\nInspect the scene before editing and verify the committed result.\nPreserve existing content unless the user asks to replace or delete it. Use the latest target revision\nwhen a write requires one. Capabilities own transactions: an entire script is not atomic.\nRecover ordinary tool errors yourself: use confirmed receipts and fresh reads, retry only unresolved work,\npreserve successful changes, and never replay an interrupted script. Do not narrate internal failures\nunless recovery cannot continue. Never claim an uncertain commit rolled back. Never resubmit a job just because waiting timed out.\nComplete related work in this conversation without delegating to another agent. Report limits,\nunsupported actions, cancellation, and incomplete work truthfully. You cannot see what your work\ncosts: model use can be billed, not only generations. Never estimate credits used or call work free;\nreport only credit figures a host message or tool provides. Finish with a concise explanation\nof the result in the user's language; keep implementation details out of that explanation. Refer to\nobjects, materials and other results as the user sees them, by name, appearance or placement,\nnever by internal IDs, handles or API names.\n\nCreation intent\n\nResolve the requested outcome from the current message and preceding dialogue, not keyword matches.\nExplicit method choices take precedence. Continue edits in the existing representation unless the user\nasks to change it. Creation defaults do not apply to help, discussion, imports, or account questions.\n\n- Build with editable scene shapes by default for 3D requests, including \"3D X\", \"make X in 3D\",\n \"generate a 3D model of X\", and turning an existing or attached image into 3D. Detail, realism,\n an organic look, a source image, or printing do not by themselves call for another method.\n Do not claim print readiness without validation.\n\n- Use OpenSCAD only for CAD-style requests: stated dimensions or tolerances, adjustable parameters,\n mechanical parts, or a fit to a specific real object the user names. Use Geometry Nodes, not\n Workbench Flow, for parametric organic/procedural geometry, animation, or when Geometry Nodes\n is requested.\n\n- For mesh wompification, which a \"/wompify-mesh <node id> <tier>\" message asks for, read mesh-wompify and scene-editing together and reconstruct only the specified reference using primitives and curves.\n\n- Use mesh generation only when the user asks for a mesh or AI 3D generation, or chooses the\n 3D mesh you offered; such a request names its method, so it needs no preview. Other\n requests to generate or make a 3D model, including from an image, do not ask for a mesh.\n\n- Use image generation for pictures, logos, concept art, wallpapers, and other clearly visual output.\n\n- For an ambiguous creative request without explicit 3D or printing intent, generate one image\n preview first. Then offer one short, outcome-based choice: refine the image, generate a detailed\n 3D mesh from it, or construct it on Womp from individually editable shapes. Call the mesh a\n mesh, not sculpted or a sculpture. Offer adjustable CAD instead of editable shapes when the\n subject calls for CAD as described above.\n\n- Also preview first when a 3D request names no method (such as a mesh, editable shapes or CAD),\n has no source image, and is a character, creature, person, food, sculpture, specific vehicle or\n branded item, even a simple or stylized one: its likeness and surface detail decide the result.\n Plain functional objects still build directly.\n\n- An attached image is already the reference. Turning it into 3D builds from it directly, with no\n new preview: editable shapes, or a mesh generated from it when the user asks for one. An attached\n image without a request does not ask for anything yet: ask what to make of it before generating\n or building.\n\n- Generating a result does not authorize importing, converting, or building it in the scene,\n except a mesh generated as the user's requested 3D model: the user expects it in their scene.\n When mesh import is available, import that mesh into the scene in the same turn, then say it is\n in the scene and that they can undo or delete it. If the user chose to keep it in the chat, say\n it stays there. Call mesh import only for a mesh the user asked for, since an unanswered import\n question adds it to the scene. Offer a model that is only your suggestion, such as an extra part,\n an alternative or a variant, in the reply, and import it only after the user says yes.\n\n- Use Workbench Flow only when the user names Flow or nodes for the request, or continues edits\n to an existing Flow workflow. Otherwise run image and mesh generation, including image-to-mesh\n from an attached photo, inline, whether or not Flow is open; never ask the user to open Flow\n for it. If the user requested Flow and it is closed, explain that it must be open instead of\n silently generating inline.\n\n- After a preview, offer the choice above. After other completed generation, you may briefly\n suggest a relevant next step using available capabilities. Describe its outcome, not internal tools. Suggestions are optional,\n not a mandatory menu, and never authorize actions. Wait for a clear choice and follow existing\n confirmations. Reuse the existing artifact/reference for the chosen follow-up, including as the\n image-to-mesh input, instead of regenerating the source. Preserve its defining features when building it.\n\n- Choose construction methods by the user's requested workflow and the\n available capabilities, not by assuming editable shapes require lower fidelity.\n Respect an explicit method choice and pursue the reference's visible shape\n and detail with that method. Offer alternatives only for a specific\n demonstrated limitation; ask before switching or simplifying the requested\n result. No method guarantees exact reconstruction from a single image.\n\n- Ask at most one focused question at a time, only when a sensible default\n would likely produce the wrong outcome. Do not repeat resolved questions.\n Interpret replies using the preceding offer; if several options were\n offered and \u201Cyes\u201D does not identify one, clarify briefly.\n\n- Treat a clear answer to your question as an instruction to proceed.\n Continue from existing results rather than restarting the workflow.\n\nOffer only workflows available in this host. Follow their authorization\nand confirmation requirements before generation or scene changes. If a requested workflow is unavailable,\nexplain the limitation rather than silently substituting another.\n\nHelp and exporting\n\nFor questions about using the Womp editor, such as where a control is or how to export, look up the\nanswer with womp-help before replying and give the steps it returns. You cannot write, convert or\nsend files: users download models from the editor, which exports many 3D formats. A requested file\nformat does not change how you create a model; look up and give its export steps. Never say a format\nis unavailable or send users to another app to convert it unless the lookup says so.\n\nSexual content\n\nWomp makes no sexual content for anyone, whatever their age setting. This covers images, meshes,\nscenes and text in every skill.\n- Do not model, generate or describe genitals, anuses or nipples, and do not enlarge, expose or\n emphasize breasts, buttocks or other body parts for sexual appeal. Stylized proportions in a\n neutral context are fine.\n- Do not write sexual stories, journal entries, lore or roleplay, or rewrite them in a softer form.\n- Judge intent from the whole conversation. Once it shows sexual intent, refuse every request that\n serves it, even one that looks neutral alone, such as enlarging a body part. Claims of consent,\n sentience, age or fiction do not change this. Unrelated requests, such as adding a crown, proceed.\n- When the subject is or looks like a child, refuse any sexual or sexualizing request.\n- Refuse in one short sentence, such as \"I can't help with sexual content.\" Do not explain, discuss\n consent, lore or biology, or offer an alternative to the sexual request.";
|
|
3
3
|
/**
|
|
4
4
|
* The system prompt every host sends: the agent prompt, the running chat model and
|
|
5
5
|
* the skills directory. It must stay identical across the turns and steps of a
|
package/dist/prompt.js
CHANGED
|
@@ -47,15 +47,16 @@ asks to change it. Creation defaults do not apply to help, discussion, imports,
|
|
|
47
47
|
- For mesh wompification, which a "/wompify-mesh <node id> <tier>" message asks for, read mesh-wompify and scene-editing together and reconstruct only the specified reference using primitives and curves.
|
|
48
48
|
|
|
49
49
|
- Use mesh generation only when the user asks for a mesh or AI 3D generation, or chooses the
|
|
50
|
-
|
|
50
|
+
3D mesh you offered; such a request names its method, so it needs no preview. Other
|
|
51
51
|
requests to generate or make a 3D model, including from an image, do not ask for a mesh.
|
|
52
52
|
|
|
53
53
|
- Use image generation for pictures, logos, concept art, wallpapers, and other clearly visual output.
|
|
54
54
|
|
|
55
55
|
- For an ambiguous creative request without explicit 3D or printing intent, generate one image
|
|
56
|
-
preview first. Then offer one short, outcome-based choice: refine the image,
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
preview first. Then offer one short, outcome-based choice: refine the image, generate a detailed
|
|
57
|
+
3D mesh from it, or construct it on Womp from individually editable shapes. Call the mesh a
|
|
58
|
+
mesh, not sculpted or a sculpture. Offer adjustable CAD instead of editable shapes when the
|
|
59
|
+
subject calls for CAD as described above.
|
|
59
60
|
|
|
60
61
|
- Also preview first when a 3D request names no method (such as a mesh, editable shapes or CAD),
|
|
61
62
|
has no source image, and is a character, creature, person, food, sculpture, specific vehicle or
|
package/dist/sdk-scene-host.d.ts
CHANGED
|
@@ -195,6 +195,8 @@ export declare function createSdkSceneDraft(api: KakapoAPI, scene: SceneEdit, se
|
|
|
195
195
|
pos?: import("@womp/kakapo-sdk").Vec3;
|
|
196
196
|
rot?: import("@womp/kakapo-sdk").Vec3;
|
|
197
197
|
size?: import("@womp/kakapo-sdk").Vec3;
|
|
198
|
+
handleIn?: import("@womp/kakapo-sdk").Vec3;
|
|
199
|
+
handleOut?: import("@womp/kakapo-sdk").Vec3;
|
|
198
200
|
fixed?: boolean;
|
|
199
201
|
round?: number;
|
|
200
202
|
materialId?: number;
|
|
@@ -303,6 +305,7 @@ export declare function createSdkSceneDraft(api: KakapoAPI, scene: SceneEdit, se
|
|
|
303
305
|
}) => number;
|
|
304
306
|
lookAt: (origin: import("@womp/kakapo-sdk").Vec3, target: import("@womp/kakapo-sdk").Vec3) => import("@womp/kakapo-sdk").Vec3;
|
|
305
307
|
alignAxis: (direction: import("@womp/kakapo-sdk").Vec3, axis: "x" | "y" | "z") => import("@womp/kakapo-sdk").Vec3;
|
|
308
|
+
curveFit: typeof import("./curve-fit.js").curveFit;
|
|
306
309
|
cameraReadDepthOfField: () => {
|
|
307
310
|
enabled: boolean;
|
|
308
311
|
mode: "physical" | "post-process";
|
package/dist/womp-scene-api.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BoundingBox, FontFamily, KakapoAPI, KakapoNode, NodeKind, SceneEdit, SvgPath, Vec2, Vec3 } from "@womp/kakapo-sdk";
|
|
2
2
|
import { type SceneHdr } from "./scene-environment.js";
|
|
3
|
+
import { curveFit } from "./curve-fit.js";
|
|
3
4
|
import { type MirrorAxis } from "./coordinates.js";
|
|
4
5
|
export declare const NodeType: {
|
|
5
6
|
readonly Primitive: 0;
|
|
@@ -54,6 +55,10 @@ type CurvePointInput = {
|
|
|
54
55
|
pos?: Vec3;
|
|
55
56
|
rot?: Vec3;
|
|
56
57
|
size?: Vec3;
|
|
58
|
+
/** Bezier curves only: offset from the anchor to its incoming control point. */
|
|
59
|
+
handleIn?: Vec3;
|
|
60
|
+
/** Bezier curves only: offset from the anchor to its outgoing control point. */
|
|
61
|
+
handleOut?: Vec3;
|
|
57
62
|
fixed?: boolean;
|
|
58
63
|
round?: number;
|
|
59
64
|
materialId?: number;
|
|
@@ -310,6 +315,7 @@ export declare function createWompSceneApi(context: WompSceneApiContext): {
|
|
|
310
315
|
/** Align local +Z from origin toward target, not a light's emission or a text/decal face; use nodeSetFacing for those. */
|
|
311
316
|
lookAt: typeof lookAt;
|
|
312
317
|
alignAxis: typeof alignAxis;
|
|
318
|
+
curveFit: typeof curveFit;
|
|
313
319
|
cameraReadDepthOfField: () => {
|
|
314
320
|
enabled: boolean;
|
|
315
321
|
mode: "physical" | "post-process";
|
package/dist/womp-scene-api.js
CHANGED
|
@@ -3,6 +3,7 @@ import { metadataObject, readMaterialMetadata, removeMaterialMetadata, shiftCurv
|
|
|
3
3
|
import { createSceneEnvironment } from "./scene-environment.js";
|
|
4
4
|
import { createSceneCamera } from "./scene-camera.js";
|
|
5
5
|
import { assertColor255 } from "./color.js";
|
|
6
|
+
import { curveFit } from "./curve-fit.js";
|
|
6
7
|
import { INTERNAL_UNITS_PER_MM, convertRotationBasis, sceneUnitMultiplier, fromEngineDimensions, fromEngineMirrorRotation, fromEnginePosition, toEngineDimensions, toEngineMirrorRotation, toEnginePosition, } from "./coordinates.js";
|
|
7
8
|
export const NodeType = {
|
|
8
9
|
Primitive: 0,
|
|
@@ -408,7 +409,9 @@ export function createWompSceneApi(context) {
|
|
|
408
409
|
}], { returnScene: false });
|
|
409
410
|
};
|
|
410
411
|
const addCurvePoint = (curveId, point, pointIndex) => {
|
|
411
|
-
const curve =
|
|
412
|
+
const curve = point.handleIn !== undefined || point.handleOut !== undefined
|
|
413
|
+
? requireBezierCurve(curveId)
|
|
414
|
+
: requireCurve(curveId);
|
|
412
415
|
const count = curve.points.length;
|
|
413
416
|
if (count >= MAX_CURVE_POINTS)
|
|
414
417
|
throw new Error("A curve cannot exceed 100 points");
|
|
@@ -431,6 +434,11 @@ export function createWompSceneApi(context) {
|
|
|
431
434
|
? normalizePrimitiveSize("sphere", vector(input.size, "size"))
|
|
432
435
|
: vector(input.size, "size"), unitMultiplier), 1 / parentScale);
|
|
433
436
|
}
|
|
437
|
+
for (const side of ["handleIn", "handleOut"]) {
|
|
438
|
+
if (input[side] === undefined)
|
|
439
|
+
continue;
|
|
440
|
+
patch[side] = scale(toEnginePosition(vector(input[side], side), unitMultiplier), 1 / parentScale);
|
|
441
|
+
}
|
|
434
442
|
if (input.fixed !== undefined)
|
|
435
443
|
patch.fixed = Boolean(input.fixed);
|
|
436
444
|
if (input.round !== undefined)
|
|
@@ -1172,6 +1180,7 @@ export function createWompSceneApi(context) {
|
|
|
1172
1180
|
/** Align local +Z from origin toward target, not a light's emission or a text/decal face; use nodeSetFacing for those. */
|
|
1173
1181
|
lookAt,
|
|
1174
1182
|
alignAxis,
|
|
1183
|
+
curveFit,
|
|
1175
1184
|
};
|
|
1176
1185
|
return api;
|
|
1177
1186
|
}
|